Skip to content

Commit 2e885a5

Browse files
tests: Add end-to-end mutation provenance regressions
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>
1 parent 747ecc8 commit 2e885a5

18 files changed

Lines changed: 411 additions & 117 deletions

‎cli/src/services/hooks/claude_mutation_scope/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ pub(crate) fn run_claude_mutation_scope_from_payload(
384384
}
385385

386386
#[cfg(test)]
387-
fn run_claude_mutation_scope_from_payload_at_state_root(
387+
pub(crate) fn run_claude_mutation_scope_from_payload_at_state_root(
388388
state_root: &Path,
389389
stdin_payload: &str,
390390
logger: Option<&dyn Logger>,

‎cli/src/services/hooks/codex_mutation_scope/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ pub(crate) fn run_codex_mutation_scope_from_payload(
359359
}
360360

361361
#[cfg(test)]
362-
fn run_codex_mutation_scope_from_payload_at_state_root(
362+
pub(crate) fn run_codex_mutation_scope_from_payload_at_state_root(
363363
state_root: &Path,
364364
stdin_payload: &str,
365365
logger: Option<&dyn Logger>,

‎cli/src/services/hooks/mod.rs‎

Lines changed: 281 additions & 66 deletions
Large diffs are not rendered by default.

‎cli/src/services/mutation_trace/attribution.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub fn patch_for_locations_with_provenance(
169169
};
170170
let provenance = selected.get(&location)?;
171171
let mut line = line.clone();
172-
line.session_id = provenance.session_id.clone();
172+
line.session_id.clone_from(&provenance.session_id);
173173
Some(line)
174174
})
175175
.collect::<Vec<_>>();

‎context/architecture.md‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎context/cli/claude-mutation-scope-integration.md‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎context/cli/codex-mutation-scope-integration.md‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎context/cli/mutation-scope-hook-ingress.md‎

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎context/cli/mutation-scope-provenance.md‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎context/cli/mutation-scope-runtime.md‎

Lines changed: 16 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)