Skip to content

feat(core): flag "tenant" where "tenet" is meant - #4425

Merged
elijah-potter merged 2 commits into
Automattic:masterfrom
manduinca:feat/tenant-tenet
Oct 27, 2026
Merged

elijah-potter merged 2 commits into
Automattic:masterfrom
manduinca:feat/tenant-tenet

Conversation

@manduinca

Copy link
Copy Markdown
Contributor

Written with LLM assistance: the Weir rules and their tests were drafted with an LLM. The approach, the corpus validation and the final wording are mine, and I've reviewed every line.

Issues

Closes #1070.

Description

tenant (a renter) gets written where tenet (a principle) is meant: "the core tenants of our design".

This adds a grouped TenantTenet rule (singular and plural children) that fires only when tenant/tenants follows a principle-sense adjective — core, central, fundamental, basic, guiding, cardinal, underlying, foundational, defining — and is followed by of or is. Phrases like of the building are excluded through a word list of places.

The narrow shape is the point, and it comes from data rather than taste. I pulled 2,086 real sentences containing tenant/tenants from GitHub issues and Wikipedia and ran the rule over them: 30 hits, 29 of them the actual mistake. The one false positive is a Japanese shopping centre ("the core tenant of Tamagawa Takashimaya Shopping Center").

The obvious wider rule does much worse on the same sample. Gating on "adjective + non-noun", which is where #3822 ended up, would have flagged around 20 legitimate uses: "its core tenant was a hotel", "Central tenants are in scope", "with two core tenants, Armstrong Marine and Winter Custom Yachts".

main and key are deliberately left out. In that corpus, 19 of their 23 of/is uses are stadiums, malls and office buildings — "The main tenants of the stadium are…". That does cost the rule the "main tenants of many religions" example from the issue; I'd rather miss it than flag every arena in Wikipedia.

Known misses, all on purpose: sentence-final "a core tenant." (nothing follows to disambiguate) and "core tenants from day 1".

Demo

$ harper-cli lint --only TenantTenet "These are the core tenants of our design."
Malapropism: Did you mean `tenets`? A `tenant` rents a place; a `tenet` is a principle.

$ harper-cli lint --only TenantTenet "The core tenant isolation logic lives here."
(no lints)

How Has This Been Tested?

42 tests across the two .weir files, covering true positives, the multi-tenancy false positives, real-estate uses, casing and sentence-final forms. cargo test -p harper-core passes, 6,559 tests, including curated_default_config_lists_every_registered_rule after adding the entry to default_config.json.

`tenant` (a renter) is often written where `tenet` (a principle) is
meant: "the core tenants of our design". The renter reading is common
in real writing, so the rule only fires after an adjective that reads
as a principle and before `of` or `is`, and it leaves `of the building`
style phrases alone.

Run over 2,086 sentences with `tenant`/`tenants` gathered from GitHub
issues and Wikipedia: 30 hits, 29 of them the mistake. Adjective plus a
following non-noun, as in the earlier attempt, would have flagged about
20 real uses in the same sample (`its core tenant was a hotel`,
`central tenants are in scope`). `main` and `key` are left out on
purpose: 19 of their 23 `of`/`is` uses are stadiums, malls and
buildings.

Closes Automattic#1070
@elijah-potter
elijah-potter added this pull request to the merge queue Sep 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 24, 2026
@elijah-potter
elijah-potter added this pull request to the merge queue Oct 27, 2026
Merged via the queue into Automattic:master with commit 0c7c261 Oct 27, 2026
14 checks passed
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.

Flag using "tenant" instead of "tenet".

2 participants