fix(spec): #4001 重测 —— 实测剩余站点清单,并修好测量它的那把尺 - #4852
Conversation
…r measuring it
Measurement step only — no schema changes posture in this commit. Produces the
real remaining-site list the 2026-08-03 ruling asked for before the remaining
batches are cut.
The site counter now reads the AST instead of matching source text. The textual
method was wrong in BOTH directions on seven files: it counted `z.object({ … })`
appearing inside JSDoc prose (ui/action.zod.ts declared 9 sites, has 8), and it
missed both the prettier-wrapped `z\n .object({` form (ui/chart.zod.ts 6 -> 7)
and `z.looseObject(` (data/field-value.zod.ts 1 -> 2). On ui/ the two errors
cancelled exactly, so a correct section total sat over two wrong rows.
The consequential case: automation/time-relative-trigger.zod.ts counted ZERO,
because its only site is written wrapped — and a zero-site file is deliberately
skipped by the coverage walk. An authorable schema sat outside the map while the
gate printed "no undeclared schema files". Not the data/driver/ blind spot
repeated: that walk was blind, this walk was fine and honoured a zero the
counter got wrong. Now classified.
check:strictness-ledger gains a remaining-strip-site map: per file, how many
object sites still silently discard unknown keys. That number is what batch
plans are scheduled against and nothing measured it before — which is why the
ruling was cut against `strictObject(` occurrence counts, an idiom that misses
every schema closed with the older `z.object(…).strict()` spelling and reads
automation/ as 0 strict when it has 8. Gated in both directions: a file with
strip sites must have a row, and a row whose file reaches zero strip sites
FAILS, so a closed file drops out of the worklist rather than outliving it.
Every new check verified to go red on a known input before being trusted
(campaign rule): the four remaining-strip failure modes were each induced and
observed, and the posture reads carry mutation controls in the test file.
Refs #4001, #4721
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0176qgxgCXTJCUv4YFLtusP9
…ictness-remeasure
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📓 Docs Drift CheckNo hand-written docs reference the 0 changed package(s). ✅ |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0176qgxgCXTJCUv4YFLtusP9
状态说明:本 PR 从未进入合并队列,已重跑失败 job跟进时发现 auto-merge 挂了约 100 分钟未动,而同期队列消化了 #4841 / #4870 / #4863 / #4872 / #4869 等多单 —— 排查后确认不是队列慢: 原因是时序:本 PR 的 CI 红在 10:1xZ,签名是 #4796 的 5s 超时族;而那条的修复 #4856( 已
Generated by Claude Code |
更正:重跑不够 ——
|
Refs #4001
Refs #4721
按 2026-08-03 维护者裁决「必要的全收」执行注意第 1 条 —— 先重测,再切批。
本轮不改任何 schema 的 strictness 姿态。 产出是一份实测的剩余站点清单,供 PM 据实拆批。
一、先说结论:那把尺本身是坏的,而且两个方向同时坏
台账的站点计数一直是对源码做文本匹配(
z.object(/strictObject()。这次用一把独立的 AST 尺去对,七个文件不一致 —— 出现在这场战役专门为了「地图不许悄悄过期」而写的那个闸门里。ui/action.zod.ts声明 9,实为 8(第 9 个在一段 JSDoc 里);kernel/metadata-protection.zod.ts、shared/suggestions.zod.ts整个是注释z\n .object({,z\.object\(匹配不到 ——ui/chart.zod.ts漏 1、kernel/manifest.zod.ts漏 2z.looseObject(data/field-value.zod.ts声明 1,实为 2在
ui/上这两个错误恰好抵消(−1 和 +1),于是 section 总数校验因为第二个错误而通过,盖在两行错的数字上。最要命的一个:
automation/time-relative-trigger.zod.ts计数为 0 —— 它唯一的站点是折行写的,而零站点文件会被覆盖检查刻意跳过(「没东西可分类」)。于是一个作者手写的可授权 schema 落在地图外,闸门照样打印「no undeclared schema files」。修法是结构性的而非再往正则里补一种拼法:计数器改读 AST,不会被格式或注释骗,也不用每出一种新写法就学一次 —— 和第 9 条发现里信封探针改走结构遍历是同一个动作。
二、同一次遍历顺带给出姿态,这才是重测真正要的东西
台账过去只能回答「这个文件里有没有
.strict()」,永远回答不了「它还有几个站点是开的」。而后者正是拆批要用的数。裁决当时是按
strictObject(的出现次数排的期 —— 那个写法漏掉每一个用更早的z.object(…).strict()关掉的 schema:strictObject(数ui/automation/data/security/studio/三、新增「剩余 strip 站点」地图,并且双向上闸
check:strictness-ledger现在还守这张表:反向那一半更重要。能活过自己工作的清单,一定会活过:这个台账已经记过一次自己把「已发布的功能」列成待办,ADR-0010 欠债清单当初也是为同一个理由加的反向钉。
四、每一条绿色都先证过红
战役自己的规矩:信一个绿色读数之前,先让它在一个你确知存在的东西上变红。
ui/action9→8、ui/chart6→7、data/field-value1→2、automation/一个未声明文件),补完才转绿;strictObject(还原成z.object(必须读成 strip,给一个 strip 站点加.strict()必须读成 strict。验证
check:strictness-ledgerPASS(两行绿:67 文件 / 5 目录;51 个未关闭文件 / 325 strip 站点)check:generated8/8@objectstack/spec:294 文件 / 7369 用例通过,tsc --noEmit干净pnpm typecheck:122/122origin/main(4 个提交)后复验:merge 未触及packages/spec/src,实测数不变,闸门仍绿范围
只改测量脚本 / 测试 / 台账 + 一个 changeset。零 schema 改动,
content/docs/releases/未触碰。剩余清单、分类依据、拆批建议与 #4721 现状核实见 issue #4001 上的重测报告评论。
🤖 Generated with Claude Code
https://claude.ai/code/session_0176qgxgCXTJCUv4YFLtusP9
Generated by Claude Code