Skip to content

fix(core): flag "a software" with modifiers#3805

Open
ychampion wants to merge 2 commits into
Automattic:masterfrom
ychampion:fix-mass-noun-modifiers
Open

fix(core): flag "a software" with modifiers#3805
ychampion wants to merge 2 commits into
Automattic:masterfrom
ychampion:fix-mass-noun-modifiers

Conversation

@ychampion

@ychampion ychampion commented Jul 11, 2026

Copy link
Copy Markdown

AI disclosure: This change was implemented by an autonomous Codex agent and reviewed and tested in the local workspace.

Issues

Fixes #3799

Description

MassNouns now recognizes software as the head of a qualified noun phrase, including the reported a novel writing software case. Corrections preserve the original modifiers.

The matcher stops when a later noun becomes the head, so compounds such as a software tool and a software engineering manager remain unchanged. This is scoped to software; applying the same heuristic to every mass noun caused corpus false positives for words with valid countable senses.

Demo

a novel writing software now offers a novel writing program, novel writing software, and some novel writing software.

How Has This Been Tested?

  • CARGO_PROFILE_TEST_DEBUG=0 CARGO_INCREMENTAL=0 cargo test -p harper-core --quiet
  • CARGO_PROFILE_TEST_DEBUG=0 CARGO_INCREMENTAL=0 cargo test -p harper-core --no-default-features --quiet
  • cargo clippy -p harper-core --lib -- -D warnings -A clippy::useless-borrows-in-formatting -A clippy::question-mark
  • cargo clippy -p harper-core --lib --no-default-features -- -D warnings -A clippy::useless-borrows-in-formatting -A clippy::question-mark
  • cargo fmt --all -- --check

AI Disclosure

  • I am a human and didn't use any AI.
  • I used LLM features of my editor, but not an agent.
  • I used an AI agent interactively.
  • I am an agent or I got an agent to do the work autonomously.

If Your PR Implements or Enhances a Linter

  • I made up the sentences in the unit tests.
  • The sentences in the unit tests were generated by an AI.
  • I'm using examples from the bug report / feature request.
  • I collected real-world sentences for the unit tests.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • I have considered splitting this into smaller pull requests.

Constraint: Preserve valid compound-noun uses and existing direct suggestion behavior.
Rejected: General qualified mass-noun matching | Corpus snapshots exposed valid countable senses and clause false positives.
Confidence: high
Scope-risk: narrow
Directive: Gate any broader modifier matching on corpus tests and noun-specific ambiguity.
Tested: Full default and no-default harper-core package suites; focused regressions; strict library Clippy; cargo fmt; diff check.
Not-tested: JavaScript Biome formatting because node_modules is absent and the diff is Rust-only.

@hippietrail hippietrail left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI-written linters, especially for tricky mistakes that need context to disambiguate need a lot of real world test cases. I spent some human time and effort to find some to help see how close this is.

Comment thread harper-core/src/linting/mass_nouns/noun_countability.rs
Constraint: Preserve valid software compounds while covering every real-world sentence supplied in review.
Rejected: Broaden follower classification for every mass noun | Corpus snapshots exposed a false positive in an unrelated literary sentence.
Confidence: high
Scope-risk: narrow
Directive: Keep future qualified-mass-noun exceptions noun-specific and corpus-tested.
Tested: focused 64-test noun-countability suite; full default and no-default harper-core suites; corpus snapshots; strict default and no-default Clippy; cargo fmt; release CLI positive and negative smokes; diff check.
Not-tested: JavaScript Biome formatting because the clean clone has no node_modules; just format completed its Rust formatting step.
@ychampion

Copy link
Copy Markdown
Author

AI-written linters, especially for tricky mistakes that need context to disambiguate need a lot of real world test cases. I spent some human time and effort to find some to help see how close this is.

Nah, I reviewed dw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False negative: MassNouns doesn't flag "a software" that has modifiers/qualifiers

2 participants