Skip to content

Commit 6619071

Browse files
committed
fix(spec): re-measure the #4001 strictness ledger, and fix the counter 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
1 parent 9c040f1 commit 6619071

5 files changed

Lines changed: 622 additions & 32 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
Re-measure the #4001 unknown-key strictness ledger, and fix the instrument that was measuring it.
6+
7+
No schema changed posture in this change — it is the measurement step the
8+
2026-08-03 ruling asked for before the remaining batches are cut.
9+
10+
**The site counter now reads the AST instead of matching source text**, because
11+
the textual method was wrong in both directions at once. It counted
12+
`z.object({ … })` written inside JSDoc prose (`ui/action.zod.ts` declared 9 sites
13+
and has 8), and it missed both the prettier-wrapped `z\n .object({` form
14+
(`ui/chart.zod.ts`, 6 → 7) and `z.looseObject(` (`data/field-value.zod.ts`,
15+
1 → 2). On `ui/` the two errors cancelled exactly, so a correct section total sat
16+
over two wrong rows.
17+
18+
The worst case was `automation/time-relative-trigger.zod.ts`: its only site is
19+
written wrapped, so it counted **zero** — and a zero-site file is deliberately
20+
skipped by the coverage walk, so an authorable schema stayed outside the ledger
21+
while the gate printed "no undeclared schema files". It is now classified.
22+
23+
**`check:strictness-ledger` gained a remaining-strip-site map** — per file, how
24+
many object sites still silently discard unknown keys, which is the number batch
25+
plans are actually scheduled against and which nothing measured before. It is
26+
gated in both directions: a file with strip sites must have a row, and a row
27+
whose file reaches zero strip sites fails, so a closed file drops out of the
28+
worklist rather than outliving it.

0 commit comments

Comments
 (0)