|
| 1 | +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. |
| 2 | + |
| 3 | +import type { SemanticMigration } from '../../types.js'; |
| 4 | + |
| 5 | +// The upgrade-guide entry of the publish door's object re-parse (#35924): the |
| 6 | +// per-item and package publish now judge a stored object draft by the current |
| 7 | +// `ObjectSchema`, as the save door judges the same body. Notice only: no key |
| 8 | +// is removed and no D2 conversion exists. A draft the ADR-0087 chain converts |
| 9 | +// is judged as served and keeps publishing; what is refused is a draft the |
| 10 | +// current schema refuses after the chain, and its fix is the author's. |
| 11 | +export const entry: SemanticMigration = { |
| 12 | + id: 'publish-refuses-object-draft-the-current-schema-refuses', |
| 13 | + surface: |
| 14 | + 'The per-item publish (`POST /api/v1/meta/object/:name/publish`) and the package publish (`POST /api/v1/packages/:id/publish-drafts`) of an ' |
| 15 | + + '`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[]`', |
| 17 | + replacement: |
| 18 | + 'Fix the keys the refusal\'s `issues[]` names, save the draft again (the save answers the same refusal until ' |
| 19 | + + 'the body parses), then publish', |
| 20 | + reason: |
| 21 | + 'A draft saved before a stricter `ObjectSchema` rule landed (for example a sealed audit object with no ' |
| 22 | + + '`tenant_id` chain column, ADR-0154 D10) was promoted live at publish, unjudged by that rule, while a save of ' |
| 23 | + + 'the same body is refused. Stored metadata is not rewritten or refused at boot; an active row is unchanged. ' |
| 24 | + + 'The next publish of such a draft is refused, the draft stays a draft, and a package publish refuses its ' |
| 25 | + + 'whole batch with nothing promoted.', |
| 26 | + acceptanceCriteria: |
| 27 | + 'Every pending object draft reads `_diagnostics.valid: true`; a publish of every object draft the package carries succeeds.', |
| 28 | +}; |
0 commit comments