Commit 288e5a4
`getEffectiveLock` is the only source of truth for the ADR-0010 §3.3 lock
gate, and both callers are write-path admission — `assertLockAllowsWrite`
(save/publish/rollback) and `assertLockAllowsDelete`. Its overlay read was
wrapped in a bare `catch` that fell through to `lock: 'none'`.
`'none'` is not a neutral placeholder there: it is the verdict "the author
declared no protection", which `evaluateLockForWrite` /
`evaluateLockForDelete` turn straight into "allow". A `sys_metadata` read
that FAILED therefore became a write that was PERFORMED on an item whose
overlay row declared it protected. Measured on origin/main, with the row
carrying `_lock` and only the gate's own read rejecting: `saveMetaItem`
resolved `success: true` after `update:sys_metadata` on a `no-overlay`
item, and `deleteMetaItem` the same on a `no-delete` one — while the same
rows read successfully produce 403 ITEM_LOCKED. The audit trail did not
compensate: the allowed path writes its ordinary `outcome: 'allowed'` row.
Reuses `rethrowUnlessMetadataStoreUnprovisioned` (#5705) rather than
inventing a second predicate — an unprovisioned `sys_metadata` genuinely
has no overlay row, so `'none'` is the truth and first boot still saves;
every other error becomes 503/SERVICE_UNAVAILABLE with the driver error as
`cause`. Wire-visible, and deliberate: refusing one uncertain write beats
performing one that had to be refused.
Unaffected and pinned by regression tests: artifact-level locks (answered
from the in-memory registry before the overlay read), a genuine miss on a
healthy store, and control-plane kernels.
Claude-Session: https://claude.ai/code/session_01V7WetGmnfoXNn8cLieKKmx
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5e3c83b commit 288e5a4
3 files changed
Lines changed: 495 additions & 2 deletions
File tree
- .changeset
- packages/metadata-protocol/src
| 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 | + | |
0 commit comments