Skip to content

Commit b78754e

Browse files
committed
docs(changeset): state each publish door's real answer to a refused object draft
Claude-Session: https://claude.ai/code/session_017xRBcRoJWF7MQr6HoRgBeC Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8627792 commit b78754e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎.changeset/35924-publish-reparses-object-draft.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Metadata-protocol: narrowed
1414

1515
A save checks an object body against the current `ObjectSchema` and refuses it with `422 INVALID_METADATA`. Publishing a draft did not repeat that check. So an object draft saved before a stricter `ObjectSchema` rule landed went live at publish, even though that rule refuses it. One example is a sealed object with no `tenant_id` chain column (ADR-0154 D10).
1616

17-
Both publishes now check the draft the same way a save does: per item (`POST /api/v1/meta/object/:name/publish`) and per package (`POST /api/v1/packages/:id/publish-drafts`), including the pass that judges a batch before it writes on a store that cannot roll back. They refuse it with the same `422 INVALID_METADATA` and the same `issues[]` before anything is written. The draft stays a draft, and a package publish refuses its whole batch with nothing promoted. The draft is checked as the publish would serve it, after the stored-row conversions are applied. So a draft stored in a spelling a later release retired, which those conversions rewrite, still publishes as before.
17+
Both publishes now check the draft the same way a save does: per item (`POST /api/v1/meta/object/:name/publish`) and per package (`POST /api/v1/packages/:id/publish-drafts`), including the pass that judges a batch before it writes on a store that cannot roll back. Each answers with the save door's refusal before anything is written. The per-item publish answers `422 INVALID_METADATA` with the same `issues[]` a save of that body gets. The package publish answers `outcome: 'refused'` (read `outcome`, not the HTTP status), with the draft in `failed[]` under `code: 'INVALID_METADATA'` and the same `issues[]`, and its whole batch is refused with nothing promoted. Either way the draft stays a draft. The draft is checked as the publish would serve it, after the stored-row conversions are applied. So a draft stored in a spelling a later release retired, which those conversions rewrite, still publishes as before.
1818

1919
## FROM → TO
2020

‎packages/spec/src/migrations/entries/semantic/19.publish-refuses-object-draft-the-current-schema-refuses.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export const entry: SemanticMigration = {
1313
surface:
1414
'The per-item publish (`POST /api/v1/meta/object/:name/publish`) and the package publish (`POST /api/v1/packages/:id/publish-drafts`) of an '
1515
+ '`object` draft: the draft is parsed against the current `ObjectSchema`, as served (the stored-row conversion '
16-
+ 'chain applied), before it is promoted, and refused `422 INVALID_METADATA` with the save door\'s `issues[]`',
16+
+ 'chain applied), before it is promoted. The per-item publish refuses it `422 INVALID_METADATA` with the save '
17+
+ 'door\'s `issues[]`; the package publish answers `outcome: \'refused\'`, with the draft in `failed[]` under '
18+
+ '`code: \'INVALID_METADATA\'` and the same `issues[]`',
1719
replacement:
1820
'Fix the keys the refusal\'s `issues[]` names, save the draft again (the save answers the same refusal until '
1921
+ 'the body parses), then publish',

0 commit comments

Comments
 (0)