Repository navigation
fv(kani): prove the five next-action refusal stops on a typed decision (#13707) - #13730
Conversation
#13707) Split select_canonical_next_action into decide_next_action, which picks a typed NextActionDecision (borrowed references only, no label formatting or candidate collection), and render_decision, which builds the stop labels, candidate lists and alternatives exactly as before. Add five Kani harnesses that prove the unsupported/unknown-platform, terminal-attempt, awaiting-edit, restart-recommended and several-unranked-items stops on the decision: when the stop condition holds the decision is exactly that typed stop and is not executable, and the admitted twin runs. The control-10 unit battery now also asserts decision and rendered executability agree for every gate. Rendered output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 36 minutes. View limit details
|
… METRICS row (#13707) Review nits on #13730: the admitted twin decides Run (render can still fail closed at mint), the control-10 battery covers the gates it exercises, the decision enum carries the producer facts (not exactly), and docs/METRICS.md no longer lists the five refusal paths as unproved or a hand-counted total. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of the selector split: decide_next_action keeps main's gate order and refusal texts, error strings are the same literals, and every render_decision arm builds the same stop or run output as main (the shared refresh_head_stop matches both former copies). Only Run reaches running; every other variant mints through stopped with no command. The five harnesses constrain their stops with symbolic flags, role, platform subset and candidate count; precedence swaps, is_none_or to is_some_and, and > 1 to >= 1 would each fail an assertion; unwind 6 covers the bounded loops, and the decide path allocates nothing. 0af81b4 only tightens doc wording from that review and updates the docs/METRICS.md Kani row. Kani verdicts and runtime come from the hosted lane on this head.
Generated by Claude Code
…#13707) The row sits in a dated snapshot and the refusal-stop harnesses have no hosted Kani verdict yet, so the update moves to the post-merge scoreboard refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head a3d7747 equals the reviewed 0af81b4 minus the docs/METRICS.md row, which is back to main's text. The selector split, the five refusal-stop harnesses and the doc wording are unchanged from the independent review: same gate order and literals, only Run reaches running, and each harness asserts its exact typed stop and non-executability. Kani verdicts come from the hosted lane on this head.
Generated by Claude Code
ripr static exposure checkCommit Took 155s. |
|
Kani lane on a3d7747 (job 128743534817): the five new decision harnesses all VERIFIED in 7.6-11.1s each, but this change regresses the existing selector harnesses. Generated by Claude Code |
|
|
The decide-then-render split joined a symbolic NextActionDecision before render_decision, so CBMC explored every rendering arm (including the format!/collect arms) under merged state and the existing selector harnesses timed out. walk_gates is now the single gate owner and applies a caller-supplied emit at each gate's return site with a decision whose variant is fixed there: select_canonical_next_action passes render_decision, decide_next_action (test/kani only) passes the identity. Gate logic, order, refusal texts and rendered output are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
Resolve the next_action.rs conflict with #13671: keep the walk_gates / render_decision structure and carry main's new CheckTriage repair_route (input.check_repair_route) in the CheckTriage render arm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent review of the delta a3d7747..dafb1fb: c7fc355 only wraps each of the 20 gate returns in emit(...) inside walk_gates, with gate order, conditions, fields and the five error literals unchanged; the selector passes render_decision and decide_next_action (cfg test/kani) passes identity. The merge with main carries all seven #13671 changes verbatim, with repair_route moved into the CheckTriage render arm. Kani workflow run 42492265447 on dafb1fb succeeded: the five new refusal-stop harnesses verified in 8-13s, and the existing selector harnesses are back to main's range (diverged config 62s, disagreement 46s, stale head 86s, route/mode/effect 77s, mint 109s). Compile and unit tests on this head come from hosted CI.
Generated by Claude Code
Picks up #13773 (module_reach_control_qualified fixture contract), which the Rust gates check-fixture-contracts step needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
b7dcd80 is a clean merge of origin/main into the reviewed dafb1fb, picking up #13773 (the module_reach_control_qualified fixture contract that the Rust gates check-fixture-contracts step flagged on dafb1fb; that failure came from main, not this change). git diff dafb1fb6 b7dcd80a -- crates/ripr/src/domain/ is empty, so the reviewed selector split, the five refusal-stop harnesses and the Kani result from run 42492265447 carry over unchanged.
Generated by Claude Code
Picks up the regenerated docs/CLI_REFERENCE.md (#13604) that the cli_reference_doc test needs after #13685/#13731. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
73f138a is another clean merge of origin/main, picking up #13604's regenerated docs/CLI_REFERENCE.md: the Rust-only feature lane on b7dcd80 flagged cli_reference_matches_the_binary because the branch had #13731's check and #13685's init help change but not the regenerated page. The domain diff since the reviewed dafb1fb is still empty; the selector split, harnesses and Kani result carry over unchanged.
Generated by Claude Code
Picks up #13778, which reblesses docs/CLI_REFERENCE.md after the repair/continue --json help change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
0bc0cd0 is a clean merge of origin/main picking up #13778, the CLI reference rebless that main itself needed after the repair/continue --json help change (the cli_reference_matches_the_binary result on 73f138a matched main's state, not this change). Domain diff since the reviewed dafb1fb remains empty; the selector split, harnesses and Kani result carry over unchanged.
Generated by Claude Code
ripr completions, so cli_reference_matches_the_binary fails
#13813
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head c471a88 is a main merge only (brings in #13811's CLI reference rebless). git diff 0bc0cd0d c471a88b -- crates/ripr/src/domain/ is empty, so the reviewed selector source and the Kani run 42492265447 verdicts (all next_action harnesses VERIFIED) still describe this head. cargo check -p ripr --lib passes locally on c471a88.
Generated by Claude Code
Governing issue or accepted claim: #13707
Acceptance delta (one sentence): The five next-action selector refusal stops CBMC ran out of memory on are now decided as a typed
NextActionDecisionwith no string building or collection, and five new Kani harnesses assert on that decision that each stop condition yields exactly its typed stop and no executable command, while rendered selector output stays the same.What changed
crates/ripr/src/domain/next_action.rs:select_canonical_next_actionis nowdecide_next_action(input)followed byrender_decision(input, decision).decide_next_actionreturnsResult<NextActionDecision<'_>, &'static str>. It keeps the same gate order and the same producer-input refusal texts. The decision variants hold only borrowed references (&NextActionAttemptView,&CommandSpec,&str) and copy enums. There is noformat!,to_string,cloneorcollecton the decision path.render_decisioncontains thestopped(...)/running(...)calls from before, unchanged: labels, candidate lists and selector-added alternatives. OnlyNextActionDecision::Runreachesrunning; every other variant mints throughstopped, which never references a command. The two head-refresh stops (bound divergence and the not-fresh tail) share arefresh_head_stophelper that builds the same values as before.NextActionDecision::is_executable(cfg(any(test, kani))) is true only forRun. The control-10 unit battery now also checks, for every gate, that decision executability equals rendered executability.crates/ripr/src/domain/next_action/kani_proofs.rs: five new harnesses that calldecide_next_action:platform_stop_decides_unavailable_and_never_runs: symbolic host platform (unknown/Linux/macOS/Windows), spec platform subset and role. Unknown or unsupported host =>PlatformUnavailablefor the offered spec (checked withptr::eq), not executable. OtherwiseRun.terminal_attempt_stop_decides_terminal_and_never_runs: symbolic terminal/awaits-edit/restart flags and spec role. Terminal with a non-read-only offer =>TerminalAttemptfor the input's attempt. Executable iff no attempt obligation.awaiting_edit_stop_decides_awaiting_and_never_runs: terminal stop not firing and awaits edit =>AwaitingEdit. Executable iff no obligation.restart_recommended_stop_decides_restart_and_never_runs: neither earlier stop firing and restart recommended =>RestartRecommended. Executable iff no obligation.several_items_stop_decides_selection_and_never_runs: 0 to 3 candidates over {"a","b"}. More than one =>SeveralItems, not executable. Zero or one =>Run.render_decisionitself. Its link to the decision is structural and is covered by unit tests.changelog.d/13707-kani-selector-refusal-stops.md.No change to actionability policy, gate order, refusal texts or rendered output. No new required check.
Proof
Ran locally (Linux, bash,
CARGO_INCREMENTAL=0,-j1):cargo fmt -p ripr -- --check: pass.cargo test -j1 -p ripr --lib next_action: pass, 70 passed, 0 failed. This run also included a temporary, uncommitted type-check shim:kani_proofs.rscompiled as#[test]functions with stubkani::any(default values),kani::assumeandkani::cover!. All 12 harness bodies compiled against the real types and ran on their default inputs. The shim was removed before commit.cargo clippy -j1 -p ripr --lib --tests -- -D warnings: pass.cargo xtask precommit: incomplete.check-static-language,check-no-panic-family,check-allow-attributesandcheck-local-contextpassed, as did the covered_by test builds. The run then failed withNo space left on device (os error 28)while recompilingripr. This is an environment limit, not a source failure. Precommit is not established for this head.Not run locally: Kani.
cargo-kaniis not installed here, and--cfg kanicannot resolve thekanicrate outsidecargo kani. Kani verdicts (VERIFICATION:- SUCCESSFULwithin budget, plus the negative experiment of a deliberately wrong assertion failing) must come from the hosted Kani lane on this exact head and are not yet established.Generated by Claude Code