Skip to content

feat(rules): content/terminology-consistency flags pages that call the same thing by a different name (repo#1368) - #1910

Merged
nc9 merged 2 commits into
mainfrom
boat/terminology-consistency-1368
Nov 16, 2026
Merged

nc9 merged 2 commits into
mainfrom
boat/terminology-consistency-1368

Conversation

@nc9

@nc9 nc9 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Adds content/terminology-consistency (squirrelscan/repo#1368, part of repo#1349 T-19). Pages that call one concept by a different name than the rest of the site are flagged. The concepts are sign in / log in / login / signin, email / e-mail, sign up / signup / register / create account, FAQ / FAQs / Faq, and the casing of the product name (from a one-word og:site_name).

Design

  • Per-page data is one bounded column, page_features.terminology_variants. It is a JSON map from fixed variant keys (18 at most, e.g. signin.log_in, brand.lower) to counts capped at 255, and it never holds raw text. The schema goes from 41 to 42 with an additive nullable migration. The rule cache goes from prc-7 to prc-8.
  • pageTerminologyVariants(parsed) is the one extractor. extractPageFeatures stores its output for the streaming path, and the legacy ctx.site.pages path calls it directly. Both paths feed one accumulator and one check builder, the same shape as voice-consistency.
  • Guards:
    • The crawl needs at least 10 pages.
    • A concept needs at least 10 uses spread over 3 pages.
    • The dominant spelling needs at least 70% of a concept's uses.
    • Non-2xx pages don't vote, and on an indexed site neither do noindex pages.
  • Scoring: severity warning, weight 2. One or two inconsistent concepts give a warn, three or more give a fail. Items are capped at 8, each with up to 10 pages.
  • What is not counted:
    • Words inside URLs and email addresses.
    • Text in code, pre, samp, kbd, script, style and noscript.
    • A Title-case brand at the start of a sentence or element.
    • A brand inside a hostname.

Acceptance criteria

  • Minority spellings are flagged and the finding names the dominant and minority terms. Tests: "a minority spelling is a warning naming the dominant and minority terms", "minority email, sign up and FAQ spellings are found against their dominant ones", "product-name casing deviants are flagged" (packages/rules/tests/terminology-consistency.test.ts).
  • The legacy and streaming paths are byte-identical. Every rule test in that file runs both paths on one fixture through bothPaths and asserts JSON.stringify equality.
  • Below the floor or with no norm, the rule skips instead of flagging. Tests: "a crawl below the page floor is skipped", "a site with no clear norm (60/40 split) is skipped, not guessed at", "exactly 70 percent agreement is a norm, 65 percent is not", "too little wording to judge is skipped".
  • The variant counts are one bounded column, filled for both paths. Tests: packages/crawler/tests/page-features-store.test.ts round-trips the column, packages/audit-engine/tests/page-features-terminology.test.ts checks the extractor wiring, and "is bounded by the key table and caps each count" checks the bound.
  • Tests cover pass, warn, fail and skipped, and a consistent-site fixture produces no finding ("a consistent site produces no finding", "three inconsistent concepts fail"). The docs page docs/rules/content/terminology-consistency.mdx and the hub and catalog (docs/scripts/glossary.ts --write) are updated. The Content count goes from 28 to 29 in README.md, docs/index.mdx, docs/rules/index.mdx and docs/rules/seo/index.mdx. The live-total comment in constants goes from 332 to 333, and the "300+" floor is unchanged.

Gates

  • bun test packages/rules/tests/terminology-consistency.test.ts: 19 pass.
  • rules docs-category-table, docs-index-rule-counts, docs-rule-pages, rule-check-declarations and rule-verdict-scope: 424 pass.
  • audit-engine page-features-terminology, terminology-consistency-scoring, streaming-rules-canonical-golden, golden-finding-messages-229 and rule-cache-codec: 34 pass.
  • crawler page-features-store, rule-cache-replay-golden and template-fanout-parity-golden: 95 pass.
  • bun run typecheck passes in rules, audit-engine, crawler, core-contracts and utils. apps/cli passes typecheck, lint and format:check.
  • docs: make validate passes (62 pass).

Agent skill

The squirrelscan agent skill needs no change. The rule appears in the catalog automatically, and it adds no new CLI surface.

@nc9
nc9 force-pushed the boat/terminology-consistency-1368 branch from b2b9a47 to 722eadc Compare November 16, 2026 04:43
@nc9
nc9 marked this pull request as ready for review November 16, 2026 06:08
nc9 added 2 commits November 16, 2026 17:45
…e same thing by a different name (repo#1368)

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the boat/terminology-consistency-1368 branch from 722eadc to 1a0db23 Compare November 16, 2026 06:45
@nc9
nc9 merged commit b6b8c38 into main Nov 16, 2026
16 checks passed
@nc9
nc9 deleted the boat/terminology-consistency-1368 branch November 16, 2026 07:35
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.

1 participant