Skip to content
Merged
Show file tree
Hide file tree
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 Oct 15, 2026
01f926a
fix(ux): clear double-colon label collisions in human render (#7755)
EffortlessSteven Oct 15, 2026
38dd000
fix(ux): one trailing-period rule for the human render (#7756)
EffortlessSteven Oct 15, 2026
5405c54
fix(ux): pluralize count nouns at one (#7753)
EffortlessSteven Oct 15, 2026
d9f110b
test(fixtures): re-bless goldens for the human copy/grammar fixes (#7…
EffortlessSteven Oct 15, 2026
5996a42
fix(domain): keep indefinite_article crate-internal (#7752)
EffortlessSteven Oct 15, 2026
0bfd557
fix(domain): correct article test expectations (#7752)
EffortlessSteven Oct 15, 2026
adc60ff
fix(domain): drop duplicate article test left by the expectation fix …
EffortlessSteven Oct 15, 2026
ae29292
fix(domain): whole_object_equality takes 'a', not 'an' (#7752)
EffortlessSteven Oct 15, 2026
8ea0405
style: cargo fmt the article test list (#7752)
EffortlessSteven Oct 15, 2026
f98ef14
fix(output): align tests and publisher corpus with the new copy gramm…
EffortlessSteven Oct 15, 2026
275c2b4
fix(output): address reviewer findings on the copy grammar batch (#77…
EffortlessSteven Oct 15, 2026
3699854
test(output): align cli_smoke and canonical controls with the copy gr…
EffortlessSteven Oct 15, 2026
4ae1b41
test(guidance): adopt copy-grammar forms in pinned guidance assertion…
EffortlessSteven Oct 15, 2026
e0d16db
test(goldens): bless 69 fixtures for the copy-grammar render follow-u…
EffortlessSteven Oct 15, 2026
4928b10
Merge remote-tracking branch 'origin/main' into fix/ux-copy-grammar-b…
EffortlessSteven Oct 15, 2026
aee62a2
test(goldens): bless five main-side fixtures for the copy grammar (RI…
EffortlessSteven Oct 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions changelog.d/7752-oracle-article-agreement.md
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).
2 changes: 2 additions & 0 deletions changelog.d/7753-count-noun-pluralization.md
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).
2 changes: 2 additions & 0 deletions changelog.d/7755-human-double-colon-labels.md
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).
2 changes: 2 additions & 0 deletions changelog.d/7756-human-trailing-period-rule.md
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).
14 changes: 10 additions & 4 deletions crates/ripr/src/analysis/language/python/classify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::analysis::diff::lines_look_alike;
use crate::domain::{
Confidence, ExposureClass, Finding, LanguageId as DomainLanguageId, LanguageStatus,
MissingDiscriminatorFact, OracleKind, OracleStrength, Probe, ProbeFamily, RevealEvidence,
RiprEvidence, SourceLocation, StageEvidence, StageState,
RiprEvidence, SourceLocation, StageEvidence, StageState, indefinite_article,
};
use std::path::Path;

Expand Down Expand Up @@ -515,8 +515,10 @@ pub(super) fn classify_change_for_owner(
StageState::Yes,
StageState::Yes,
vec![format!(
"Related Python test reaches `{}` with a `{}` oracle. Static evidence suggests the changed behavior is observed under an exact-value discriminator.",
// #7752: the article follows the oracle-kind label ("an `exact_value`").
"Related Python test reaches `{}` with {} `{}` oracle. Static evidence suggests the changed behavior is observed under an exact-value discriminator.",
owner.name,
indefinite_article(strongest_kind.as_str()),
strongest_kind.as_str()
)],
)
Expand Down Expand Up @@ -837,14 +839,18 @@ pub(super) fn classify_change_for_owner(
)
} else if matches!(class, ExposureClass::Exposed) {
format!(
"Related Python test uses a `{}` oracle; static evidence suggests the changed behavior is discriminated.",
// #7752: the article follows the oracle-kind label ("an `exact_value`").
"Related Python test uses {} `{}` oracle; static evidence suggests the changed behavior is discriminated.",
indefinite_article(strongest_kind.as_str()),
strongest_kind.as_str()
)
} else if strongest_strength >= OracleStrength::Strong.rank() {
// Strength alone cannot override the classifier's alignment, error-path,
// or default-activation decision. Keep the narrative at that verdict.
format!(
"Related Python test uses a `{}` oracle, but static evidence does not establish discrimination of the changed behavior.",
// #7752: the article follows the oracle-kind label ("an `exact_value`").
"Related Python test uses {} `{}` oracle, but static evidence does not establish discrimination of the changed behavior.",
indefinite_article(strongest_kind.as_str()),
strongest_kind.as_str()
)
} else {
Expand Down
4 changes: 2 additions & 2 deletions crates/ripr/src/analysis/language/python/classify/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ fn assert_strong_oracle_is_not_discrimination(finding: &Finding) {
assert_eq!(finding.ripr.reveal.discriminate.state, StageState::Weak);
assert_eq!(
finding.ripr.reveal.discriminate.summary,
"Related Python test uses a `exact_value` oracle, but static evidence does not establish discrimination of the changed behavior."
"Related Python test uses an `exact_value` oracle, but static evidence does not establish discrimination of the changed behavior."
);
}

Expand Down Expand Up @@ -863,7 +863,7 @@ fn exercised_default_retains_its_positive_discriminator_summary() -> Result<(),
assert_eq!(finding.ripr.reveal.discriminate.state, StageState::Yes);
assert_eq!(
finding.ripr.reveal.discriminate.summary,
"Related Python test uses a `exact_value` oracle; static evidence suggests the changed behavior is discriminated."
"Related Python test uses an `exact_value` oracle; static evidence suggests the changed behavior is discriminated."
);
Ok(())
}
Expand Down
8 changes: 6 additions & 2 deletions crates/ripr/src/analysis/language/typescript/classifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4337,8 +4337,10 @@ pub(crate) fn classify_change_with_alias_state(
StageState::Yes,
StageState::Yes,
vec![format!(
"Related test reaches `{}` with a `{}` oracle. Static evidence suggests the changed behavior is observed under an exact-value or exact-error-variant discriminator.",
// #7752: the article follows the oracle-kind label ("an `exact_value`").
"Related test reaches `{}` with {} `{}` oracle. Static evidence suggests the changed behavior is observed under an exact-value or exact-error-variant discriminator.",
owner.name,
crate::domain::indefinite_article(strongest_kind.as_str()),
strongest_kind.as_str()
)],
)
Expand Down Expand Up @@ -4534,7 +4536,9 @@ pub(crate) fn classify_change_with_alias_state(
)
} else if strongest_strength >= OracleStrength::Strong.rank() && observation_confirmed {
format!(
"Related test uses a `{}` oracle; static evidence suggests the changed behavior is discriminated.",
// #7752: the article follows the oracle-kind label ("an `exact_value`").
"Related test uses {} `{}` oracle; static evidence suggests the changed behavior is discriminated.",
crate::domain::indefinite_article(strongest_kind.as_str()),
strongest_kind.as_str()
)
} else if strongest_strength >= OracleStrength::Strong.rank() && !boundary_witnessed {
Expand Down
6 changes: 4 additions & 2 deletions crates/ripr/src/app/agent_review_summary/artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ pub(super) fn agent_status_surface(
status: status.status().to_string(),
required: true,
summary: format!(
"{required_present} of {required_count} required artifacts present, {missing} missing, {warnings} warnings. Command: {}",
agent_status_command(
// #7753: count-aware noun — "1 warning", never "1 warnings".
"{required_present} of {required_count} required artifacts present, {missing} missing, {warnings}. Command: {command}",
warnings = crate::output::count_noun::count_noun(warnings, "warning", "warnings"),
command = agent_status_command(
&bound_root(&root_path_display(root_argument)),
Some(WORKFLOW_AGENT_STATUS_ARTIFACT)
)
Expand Down
7 changes: 6 additions & 1 deletion crates/ripr/src/app/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,12 @@ fn check_with_progress_and_origins_with_open_rust_paths(
if crate::is_verbose() {
let finding_count = analysis.findings.len();
let probe_count = analysis.summary.probes;
eprintln!("ripr: analysis complete — {probe_count} probes, {finding_count} findings");
// #7753: count-aware nouns — a single-probe run says "1 probe, 1 finding".
eprintln!(
"ripr: analysis complete — {probes}, {findings}",
probes = crate::output::count_noun::count_noun(probe_count, "probe", "probes"),
findings = crate::output::count_noun::count_noun(finding_count, "finding", "findings"),
);
}

progress.emit(AnalysisProgressStage::BuildingOutput);
Expand Down
10 changes: 8 additions & 2 deletions crates/ripr/src/cli/commands/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,11 @@ fn root_has_entries(cache_dir: &Path) -> Result<bool, String> {
}

fn describe_entries(entry_count: usize, total_size_bytes: u64) -> String {
format!("{entry_count} entries ({total_size_bytes} bytes)")
// #7753: count-aware noun — "1 entry", never "1 entries".
format!(
"{} ({total_size_bytes} bytes)",
crate::output::count_noun::count_noun(entry_count, "entry", "entries")
)
}

fn describe_layers(plan: &ClearPlan) -> String {
Expand Down Expand Up @@ -1214,7 +1218,9 @@ mod tests {
let still_present = cache_dir.join("repo-seam-facts").is_dir();
remove_base(&base)?;
if !still_present
|| !dry_run.contains("1 entries")
// #7753: regression pin — the count-aware form must read "1 entry".
|| !dry_run.contains("1 entry")
|| dry_run.contains("1 entries")
|| !dry_run.contains("repo-seam-facts")
|| !dry_run.contains("unrelated siblings would remain")
{
Expand Down
53 changes: 53 additions & 0 deletions crates/ripr/src/domain/evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,59 @@ impl OracleKind {
}
}

/// #7752: indefinite article for a user-interpolated label, decided from the
/// first alphanumeric character ("an `exact_value` oracle", "a `snapshot`
/// oracle"). Narrative templates must route interpolated `OracleKind` values
/// through this helper instead of hardcoding "a".
pub fn indefinite_article(word: &str) -> &'static str {
match word.chars().find(|ch| ch.is_alphanumeric()) {
Some('a' | 'e' | 'i' | 'o' | 'u' | 'A' | 'E' | 'I' | 'O' | 'U') => "an",
_ => "a",
}
}

#[cfg(test)]
mod article_tests {
use super::{OracleKind, indefinite_article};

#[test]
fn vowel_initial_oracle_kinds_take_an() {
// Closed set: every vowel-sound-initial member must keep taking "an"
// so the narrative templates below stay grammatical. "unknown" starts
// with a vowel letter; "whole_object_equality" is spelled with a vowel
// letter but pronounced with a consonant 'w' and takes "a".
for kind in [
OracleKind::ExactValue,
OracleKind::ExactErrorVariant,
OracleKind::Unknown,
] {
assert_eq!(indefinite_article(kind.as_str()), "an", "{kind:?}");
}
}

#[test]
fn consonant_initial_oracle_kinds_take_a() {
for kind in [
OracleKind::WholeObjectEquality,
OracleKind::Snapshot,
OracleKind::RelationalCheck,
OracleKind::BroadError,
OracleKind::SmokeOnly,
OracleKind::MockExpectation,
OracleKind::GuardedResultMatch,
] {
assert_eq!(indefinite_article(kind.as_str()), "a", "{kind:?}");
}
Comment thread
EffortlessSteven marked this conversation as resolved.
Resolved
}

#[test]
fn article_skips_leading_non_alphanumerics() {
assert_eq!(indefinite_article("`exact_value`"), "an");
assert_eq!(indefinite_article("`snapshot`"), "a");
assert_eq!(indefinite_article(""), "a");
}
}

#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum OracleStrength {
Strong,
Expand Down
1 change: 1 addition & 0 deletions crates/ripr/src/domain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub use diagnostic_witness::{
DiagnosticWitnessLimitation,
};
pub(crate) use diagnostic_witness::{perl_suggested_related_test, python_suggested_related_test};
pub(crate) use evidence::indefinite_article;
pub use evidence::{
Confidence, OracleKind, OracleStrength, RelationConfidence, RelationReason, RevealEvidence,
RiprEvidence, StageEvidence, StageState,
Expand Down
34 changes: 34 additions & 0 deletions crates/ripr/src/output/count_noun.rs
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");
}
}
8 changes: 7 additions & 1 deletion crates/ripr/src/output/first_pr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,13 @@ fn current_evidence_strength_for_card(card: &Value) -> String {
string_path(card, &["oracle_kind"]),
) {
(Some(strength), Some(kind)) => {
format!(" with a `{strength}` `{kind}` related-test oracle")
// #7752: the displayed phrase opens with the strength adjective
// ("a `strong` ..."), so the article agrees with the strength,
// not the oracle-kind label (Devin review on #8096).
format!(
" with {} `{strength}` `{kind}` related-test oracle",
crate::domain::indefinite_article(&strength)
)
Comment thread
EffortlessSteven marked this conversation as resolved.
Resolved
}
_ => String::new(),
};
Expand Down
7 changes: 5 additions & 2 deletions crates/ripr/src/output/gap_decision_ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,12 @@ pub(crate) fn build_gap_decision_ledger_report(
let input_items = input_findings_total_from_source_value(source_value_snapshot.as_ref());
if input_items > 0 {
warnings.push(format!(
"check output contained {input_items} findings, but the --check-output route \
// #7753: count-aware noun — "1 finding", never "1 findings".
"check output contained {findings}, but the --check-output route \
projects Python/TypeScript/Perl findings only; no gap records were derived \
from them"
from them",
findings =
crate::output::count_noun::count_noun(input_items, "finding", "findings"),
));
}
}
Expand Down
Loading
Loading