Repository navigation
test(web): require an in-app glossary entry or a reasoned exclusion for every GLOSSARY.md term - #1193
Conversation
…or every GLOSSARY.md term
|
Review round 1 (Codex
Caught correctly: renamed terms, stale rows, empty reasons and punctuation. |
All four are fixed. #1193 head:
Also in #1194 ( |
|
Review round 2 (Codex Every round 1 repro is closed: the NOT_YET swap (now ratcheted by #1194's docs-impact script), a term directly after a heading, the Break-glass reset and Money classification, and placeholder reasons. All 11 glossary tests pass. The two PRs stay correct whichever merges first. The one coupling gap found (renaming the module) belongs to #1194 and is being fixed there. The review loop for #1193 stops here. |
Makes the in-app glossary complete against
specs/product/GLOSSARY.md: every term needs an entry or a stated reason.Part of #1186
What changes
helpGlossary.test.tsused to treat the in-app glossary as a "curated subset". It checked that every in-app entry names a real GLOSSARY.md term, but a new GLOSSARY.md term with no in-app entry passed. Three new tests:Every term is covered. A term is a bold run that opens a paragraph (after a blank line or a heading), or an h3: 116 today. Each needs an in-app entry or a
SPEC_ONLYrow with a reason. On failure, the message lists the missing terms and says what to add.SPEC_ONLYstays honest. A row whose term left GLOSSARY.md, or that now has an in-app entry, fails. So does an empty reason, or a bare TODO, TBD or FIXME.NOT_YETis debt that only shrinks. 54 terms have no entry today. 8 have a real reason:Version;The other 46 are user-facing and simply missing from the app: Flock, Customer, Payment, Steppers, Audit log, Break-glass reset (the Audit screen shows it) and so on. They are
NOT_YETrows, and the test pins their count at 46. A count cannot stop a swap, where one row is removed and a new term deferred in its place. The term-by-term comparison with the PR's base therefore lives in the Docs impact CI check (ci: flag user-facing strings and glossary changes that ship without their docs #1194), which already reads both revisions with git. That check refuses a term deferred at head but not at the base.The term rule and the rows live in
web/src/routes/glossaryCoverage.ts, which has no imports, so the Docs impact check can load any revision of it. The test reads both from there; both directions of the check (entry to spec, spec to entry) use one extraction.Adding the 46 entries in three locales is out of scope here, as with the async-effect sites in #1185.
web/AGENTS.mdgets a "Glossary" rule describing the check.Checks run locally
npx vitest run src/routes/helpGlossary.test.ts --maxWorkers=2: 11 passed (also at9d63c5b1).npm run typecheckandnpm run lintpass.Proof
Run locally at
aa0f289awithnpx vitest run src/routes/helpGlossary.test.ts --maxWorkers=2. Every mutation was reverted, andgit statuswas clean afterwards.Before this PR.
origin/main's test file, with a brand-new GLOSSARY.md term (**Tray deposit (#9999)** — …) appended and no in-app entry: 8 passed. That is the gap.1. The state #464 shipped: "Stock write-off" in GLOSSARY.md, no in-app entry.
Mutation: the
StockWriteOffline removed fromhelpGlossary.ts(its catalog keys stay, so the catalog-parity test fails too).1 file changed, 1 deletion(-)
2. A brand-new GLOSSARY.md term with no entry.
3. The same new term parked as NOT_YET.
4. The same new term with a real reason.
5. Reverted.
#588 is not caught by this check, and could not be. #588 added no term. It added a paragraph to the existing Farm code entry in GLOSSARY.md (the
?farm=prefill and the remembered-codes picker), and the review finding was that the in-appglossaryFarmCodeDefstill described only typing the code. That is drift in the content of an entry that already exists. An existence check cannot see it. It needs a diff check: a GLOSSARY.md paragraph changed for a term that has an in-app entry, with that entry'sglossary<Key>Defunchanged inen.ts. That fits the CI diff script in #1186's second PR, and I have proposed it there.Review round 1 fixes
NOT_YETcount allowed a swap6f0a26b3); data moved toglossaryCoverage.tshere (d9dcb88e)glossaryTerms()serves both directionsd9dcb88eNOT_YET(count 45 -> 46); Money's reason now names only what it coversd9dcb88ed9dcb88e9d63c5b1updatesweb/AGENTS.mdto say where the membership check lives.Mutations, with
npx vitest run src/routes/helpGlossary.test.ts --maxWorkers=2:aa0f289ad9dcb88e## Packagingthen**Tray deposit** — …with no blank line betweenSPEC_ONLYreason of"TODO"Finding 1, end to end. Base = this PR's head
9d63c5b1. Head = a throwawaycommit-treecommit on top of it that removes"flock": NOT_YETand adds a new GLOSSARY.md termTray depositasNOT_YET. The count stays at 46.From #1194's round 1 (
68c7f06f). A wrapped line that starts with an issue number, such as GLOSSARY.md's#729); Managers and below…, was treated as a heading. A bold word at the start of the next line then counted as a new term. Only^#{1,6}(\s|$)is a heading now. Mutation: rewrap so the line after#729);starts with**Managers**. At9d63c5b1: 1 failed,expected [ 'managers' ] to deeply equal []. At68c7f06f: 11 passed.