Commit 5d21a48
The spec contract stopped at authored source: sys_metadata rows were
rehydrated unparsed and unconverted, so the authored and stored contracts
silently diverged (option 1 of #3903, chosen because #3855 already concluded
operator-run migrations cannot be relied on, and out-of-scope-by-policy would
fossilize the accommodations PD #12 names as debt).
- spec: new `applyConversionsToStoredItem(type, item, options?)` — one
primitive encoding the data-at-rest policy: the FULL chain replays,
retiredFromLoadPath entries included, because retirement is an
authoring-surface event and a row at rest has no author to teach.
- metadata-protocol: wired at loadMetaFromDb, getMetaItems (active+drafts),
getMetaItem (active+draft), getMetaItemLayered, duplicatePackage. Flow rows
are deliberately skipped (the flow conversions' open-namespace conflict
guard needs the automation engine's executor registry).
- metadata: DatabaseLoader live-row reads convert; history stays verbatim
(the version layer records what was written — checksums must keep pairing).
- objectql: authored-action/-hook table reads convert (a stored pre-17 action
row's `execute` dispatches via `target` again); the rule-validator's
`requiredWhen ?? conditionalRequired` fallback — kept in #3883 with a
retirement promise that had no mechanism — is deleted, its job done by the
chain at every seam.
- service-automation: registerFlow passes includeRetired, so stored flows
keep canonicalizing after their conversions graduate out of the window.
- registry.ts swallow answered (#3903 closing note): loadMetaFromDb validates
the CONVERTED row, returns {loaded, errors, invalid}, and warns with a
stable [metadata_spec_invalid] marker; registration proceeds deliberately
(refusal at boot unhooks live tables and makes the row unfixable in
Studio) — the enforcing gates are saveMetaItem's 422 and _diagnostics on
read, and the registerItem hook is now documented as the diagnostic it is.
Policy written down in the ADR-0087 addendum ("stored metadata replays the
chain") and PD #12.
Closes #3903.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 366105c commit 5d21a48
15 files changed
Lines changed: 711 additions & 54 deletions
File tree
- .changeset
- docs/adr
- packages
- metadata-protocol/src
- metadata/src/loaders
- objectql/src
- validation
- services/service-automation/src
- spec
- src/conversions
| 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 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
0 commit comments