Repository navigation
fix(ux): clear four human-copy grammar frictions #8096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a07c63a
fix(ux): use correct articles before oracle-kind labels (#7752)
EffortlessSteven 01f926a
fix(ux): clear double-colon label collisions in human render (#7755)
EffortlessSteven 38dd000
fix(ux): one trailing-period rule for the human render (#7756)
EffortlessSteven 5405c54
fix(ux): pluralize count nouns at one (#7753)
EffortlessSteven d9f110b
test(fixtures): re-bless goldens for the human copy/grammar fixes (#7…
EffortlessSteven 5996a42
fix(domain): keep indefinite_article crate-internal (#7752)
EffortlessSteven 0bfd557
fix(domain): correct article test expectations (#7752)
EffortlessSteven adc60ff
fix(domain): drop duplicate article test left by the expectation fix …
EffortlessSteven ae29292
fix(domain): whole_object_equality takes 'a', not 'an' (#7752)
EffortlessSteven 8ea0405
style: cargo fmt the article test list (#7752)
EffortlessSteven f98ef14
fix(output): align tests and publisher corpus with the new copy gramm…
EffortlessSteven 275c2b4
fix(output): address reviewer findings on the copy grammar batch (#77…
EffortlessSteven 3699854
test(output): align cli_smoke and canonical controls with the copy gr…
EffortlessSteven 4ae1b41
test(guidance): adopt copy-grammar forms in pinned guidance assertion…
EffortlessSteven e0d16db
test(goldens): bless 69 fixtures for the copy-grammar render follow-u…
EffortlessSteven 4928b10
Merge remote-tracking branch 'origin/main' into fix/ux-copy-grammar-b…
EffortlessSteven aee62a2
test(goldens): bless five main-side fixtures for the copy grammar (RI…
EffortlessSteven File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| <!-- section: Fixed --> | ||
| - Verdict prose now uses the grammatically correct indefinite article before interpolated oracle-kind labels: "an `exact_value` oracle", "an `exact_error_variant` oracle", "an `unknown` oracle", while consonant-initial and consonant-sound-initial kinds (`whole_object_equality` is spelled with a vowel but pronounced with a 'w') keep "a". One shared `indefinite_article` helper in the domain layer decides the article from the first alphanumeric character, and all narrative templates that interpolate an `OracleKind` route through it (#7752). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| <!-- section: Fixed --> | ||
| - Count nouns are singular at one across user-facing surfaces: the verbose completion line says "1 probe, 1 finding", `ripr cache` reports "1 entry", the next-action selector says "one of 1 attempt", and artifact summaries, gap-ledger warnings and publish-plan blockers no longer render "1 warnings" / "1 findings" / "1 items blocked". One shared `count_noun(count, singular, plural)` helper in the output layer owns the singular/plural decision; the cache dry-run regression pin now asserts the correct "1 entry" form (#7753). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| <!-- section: Fixed --> | ||
| - The human render no longer stacks two colons on labelled lines: the per-language changed-file breakdown uses `=` for its key/value pairs ("Changed file(s) by language: javascript = 1."), and a finding next-step value that carries its own leading label ("TypeScript preview advisory: ...", "Static limit ...") renders under a dash instead of a second colon ("Next step — TypeScript preview advisory: ...") (#7755). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| <!-- section: Fixed --> | ||
| - The `ripr check` human render now follows one trailing-period rule: labelled field lines ("Summary:", "Changed file(s) by language:", "Analysis outcome:", "Counts:", "Safe next action:", "Discriminator:", "Next step:") and evidence/weakness list-item values carry no trailing period, while free-standing prose sentences (the "Note:" advisory) keep theirs. The period is stripped at the human-render emit boundary, so producer strings and the JSON/SARIF surfaces are unchanged (#7756). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| //! #7753: count-aware noun formatting shared by user-facing surfaces. | ||
| //! | ||
| //! Hardcoded plural nouns rendered "1 entries" / "1 probes" on the most | ||
| //! common first-run path (a single-probe, single-finding diff). This helper | ||
| //! is the single owner of the singular/plural decision; new interpolated | ||
| //! count strings route through it instead of hand-rolling `== 1` branches. | ||
|
|
||
| /// Render "`count` `singular`" for one and "`count` `plural`" otherwise: | ||
| /// `count_noun(1, "probe", "probes")` → `"1 probe"`. | ||
| pub(crate) fn count_noun(count: usize, singular: &str, plural: &str) -> String { | ||
| if count == 1 { | ||
| format!("{count} {singular}") | ||
| } else { | ||
| format!("{count} {plural}") | ||
| } | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::count_noun; | ||
|
|
||
| #[test] | ||
| fn one_takes_the_singular() { | ||
| assert_eq!(count_noun(1, "probe", "probes"), "1 probe"); | ||
| assert_eq!(count_noun(1, "entry", "entries"), "1 entry"); | ||
| assert_eq!(count_noun(1, "finding", "findings"), "1 finding"); | ||
| } | ||
|
|
||
| #[test] | ||
| fn zero_and_many_take_the_plural() { | ||
| assert_eq!(count_noun(0, "probe", "probes"), "0 probes"); | ||
| assert_eq!(count_noun(2, "attempt", "attempts"), "2 attempts"); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.