Commit 1ee48bc
fix(objectql,metadata-protocol): a tenant-authored overlay must not read back as a code artifact (#4429)
`saveMetaItem` refuses to write an artifact-backed item of a type that has not
opted into overlay writes (`not_overridable`), and it asks
`registry.getArtifactItem` who is artifact-backed. That answer was "anything
whose `_packageId` is not the literal string `sys_metadata`" — a sentinel that
only holds on the save path. The boot-time rehydration of `sys_metadata`
registers each row under its REAL package id (`app.<slug>`), which every
runtime-authored item has carried since packages became mandatory.
So an app the user had just built through Studio (or the AI build agent) came
back from the next kernel rebuild looking code-shipped, and the following edit
was refused with a 403 — permanently. Live capture: two identical `modify_field`
calls on the same object seconds apart, the first published LIVE and the second
`not_overridable`, because the first one's auto-publish triggered the rebuild in
between (cloud#970). It is also why the AI authoring skill's "after
apply_blueprint, update_metadata to add the roll-up config" instruction pointed
at a road that does not exist.
Provenance is the axis that actually separates the two (ADR-0010 `_provenance`:
`'package'` for loader-introduced, `'org'` for tenant-authored), so ask it: the
`sys_metadata` hydration stamps `_provenance: 'org'`, and `getArtifactItem` no
longer treats such an item as an artifact. An item with NO provenance under a
real package id keeps the old answer, so nothing that was protected silently
becomes writable.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 26bb053 commit 1ee48bc
4 files changed
Lines changed: 128 additions & 5 deletions
File tree
- .changeset
- packages
- metadata-protocol/src
- objectql/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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8163 | 8163 | | |
8164 | 8164 | | |
8165 | 8165 | | |
8166 | | - | |
| 8166 | + | |
| 8167 | + | |
| 8168 | + | |
| 8169 | + | |
| 8170 | + | |
| 8171 | + | |
| 8172 | + | |
| 8173 | + | |
| 8174 | + | |
| 8175 | + | |
| 8176 | + | |
| 8177 | + | |
| 8178 | + | |
8167 | 8179 | | |
8168 | 8180 | | |
8169 | 8181 | | |
| |||
Lines changed: 64 additions & 0 deletions
| 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 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
582 | 601 | | |
583 | 602 | | |
584 | 603 | | |
| |||
1314 | 1333 | | |
1315 | 1334 | | |
1316 | 1335 | | |
1317 | | - | |
| 1336 | + | |
1318 | 1337 | | |
1319 | 1338 | | |
1320 | 1339 | | |
| |||
1326 | 1345 | | |
1327 | 1346 | | |
1328 | 1347 | | |
1329 | | - | |
| 1348 | + | |
1330 | 1349 | | |
1331 | 1350 | | |
1332 | 1351 | | |
1333 | 1352 | | |
1334 | | - | |
| 1353 | + | |
1335 | 1354 | | |
1336 | 1355 | | |
1337 | 1356 | | |
| |||
1344 | 1363 | | |
1345 | 1364 | | |
1346 | 1365 | | |
1347 | | - | |
| 1366 | + | |
1348 | 1367 | | |
1349 | 1368 | | |
1350 | 1369 | | |
| |||
0 commit comments