Extend the pass-rate sentinel beyond POSITIONING_FAQS to the rest of the site copy
#1,116 创建于 2026年8月9日
仓库指标
- 星标
- (19 个星标)
- PR 合并指标
- (平均合并 16小时 4分钟) (30 天内合并 128 个 PR)
描述
Summary
website/src/__tests__/positioning.test.ts ("rejects compressed claims and historical pass rates") guards against a hand-typed conformance percentage, but it only inspects POSITIONING_FAQS. Extend it to the other modules that carry user-facing copy: landing.tsx, landing-data.ts, agent-discovery.ts, and site-markdown.ts.
Why
A hardcoded "80%" once sat in the site copy long after the real test262 figure had moved well past it. The current guard would not catch that class of regression today, because the copy carrying conformance figures does not live in POSITIONING_FAQS.
Everything is clean right now — every figure on the site is live-sourced from published dashboard data — so this is prevention, not a bug fix. It is the follow-up the /prepare-release skill names for hardening its Layer 1 sweep, which currently depends on a human running a grep each release cycle.
Current behavior
positioning.test.ts:154 asserts /\b\d{2,3}(?:\.\d+)?\s*%/ against the concatenated POSITIONING_FAQS question/answer pairs only. Nothing guards:
website/src/components/landing.tsxwebsite/src/lib/landing-data.tswebsite/src/lib/agent-discovery.tswebsite/src/lib/site-markdown.ts
Expected behavior
A regression test fails when a literal conformance percentage is introduced into any of those modules' user-facing copy.
Scope notes
Blocked by #1114. No CI workflow currently runs the website suite, so this test would not gate anything until that lands. Worth filing and implementing regardless — it is cheap and #1114 is already open.
The guard must not fire on legitimate percentages. A naive raw-file-text regex produces false positives immediately:
landing.tsxcontainswidth="100%"(lines 609 and 735) — CSS, not a claim.site-markdown.tsgenerates percentages at runtime viacompatibilityPercent()and returns a"0.0%"fallback for an empty run.agent-discovery.ts:225already carries the prose instruction "Do not copy a historical pass rate from this file" — that line must stay allowed.
Suggested approach: assert over the exported copy constants (as the existing test does for POSITIONING_FAQS) rather than scanning file text, so that computed and interpolated values are structurally out of the guard's reach. landing-data.ts and agent-discovery.ts contain no % at all today, so they are cheap to lock down.
Extend the existing "rejects compressed claims and historical pass rates" test rather than adding a parallel one, and keep the accompanying comment explaining why % needs no trailing \b.