Skip to content

Mutation scope provenance - #275

Open
davidabram wants to merge 8 commits into
codex-mutation-scope-integrationfrom
mutation-scope-provenance
Open

Mutation scope provenance#275
davidabram wants to merge 8 commits into
codex-mutation-scope-integrationfrom
mutation-scope-provenance

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

@davidabram
davidabram added this pull request to stack #240 September 9, 2026 16:43
@davidabram
davidabram force-pushed the mutation-scope-provenance branch 4 times, most recently from 9429949 to 5be94bc Compare September 9, 2026 22:55
davidabram added a commit that referenced this pull request Sep 10, 2026
Restore the missing D1-D11 Design section referenced by AC1/T01, make the
T01 OpenCode/@opencode-ai/plugin version policy deterministic (probe the
exact version inherited from #275 first; version changes require an explicit
replan and full reprobe), add explicit fail-closed execution-barrier probes
to T01 (tool.execute.before failure, shell.env failure, earlier-plugin
failure), and move lifecycle-dependent claims out of Assumptions into the
T01-owned Design decisions.

Plan-only; no task started.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBU1RzU6Senqf3t4MDYL2A
davidabram and others added 8 commits September 10, 2026 18:00
Define the durable scope-provenance design for preserving session and model metadata from Codex and Claude mutation scopes into Agent Trace. The plan covers insert-once storage, optional Start ingress metadata, producer snapshots, mutation attribution, conservative model agreement, regression coverage, and context synchronization.

Plan: mutation-scope-provenance (T01-T07)

Co-authored-by: SCE <sce@crocoder.dev>
Persist session and optional model metadata for established mutation scopes without coupling it to protocol state or attribution decisions.

Add migration 005 and typed insert-once register/load seams with owning-scope validation, immutable first-observed metadata, and session-conflict detection. Extend schema assertions and document the storage contract, completing plan `mutation-scope-provenance` task T01.

The additive table and nine focused tests preserve existing protocol behavior while enabling later runtime consumers to access scope identity and descriptive model information.

Co-authored-by: SCE <sce@crocoder.dev>
Mutation-scope starts now carry validated session and optional model identity into
the runtime, so provenance is durably associated with its owning scope before
the protocol transition commits. The ingress rejects malformed or misplaced
provenance, while registration remains idempotent and fails closed on conflicting
sessions; existing starts without provenance retain their behavior.

Plan: mutation-scope-provenance (T02)

Co-authored-by: SCE <sce@crocoder.dev>
Record the canonical session and normalized model when Codex Bash and apply_patch executions establish mutation scopes. Tolerate unusable model values as absent metadata so malformed descriptive fields do not deny mutation-capable tools, while leaving close and untracked/delegation behavior unchanged.

Document the producer contract and its verification coverage.
Plan: mutation-scope-provenance T03

Co-authored-by: SCE <sce@crocoder.dev>
Capture the canonical session and exact agent-scoped model when Claude mutation scopes are admitted, so durable scope provenance reflects the model active at Start without allowing later model switches to rewrite it. Resolve model state through an injectable adapter seam, normalize available models, and degrade unavailable lookups to null provenance while preserving successful fail-closed admission behavior. Update the integration context and mark plan task T04 complete with its verification evidence.

Plan: mutation-scope-provenance.md T04

Co-authored-by: SCE <sce@crocoder.dev>
Carry each mutation-AI location's ScopeId through post-commit replay and resolve distinct scopes to durable session/model metadata. Preserve per-line sessions and emit a hunk model only when all contributing lines agree on a known model.

Keep missing provenance, NULL models, and conflicting models conservative without changing AI classification, and synchronize the implementation context and plan task T05.

Plan: mutation-scope-provenance (T05)

Co-authored-by: SCE <sce@crocoder.dev>
Preserve provenance from mutation-history AI coverage in Agent Trace conversations so mutation-only hunks can identify their model and related session. Combine direct and mutation session links deterministically, while emitting a model only when the present evidence sources agree.

Add focused regressions and update mixed-evidence goldens and generator context for the conservative model-agreement behavior.
Plan: mutation-scope-provenance.md (T06)

Co-authored-by: SCE <sce@crocoder.dev>
Exercise Claude and Codex Bash mutation scopes through real Git commits and Agent Trace persistence to verify that model and canonical session provenance survive mutation projection.
Keep mutation protocol attribution separate from direct diff evidence while synchronizing the completed provenance contract across the affected context records.
Plan: mutation-scope-provenance (T07)

Co-authored-by: SCE <sce@crocoder.dev>
@davidabram
davidabram force-pushed the mutation-scope-provenance branch from 5be94bc to 3898434 Compare September 10, 2026 16:05
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