-
Notifications
You must be signed in to change notification settings - Fork 1
agent_trace: Add git vcs metadata to built trace payloads #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,11 @@ | ||
| { | ||
| "$schema": "https://agent-trace.dev/schemas/v1/trace-record.json", | ||
| "version": "0.1", | ||
| "version": "0.1.0", | ||
| "id": "01962f15-2d3d-7c85-9f6b-0a8b4f6b2fd1", | ||
| "timestamp": "2026-04-23T10:20:30Z", | ||
| "vcs": { | ||
| "type": "git", | ||
| "revision": "a0b1c2d3e4f5a6b7c8d9e0f11223344556677889" | ||
| }, | ||
| "files": [] | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate commit revision before emitting trace payload.
Line 387 copies caller-provided revision without validation. An empty/whitespace revision can silently persist unusable VCS metadata.
🛡️ Proposed fix
pub fn build_agent_trace( constructed_patch: &ParsedPatch, post_commit_patch: &ParsedPatch, metadata: AgentTraceMetadataInput<'_>, ) -> Result<AgentTrace> { + ensure!( + !metadata.commit_revision.trim().is_empty(), + "Invalid commit revision: expected non-empty commit OID." + ); let commit_time = parse_commit_timestamp(metadata.commit_timestamp)?;📝 Committable suggestion
🤖 Prompt for AI Agents