Repository navigation
Commit 85a1e89
fix(metadata-protocol): judge a package publish against the batch's own pending declarations
`publishPackageDrafts` built its author-time validation context from
`engine.registry` alone -- the ALREADY-LIVE universe. A draft is not in that
registry (the write-through runs on `mode: 'publish'`), and the batch's own
promotions do not put it there either: `applyRegistryWriteThrough` lives in
Phase 2, after the Phase-1 transaction in which every draft is gated and
promoted. So while a batch was judged, no member of it was visible to any other
member, in any order.
Measured 2026-08-21 on a cloud rig: a package carrying `dataset/shyx_customer_ds`
and a `dashboard` whose widget binds it rolled back at the dashboard with
`[widget-dataset-unknown] ... does not resolve to a declared dataset`, on every
attempt and under both dataset names the author tried. So a package shipping a
dashboard together with its dataset could never publish.
The batch door now reads its own pending drafts ONCE, before any promotion (a
promote deletes the row it reads), and folds them into all four collections the
closure carries -- `objects`, `permissions`, `books`, `datasets` -- replacing a
live declaration of the same name rather than sitting beside it. A name in
neither the batch nor the live universe is still refused exactly as before.
Fixes #10377
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent b1893a8 commit 85a1e89
5 files changed
Lines changed: 745 additions & 5 deletions
File tree
- .changeset
- packages/metadata-protocol/src
- scripts
| 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 | + | |
0 commit comments