Commit 4794093
committed
feat(spec)!: field closes, reusing the curated table that already knew which advice would be wrong (#4001)
`FieldSchema` carries more silently-stripped keys than any shape in the spec,
and it said so about itself for two releases. Two notes on the object — one on
`accept`/`maxSize`, one on the five pruned governance keys — both state that a
write "parsed clean and the key was silently stripped", and both name it the
ADR-0104 failure class. Neither could act, because the object was not strict.
The guidance is derived rather than hand-written, and the reason is a bug the
first pass shipped. `FIELD_KEY_GUIDANCE` is twenty-odd curated entries for this
exact surface, already held honest by a test. A hand-written table beside it is
a second copy of the truth, and it proved that immediately: the lint suppresses
the suggestion for `pii` BECAUSE `pii` is three edits from `min`, so a bare
suggester answers a personally-identifiable-information key with "did you mean
`min`?" — confident, wrong, unrelated. The hand-written pass did exactly that.
`FieldSchema` now reads the table (`to` → alias, `why` → guidance). The table is
unchanged; its consumer moved, which is the intended end state for every entry.
The two entries that matter most are the ones that read as protection and were
not: `encryptionConfig` and `maskingRule` "implied at-rest protection that never
happened". A field declaring either was stored in plaintext exactly as if it had
not, silently. The rejection now points at `type: 'secret'` and
`requiredPermissions`.
A cycle the whole test suite passed through. `suggestions.zod` imports
`FieldType` from `field.zod`, so adopting `strictObject` here closed a loop.
Under OS_EAGER_SCHEMAS=1 every lazySchema body runs at module init, so the
loader hit a half-initialized module and threw before any schema was built.
284 files and 7,239 cases went green over it — tests import lazily, so the cycle
never resolved in the order that breaks. Only the eager build caught it.
`strictObject` now defers its error map to first use: free, and cycle-proof for
every schema after this one instead of making each conversion prove it is not in
a loop. Pinned via an alias-table getter that fires exactly when the map is
built, and verified to go red when the map is hoisted back to construction.
`field` gains its ADR-0010 envelope — it was the ONE type the original probe
actually checked, so it was the only gap visible while that probe was green, and
it outlasted every gap the probe was hiding. Debt list down to one, from eight.
Registered types closed: 22 of 25. Still open: action, dashboard, view.
Verified: 284 files / 7240 tests, tsc clean, 8 generated artifacts current, all
10 spec gates green, and CRM/Todo/showcase/platform-objects build.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WnqGjQFQMqd5k81LYV8SCY1 parent 7cf42fe commit 4794093
9 files changed
Lines changed: 370 additions & 57 deletions
File tree
- .changeset
- content/docs/references/data
- docs/audits
- packages/spec
- src
- data
- kernel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
133 | 140 | | |
134 | 141 | | |
135 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
289 | 333 | | |
290 | 334 | | |
291 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3430 | 3430 | | |
3431 | 3431 | | |
3432 | 3432 | | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
3433 | 3440 | | |
3434 | 3441 | | |
3435 | 3442 | | |
| |||
0 commit comments