Skip to content

Commit 8f9eb3d

Browse files
feat(metadata-protocol, spec): a publish whose registry refused an object answers published_unregistered naming it (#33528)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D75mRNRrsy6GfiJD9q7La4j)_ Fixes #33277 Clause-②: yes (widening) Metadata-protocol: semantic ## 维护者速读 - 改了什么:发布整个应用(publish-drafts)时,如果运行时注册表拒收了某个对象,返回不再说「published」,而是新的 `published_unregistered`(`success: false`),并在 `unregistered[]` 里点名这些对象,沿用 #33005 的规则码 `object-registry-refused`。 - 为什么改:按 #33005 的裁决「D 先告警,A 后续跟上」,这是 A:程序化调用方(托管云的 AI 搭建)以前看到「发布成功」就去灌示例数据,结果报找不到表。 - 风险与回滚:新增枚举值,注册表全部接受时返回逐字节不变;应用可见性翻转和控制台的提示保持现状(待裁决)。回滚即 revert 本 PR。 - 先看:`packages/metadata-protocol/src/protocol-history-and-publish.ts`(outcome 推导)、`packages/runtime/src/domains/packages.ts`(翻转白名单,新值保持翻转)、`packages/spec/src/api/protocol.zod.ts`(契约)。 - 两分钟验证:`pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol-publish-drafts-advisories.test.ts`,预期 14 个用例全绿,含 `[#33277]` 四个。 - 需要你做的:裁决两件事——新值是否继续触发应用可见性翻转,以及控制台对它是否继续显示「发布成功」(本 PR 均保持现状)。 ## What changes - **Spec** (`PublishPackageDraftsResponseSchema`): `outcome` gains `published_unregistered`; the response gains optional `unregistered: [{ type, name, rule: 'object-registry-refused' }]`, present if and only if the outcome is `published_unregistered`. `success` stays exactly `outcome === 'published'`, so it is false on the new value. Describes updated; reference docs, `authorable-surface/api.json` and the strictness counts regenerated. One ADR-0087 semantic entry for major 18 (`publish-drafts-outcome-published-unregistered`), because a caller branching on `success` or `outcome` now takes a different branch for the same server event. - **Producer** (`publishPackageDrafts`, metadata-protocol): each object whose registry write-through was refused (the #33005 `registryRefused` receipt) is collected in publish order; the batch answers `published_unregistered`, `success: false`, `unregistered[]`. Nothing else moves: the drafts landed and stay live, every object is still in `published[]` with its warning, `failed[]` stays empty, and commit, seeds, probes and receipts are unchanged. Return types in `protocol-history-and-publish.ts` and `protocol.ts` widened. - **Runtime flip** (`PUBLISH_OUTCOMES_THAT_FLIP`): `published_unregistered` is added, so the ADR-0045 visibility flip and the `metadata:reloaded` announce run exactly as they did when this answer read `published`. Kept as the status quo pending a ruling (below). - **Client SDK**: the `packages.publishDrafts` docblock no longer says `success: false` on a 200 means nothing landed; it names the three non-success outcomes. - **Console** (`ui/packages/app-shell`): Studio's publish, the package sheet, Home's Publish all and the AI chat card treated every `success: false` as a failed publish. Each now reads `published_unregistered` as it read the `published` answer the server gave for this before: the refused object's `object-registry-refused` warning still reaches the author through the client's advisory sink, and no caller reports "Action failed" / "Publish failed" for drafts that landed. ## Tests - `protocol-publish-drafts-advisories.test.ts` (the shared harness): a new `[#33277]` describe pins the refused object named in `unregistered[]` with `published_unregistered` / `success: false` in both publish orders (refused object first and second), two refused objects named in publish order, and a CONTROL that a batch the registry takes whole still answers `published`, `success: true`, with no `unregistered` key. The #33005 case no longer pins `outcome: 'published'`. - `packages/spec/src/api/protocol.test.ts`: the new value and key parse and round-trip; an entry with an unknown rule or no rule is refused; the vocabulary stays closed. - `packages/runtime/src/http-dispatcher.test.ts`: the flip still runs after `published_unregistered` (status-quo pin). - UI: one case each in `PackagesPage.publishRefusal-11922`, `usePublishAllDrafts.refusal-11922`, `AiChatPage.publishAdvisoryReachesAuthor` and `StudioDesignSurface.publishCount-11807`. - Ablation (once, on the negative pin, after the fix was committed): `scripts/ablation-replace.mjs` replaced the `unregistered.push(...)` line with a no-op (anchor 1 to 0, blob 8035b04 to 78b920f646cd); the pin file went to 3 failed / 11 passed, exactly the three negative `[#33277]` cases, CONTROL and the #33005 cases green; restored to blob 8035b04 equal to HEAD, `git diff HEAD` empty. The test imports `./protocol.js` from `src`, so no rebuild was needed. ## Acceptance notes - **Open choice 1, the visibility flip.** `published_unregistered` still flips `_unpublished` apps (status quo: this answer used to read `published`). Alternative: drop it from the allow-list so an app whose object is not served stays hidden until a re-publish. Listed for a ruling; not changed here. - **Open choice 2, the console's presentation.** The console keeps showing a successful publish plus the object's warning toast (the presentation ruled for #33005). Alternative: a distinct "published, but N objects are not served" message. Listed for a ruling; not changed here. - **The card's premise detail:** `ui/packages/data-objectstack/src/metadata-client.ts` does not switch on the outcome (it returns a 2xx unexamined and only emits advisories); the switches are in the four `app-shell` callers above, which this PR adapts. - **Hosted cloud (outside this repo):** the AI build path must stop or retry before seeding on `published_unregistered`, keyed on `unregistered[]` or the `object-registry-refused` rule. Cloud already ships a bounded retry for the seed race; it should now branch on the outcome instead. - **Not in this card:** the single-item doors (`publishMetaItem`, a publish-mode save) still answer success with the warning on `advisories`; the other write-through callers #33005's report listed stay warn-only. - Shared files with #33276 (now merged into this branch): `protocol-history-and-publish.ts`, `protocol.ts`, `protocol.zod.ts`, `packages.ts`, the advisories test, `http-dispatcher.test.ts`; the merge was clean and every suite below was re-run on the merged head. ## Verification Premise measured first, at `origin/main` ba35dfd (producer file restored from that commit, blob 884d24a): a publish with the registry refusing `ticket` answered `{"success":true,"outcome":"published","publishedCount":2,"failedCount":0}` with `ticket` carrying `object-registry-refused`, in both publish orders. At this branch: `{"success":false,"outcome":"published_unregistered",...,"unregistered":[...]}` in both orders. <details><summary>Package suites, final head 28691d1 (merged with origin/main), under os-verify-lock</summary> - `@objectstack/metadata-protocol` typecheck exit 0 (`tsc --listFilesOnly` includes the advisories test); `test`: Test Files 340 passed, 9 skipped (349); Tests 22870 passed, 43 skipped. - `@objectstack/spec` `src/api/protocol.test.ts` + `src/migrations/`: Test Files 6 passed; Tests 451 passed. - `@objectstack/runtime` `http-dispatcher.test.ts`, `packages-publish-drafts-change-note.integration.test.ts`, `packages-publish-drafts-response-conformance.test.ts`: Test Files 3 passed; Tests 275 passed. - `@objectstack/objectql` `publish-package-drafts-response-conformance.test.ts`: 16 passed. - `@object-ui/app-shell`, the four UI files: Test Files 4 passed; Tests 23 passed. </details> <details><summary>Gates (local subset; CI owns the rest)</summary> Exit 0 at the final head: `check:generated` (all 14 artifacts current), `check:strictness-ledger`, `check:api-surface` (unchanged), `check:doc-authoring`, `check-adr-0087-registration` (no breaking changeset), `check-nul-bytes`. Exit 0 before the merge: `check:spec-changes`, `check:upgrade-guide`, `check:authorable-surface`, `check:docs`, `check-changeset-no-major`, `check-empty-changeset`, `check:durability-log-level`; eslint `--no-inline-config` on the nine touched package files and eslint on the four UI files (0 errors). `dispatch-gates --ran`: 12 of 123 derived families run locally, 111 left to CI by declared narrowing (the verify lock was held 3h20m by another run). NOT MEASURED locally: app-shell `type-check` (needs every `@object-ui/*` dist built; Type Check UI owns it); the `check:test-typecheck` leg of runtime and client typecheck (their main `tsc --noEmit` passed; the test layer reported errors in test files this diff does not touch, which import packages not built here). </details> Session: https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: domain:server#5 · os-elon-musk · session_016WV4cy1y7UNVbT2QAdmgdn --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 020ce3d commit 8f9eb3d

21 files changed

Lines changed: 454 additions & 36 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/metadata-protocol': patch
4+
'@objectstack/runtime': patch
5+
'@objectstack/client': patch
6+
'@object-ui/app-shell': patch
7+
---
8+
9+
feat(metadata-protocol, spec): a package publish whose runtime registry refused an object answers `published_unregistered` and names the object, instead of `published`
10+
11+
Clause-②: yes (widening) — `PublishPackageDraftsResponseSchema.outcome` gains the value `published_unregistered`, and the response gains the optional member `unregistered[]`. Every other answer is byte-identical: a publish the registry takes whole still answers `published` with `success: true` and no `unregistered` key.
12+
Metadata-protocol: semantic
13+
14+
The authorable-surface shard gains `api/PublishPackageDraftsResponse:unregistered`, and the same server event answers `outcome` / `success` differently; ADR-0087 entry `18.publish-drafts-outcome-published-unregistered`.
15+
16+
**What answers differently.** `POST /api/v1/packages/:id/publish-drafts` (and the protocol's `publishPackageDrafts`, and `client.packages.publishDrafts()`) used to answer `outcome: 'published'` and `success: true` when the runtime registry refused one of the objects it had just made live. The object carried the `object-registry-refused` warning on its `published[]` element, but a caller that read `success` or `outcome` saw a clean publish, and a seed load or data read right after it answered `OBJECT_NOT_FOUND`. The same publish now answers:
17+
18+
- `outcome: 'published_unregistered'` and `success: false` (`success` is still exactly `outcome === 'published'`);
19+
- `unregistered: [{ type: 'object', name, rule: 'object-registry-refused' }]`, one entry per refused object, in publish order;
20+
- everything else as before: the drafts landed and stay live, so every object is still in `published[]` (the refused one still carries its warning), `failed[]` is empty, and the commit, seeds, probes and receipts are as they were.
21+
22+
**What to do.** Handle the new value wherever you branch on the batch publish answer. Do not treat it as "nothing landed": the metadata is live. Do not seed or read an object `unregistered[]` names until it is registered: publish it again, which re-runs the registration, or restart, which registers every stored object.
23+
24+
**The console.** Studio's publish, the package sheet, Home's *Publish all* and the AI chat card read `published_unregistered` as they read the `published` answer the server gave for this before: the refused object's warning reaches the author through the client, and none of them reports the publish as failed.
25+
26+
**Unchanged on purpose.** The REST door's app visibility flip (ADR-0045 §3) still runs after this outcome, as it ran after the `published` answer this used to be. The single-item doors (`publishMetaItem`, a publish-mode save) still answer success with the warning on their `advisories`.

‎content/docs/references/api/protocol.mdx‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2625,12 +2625,13 @@ The authoring surface of a metadata write. Closed: `copilot` is an AI assistant'
26252625

26262626
| Property | Type | Required | Description |
26272627
| :--- | :--- | :--- | :--- |
2628-
| **success** | `boolean` | ✅ | True only when every pending draft promoted (`failed` empty) AND at least one item published. A pre-flight refusal or an ADR-0067 D2 rollback answers false on a 200 — but so does a publish with nothing to promote, so false alone is NOT a refusal: read `outcome`, not this boolean or the HTTP status. Always equal to `outcome === 'published'` (pinned). It does NOT cover the best-effort receipts below, each of which reports its own `success`. |
2629-
| **outcome** | `Enum<'published' \| 'refused' \| 'nothing_to_publish'>` | ✅ | First-class discriminant for WHICH exit answered — the fact `success` compresses into one boolean. `published`: at least one draft promoted and none refused. `refused`: the batch was refused — a pre-flight violation or the ADR-0067 D2 all-or-nothing rollback; the per-item story is in `failed[]`, which is non-empty exactly on this outcome (the invariant consumers previously had to reverse-engineer, now stated by the producer). `nothing_to_publish`: the package had no pending drafts — nothing landed AND nothing was refused; `success` stays false (a no-op is not a successful publish), which before this field made that answer indistinguishable from a refusal. Producer invariants, pinned in the conformance suites: `success === (outcome === 'published')`; `refused` if and only if `failed.length > 0`; `nothing_to_publish` if and only if `published.length === 0 && failed.length === 0`. Values are lowercase snake, matching the `sys_metadata_audit` outcome vocabulary. |
2628+
| **success** | `boolean` | ✅ | True only when every pending draft promoted (`failed` empty) AND at least one item published. A pre-flight refusal or an ADR-0067 D2 rollback answers false on a 200 — but so does a publish with nothing to promote, so false alone is NOT a refusal: read `outcome`, not this boolean or the HTTP status. Always equal to `outcome === 'published'` (pinned), so it is also false on `published_unregistered`, where the drafts landed but an object is not served. It does NOT cover the best-effort receipts below, each of which reports its own `success`. |
2629+
| **outcome** | `Enum<'published' \| 'published_unregistered' \| 'refused' \| 'nothing_to_publish'>` | ✅ | First-class discriminant for WHICH exit answered — the fact `success` compresses into one boolean. `published`: at least one draft promoted, none refused, and the runtime registry took every promoted object. `published_unregistered`: the drafts landed exactly as on `published` — the metadata is live and stays live — but the runtime registry refused at least one promoted object, so that object is not served: until something registers it, data reads, writes and seed loads against it answer OBJECT_NOT_FOUND. `unregistered[]` names each such object; do not seed or read it before it is registered (publish it again, or restart). `refused`: the batch was refused — a pre-flight violation or the ADR-0067 D2 all-or-nothing rollback; the per-item story is in `failed[]`, which is non-empty exactly on this outcome (the invariant consumers previously had to reverse-engineer, now stated by the producer). `nothing_to_publish`: the package had no pending drafts — nothing landed AND nothing was refused; `success` stays false (a no-op is not a successful publish), which before this field made that answer indistinguishable from a refusal. Producer invariants, pinned in the conformance suites: `success === (outcome === 'published')`; `refused` if and only if `failed.length > 0`; `nothing_to_publish` if and only if `published.length === 0 && failed.length === 0`; `published_unregistered` if and only if `unregistered` is present. Values are lowercase snake, matching the `sys_metadata_audit` outcome vocabulary. |
26302630
| **publishedCount** | `integer` | ✅ | Number of drafts promoted to active — `published.length`. 0 on every refusal path (the batch is all-or-nothing, ADR-0067 D2). |
26312631
| **failedCount** | `integer` | ✅ | Number of items that did not publish — `failed.length`. On a rollback this counts the WHOLE batch: the causal item plus every sibling marked BATCH_ABORTED. |
26322632
| **published** | `{ type: string; name: string; version: string; advisories?: object[] }[]` | ✅ | Every draft promoted to active, in publish order. Empty on every refusal path. |
26332633
| **failed** | `{ type: string; name: string; error: string; code?: string; … }[]` | ✅ | Items that did not publish. Because the batch is all-or-nothing (ADR-0067 D2), a non-empty list means NOTHING landed: `published: []`, `publishedCount: 0`. |
2634+
| **unregistered** | `{ type: string; name: string; rule: Enum<'object-registry-refused'> }[]` | optional | Present ONLY on `outcome: 'published_unregistered'`, and then non-empty: each promoted object the runtime registry refused, in publish order. Every entry also appears in `published[]` — its metadata IS live, nothing was rolled back (ADR-0067 D2 runs the registration after the metadata commit) — but the object is not served until something registers it, so a caller about to seed or read it should publish it again or restart first. Absent on every other outcome; an empty array is never emitted. |
26342635
| **seedApplied** | `{ success: boolean; inserted?: integer; updated?: integer; error?: string; … }` | optional | Aggregate outcome of materializing EVERY published `seed` body in one multi-pass loader run (cross-seed references need the whole set). Present ONLY when the batch published at least one seed. Two producers, one key: the batch itself self-applies (`applySeedBodies`), and the REST door back-fills the same key for custom protocols that do not — never both (an externalId-less seed would double-insert). Best-effort: a seed problem is surfaced here, never thrown. |
26352636
| **materializeApplied** | `{ success: boolean; inserted: integer; updated: integer; failures: object[] }` | optional | ADR-0086 P2 — aggregate result of publish-time materializers across the batch (e.g. `flow`, whose draft credentials become the live ones), including side-effect failures surfaced by the per-item effects loop. Present ONLY when at least one published item had a registered materializer or a side-effect failure. Best-effort, same contract as `seedApplied`. |
26362637
| **probes** | `any` | optional | ADR-0038 L3 post-publish runtime probe report — one real read per published artifact (seeded objects have rows, views are readable, widget dataset selections execute). DELIBERATELY OPAQUE in this contract: the key is declared and carried through verbatim, but its inner shape is intentionally not modeled until a consumer needs a field of it. Present only when something was publishable; probes never fail the publish. |
@@ -2659,6 +2660,14 @@ The authoring surface of a metadata write. Closed: `copilot` is an AI assistant'
26592660
| **code** | `string` | optional | Machine code for the refusal class (SCREAMING_SNAKE, ADR-0112 vocabulary) — e.g. a pre-flight violation code, or BATCH_ABORTED on the non-causal items of a rolled-back batch. |
26602661
| **issues** | `{ rule: string; path: string; where: string; message: string; … }[]` | optional | The structured findings behind the refusal, when the refusing error carried them — today the author-time gate's INVALID_METADATA refusal on the causal item. The producer has emitted this key; declaring it is what lets a typed consumer read it back, and what lets `error` stay a headline without losing the per-path detail. Same element shape as `published[].advisories` and the single-item 422's `issues[]` (— one dialect, declared once). Present ONLY on the causal item and only when the refusal produced structured findings; BATCH_ABORTED siblings never carry it. Absent means "this refusal carried no structured findings", never "no problems". |
26612662

2663+
### Nested Shape: `PublishPackageDraftsResponse.unregistered[number]`
2664+
2665+
| Property | Type | Required | Description |
2666+
| :--- | :--- | :--- | :--- |
2667+
| **type** | `string` | ✅ | Metadata type of the published item the registry refused (`object`). |
2668+
| **name** | `string` | ✅ | Name of the object that is published but not served. |
2669+
| **rule** | `Enum<'object-registry-refused'>` | ✅ | Why it is not served, as a stable rule id: the same id as the warning on this object's `published[]` element, whose `message` and `hint` say what happened and how to fix it. |
2670+
26622671
### Nested Shape: `PublishPackageDraftsResponse.seedApplied`
26632672

26642673
| Property | Type | Required | Description |

‎docs/audits/2026-07-unknown-key-strictness-ledger.counts/api.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ hand-patch a number here** — fix the code or the verdict and regenerate.
1919

2020
| Dir | Sites |
2121
|---|---|
22-
| `api/` | 507 |
22+
| `api/` | 508 |

‎packages/client/src/index.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,8 +3304,13 @@ export class ObjectStackClient {
33043304
* Nameable at the type level only since #9406, which declared
33053305
* `PublishPackageDraftsResponseSchema` — the batch sibling of #7294's
33063306
* single-item declaration; this method resolved to `any` before that.
3307-
* The batch is all-or-nothing (ADR-0067 D2): `success: false` on a 200
3308-
* means NOTHING landed — read `failed[]`. Each `published[]` element's
3307+
* The batch is all-or-nothing (ADR-0067 D2), but `success: false` on a
3308+
* 200 does not by itself mean nothing landed — read `outcome`: `refused`
3309+
* means NOTHING landed (read `failed[]`), `nothing_to_publish` means there
3310+
* was nothing to promote, and `published_unregistered` (#33277) means the
3311+
* drafts landed but the runtime registry refused the objects
3312+
* `unregistered[]` names, which are not served until registered: publish
3313+
* them again or restart before seeding or reading them. Each `published[]` element's
33093314
* `version` is the ADR-0008 OCC token (pass to `saveItem` as
33103315
* `options.ifMatch`, which sends it as `If-Match`), and the
33113316
* conditional receipts (`seedApplied` / `materializeApplied` /

‎packages/metadata-protocol/src/protocol-history-and-publish.ts‎

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import type { SysMetadataRepository } from './sys-metadata-repository.js';
6565
import type { HistoryVersionOwner } from './sys-metadata-repository.js';
6666
import { historySlotOf, refusePackageSelectorOutsideSlottedTypes } from './protocol-history-slots.js';
6767
import { captureStoredExpressionChange, fillStoredExpressionChange, type StoredExpressionFillCapture } from './protocol-stored-expression-fill.js';
68-
import { reportObjectRegistryRefusal } from './protocol-registry-hydration.js';
68+
import { OBJECT_REGISTRY_REFUSED, reportObjectRegistryRefusal } from './protocol-registry-hydration.js';
6969

7070
/**
7171
* [#32396] A promotion a package publish wrote: what {@link undoLandedPromotions}
@@ -1540,8 +1540,12 @@ export class ProtocolHistoryAndPublishFacet {
15401540
* `success === (outcome === 'published')` — `success` keeps its exact
15411541
* pre-#10462 value and is now derivable. Values are lowercase snake,
15421542
* matching the `sys_metadata_audit` outcome vocabulary.
1543+
* [#33277] `published_unregistered`: the drafts landed as on
1544+
* `published`, but the runtime registry refused a promoted object, so
1545+
* it is not served; `unregistered` is present if and only if this is
1546+
* the outcome, and `success` is false on it.
15431547
*/
1544-
outcome: 'published' | 'refused' | 'nothing_to_publish';
1548+
outcome: 'published' | 'published_unregistered' | 'refused' | 'nothing_to_publish';
15451549
publishedCount: number;
15461550
failedCount: number;
15471551
published: Array<{
@@ -1566,6 +1570,14 @@ export class ProtocolHistoryAndPublishFacet {
15661570
advisories?: RuntimeAuthoringIssue[];
15671571
}>;
15681572
failed: Array<{ type: string; name: string; error: string; code?: string }>;
1573+
/**
1574+
* [#33277] Each promoted object the runtime registry refused, in
1575+
* publish order, under the rule its `published[]` element's warning
1576+
* carries. Present only on `outcome: 'published_unregistered'`, and
1577+
* then non-empty; the object stays in `published[]` (its metadata is
1578+
* live) but is not served until something registers it.
1579+
*/
1580+
unregistered?: Array<{ type: string; name: string; rule: 'object-registry-refused' }>;
15691581
/** Aggregate result of materializing every published `seed` (absent when no seeds). */
15701582
seedApplied?: { success: boolean; inserted: number; updated: number; error?: string; errors?: unknown[]; landed?: SeedAppliedLandedParsed[] };
15711583
/**
@@ -2505,6 +2517,10 @@ export class ProtocolHistoryAndPublishFacet {
25052517
if (capture && !storedExpressions.has(capture.object)) storedExpressions.set(capture.object, { capture, at });
25062518
});
25072519
const storageRefusedObjects = new Set<string>();
2520+
// [#33277] The promoted objects the registry refused at their own
2521+
// write-through below, in publish order: what turns the answer into
2522+
// `published_unregistered`.
2523+
const unregistered: Array<{ type: string; name: string; rule: typeof OBJECT_REGISTRY_REFUSED }> = [];
25082524
await registerAdmittedBatchRows(this, promotedObjects, admittedOrder);
25092525
for (const p of promoted) {
25102526
// [#9343] Omitted-when-empty, never `advisories: []` — the #4717
@@ -2540,7 +2556,13 @@ export class ProtocolHistoryAndPublishFacet {
25402556
// `object-registry-refused`: the batch still answers
25412557
// `published` (outcome and `success` unchanged), and this is
25422558
// the element a caller reads to learn the object is not served.
2543-
if (eff.registryRefused) element.advisories = [...(element.advisories ?? []), eff.registryRefused];
2559+
// [#33277] …and the batch no longer answers `published` over
2560+
// it: the object is named in `unregistered[]` under the same
2561+
// rule, and the outcome below is `published_unregistered`.
2562+
if (eff.registryRefused) {
2563+
element.advisories = [...(element.advisories ?? []), eff.registryRefused];
2564+
unregistered.push({ type: p.d.type, name: p.d.name, rule: OBJECT_REGISTRY_REFUSED });
2565+
}
25442566
if (eff.storageRefused) {
25452567
element.advisories = [...(element.advisories ?? []), eff.storageRefused];
25462568
storageRefusedObjects.add(p.d.name);
@@ -2654,20 +2676,28 @@ export class ProtocolHistoryAndPublishFacet {
26542676
);
26552677
}
26562678

2679+
const outcome = failed.length > 0
2680+
? 'refused'
2681+
: published.length === 0
2682+
? 'nothing_to_publish'
2683+
: unregistered.length > 0 ? 'published_unregistered' : 'published';
26572684
return {
2658-
success: failed.length === 0 && published.length > 0,
2685+
// [#33277] Still exactly `outcome === 'published'`: a batch whose
2686+
// drafts landed while the registry refused an object among them is
2687+
// not a successful publish for a caller about to use that object.
2688+
success: outcome === 'published',
26592689
// [#10462] Derived, never stored: 'refused' the moment anything is
26602690
// in `failed[]` (defensive — every failure on this route unwinds
2661-
// through the Phase-1 catch above today), else 'published' iff
2662-
// something landed, else the no-op. Exactly the three-way fact
2663-
// `success` compresses into one boolean.
2664-
outcome: failed.length > 0
2665-
? 'refused'
2666-
: published.length > 0 ? 'published' : 'nothing_to_publish',
2691+
// through the Phase-1 catch above today), else the no-op when
2692+
// nothing landed, else [#33277] 'published_unregistered' when the
2693+
// registry refused a promoted object, else 'published'. Exactly the
2694+
// fact `success` compresses into one boolean.
2695+
outcome,
26672696
publishedCount: published.length,
26682697
failedCount: failed.length,
26692698
published,
26702699
failed,
2700+
...(unregistered.length > 0 ? { unregistered } : {}),
26712701
...(seedApplied ? { seedApplied } : {}),
26722702
...(materialize.any
26732703
? { materializeApplied: {

0 commit comments

Comments
 (0)