Repository navigation
test(kani): guard every command-error proof constructor (#12109) - #14588
EffortlessSteven wants to merge 3 commits into
Conversation
Add the exact fixture exception with its owner, purpose and retained replay controls. Production and proof bytes are unchanged. Authored-by: Codex <codex@openai.com> Local-source-equivalent: 53b16e3bec5bf2ca77a74ced3996fca630a3da6e
Generate the symbolic inputs, exhaustive guard and input covers from one declaration while retaining the literal exit-code oracle. Authored-by: Codex Local-source-equivalent: 51d0396939d47bff9f467be55ae48f1d96454640
|
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 59 minutes. View limit details
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Reviewed the complete six-file constructor-domain repair at 5163325ab13fbd3515916d1902967b468b6538fc, tree b8a350bd197c7b3127e2f4c91af6d1247e318c30, identical to qualified local source 51d0396939d47bff9f467be55ae48f1d96454640 over #14469 at 172fe0e6965aae8ac2a901821079befe3de176d8.
The unchanged production exit mapping is checked against independently literal 2/3/130 expectations. The generated wildcard-free guard refuses omitted, duplicated and newly added constructors; removing that guard permits the intentional omission. Native Kani over the exact production items records positive / wrong-mapping / restored exits 0/1/0, with every constructor cover satisfied and the single intended mapping assertion detecting the mutation. The actual ripr library's exact harness separately passed under the explicit Rust-only profile with 34 successful properties and all three covers satisfied. Four retained model hashes and owned-process completion were independently read back.
The source, ordinary/Kani oracles, specification, traceability and changelog agree. No unresolved material source finding remains. This is a bounded source attestation; the detailed PR body retains the distinct extraction/custom-profile scopes, earlier compilation timeout, assumptions and protected-integration requirements.
There was a problem hiding this comment.
Code Review
This pull request introduces a robust constructor-domain discipline for CommandError exit proofs and tests by defining a new exit_proof_domain module. It replaces hardcoded matches in exit_kani.rs with a macro-generated domain that enforces compile-time exhaustiveness and unreachable pattern checks, alongside adding unit tests and updating Kani traceability configurations. The review feedback suggests a minor improvement to the macro's exhaustiveness check, recommending the use of an anonymous constant block instead of a closure coercion to a function pointer to ensure better compatibility with older Rust compiler versions.
| const _: fn(&CommandError) = |error| { | ||
| #[deny(unreachable_patterns)] | ||
| match error { | ||
| $(CommandError::$variant(_) => (),)+ | ||
| } | ||
| }; |
There was a problem hiding this comment.
Using a closure coercion to a function pointer in a const item can be less portable across older Rust compiler versions (MSRV). A more idiomatic and widely compatible way to perform compile-time exhaustiveness and unreachable pattern checks is to use an anonymous constant block (const _: () = { ... }) containing a helper function.
| const _: fn(&CommandError) = |error| { | |
| #[deny(unreachable_patterns)] | |
| match error { | |
| $(CommandError::$variant(_) => (),)+ | |
| } | |
| }; | |
| const _: () = { | |
| #[deny(unreachable_patterns)] | |
| fn _assert_exhaustive(error: &CommandError) { | |
| match error { | |
| $(CommandError::$variant(_) => (),)+ | |
| } | |
| } | |
| }; |
|
Coordination note (evidence-only reviewer): this branch is now conflicted with main ( |
Summary
Close the command-error proof's constructor-drift gap under #12109. The old
u8 < 3selector and catch-all arm could keep a passing proof after a newCommandErrorvariant was added, or after a constructor was omitted from thesymbolic domain. One declaration now generates the cases, a wildcard-free
compiler check, and per-input-variant covers. The existing production exit-code
method is unchanged.
Published head:
5163325ab13fbd3515916d1902967b468b6538fc. The complete Git tree is identical to localqualified candidate
51d0396939d47bff9f467be55ae48f1d96454640, treeb8a350bd197c7b3127e2f4c91af6d1247e318c30. Draft; the bounded source repair has been reviewed: exactextracted-owner Rust tests, compiler-refusal controls, and isolated actual-item
native Kani positive / intended wrong-mapping / restored runs passed. The actual
riprlibrary's exact harness also passed under the supported custom Rust-onlyfeature profile in a separately admitted warm-cache run: 37 distinct properties,
all three input covers satisfied, and the actual model retained. The earlier cold
attempt timed out during compilation. Actual-package mutation/restoration,
default-profile registration, repository-native policy and protected integration
remain unexecuted on this candidate.
Swarm / Source Boundary
EffortlessMetrics/ripr-swarm.Source-of-truth Links
Proposal: the command-error finite-domain gap recorded in #12109's implementation
checkpoint, #12109 (comment).
Spec:
docs/specs/RIPR-SPEC-0371-kani-bounded-model-checking-lane.mdand theliteral mapping in
docs/EXIT_CODES.md.ADR: none; apply the existing constructor-domain discipline introduced by
#12975 without changing proof-engine or product architecture.
Plan item: #12109 / #12904 self-assurance, command-error exit obligation.
Governing issue or accepted claim: #12109; this bounded repair does not close
the programme.
Acceptance delta (one sentence): The command-error proof visits every declared
constructor using a compiler-checked domain, rejects missing or duplicate cases
and new variants at compilation, and compares the real production result with
the independently literal 2/3/130 table while covers remain tied to inputs.
Candidate Relationships
Candidate branch:
fix/12109-command-error-proof-domain; the GitHub head is boundto the identical local reviewed tree stated above.
Stack parent or prerequisite PR: #14469 at
172fe0e6965aae8ac2a901821079befe3de176d8. Its complete-cover admission andconstant-harness witness are retained. This child adds no runner change.
Proposed replacement of PR: none.
Acceptance retained from a replaced candidate: none replaced; the normal
CommandError::exit_codeimplementation and #14469 acceptance remain intact.Accepted winner and losing candidate disposition: no competing domain repair
found. All-state exact-subject search returned only historical #11954; the
exit_kani.rssearch returned #11954, #14469 and unrelated #13108. #14556 ownsregistry governance and is not modified by this candidate.
Scope, oracle and maintenance
Six files, 102 additions and 13 deletions against #14469:
exit_proof_domain.rsowns the constructor declaration, generated exactmatch and input covers, with two ordinary tests.
exit_kani.rsselects from that domain's actual length and calls the normalproduction method; expected codes are literal data independent of that method
and its constants.
cli/mod.rsincludes the domain only under ordinary tests or Kani.same bounded behavior.
The native domain retains empty String payloads. No claim is added about
message handling, command dispatch, process cleanup, receipt delivery or
whole-program correctness. Input covers are intentionally independent of the
observed exit code: a wrong mapping must fail the assertion while every
constructor can still be reached. Any future registry admission must use fresh
native property/cover identities and the appropriate generation; the aggregate
registry's old output-cover anchors must not be carried over as current evidence.
Changelog:
changelog.d/12109-command-error-proof-domain.md, canonicalInternal / CIsection marker, bullet and trailing issue reference checkedagainst
changelog.d/README.md.Qualification observed
Rust 1.95.0 (
59807616e1fa2540724bfbac14d7976d7e4a3860), Linux x86-64.To respect the unresolved full-product codegen resource boundary, qualification
compiled the exact production constant declarations, complete
CommandErrorenum and complete
impl CommandError, together with the complete actual newdomain module. There are no replacement method bodies or mock enum variants in
the positive build. The wrapper's module/extraction boundary is explicit; this
is not a complete Cargo build of ripr or a native Kani result.
deny(unreachable_patterns)at that matchStrict direct Clippy on the exact positive extraction and Rustfmt checks on all
three affected Rust source files passed.
git diff --checkpassed. The sevencontrol outcomes and source/binary hashes are retained in the qualification
receipt. The first isolated invocation omitted
cfg(test)from its explicitcheck-cfg list and failed before tests; that instrument setup failure is retained
separately and is not a behavioral red witness.
Native Kani 0.68.0 / CBMC 6.11.0 also ran the exact extracted production items
with both complete actual proof modules in a dependency-free isolated Cargo
package. Its required Rust runtime was the official bundle's exact
1.100.0-nightly (8925ea358 2026-08-20). All ordinary assertion, safety andunwinding checks remained enabled; the command selected the exact harness with
default unwind 32 and regular, verbose output.
The one failure is
cli::exit_kani::command_error_exit_code_total_and_matches_table.assertion.2,the
code == *expectedassertion atexit_kani.rs:33. The nonzero assertionremains successful in the mutant. Native covers are
cli::exit_proof_domain::cover_command_errors.cover.1,.cover.2and.cover.3,with distinct Failure, Decision and Interrupted descriptions. They share macro
invocation location
exit_proof_domain.rs:31; the reviewed identities anddescriptions distinguish the inputs. No failed unsupported or unwinding check,
and no UNDETERMINED or UNREACHABLE result, appears among the 37 reported
properties per stage.
Repository source bytes are unchanged and the isolated source is restored.
This is actual Kani execution over exact production items and the actual proof
modules, with an explicit extraction/module boundary. It is not execution of the
full ripr Cargo package, admission of a registered assurance claim, or proof of
receipt authentication or publication authority. Raw output and every native
property are retained with source and transcript hashes. Native receipt SHA-256:
d524525f89a31e63832f4f6985d50989bec36a501d47f358b4f0db3437c98c7e;reviewed-property receipt SHA-256:
2996493a55da549db144b9159a123655a782215c40cb46c4faed76daad74dff9.The actual-package attempts used this exact command:
The existing manifest and library explicitly support this Rust-only product
profile. It differs from the default Rust/TypeScript/Python feature set and does
not inherit a default-profile claim. With one job and incremental compilation
disabled, the cold dependency graph and
ripr-contractcompiled, and the finalriprlibrary invocation began. The independent 600-second outer deadline thensent SIGTERM to its owned process group; the command returned
-15and the controllerwas terminal after 605.422 seconds. There were no native properties or model,
no observed compiler error, and no Kani reachability/codegen-completion message.
The last partial artifacts include dep-info and an unpublished temporary Rust
metadata file; they are not a completed
riprartifact or proof witness.The dedicated target ended at 394,641,822 bytes against a 2 GiB ceiling. Sampled
available memory stayed above 3.76 GB and free disk above 51.40 GB; no storage or
memory guard triggered. Source and Cargo.lock bytes are unchanged, and Git
status is clean. This is incomplete compilation, separate from the intended
semantic negative witnessed in the isolated trio. Cold-attempt receipt SHA-256:
ac28fb247a111a8f991fd0be6f65d6e35b8ae46cd78eaadd045735066cfbc074.A separately admitted warm attempt reused that mutable dependency cache after
recording all 1,352 cache files (394,641,822 bytes) and their hashes. It used the
same exact source, command, feature profile, tool homes, one-job/incremental-zero
settings and independent 600-second/resource bounds. The actual native command
finished normally with exit 0 in 369.557 seconds; the complete controller,
including cache inventory and readback, finished in 385.337 seconds.
All 37 distinct actual-package properties were read back: 34 SUCCESS and
three SATISFIED input covers. The exact table assertion
.assertion.2and thenonzero assertion
.assertion.3passed atcrates/ripr/src/cli/exit_kani.rs.Each Failure/Decision/Interrupted input cover has its own native property ID
and description at
crates/ripr/src/cli/exit_proof_domain.rs:31:1. There wereno failed, unreachable, or undetermined properties. Four completed actual
harness model files totaling 89,087 bytes were copied and hash-verified.
The warm controller verified Linux child-subreaper ownership before launching
Kani and recorded the main command reaped at exit 0 with an empty in-session
owned descendant/group census before and after cleanup. It required no process
termination. The dedicated target finished at 535,302,208 bytes; minimum sampled
available memory was 2,112,892,928 bytes and free disk 52,096,086,016 bytes.
Source, Cargo.lock, head and tree stayed unchanged; the worktree remains clean.
Warm actual-package receipt SHA-256:
c46a8b2ccf55ab2db1e154d9e9f51d781780554c03cf68b05912b9e03722ee2e.This closes the actual-package positive gap for the custom Rust-only profile.
It does not establish a package-level intended-mutant/restored pair, the default
Rust/TypeScript/Python profile, registered assurance admission, shared producer/
parser replay, or authenticated publication. The isolated native 0/1/0 sequence
retains its explicit extraction boundary. No further package run or mutation
was attempted automatically.
Not run: ordinary full ripr Cargo tests/build,
check-fast,precommit,repository-native policy and protected combined-tree qualification. The narrow
Clippy invocation is not the workspace Clippy gate. Compilation refusal is the
intended enum-domain control, separate from the native functional counterexample
above.
Next proof and delivery route
custom-profile package positive. Any package-level mutation/restoration needs
its own bounded admission; it has not been executed or inferred from the
isolated run.
the admitted hosted route once the prerequisite composition is ready.
through the existing registry owner, with its own exact source/configuration
and artifact custody. A custom-profile package pass does not inherit the
default profile or acquire authentication/execution authority.
Rollback
Revert these six files as one ordinary change. The earlier production exit map
is untouched, and the original harness remains available in the parent. Do not
reuse evidence from this constructor-domain generation for a reverted harness.
Authorship: Codex authored this candidate; authenticated connector metadata,
if used for publication, records publication identity rather than manual authoring.
Current source inspection
reviewed_head_sha:5163325ab13fbd3515916d1902967b468b6538fc; exact treeb8a350bd197c7b3127e2f4c91af6d1247e318c30.integration_basis: #14469 at172fe0e6965aae8ac2a901821079befe3de176d8.The complete six-file change, unchanged production
CommandErrormapping, itsconsumers, literal EXIT_CODES contract, generated constructor guard, input
covers, ordinary oracle tests, SPEC-0371 and traceability were reviewed. The
omitted/new/duplicate cases and wrong-production-mapping controls discriminate
the intended failures. Independent readback verified all 37 actual-package
properties, all three constructor covers, four retained model hashes and
terminal owned-process cleanup. No unresolved material source finding remains.
Source conclusion: SOURCE_REVIEW_READY for this bounded constructor-domain
repair. Overall merge review: REVIEW_INCOMPLETE pending required repository
policy and protected integration evidence. The actual-package positive applies
to the explicit Rust-only profile; mutation/restoration applies to the exact-item
extraction. Neither promotes a canonical registry claim or proves whole-program
behavior. No required check has been waived and no CI request is made here.