Repository navigation
Fix agent trace attribution - #348
Open
davidabram wants to merge 11 commits into
Open
davidabram wants to merge 11 commits into
davidabram wants to merge 11 commits into
Conversation
Replace historical patch overlap with line-level attribution so stale or ambiguous direct evidence cannot claim committed changes. Replay bounded mutation lineage first, then accept only fresh exact single-session direct matches for uncovered lines, while preserving non-AI overrides and keeping post-commit intersection evidence separate. Refactor fixtures and regression coverage around the Agent Trace service, and update the context documentation and flake inputs to describe the new contract. Co-authored-by: SCE <sce@crocoder.dev>
Replace suffix-based file matching with normalized repository-relative identity, rejecting paths outside the repository and resolving structured Claude paths against their recorded cwd. Preserve each direct-trace row through attribution so conflicting sessions are rejected and tool metadata is derived only from accepted final evidence. Update the co-author preflight, post-commit builder, tests, and context documentation to enforce the same fail-closed rules. Co-authored-by: SCE <sce@crocoder.dev>
Claude structured diff paths previously fell back to repository-relative matching when cwd was unavailable, which could attribute an edit to the wrong repository file. Carry an explicit path origin through parsing and attribution: repository-relative Git paths, absolute cwd-based Claude paths, and absolute-only Claude paths without a usable cwd. Reject unresolved relative identities while preserving absolute paths, and add regression coverage and context documentation. Co-authored-by: SCE <sce@crocoder.dev>
Resolve each canonical committed line to one AI, non-exclusive, or unknown decision and derive hunk classifications and metadata counters from that shared map. This preserves non-exclusive lineage against direct evidence and makes totals independent of hunk boundaries. Expand fixture, integration, and randomized coverage for the per-line attribution contract. Co-authored-by: SCE <sce@crocoder.dev>
Keep the mixed-path parser fixture's hunk header aligned with its four removed and six added lines. This preserves the test's intended line-number coverage for direct, lineage, contended, and manual additions.
Replace Git-hunk-based Agent Trace conversations with revision-positioned ranges built from final per-line attribution decisions. Read committed blobs at the recorded revision to validate positions and hash exact line bytes, while preserving conservative handling for unavailable or non-line-addressable files. This removes fabricated mixed hunk ownership and embedded deleted-patch expansion, groups ranges by accepted provenance, and updates the hook integration, fixtures, tests, and context contracts for the new payload semantics. Co-authored-by: SCE <sce@crocoder.dev>
… lookup Decode Git's C-quoted paths to preserve exact repository identity and reject malformed or ambiguous patch headers. Make committed-file reads distinguish missing, non-line-addressable, and explicitly unverified files while propagating tree and blob lookup failures instead of persisting unverified ranges. Add focused parser, committed-content, and post-commit path identity coverage, and update the attribution documentation. Co-authored-by: SCE <sce@crocoder.dev>
Track parent-line identities through bounded mutation replay so deleted lines are attributed to the transition that removed them rather than their original author. Anchor removal replay to the exact first-parent tree and captured commit OID, reconcile paths and unobserved tails conservatively, and keep unresolved cases unknown across gaps, partial staging, restorations, root or merge commits, and HEAD moves. Extend hook and runtime coverage and document the effective-remover contract. Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
fix-agent-trace-attribution
branch
from
November 6, 2026 22:46
274781b to
36c3733
Compare
Keep the synthetic `Unverified` committed-file state and its matching validation branch available only in test builds. This removes the test-only fallback from production code while preserving the existing test behavior.
Prevent late mutation events and direct evidence from claiming lines in an already-created commit. Capture the committer timestamp from the captured commit OID, reject untrusted timestamps, and apply the insertion-time cutoff in both evidence queries and mutation-event paging. When the timestamp is untrusted, fail closed to unknown attribution while still persisting the trace. Add database helpers, bounded replay coverage, hook integration, and documentation for the conservative cutoff behavior. Co-authored-by: SCE <sce@crocoder.dev>
Clarify that post-commit direct evidence and mutation history are eligible only when both reported and database timestamps precede a trusted commit-time cutoff. Document captured-commit tree resolution, SQL filtering before the bounded mutation-event window, and fail-closed unknown attribution when the cutoff is untrusted. Update the related database, storage, structured-patch, architecture, glossary, overview, and context-map descriptions to match the runtime contract. Co-authored-by: SCE <sce@crocoder.dev>
This branch has not been deployed
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.
No description provided.