feat(registration): report the agent's commit and source repo at registration - #508
Open
max-parke-scale wants to merge 1 commit into
Open
feat(registration): report the agent's commit and source repo at registration#508max-parke-scale wants to merge 1 commit into
max-parke-scale wants to merge 1 commit into
Conversation
…stration Registration is the one moment an agent built and deployed outside SGP tells SGP about itself, and until now it reported only the deployment id and the agent card. It now also sends commit_sha (from AGENT_COMMIT_SHA, same git object-name guard as __commit_sha__) and source_repo (from a new AGENT_SOURCE_REPO, normalized to host/path with the build-provenance util). Keys appear only when the value is known; nothing is sent empty. The metadata assembly moves into build_registration_metadata so it can be tested without the HTTP round trip. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
max-parke-scale
force-pushed
the
mparke/registration-provenance
branch
from
September 4, 2026 19:13
36d770d to
ee05394
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent registration now carries
commit_shaandsource_repoinregistration_metadata, alongside the existingdeployment_idand agent card. Registration is the one moment an agent built and deployed outside SGP (CLI Helm deploys, e.g. BP Wells' Azure DevOps → ACR →agentex agents deploy) tells SGP about itself, so it is the consistent place to record what is deployed right now without inventing a build row for a build SGP never performed. Part of AGX1-969.What
commit_sha: fromAGENT_COMMIT_SHA, accepted only when it is a git object name, the same guard__commit_sha__uses (code_revision.is_git_object_name, now public). A non-commit value logs a warning and is omitted, never forwarded.source_repo: from a newAGENT_SOURCE_REPOenv var, normalized tohost/pathwithbuild_provenance.normalize_remote(feat(lib): capture client-attested build provenance #454), sogit@github.com:scaleapi/Demo.gitandhttps://token@github.com/scaleapi/Demoboth record asgithub.com/scaleapi/Demo.build_registration_metadataso it is testable without the HTTP round trip.register_agentbehavior is otherwise unchanged; the backend storesregistration_metadataas-is, so no server change.Relation to #507 and #5553
Independent of #507: registration reports the deployment's declared commit whether or not the agent opted into span stamping. Today nothing sets
AGENT_SOURCE_REPO; the chart follow-up is aglobal.agent.sourceRepovalue rendered into that env var, in the #5553 contract.AGENT_COMMIT_SHAis set by #5553 from a SHA-shaped image tag orglobal.agent.commitSha.Tests
tests/lib/utils/test_registration.py: empty metadata when nothing is known; commit and normalized repo when set; non-commit values (tag, semver, AWS composite, too short, blank) omitted; credential and scheme stripping; deployment id and agent card unchanged.ruffandpyrightclean.🧑💻🤖 — posted via Claude Code
Greptile Summary
Agent registration now reports validated source provenance while preserving existing deployment and agent-card metadata.
AGENT_COMMIT_SHAandAGENT_SOURCE_REPOenvironment configuration.Confidence Score: 5/5
The PR appears safe to merge; both previous findings are fully addressed and no new actionable issues remain.
The repository normalizer now removes query strings and fragments before source metadata is returned, and the existing registration test stub now supplies both newly required environment attributes. The added tests cover these fixes and the principal metadata behaviors.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Env[Environment variables] --> Validate[Validate commit SHA] Env --> Normalize[Normalize source repository] Validate --> Metadata[Registration metadata] Normalize --> Metadata Deployment[Deployment ID] --> Metadata Card[Agent card] --> Metadata Metadata --> Registration[Agent registration request]Reviews (2): Last reviewed commit: "feat(registration): report the agent's c..." | Re-trigger Greptile