Skip to content

feat(rules-nlp): add no-superlative-claims rule - #23

Merged
Peyton-Spencer merged 3 commits into
mainfrom
dex/no-superlative-claims
May 11, 2026
Merged

feat(rules-nlp): add no-superlative-claims rule#23
Peyton-Spencer merged 3 commits into
mainfrom
dex/no-superlative-claims

Conversation

@Peyton-Spencer

Copy link
Copy Markdown
Contributor

Summary

  • Add no-superlative-claims to @faircopy/rules-nlp
  • Wire the rule through exports, type exports, and the NLP rule registry
  • Document the rule in the root README and packages/rules-nlp/README.md
  • Cover defaults, custom phrases, mid-sentence matching, substring boundaries, and registry exposure

Closes #16.

Notes

Validation

  • CI=true bunx pnpm@9.15.9 --workspace-concurrency=1 build
  • CI=true bunx pnpm@9.15.9 --filter @faircopy/rules-nlp test
  • CI=true bunx pnpm@9.15.9 --workspace-concurrency=1 test
  • CI=true bunx pnpm@9.15.9 --workspace-concurrency=1 typecheck

Peyton-Spencer and others added 2 commits May 10, 2026 20:28
Co-Authored-By: Codex <noreply@openai.com>
…aims

# Conflicts:
#	packages/rules-nlp/test/rules.test.mjs

const DEFAULT_PHRASES = [
'best',
'leading',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

industry-leading currently produces two diagnostics because leading is also a default phrase and \b treats the hyphen as a boundary. Local repro after build: This is industry-leading support. reports both industry-leading and nested leading. Please add coverage for this and suppress overlapping matches, or sort by phrase length and skip ranges already claimed, so the longer phrase wins.

@Peyton-Spencer Peyton-Spencer left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Non-author review on head 52a9f96652b95433c2cd4e018975f91ff11407c1.

I found one blocking issue: industry-leading currently emits overlapping diagnostics for both the full phrase and nested leading, because hyphens create word boundaries. I left an inline comment with a local repro and suggested either overlap suppression or longest-phrase-first range claiming.

Verified locally:

  • CI=true bunx pnpm@9.15.9 --filter @faircopy/rules-nlp test passes, 37/37
  • Additional local repro shows duplicate diagnostics for This is industry-leading support.

Co-Authored-By: Codex <noreply@openai.com>

@Peyton-Spencer Peyton-Spencer left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Non-author re-review on updated head ccb25650cf31a70548037a8d2d1832dff5c945a9.

The overlapping-diagnostic blocker is resolved. The rule now evaluates longer phrases first and skips overlapping shorter matches, and the new regression covers industry-leading producing a single diagnostic rather than a nested leading hit.

Verified:

  • CI=true bunx pnpm@9.15.9 --filter @faircopy/rules-nlp test passes, 38/38
  • Local repro for This is industry-leading support. now returns one diagnostic for industry-leading
  • GitHub CI: pass
  • Merge state: CLEAN

No remaining blocking findings.

@Peyton-Spencer
Peyton-Spencer merged commit 770ce91 into main May 11, 2026
1 check passed
@Peyton-Spencer
Peyton-Spencer deleted the dex/no-superlative-claims branch May 11, 2026 00:35
github-actions Bot pushed a commit that referenced this pull request May 11, 2026
# [1.14.0](v1.13.0...v1.14.0) (2026-05-11)

### Features

* **rules-nlp:** add no-superlative-claims rule ([#23](#23)) ([770ce91](770ce91))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add no-superlative-claims rule

1 participant