Skip to content

fix(config): name the accepted value for a near-miss ripr.toml value (#14176) - #14210

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/project-thread-lqh36x
Nov 12, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/project-thread-lqh36x

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven Zimmerman · project thread

Summary

  • Closed-set ripr.toml values are lowercase and case-sensitive, so mode = "Draft" or enabled = ["Rust"] fails the load. The error listed every accepted value and never said which one was meant, while ripr check --mode Fast already 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`?).

Before:

ripr: ripr.toml:2:8: analysis.mode `Draft` is not supported; expected instant, draft, fast, deep, or ready

After:

ripr: ripr.toml:2:8: analysis.mode `Draft` is not supported; expected instant, draft, fast, deep, or ready (did you mean `draft`?)

Swarm / Source Boundary

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

Source-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.toml value 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-lqh36x
Stack 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 by parse_mode_value, parse_oracle_strength, parse_severity and parse_languages_enabled. It reuses the existing key-suggestion edit distance in config/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

  • One production behavior

Production delta:

  • Error text only, on an already-failing load. The hint is appended to the message; values stay case-sensitive and nothing new is accepted.

Evidence/support delta:

  • Three unit tests: exact messages for case, padding and typo near-misses across the four value families; no hint for unrelated values (slow, error, cobol, empty) and no steering of a [severity.findings] value to off; the typed ConfigDiagnostic keeps its span, invalid_value and expected_values.

Single acceptance criterion:

  • mode = "Draft" fails with a message ending (did you mean `draft`?), and mode = "slow" fails with no hint.

Non-goals:

  • Accepting other-case values; lsp.diagnostic_profile and perl.producer messages; any JSON schema change.

Support-tier Impact

  • none

Policy Impact

  • none

Proof

cargo fmt --check                                              # clean
CARGO_INCREMENTAL=0 cargo test -j1 -p ripr --lib config::       # 269 passed
target/debug/xtask check-changelog-fragments                    # pass

Result, failures, or skipped proof:

  • cargo xtask precommit did not complete locally: it exited 1 when rustc was killed for memory while building the ripr lib tests in its covered_by step (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.
  • The focused config tests above were run on this exact tree, rebuilt on main at abf2c72d.
  • The hint text is built from the fixed accepted names; no file text is echoed beyond what the message already quoted.

Claim Boundary

  • May be claimed: a near-miss closed-set value names the accepted spelling in the load error.
  • Must not be claimed: that other-case values are accepted, or that every invalid value gets a hint.

Rollback

  • Revert this commit; no schema, config or stored-artifact change.

Spec-Test-Code Traceability

  • Spec: n/a
  • Tests: config::value_hint_tests::{near_miss_values_name_the_accepted_value, unrelated_values_get_no_hint, hint_does_not_change_the_typed_diagnostic}
  • Code: crates/ripr/src/config.rs
  • Golden outputs: none affected (no golden carries these messages)
  • Metrics: n/a
  • ADR/learning: n/a

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

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.
  • Errors are reported with actionable context.

Gates

  • cargo fmt --check
  • cargo xtask precommit (not completed locally, see Proof)

Generated by Claude Code

…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
@EffortlessSteven EffortlessSteven self-assigned this Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 144 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 05e3ec17-68ba-4180-94ec-4d975ab2b94d
Commits

Reviewing files that changed from the base of the PR and between abf2c72 and 6ad3d1d.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 7

  • .ripr/traceability.toml
  • changelog.d/14176-config-value-near-miss-hint.md
  • crates/ripr/src/config.rs
  • crates/ripr/src/config/suggest.rs
  • crates/ripr/src/config/value_hint_tests.rs
  • docs/CONFIGURATION.md
  • docs/specs/RIPR-SPEC-0007-repository-configuration.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.rs are the single authority for these values; the hint is added there and nowhere else. near_value_hint reuses suggest::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 to off; the dedicated off message for findings is untouched.
  • Consumers: ConfigDiagnostic::at_value derives span, invalid_value and expected_values from the key path and source span, so the typed diagnostic is the same; only message gains 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

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 potential issues.

Devin Review

Comment thread crates/ripr/src/config.rs Resolved
Comment thread crates/ripr/src/config.rs Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit 6ad3d1daae57 · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=abf2c72db29b8717348596d9034d18af66479b10 findings=27 gaps=0 unconfirmed_gaps=1 static_unknown=3 weakly_exposed=24
open=a static limit leaves reach unconfirmed, but a related test asserts too weakly to notice the change; not a confirmed gap, and tests may still help
weakly_exposed|crates/ripr/src/config/suggest.rs:103|candidate.chars().count().abs_diff(length) <= limit|missing=-|test=t1|id=probe:crates_ripr_src_config_suggest.rs:predicate:31454824
stages=reach:yes,infect:yes,propagate:yes,observe:yes,discriminate:weak
t1=crates/ripr/src/config/value_hint_tests.rs:93 oversized_value_fails_without_a_hint relational_check `assert!(message.contains("expected instant") || message.contains("unknown langua…` miss=weak_assertion
limits=static_unknown:3,weakly_exposed:24
next=ripr explain --root . --base abf2c72db29b8717348596d9034d18af66479b10 --committed --mode draft --format agent probe:crates_ripr_src_config_suggest.rs:predicate:31454824
verify=refused|outcome=complete_with_findings|findings=27|exposed=0|reason=gaps_remain

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 EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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 in schema_parity_tests.rs ran unchanged. The filter runs ahead of edit_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) for analysis.mode and languages.enabled, then asserts no hint and a None from 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 EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.lock only: rustix 1.1.5 to 1.1.6 (version and checksum lines, same crates.io source). No manifest, feature or other package entry moves.
  • Reason: cargo-deny reported 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-dependencies passes, and cargo check -p ripr -p xtask --locked completes against the new lockfile.

Hosted qualification for this head is still to run and is not claimed here.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

CI note for head cf9b8c24:


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

REVIEW_READY

Final merge review of head 6ad3d1d.

Inspected on this exact head:

  • Complete diff against main: config.rs value parsers (mode, oracle strength, severity, languages) append a near-miss hint through suggest::did_you_mean; suggest.rs filters candidates by length before computing edit distance; new value_hint_tests.rs; docs, RIPR-SPEC-0007 acceptance example, traceability rows, changelog fragment; Cargo.lock rustix 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 Result success (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-subset all success.
  • Review state: both Devin threads repaired in cf9b8c2, replied and resolved. Gemini raised no findings. CodeRabbit was rate limited and ub-review was 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

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 1707650 Nov 12, 2026
77 of 78 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-lqh36x branch November 12, 2026 04:45
EffortlessSteven added a commit that referenced this pull request Nov 12, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants