Repository navigation
fix(config): name the accepted value for a near-miss ripr.toml value (#14176) - #14210
Conversation
…14176) Closed-set ripr.toml values are case-sensitive, so `mode = "Draft"` or `enabled = ["Rust"]` fails the load. The error listed every accepted value but never said which one was meant, while `--mode Fast` on the command line answers "Did you mean `fast`?". A rejected analysis.mode, oracle strength, severity or languages.enabled value that is an accepted spelling in another case, padded with whitespace, or a small typo now ends its error with `(did you mean `x`?)`. The hint is built from the fixed accepted names, reuses the key-suggestion edit distance, and leaves the typed diagnostic unchanged. Values stay case-sensitive. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVhiLkoko6xjFcyPWx6
|
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 7 minutes. View limit details
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Source review of head 3778957 (complete diff against main abf2c72, 4 files).
Inspected:
- Semantic owner: the four closed-set value parsers in
crates/ripr/src/config.rsare the single authority for these values; the hint is added there and nowhere else.near_value_hintreusessuggest::did_you_mean(same edit-distance bound as the unknown-key hint) on a trimmed, ASCII-lowercased copy of the value. - Accepted set: unchanged. Every arm that returned an error still returns an error; the match arms that accept values are untouched, so values remain case-sensitive.
- Candidate lists match the accepted arms of each parser.
[severity.findings]passes the three-value list, so a findings value is never steered tooff; the dedicatedoffmessage for findings is untouched. - Consumers:
ConfigDiagnostic::at_valuederives span,invalid_valueandexpected_valuesfrom the key path and source span, so the typed diagnostic is the same; onlymessagegains the suffix. The source-free summary keeps the first line, which already carried this message. - Hint content: built from fixed accepted names only; no additional file text is echoed.
- Tests: exact-message assertions for case, padding and typo inputs in all four families; a discriminating set of unrelated inputs that must carry no hint; a typed-diagnostic test.
- Docs and changelog fragment match the behavior.
Local evidence on this tree: cargo fmt --check clean, cargo test -j1 -p ripr --lib config:: 269 passed, check-changelog-fragments pass. The full local precommit did not finish in the container (compiler memory limit while building lib tests); hosted qualification is still to run and is not claimed here.
Generated by Claude Code
There was a problem hiding this comment.
Code Review
This pull request introduces near-miss hints for rejected closed-set values in ripr.toml configuration files. When a user provides a value with incorrect casing, extra whitespace, or a minor typo, the configuration loader now appends a helpful suggestion (e.g., (did you mean 'draft'?)) to the error message. This enhancement is applied to language enablement, analysis modes, oracle strengths, and severity levels. The changes also include comprehensive unit tests to verify the hint behavior and updated documentation in CONFIGURATION.md. I have no further feedback to provide as there are no review comments to evaluate.
ripr static exposure checkCommit Took 66s. |
…PEC-0007 (#14176) Review repairs on the near-miss value hint: - `suggest::did_you_mean` skips a candidate whose length differs from the input by more than the edit limit. The distance is at least that difference, so results are unchanged, and an oversized rejected key or value is no longer aligned against every accepted name (the table grew with input length times candidate length). - RIPR-SPEC-0007 gains the acceptance example for nearest-value hints, its test mapping, and the traceability rows for `value_hint_tests`, including a new oversized-value negative. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVhiLkoko6xjFcyPWx6
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Source review of head cf9b8c2. The earlier review of 3778957 still describes the parser change; this pass covers the delta since then (4 files).
Inspected:
suggest::did_you_mean: a candidate is skipped when its character length differs from the input by more than the edit limit. Edit distance is bounded below by the length difference, so every result the function returned before is returned now; the existing nearest-key assertions inschema_parity_tests.rsran unchanged. The filter runs ahead ofedit_distance, so table size is bounded by candidate length plus the limit for any input.- Both callers (unknown keys and closed-set values) go through this one function; no second copy of the bound exists.
oversized_value_fails_without_a_hint: asserts the stimulus (the load is refused with the plain accepted-values message) foranalysis.modeandlanguages.enabled, then asserts no hint and aNonefrom the helper.- RIPR-SPEC-0007 acceptance example and test mapping match the implemented behavior, including the
[severity.findings]and typed-diagnostic clauses; the four traceability rows name tests that exist. - Both review threads were answered and resolved with this change.
Local evidence on this tree: cargo fmt --check clean, cargo test -j1 -p ripr --lib config:: 270 passed, check-traceability and check-spec-format pass. Hosted qualification for this head is still to run and is not claimed here.
Generated by Claude Code
cargo-deny fails on this PR and on main (abf2c72 locks rustix 1.1.5) with the new advisory RUSTSEC-2026-0486 (xattr size-query marks unwritten bytes initialized). 1.1.6 is the fixed release; this is the same lockfile change the open dependency bump #14013 carries, ported here so this head is not red for a cause outside its diff. Lockfile only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVhiLkoko6xjFcyPWx6
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Source review of head 6ad3d1d. The reviews of 3778957 and cf9b8c2 still describe the source change; this pass covers the one commit since then.
Inspected:
- The commit changes
Cargo.lockonly:rustix1.1.5 to 1.1.6 (version and checksum lines, same crates.io source). No manifest, feature or other package entry moves. - Reason:
cargo-denyreported RUSTSEC-2026-0486 against rustix 1.1.5 on the previous head. Main at abf2c72 locks the same version, so the advisory is inherited from the base. 1.1.6 is the release the advisory names as the remedy, and it is the same bump the open dependency PR #14013 carries. check-dependenciespasses, andcargo check -p ripr -p xtask --lockedcompletes against the new lockfile.
Hosted qualification for this head is still to run and is not claimed here.
Generated by Claude Code
|
CI note for head
Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY
Final merge review of head 6ad3d1d.
Inspected on this exact head:
- Complete diff against main:
config.rsvalue parsers (mode, oracle strength, severity, languages) append a near-miss hint throughsuggest::did_you_mean;suggest.rsfilters candidates by length before computing edit distance; newvalue_hint_tests.rs; docs, RIPR-SPEC-0007 acceptance example, traceability rows, changelog fragment;Cargo.lockrustix 1.1.5 to 1.1.6. - Semantic owner and consumers: the hint is produced in the config parser that owns the error text; the typed diagnostic kind and exit behaviour are unchanged, asserted by
hint_does_not_change_the_typed_diagnostic. - Test stimulus and oracle: positive near-miss cases per parser, a negative case with an unrelated value, and a 256 KiB value that must fail without a hint.
- Hosted results:
Ripr Rust Small Resultsuccess (run 42990570408: Rust gates, 4 test shards and shard verify all success),Rust-only feature lane,kani,cargo-deny,dependency-review, wheel and Python journeys, paste on three platforms,windows-advisory-subsetall success. - Review state: both Devin threads repaired in cf9b8c2, replied and resolved. Gemini raised no findings. CodeRabbit was rate limited and
ub-reviewwas cancelled, so those two providers supplied no review; they are missing evidence, not clean passes. - ripr static advisory on this head: 27 advisory findings, 0 confirmed gaps. The named one is the length filter at
suggest.rs:103. That filter cannot change which suggestion is returned, because a candidate whose length differs by more than the limit already has an edit distance above the limit; it only bounds the table size. A behavioural assertion cannot discriminate it, so no test was added. - Integration: no conflict with current main 2ab9f90.
Local evidence gap, unchanged: full cargo xtask precommit could not finish in the session container (memory), so the hosted run above is the full proof.
Generated by Claude Code
Resolve the docs/CI.md paragraph conflict by retaining parallel shard-start wording and the reviewed singleton download explanation. Preserve the verifier, tests, and changelog unchanged. Includes landed rustix 1.1.6 prerequisite from #14210.
Requested by Steven Zimmerman · project thread
Summary
ripr.tomlvalues are lowercase and case-sensitive, somode = "Draft"orenabled = ["Rust"]fails the load. The error listed every accepted value and never said which one was meant, whileripr check --mode Fastalready answersDid you mean `fast`?.analysis.mode, oracle strength, severity orlanguages.enabledvalue that is an accepted spelling in another case, padded with whitespace, or a small typo now ends its error with(did you mean `x`?).Before:
After:
Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: n/a
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #14176
Acceptance delta (one sentence): A near-miss closed-set
ripr.tomlvalue names the accepted value it most likely meant, without changing what is accepted.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
claude/project-thread-lqh36xStack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): n/a
Scope
crates/ripr/src/config.rs:near_value_hint, used byparse_mode_value,parse_oracle_strength,parse_severityandparse_languages_enabled. It reuses the existing key-suggestion edit distance inconfig/suggest.rs.crates/ripr/src/config/value_hint_tests.rs: new unit tests.docs/CONFIGURATION.md,changelog.d/14176-config-value-near-miss-hint.md.Scope Classification
Production delta:
Evidence/support delta:
slow,error,cobol, empty) and no steering of a[severity.findings]value tooff; the typedConfigDiagnostickeeps its span,invalid_valueandexpected_values.Single acceptance criterion:
mode = "Draft"fails with a message ending(did you mean `draft`?), andmode = "slow"fails with no hint.Non-goals:
lsp.diagnostic_profileandperl.producermessages; any JSON schema change.Support-tier Impact
Policy Impact
Proof
Result, failures, or skipped proof:
cargo xtask precommitdid not complete locally: it exited 1 when rustc was killed for memory while building theriprlib tests in itscovered_bystep (cargo test -p ripr --lib analysis::scip::admission::tests --no-run). That is a container limit, not a source result, and every check before that step passed. Hosted qualification owns the full run.mainatabf2c72d.Claim Boundary
Rollback
Spec-Test-Code Traceability
config::value_hint_tests::{near_miss_values_name_the_accepted_value, unrelated_values_get_no_hint, hint_does_not_change_the_typed_diagnostic}crates/ripr/src/config.rsStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo fmt --checkcargo xtask precommit(not completed locally, see Proof)Generated by Claude Code