Skip to content

fix(repair): keep the repair transaction working across cargo test, a scope-less base, and a committed test - #3986

Merged
EffortlessSteven merged 2 commits into
mainfrom
claude/onboarding-repair-loop-hardening
Sep 24, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
claude/onboarding-repair-loop-hardening

Conversation

@claude

@claude claude Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steven · project thread

Stacked on #3957. The base is claude/onboarding-repair-cage-build-output, which now includes current main (52288fefd). The diff is this PR's one commit, ef517e3dd. When #3957 merges, this retargets to main.

Before: a new user following the repair start (ripr agent repair --phase before, write the test, cargo test, --phase after) hit four dead ends in the first 15 minutes, found in the onboarding re-walk:

  • F15-1. In a crate with no committed Cargo.lock, the first cargo test creates one. The after phase then refused with ripr: agent verify artifacts are incomparable: analysis input identities differ, exit 2, and didn't say which input changed.
  • F15-3. Every receipt was invalid ("Analysis outcome artifact base does not match its typed identity."). Since fix(check): record the loader-resolved base in the JSON envelope (#3940) #3958 the scope-less envelope names the resolved base (main), but the typed outcome identity kept base_revision: null. The CLI still printed "result … improved" and "next: Keep the focused test and include this receipt in review."
  • F15-6. Committing the new test between the phases was refused as out-of-cage, and the recovery didn't mention the commit.
  • Receipt rerun. Running ripr agent receipt … --out target/ripr/reports/agent-receipt.json again after the after phase failed with repair attempt after verdict binding is tampered or stale, because the first run's own report write counted as a new change.

After, on the same sample repo with --root . throughout:

  • An untracked Cargo.lock created by cargo test is treated as build state, and the after phase returns an advisory receipt with movement improved.
  • A change to a tracked Cargo.lock still refuses. The refusal now names the input (ripr: analysis inputs changed after the before phase: Cargo.lock.), gives the git checkout <head> -- Cargo.lock recovery, and leaves the attempt awaiting_edit.
  • The receipt is advisory, and the top-level base equals identity.base_revision. ripr agent status prints Status: complete.
  • The CLI prints "include this receipt in review" only for an advisory receipt. Any other status prints why the receipt is not review evidence.
  • A focused test committed between the phases is accepted, with both heads recorded. A committed production change is still refused, naming the file, with an uncommit recovery. An amend, rebase or reset (HEAD no longer descends from the prepared head) is refused before finish with git reset --soft <before-head>.
  • Rerunning the receipt after the after phase succeeds, with --out or on stdout.

How: each fix sits at its semantic owner rather than in a renderer.

  • agent/artifact.rs: the analysis input identity (now input:v4) counts only lockfiles Git tracks. If Git fails, every lockfile counts.
  • edit_cage.rs:
    • a new optional policy field untracked_build_lockfile (exactly Cargo.lock for Rust packets);
    • HeadMovement::AdmitDescendantCommits, which folds git diff --name-status <before-head> <HEAD> into the same cage rules;
    • without_later_operational_writes, used only by receipt binding.
  • analysis/pipeline.rs::bind_effective_base: binds the loader's resolved base into the typed outcome identity when the caller gave none.

Summary

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Spec: RIPR-SPEC-0134 (updated); docs/REPAIR_ATTEMPT.md ("Committing between the phases"); docs/OUTPUT_SCHEMA.md
Issue: #3906 (partial). Parent: #3797

Scope Classification

  • One public contract

Production delta:

  • the input identity version (input:v4, tracked lockfiles only);
  • an optional cage policy field untracked_build_lockfile;
  • descendant-commit admission for ordinary attempts;
  • the scope-less outcome identity base;
  • receipt-rerun projection;
  • CLI next-step gating.

Single acceptance criterion: the repair transaction reaches an advisory receipt and Status: complete across cargo test, a scope-less base, a committed focused test and a receipt rerun, while production edits and tracked-input changes still refuse.

Non-goals:

  • no change to trust-bound Python attempts, which keep the exact-head rule;
  • no schema change to the manifest or the Python binding digest;
  • no change to what an explicit --base or diff-file run records.

Decisions (overrule on review)

  • Only tracked lockfiles count toward input identity. The seam inventory never reads lockfile content, so an untracked lockfile is build state. A tracked or staged lockfile still moves the identity and the cage.
    • Rejected: generating the lockfile in the before phase (it writes to the user's tree), keeping the "build once first" workaround, and dropping lockfiles from identity entirely (a tracked change must refuse).
  • The scope-less base is fixed at the producer, not inside the repair transaction. Passing an explicit base only inside the repair transaction would leave every scope-less check --format json artifact rejected by ripr's own outcome validator.
  • Committed focused tests are admitted, but only through the cage. The committed range is checked with the same rules as the worktree delta, so a production change committed and then restored is still refused.
    • Rejected: only changing the recovery text.
  • The receipt rerun drops a later change only when it can't matter. It must be an expected operational write, not the target, not an authored surface, not forbidden, not in the bound verdict's changed_paths, and not a rename. The verdict is recomputed from the filtered delta, and the digest comparison is unchanged.
    • Rejected: ignoring every operational write (that would hide a vanished bound change) and storing a second digest (a manifest schema change).
  • Compatibility: input:v4 makes a before phase from an older binary incomparable with an after phase from this one. The refusal names the reason and the rerun route. This only matters across an upgrade in the middle of an attempt.

Support-tier Impact

  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim

Claim/proof notes:

  • docs/REPAIR_ATTEMPT.md, docs/OUTPUT_SCHEMA.md and RIPR-SPEC-0134 are updated.
  • The four first-useful-action/unchanged-after-attempt fixtures are regenerated for the v4 identity. Their content digest matches production output.

Policy Impact

  • generated artifact

Ledger or exception notes: fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/{before,after}.repo-exposure.json, agent-verify.json, agent-receipt.json. No other golden changed.

Proof

Run on ef517e3dd (Linux, CARGO_INCREMENTAL=0). The later merge commits change no files relative to it.

  • cargo fmt --check: exit 0
  • cargo test -p ripr --lib: 5315 passed
  • cargo test -p ripr --tests --no-fail-fast: 5635 passed, 0 failed
  • cargo xtask goldens check, check-output-contracts, check-fixture-contracts: each exit 0
  • cargo clippy -p ripr --all-targets -- -D warnings: exit 0
  • cargo xtask precommit: exit 0

New end-to-end tests (cli_smoke):

  • agent_repair_admits_a_cargo_lock_first_generated_between_the_phases: asserts the precondition ?? Cargo.lock, the advisory receipt, base equals identity base, and three receipt reruns. As a negative, an unbound notes.txt makes the rerun fail.
  • agent_repair_refuses_a_tracked_cargo_lock_change_between_the_phases: covers a modified tracked lockfile and a staged generated lockfile, then the recovery.
  • agent_repair_admits_a_focused_test_committed_between_the_phases: covers a committed test, a committed production change, and an amend.

Negative controls: 13, each reverting one production change. The full table is in the first comment on this PR. For example:

  • counting every lockfile breaks 4 tests;
  • disabling bind_effective_base breaks 4;
  • never admitting commits breaks 2;
  • removing the receipt projection breaks the rerun test.

The weakest: receipt next-step gating (NC5) is caught only by a unit test, because the ordinary flow no longer produces an invalid receipt end to end.

Not run: the Windows lane, and cargo test -p xtask (it is outside this diff's packages).

Claim Boundary

May claim: the repair transaction completes across cargo test, a scope-less base, a committed focused test and a receipt rerun, and still refuses production edits and tracked-input changes.

Not yet, found and left open:

  • summary.next_action.recommended_action in the receipt JSON still says "include this receipt in review" for an invalid receipt. Only the CLI line is gated.
  • The analysis outcome validator compares root as a display string, so a receipt rerun with --root . after phases run with an absolute root (or the reverse) is invalid. The ordinary flow uses one spelling throughout.
  • The verdict changed_paths still lists target/ripr operational writes (F15-11).
  • Not established: a brand-new untracked test file as the selected target.

Rollback

Revert this PR's commits. Attempts started with this binary would then be incomparable (input:v4) and need a fresh before phase.

Spec-Test-Code Traceability

  • Specs: RIPR-SPEC-0134
  • Tests: listed under Proof, plus unit tests in edit_cage, repair_attempt, pipeline, artifact and cli::commands::agent
  • Code: crates/ripr/src/{agent/artifact,analysis/pipeline,analysis/seam_cache,app/repair_attempt,cli/commands/agent,edit_cage}.rs
  • Golden outputs: listed under Policy Impact

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • Public JSON/schema changes are documented.

Gates

  • cargo fmt --check
  • cargo clippy -p ripr --all-targets -- -D warnings
  • cargo xtask precommit

Merge interaction: this and #3982 (agent status reports the attempt outcome) both edit app/repair_attempt.rs, and a trial merge conflicts there. Whichever lands second resolves it. Clean against #3931 and #3876.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b0d4bc36-0e27-4be4-afc1-5f46ce8d3c18

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@claude

claude Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Negative controls at ef517e3dd. Each one reverts a single production change, runs the listed tests, then restores the file (checked by diff hash or cmp against a backup). "cli" means the cli_smoke::agent_repair* tests.

Control What failed
NC1 identity counts every lockfile repo_exposure_input_identity_tracks_every_semantic_input; cli: new-lockfile, committed-test, tracked-lockfile
NC2 cage lockfile skip disabled untracked_build_lockfile_is_build_state_only_while_untracked; same 3 cli
NC3 bind_effective_base disabled effective_base_binds_the_outcome_identity_to_the_loader_base; same 3 cli
NC4 commits never admitted descendant_commits_are_evaluated_only_when_head_movement_is_admitted; cli committed-test
NC5 receipt next-step gating removed repair_summary_withholds_the_review_recommendation_from_a_non_advisory_receipt only
NC6 trusted surface diffs against HEAD trusted_surface_includes_changes_committed_after_the_prepared_head (the cage catches it first in cli)
NC7 diverged-head preflight disabled cli committed-test
NC8 input-drift lines disabled cli tracked-lockfile
NC9 packet lockfile rule disabled cage_policy_proceeds; same 3 cli
NC10 receipt projection removed cli new-lockfile (receipt rerun)
NC11 projection ignores bound paths later_operational_writes_leave_only_the_bound_delta; 5 of 6 cli
NC12 forbidden-path exclusion removed later_operational_writes_leave_only_the_bound_delta only
NC13 renamed operational paths dropped later_operational_writes_leave_only_the_bound_delta only

Coverage gaps: NC5, NC12 and NC13 are each caught by only one unit test. There is no end-to-end scenario for them.


Generated by Claude Code

@claude

claude Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

91f3e7157 closes the first "Not yet" item in the description. The receipt JSON no longer recommends including a non-advisory receipt in review.

  • One owner: output/agent_receipt.rs::receipt_next_step fills both summary.next_recommendation and summary.next_action.recommended_action. The after phase's next: line now prints that field instead of applying its own copy of the rule.
  • Advisory receipts: unchanged.
  • Every other status: the text says the receipt is not review evidence and gives its status and reason. It then gives the recovery: regenerate the analysis outcome, then start a new attempt, because a finished attempt can't rerun its after phase.
  • Contract: field names and types are unchanged. docs/OUTPUT_SCHEMA.md and docs/REPAIR_ATTEMPT.md now describe the non-advisory text.

Test: agent_receipt_recommends_review_only_for_an_advisory_receipt renders one improved seam four ways (advisory, invalid, missing-artifact incomplete, partial incomplete). Negative control: forcing the advisory branch makes it fail with "Keep the focused test and include this receipt in review.".

Validation at 91f3e7157: cargo fmt --check, cargo test -p ripr --lib (5316 passed), the 22 cli_smoke agent_repair/agent_receipt tests, goldens check (no drift), check-fixture-contracts, check-output-contracts, clippy -D warnings and precommit all exit 0.


Generated by Claude Code

claude Bot pushed a commit that referenced this pull request Sep 23, 2026
…ude/onboarding-status-after-attempt

#3982 lands after #3986 and absorbs the combined-tree interaction.

Conflict resolutions (both behaviors kept):
- app/repair_attempt.rs: #3982's record_repair_attempt_after_refusal and
  bounded_refusal_reason sit beside #3986's AttemptHeadLineage,
  attempt_head_lineage, analysis_input_changes and is_analysis_input_path.
- output/agent_receipt.rs: #3982's
  agent_receipt_reading_ties_gap_closure_to_status_and_movement and #3986's
  agent_receipt_recommends_review_only_for_an_advisory_receipt both kept.

Semantic interaction (IX-1): #3982's
recorded_after_refusal_keeps_the_attempt_resumable_until_finish called the
three-argument finish_repair_attempt; #3986 added the HeadMovement argument.
The sample attempt is an ordinary, non-trust-bound attempt, so the call
passes HeadMovement::AdmitDescendantCommits, the movement the ordinary after
phase uses.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
claude Bot pushed a commit that referenced this pull request Sep 23, 2026
…s superseded receipts

Combined-tree interaction of #3982 (status reports the attempt outcome) with
#3986 (descendant-commit admission, receipt-rerun projection).

- N1: status compared the current HEAD with the prepared head, so a focused
  test committed between the phases read `prepared_at_other_head` and routed
  to a new before phase that cannot find the closed seam, while the recorded
  after phase would succeed. The attempt authority now owns the after phase's
  head rule (`after_phase_head_admission`: current, finishes stale for a
  trust-bound attempt, or refused for rewritten history); the after phase and
  status both call it. A descendant HEAD stays `resumable` with the recorded
  `--attempt ... --phase after`; rewritten history reports the after phase's
  own reset recovery (`DivergedHeadRecovery`, shared text).
- N1: a finished attempt is current when HEAD is the head its after phase
  recorded (which may descend from the prepared head), so
  `repair_receipt_stale` no longer fires with the same SHA on both sides.
- N4: rerunning an after phase on an attempt that is not awaiting its edit
  names its documented state, says it already finished or ended, names the
  receipt path, and gives `ripr agent status` / a new before phase as next
  steps, instead of the Rust Debug state name.
- N6: a refused after phase records its printed cause and recovery (changed
  analysis inputs, rewritten history) with the final error, bounded by the
  attempt authority, so status repeats the named cause.
- N9: status says "static grip improved (receipt advisory)" instead of
  "shows the gap closed"; dispositions and JSON enums are unchanged.
- N3: a workflow receipt bound to another attempt is reported as superseded
  (`receipt.superseded_by`), not "no receipt issued", and the warning names
  the restart for that seam if its gap is still open.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
@claude

claude Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 6ed90a4, which fixes re-walk finding N10.

  • Before: an after phase that was refused because only Cargo.toml changed still told the reader to run git rm --cached Cargo.lock.
  • After: the untrack advice is built from the inputs that actually changed, and it names the real lockfile path. A refusal where only the manifest changed now offers just the checkout route.

Test: the smoke test agent_repair_refuses_a_tracked_cargo_lock_change_between_the_phases has a new manifest modified scenario. It requires the refusal to:

  • name Cargo.toml;
  • leave out the untrack advice;
  • recover the same attempt through git checkout <head> -- Cargo.toml.

Negative control: I put the unconditional clause back and that scenario failed (exit 101, untrack advice must follow the changed input).

Command Result
smoke test, all three scenarios 1 passed
cargo xtask precommit pass
cargo clippy -p ripr --all-targets -- -D warnings pass

cli/commands/agent.rs is not included by xtask, so I did not run clippy for -p xtask. #3982 is stacked on this branch and is now only behind it, with no conflict.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven deleted the branch main September 24, 2026 03:00
@EffortlessSteven
EffortlessSteven changed the base branch from claude/onboarding-repair-cage-build-output to main September 24, 2026 03:02
@EffortlessSteven
EffortlessSteven force-pushed the claude/onboarding-repair-loop-hardening branch from 6ed90a4 to 25d3f0f Compare September 24, 2026 03:06
@claude

claude Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Ripr Rust Small on GitHub Hosted / Rust gates failed at 25d3f0f in Required Rust compilation and lints. This is the same main break #3963 hit, not this PR's change: error[E0061] at crates/ripr/src/output/gate/presentation.rs:630/:642, from #3936 and #3968 colliding. #4022 fixes it, together with the packet-index golden collision between #4011 and #3973.

Both #4022 commits are ported here as 68bdad9 with cherry-pick -x references, so they become no-ops once #4022 lands. cargo test -p ripr --lib passes locally on the new head (5343).


Generated by Claude Code

@claude

claude Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Pushed f87226a. It carries three commits, because the rebuild at 25d3f0f lost two reviewed changes and left one fixture out of date.

Restored (cherry-picked, content unchanged):

  • 0ff1e99 (was 91f3e71): a receipt that is not advisory no longer recommends including it in review.
  • 37ad2f9 (was 6ed90a4): the route that untracks a lockfile is offered only when a lockfile actually moved.

Both had already been reviewed on this branch before the rebuild. If dropping either one was deliberate, revert that commit and tell me why, and I'll leave it out.

Fixed: first_useful_action_corpus_pins_routing_cases was failing on 25d3f0f and on 68bdad9. The rebuild regenerated fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/ for input:v4 from a base that predated #3936. As a result, the before and after snapshots lacked the repair_command that production now emits for seam 67fc764ba37d77bd. I regenerated them with the test's own normalizer over real ripr check output. The only content change is the added repair_command line and the content commitment it moves. agent-verify.json and agent-receipt.json now carry the new hashes.

Checks run locally: full cli_smoke passed 217/217 after a forced rebuild, and cargo xtask precommit exited 0.


Generated by Claude Code

claude Bot pushed a commit that referenced this pull request Sep 24, 2026
#3986 was rebuilt at 25d3f0f and then carried the restored receipt and
lockfile-untrack commits plus a regenerated unchanged-after-attempt fixture.
Conflict resolution:
- app/repair_attempt.rs, output/agent_receipt.rs, docs/REPAIR_ATTEMPT.md:
  keep this branch's additions (refusal record, after_phase_head_admission,
  receipt reading test); the other side added nothing at those points.
- cli/commands/agent.rs: keep this branch's shared head rule and
  refusal.narrate; drop the rebuilt branch's local
  repair_after_diverged_head_lines (its text lives in
  diverged_head_recovery); take the lockfile-only untrack route.
- tests/cli_smoke.rs: take the manifest-only scenario that pins the
  untrack route.
- unchanged-after-attempt fixtures: take #3986's regenerated set.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
… scope-less base, and a committed test

Rebased onto current main (afe6b3d): the presentation.rs arity hunk now
resolves to main's already-landed fix; the seam_cache overlap with
fix(policy) #4015 auto-merged. Branch content otherwise unchanged:
untracked build-output admission, tracked-lockfile refusal naming the
input, committed-test admission with both heads recorded, receipt rerun
without self-tamper, and regenerated unchanged-after-attempt snapshots.
@EffortlessSteven
EffortlessSteven force-pushed the claude/onboarding-repair-loop-hardening branch from f87226a to ccc4770 Compare September 24, 2026 06:09
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
…oldens

The squash-rebased branch carried pre-#4022 copies of
python_src_layout_package_import and tail_comparison_boundary goldens;
restore main's re-blessed versions so goldens check sees the
post-RIPR-SPEC-0084 envelope.
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
#3986 was rebased onto main as one commit (6638f00), so a plain merge
re-added the same repair-loop content on both sides and conflicted in
five files. This merge takes the new #3986 tree and re-applies only this
branch's own delta (a971c8c minus the old #3986 head f87226a), which
applied without conflict.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
Carries #3986's re-squash onto main and the valid-root control fix
(a9d88f5). Clean merge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
#4014 now carries #3982's re-squash onto main (via #3986) and the
valid-root control fix. This clears the conflict GitHub reported
against the base. Clean merge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 24, 2026 11:17
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven
EffortlessSteven merged commit ff608aa into main Sep 24, 2026
25 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/onboarding-repair-loop-hardening branch September 24, 2026 11:17

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed findings

  • repair_after_input_drift_lines pushes unbounded error text into eprintln when analysis_input_changes itself errors: a malformed manifest path or a 100KB stderr from a git command would be copied into each recovery line, then concatenated. No memory-safety issue, but stderr is line-bounded only by clippy defaults; the bound_changed_paths.contains(&path) linear scan is O(n*m) on large receipt trees.
  • Receipt next-step gating (NC5) is caught only by the new unit test in output/agent_receipt.rs; the ordinary flow no longer produces an invalid receipt end to end, so the CLI's forwarding branch for non-advisory receipts is exercised solely by repair_summary_forwards_the_receipt_owned_next_step_for_a_non_advisory_receipt. Acceptable per the author's own weakest-link note, but no cli_smoke path reaches it.
  • artifact-verifier failed with exit 2; in this lane it does not affect worker-handoff semantics (no JS artifacts in this PR) but should be retried because it gates the same fixtures the diff regenerates.

Verification questions

  • Confirm new public visibility widenings (git_merge_base_is_ancestor, EditCagePolicy::untracked_build_lockfile, AttemptHeadLineage, AttemptDelta.comparable semantics) cross module boundaries but stay inside one Rust process. serde Serialize/Deserialize derives on EditCagePolicy (skip_serializing_if=Option::is_none) keep legacy JSON baselines round-trip-safe, so prior persisted packets decode.
  • Confirm trusted-surface diff is anchored at the prepared head, so a committed production change hidden by a later restore still refuses.

Refuted

  • A second, parallel head-lineage helper for the receipt-binding path would let the receipt skip the duplicate merge-base invocation and stay in sync with attempt_head_lineage's error semantics.; refuted because: The two callsites differ: receipt_binding only needs the descendant branch and runs after a finish that already validated lineage, while attempt_head_lineage is used by the CLI pre-flight and analysis_input_changes. Routing receipt_binding through AttemptHeadLineage would couple the receipt binder to the helper's Result type and to current_git_head's second read, which the binder currently does anyway. The duplication is two lines and is parked, not blocking.
  • PR diff is pure Rust + JSON fixtures + Markdown; no JS, WASM, WebAssembly-bindgen, napi, deno_core, JNI, or Node addon touched. Zero async runtime tokens (async fn, .await, tokio::spawn, JoinHandle, AbortController) in the 8 changed Rust files; all crossings are synchronous serde_json / serde bincode in the same OS thread.
  • No ArrayBuffer/TypedArray/active-view region semantics are reachable from this diff; Rust side holds serde_json values and Vec git output, and the policy field untracked_build_lockfile gates Cargo.lock at the path-rule layer, not as a slice over a backing store.
  • All 'handoffs' are intra-thread serde_json::Value / typed structs over stdin/stdout or filesystem artifacts (target/ripr/*); no Transferable, ArrayBuffer, SharedArrayBuffer, postMessage, MessageChannel, structured clone, or Atomics primitive is reachable from this diff.
  • Async capture or detached worker could outlive the closure passed to workspace_named_file_identities_relative(|lockfiles| git_tracked_lockfiles(...)) and observe a freed PathBuf/Vec.; refuted because: lockfile_scope is an FnOnce invoked synchronously inside workspace_named_file_identities_relative on the calling thread; the returned (PathBuf, Vec) vectors are owned and die with the caller frame. No async block, Future, Box, or background task is constructed, so no captured state can outlive the closure.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

Parked follow-ups

  • attempt_head_lineage / analysis_input_changes are new sibling helpers under repair_attempt, used by cli/commands/agent.rs. There is no separate helper to compute lineage for the receipt rerun path; receipt_binding re-reads current_git_head and re-runs merge-base inline rather than going through attempt_head_lineage. Functional, but a parked follow-up to reuse the helper.

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.

ux(agent): follow-up guidance routes to the low-level loop instead of agent repair

1 participant