Commit 15e61fb
* fix(metadata-protocol): run the ADR-0121 endpoint publish gates on `api` drafts in publishPackageDrafts (#5206 step 2)
`protocol.publishPackageDrafts` — the real entry point behind Studio's
"publish everything" (ADR-0033 / ADR-0067 D2) — had exactly one type-aware
pre-flight: the object namespace-prefix rule, gated on `d.type === 'object'`.
An `api` draft was therefore promoted draft→active having met no gate at all,
the same shape #5189 closed on `MetadataManager.publishPackage`, one path over.
The gate reuses `validateApiEndpointDeclarations` (public from
`@objectstack/spec/api` since #5203) verbatim — the same function the stack
schema runs, the same function `publishPackage` runs, and the same
`firstFailure` the endpoint matcher's load-time backstop runs. Refusal messages
are the gate's own; nothing here restates a criterion for what is servable.
Unlike `publishPackage`, this path already resolves the package's declared
`manifest.namespace` for the object-prefix rule, so the FULL gate runs,
namespace included (ADR-0121 D1/D2).
Failure posture mirrors the pre-existing namespace-prefix rule exactly: a
pre-flight refusal found before anything is promoted, whole batch withheld
(`success: false`, `publishedCount: 0`, `published: []`), one entry per
offending item in `failed[]`. Both violation classes now come back in one
report instead of one class per publish attempt.
The #5203 load-time backstop is untouched — this is the earlier door, not a
replacement for the last one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pbu27iNUfQCHeuS551Rqo7
* chore(scripts): record the #5206 endpoint-gate test's engine double as measured DEBT
`check:engine-double-contract` flagged the fake engine in
protocol-publish-drafts-endpoint-gate.test.ts as unpinned. The prescribed
fix — a devDependency on @objectstack/objectql so the fake's delete can route
through assertEngineDeleteDispatch — was run to completion rather than assumed:
@objectstack/objectql depends on @objectstack/metadata-protocol in
`dependencies`, so the reverse edge makes turbo refuse the build graph
(`Cyclic dependency detected: @objectstack/objectql#build,
@objectstack/metadata-protocol#build`). The edge and lockfile were reverted.
That is the same cycle, measured the same way, as the #4867 and #4981 entries
already in this ledger, whose `closes` both point at #4987 (sink the predicate
into a package both sides already depend on). This is the sixth
metadata-protocol file to hit a route those entries record as closed.
The entry is DEBT, not EXEMPT. It records that the double is structurally
looser than the contract; it does not claim the looseness is currently
harmless. The probe finding — delete is exercised, and only as a scalar
`{ where: { id } }` — is recorded in `why` as a fact about this file, which is
explicitly not an argument about the contract, per this ledger's own rule.
Purely additive: one entry, no existing entry reordered, reworded or lowered.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pbu27iNUfQCHeuS551Rqo7
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent db2ea82 commit 15e61fb
4 files changed
Lines changed: 708 additions & 11 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 | + | |
| 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 | + | |
0 commit comments