Repository navigation
No gate reads the threshold cell on the 21 content/docs/** product pages — #1127 was fixed by hand and can silently rot again #1135
Description
Found while implementing #1127 (PR pending). Filed rather than fixed: #1127's scope was explicitly the rewording, and a docs-drift gate over 21 pages in 3 locales is its own card with its own design — cluster #1018.
Measured
#1128 flipped the large-deal operator from > to >=. Two documentation surfaces stated that operator; only one of them was guarded, so only one of them failed loudly:
| surface | guard | what happened in #1128 |
|---|---|---|
src/docs/crm_sales.md, src/docs/crm_admin.md |
test/docs-drift.test.ts |
the regex stopped matching and threw, forcing the update in the same PR |
content/docs/** (21 pages), docs/feature-inventory.md, scripts/demo-staff.ts |
nothing | shipped wrong for ~2 h until #1127 was dispatched |
docs-drift.test.ts reads src/docs/*.md only. automation-docs-coverage.test.ts does read content/docs/administration/automation.*, but keys on each flow's row label and trigger cell and never on the threshold cell — I confirmed this while editing that exact table: all three locales' description cells changed and the suite stayed green.
Nothing a user hits today — #1127's PR corrects every page. This is about the next operator or value change.
The specific hook
The machinery already exists in test/docs-drift.test.ts. Its capCel(flowName, /record\.amount >= (\d+)/) extracts the live operator and value out of the compiled stack, and a pattern miss throws drift test out of date rather than failing an assertion — loud by construction. Three assertions, in increasing order of design cost:
-
Exact-match the two verbatim CEL quotes.
sales/opportunitiesandsales/pipeline-managementpresentrecord.amount >= 100000as the authoritative "where is this configured?" answer, in all three locales — six lines total. Assert each equals the compiled condition substring. This is string equality against the artifact: no phrase table, no locale judgement, no prose. If only one assertion gets built, build this one — it is the copy-paste surface that motivated 21 product pages will state "> $100K" for a gate that cuts at ">= $100K" once #1087 lands, and no gate reads them #1127, and it costs acapCelcall plus atoContain. -
A per-locale phrase table for the prose pages, keyed on the derived operator, so flipping the source flips which table must match: inclusive
en: ['$100K or more', '≥ $100K']/zh-Hans: ['$100K 及以上', '达到']/zh-Hant: ['$100K 及以上', '達到'], exclusive['over $100K', '超过 $100K', ...]. Assert the inclusive set matches and the exclusive set does not. -
The reverse-direction grep as a test, which is what 21 product pages will state "> $100K" for a gate that cuts at ">= $100K" once #1087 lands, and no gate reads them #1127 used for its verification and is cheap to keep: zero matches for the exclusive phrasings across
content/docs/**.
Why this is a card and not a rider
Assertion 2 is the part that needs design, and it is the reason this should not be bolted onto #1127. A phrase table over prose in three languages is a rewording tax if it is too strict, and a rubber stamp if it is too loose — and Chinese carries no word-for-word "or more" (超过 is strictly exclusive; the inclusive reading needs 及以上 / 达到), so the table is not a mechanical transliteration of the English one. Getting that boundary right is #1018's subject matter.
Activity
huangyiirene commentedon Aug 25, 2026
定级(首触)→
pm:queue,带一条范围裁定:做断言 1 + 3,⛔ 断言 2 不在本卡。按本席常设授权定级。
finding同笔摘除。前提
卡片记的是一次真实事故的成因:#1128 把大额门槛的运算符从
>翻成>=,两个文档面陈述了这个运算符,只有一个有守卫,于是另一个(content/docs/**21 页 +docs/feature-inventory.md+scripts/demo-staff.ts)错着上线约两小时,直到 #1127 被派发。这不是推测,是发生过的。test/docs-drift.test.ts仍只读src/docs/*.md;automation-docs-coverage.test.ts读content/docs/administration/automation.*但键在流程行标签与触发器格,不在门槛值格 —— 卡片作者是在编辑那张表时确认的:三个语言的描述格全改了,套件照样绿。裁定:断言 1 与 3 做,断言 2 留给 #1018
卡片按设计成本递增列了三条,并自己说了最重要的一句:
本席据此裁定范围,理由是四棱里的②与④:
sales/opportunities与sales/pipeline-management三语共六行,把record.amount >= 100000当作权威答案呈现给读者。断言它等于编译产物里的条件子串:字符串相等,无短语表,无语言判断,无散文。这是引发 21 product pages will state "> $100K" for a gate that cuts at ">= $100K" once #1087 lands, and no gate reads them #1127 的那个复制粘贴面,成本是一次capCel加一个toContain。content/docs/**对排他性措辞零命中。21 product pages will state "> $100K" for a gate that cuts at ">= $100K" once #1087 lands, and no gate reads them #1127 已经用它做过验证,保留成测试几乎零成本。超过严格排他,包含义要及以上/达到),所以表不是英文表的机械转写。太严是改写税,太松是橡皮图章,而那个边界正是 守卫能力:objectstack lint 的 warning 不 gate(exit 0)——warning 级缺陷在 pnpm verify 里永远不会红,只能靠人眼或逐条复刻成测试 #1018 的题目。在本卡里顺手做会得到一张没人愿意维护的表。⇒ 若实施者认为不做断言 2 就挡不住这个类,那是 fork:停手回报,⛔ 不要自行扩范围。
docs-drift.test.ts的capCel(flowName, /record\.amount >= (\d+)/)从编译后的栈里抽取运算符与数值,而模式未命中时抛drift test out of date,不是断言失败 —— 按构造就是响的。新断言必须沿用这个形状:⛔ 不要写成「找不到就跳过」,那正是本仓反复付账的假绿。面:⚠️ 该文件本轮实测 99,746 B / 100KB 上限,余量极小;#1196 记的就是这件事。动手前先读 #1196 的定级,若这次扩写会顶穿上限,那是 fork,停手回报,⛔ 不要抬上限(抬上限是维护者裁决)。
test/docs-drift.test.ts(扩它,而不是新开文件 —— 机器已经在那儿了)。同族:#1018(gate blind-spot 集群锚)· #1127 · #1128 · #1087。
Generated by Claude Code
test(docs): split docs-drift.test.ts along its describe seams (#1196)