Mutation-trace agent attribution - #259
Open
davidabram wants to merge 12 commits into
Open
Conversation
davidabram
force-pushed
the
mutation-trace-agent-attribution
branch
from
September 3, 2026 13:55
11c70c8 to
d0de082
Compare
Define direct-first, bounded newest-mutation semantics for attributing committed lines while preserving direct-only provenance and storage boundaries. Capture acceptance criteria, task dependencies, validation, and context updates for the read-only current-worktree attribution flow. Plan: mutation-trace-agent-attribution (T01-T06) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
mutation-trace-agent-attribution
branch
from
September 3, 2026 13:59
d0de082 to
084ac81
Compare
Extend mutation trace with a pure resolver for attributing unresolved committed lines from newest-first mutation evidence without guessing ownership. Direct coverage takes precedence, while strict logical-file and line matching falls back only to unique historical content. Healthy, untainted AiExclusive matches produce mutation AI coverage; other safe matches resolve as non-AI and block older evidence. Add focused regressions and document the T01 semantics. Plan: mutation-trace-agent-attribution (T01) Co-authored-by: SCE <sce@crocoder.dev>
Provide bounded attribution-history reads without loading full historical events or unrelated worktrees. Add a cold-path page reader with exact worktree filtering, fixed-width descending revision ordering, an exclusive cursor, a 32-row cap, and a minimal attribution projection with boundary-ordering and isolation regressions. Plan: mutation-trace-agent-attribution (T02) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
mutation-trace-agent-attribution
branch
from
September 3, 2026 14:53
22979be to
b4bbd7b
Compare
Resolve unresolved post-commit lines against newest-first mutation events while preserving direct and newer evidence. The read-only consumer owns bounded pagination, separate database and Git work counters, early termination, and failure barriers so incomplete history remains explicitly unresolved. Plan: mutation-trace-agent-attribution (T03) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
mutation-trace-agent-attribution
branch
from
September 3, 2026 18:24
1a99764 to
79e7622
Compare
Support agent-trace generation from direct and mutation-derived AI evidence so committed hunks can be classified from their combined line coverage without inventing provenance. Keep build_agent_trace as a direct-only compatibility path while binding model, session, and tool metadata to direct evidence; add focused fixtures and golden tests. Plan: mutation-trace-agent-attribution, T04 Co-authored-by: SCE <sce@crocoder.dev>
Post-commit Agent Trace payloads previously classified only direct recent-patch evidence, leaving lines covered by mutation history unknown. Resolve the invoking worktree's existing checkout identity read-only and use bounded mutation history for uncovered committed lines while keeping direct provenance and intersection records unchanged. Persist combined attribution with a fail-open direct-only fallback when identity or history is unavailable; do not create identities or write mutation cursors. Plan: mutation-trace-agent-attribution.md — T05 Co-authored-by: SCE <sce@crocoder.dev>
Clarify the mutation attribution plan's worktree-isolation proof with an adversarial newer foreign-worktree `AiContended` event and older current-worktree `AiExclusive` event, preventing false-positive tests. Update plan `mutation-trace-agent-attribution` tasks T05 and T06 to distinguish weak and required adversarial coverage. Co-authored-by: SCE <sce@crocoder.dev>
Exercise the shipped direct-first composition with real Git and repository-DB fixtures for mutation-only AI coverage, direct-plus-mutation completion, newer non-exclusive blocking, and linked-worktree isolation. Add a bounded-history regression proving the 129th event is neither loaded nor reconstructed, and document the resulting matching, provenance, and persistence contracts. Plan: mutation-trace-agent-attribution.md (T06) Co-authored-by: SCE <sce@crocoder.dev>
Ensure post-commit mutation attribution keeps direct evidence in `diff_traces` and `post_commit_patch_intersections` while combining direct and mutation evidence only in persisted `agent_traces.trace_json`. Exercise the real Git and repository-DB path, including direct tool provenance, and update the durable regression record for the corrective AC10 pass. No production behavior changes. Plan: mutation-trace-agent-attribution (T06) Co-authored-by: SCE <sce@crocoder.dev>
Ensure the persistence-boundary regression reads `trace_json` back from `agent_traces` before schema validation and semantic assertions. This verifies the production persistence path rather than the pre-insert value while preserving the AC10 boundary coverage. Plan: mutation-trace-agent-attribution (T06) Co-authored-by: SCE <sce@crocoder.dev>
… replay Historical mutation patches could be matched to committed lines after those lines had been removed and re-added, allowing stale AI evidence to resurrect. Replay bounded worktree events as ordered tree transitions with per-line provenance, structurally apply hunks, and conservatively reset unknown state across history gaps, reconstruction failures, and the unobserved tail into the commit tree. Capture the latest-event revision cut so post-commit events cannot influence attribution. Keep attribution focused on direct-coverage exclusion and target patch projection, add the latest-revision store query and tree-read seams, and cover lineage, horizon, barrier, and worktree-isolation behavior with regression tests and synchronized context documentation. Co-authored-by: SCE <sce@crocoder.dev>
Prevent historical mutation evidence from being associated with committed targets that only share a path suffix or basename. Add regression tests for exact-path behavior and document the lineage rule, while preserving suffix matching for direct evidence. Plan: mutation-trace-agent-attribution (T03, AC4) Co-authored-by: SCE <sce@crocoder.dev>
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.