Skip to content

Mutation-trace agent attribution - #259

Open
davidabram wants to merge 12 commits into
mutation-scope-runtime-integrationfrom
mutation-trace-agent-attribution
Open

Mutation-trace agent attribution#259
davidabram wants to merge 12 commits into
mutation-scope-runtime-integrationfrom
mutation-trace-agent-attribution

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

@davidabram
davidabram force-pushed the mutation-trace-agent-attribution branch from 11c70c8 to d0de082 Compare September 3, 2026 13:55
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
davidabram force-pushed the mutation-trace-agent-attribution branch from d0de082 to 084ac81 Compare September 3, 2026 13:59
davidabram and others added 2 commits September 3, 2026 16:26
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
davidabram force-pushed the mutation-trace-agent-attribution branch from 22979be to b4bbd7b Compare September 3, 2026 14:53
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
davidabram force-pushed the mutation-trace-agent-attribution branch from 1a99764 to 79e7622 Compare September 3, 2026 18:24
davidabram and others added 8 commits September 3, 2026 22:35
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant