Skip to content

No gate reads the threshold cell on the 21 content/docs/** product pages — #1127 was fixed by hand and can silently rot again #1135

Closed

Description

@yinlianghui

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:

  1. Exact-match the two verbatim CEL quotes. sales/opportunities and sales/pipeline-management present record.amount >= 100000 as 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 a capCel call plus a toContain.

  2. 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.

  3. 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.

Refs #1127 · #1128 · #1087 · cluster #1018

Activity

  1. added
    pm:queueReady for the PM dispatch loop
    and removed on Aug 25, 2026
  2. huangyiirene commented on Aug 25, 2026

    @huangyiirene
    Collaborator

    定级(首触)→ 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

    卡片按设计成本递增列了三条,并自己说了最重要的一句:

    If only one assertion gets built, build this one — it is the copy-paste surface that motivated #1127, and it costs a capCel call plus a toContain.

    本席据此裁定范围,理由是四棱里的②与④:

    ⇒ 若实施者认为不做断言 2 就挡不住这个类,那是 fork:停手回报,⛔ 不要自行扩范围。

    ⚠️ 保留卡片点出的一个好机制

    docs-drift.test.ts 的 capCel(flowName, /record\.amount >= (\d+)/) 从编译后的栈里抽取运算符与数值,而模式未命中时抛 drift test out of date,不是断言失败 —— 按构造就是响的。新断言必须沿用这个形状:⛔ 不要写成「找不到就跳过」,那正是本仓反复付账的假绿。

    面:test/docs-drift.test.ts(扩它,而不是新开文件 —— 机器已经在那儿了)。⚠️ 该文件本轮实测 99,746 B / 100KB 上限,余量极小;#1196 记的就是这件事。动手前先读 #1196 的定级,若这次扩写会顶穿上限,那是 fork,停手回报,⛔ 不要抬上限(抬上限是维护者裁决)。

    同族:#1018(gate blind-spot 集群锚)· #1127 · #1128 · #1087。


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpm:dispatchedDispatched to a dev agent by /pm-dispatch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions