Repository navigation
feat(approvals): the opening check's conditions are reported where a flow or an object is published (ADR-0162 item 7, slice N45) - #38527
Conversation
…flow or an object is published The metadata protocol gains addAuthoringGate: a gate added beside a type's owner gate, which runs after it on every save and restore and also when a draft is promoted to active. The approvals plugin adds publish gates on flow and object that judge an active write by the conditions an approval opens on (ADR-0162 D5), as the engine will hold things once the write lands, and refuse it with the same sentences an approval's first request is refused with, as a 422 VALIDATION_FAILED in the author's locale. A draft, a callee that cannot be read and a host with no job service are not refused at publish; the first request still refuses them. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
📓 Docs Drift CheckThis PR changes 2 package(s): 21 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 12 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 13 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 6b1de698c041e9d92f822b7f6f0acad79ebb0a7e && git checkout 6b1de698c041e9d92f822b7f6f0acad79ebb0a7e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4cc09b16f4eae866c94e99a12bde24470bf1eab4 a19894535435007a9ccc5f6c4f02355e5066b69f && git checkout -B drift-repro 4cc09b16f4eae866c94e99a12bde24470bf1eab4 && git merge --no-ff a19894535435007a9ccc5f6c4f02355e5066b69f
node scripts/docs-audit/affected-docs.mjs --json 4cc09b16f4eae866c94e99a12bde24470bf1eab4
|
…the pinned ledger Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
…the gate test doubles drivable The publish refusal carries VALIDATION_FAILED at 400, the status the error ledger documents for that code. The add-authoring-gate test loads @objectstack/lint at module top and its find double honours a caller's limit. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nzgcVrZ8Neqqd1AFi The brief handed to the isolated reviewer sub-agent whose record is posted beside this comment (posted for the seat to read before it adopts the record). Contract review brief — PR #38527 @
|
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nzgcVrZ8Neqqd1AFi Independence: isolated sub-agent of the implementing session (brief 7252737675), for the seat to adopt as it did for slice B (7251725255). The PR head has since moved to 4172ad6: the refusal status 422 → 400 (the status the error ledger documents for VALIDATION_FAILED) and two test-harness gate fixes. This record does not cover that move. Per the seat (07:50Z), the PR stays a draft until the maintainer settles S1 and S2; S3 and S4 are being fixed, and a delta review follows. Contract reviewServed-tier: Scope: the declaration face of ① Derived judgmentsEach public-surface change the diff implies, and each change to what the system accepts, judged:
Findings, graded:
SQL push-down (Prime Directive 5): no finding. The diff adds no id materialisation, no in-app join and no storage read. Every read the publish check makes is of the in-memory object registry or the automation engine's flow map. ② Semver level
③ Boundary flagsThe five questions the seat set (ruling relayed 2026-11-29 07:08Z):
Dev flags and
Implemented-by: VERDICT: PASS |
At a package publish's promotion the added authoring gates are handed the batch's object and flow drafts, and the approvals publish check reads them in place of the live items of the same name. A package that declares closedStates and repairs the flow it closes on in one publish goes through in either order. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr Closed by the seat · 2026-11-29T09:26Z · superseded by the maintainer's ruling on N45: option D (ruling record 7253749311 on #37766; analysis 7252928345). The refusal comes from one rule in the shared author-time rule table, applied by |
…onsole entries (objectstack-ai#38150 PR-B1) (objectstack-ai#38545) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XMRkgb3gwbVL5znx9yxJb7x)_ Part of objectstack-ai#38150. This is PR-B1: the server retirement of `adopt-orphans` and the two console entries that called it. It replaces closed draft objectstack-ai#38364, whose four commits are cherry-picked here onto main after PR-A2 (objectstack-ai#38389, merged as `ea82c96212`), plus the conflict resolution, the re-measured generated outputs and A2's L1 nit N1. PR-B2 (Studio `~org`, the redirects to `?source=loose`, the classifier objectstack-ai#38061, the ADR marks) follows. This PR does not close the card. Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: none (no file under `skills/**` or `.claude/skills/**` names `adopt-orphans`, `adoptOrphans` or "Adopt loose items"; searched at `37aae5aa1`) **Size: 3,387 lines** (additions + deletions, generated files included: 586 added, 2,801 deleted, 79 files; `git diff --numstat origin/main...HEAD` at `37aae5aa1`, merge base `dccf836a8`). With A1's 1,947 and A2's 1,380 the card stands at **6,714**. This PR alone passes 3,000, so it is Tier H. **Metadata-protocol, measured on this head.** `packages/spec/authorable-surface/api.json` loses exactly the four `api/ReassignOrphanedMetadataResponse:*` keys (`reassigned`, `reassignedCount`, `success`, `targetPackageId`) and gains nothing, so the shard moves and the line is `narrowed` (the closed vocabulary has no `removed`). `authorable-surface.base.json` is untouched: only `gen:authorable-surface-base` writes it. ## 维护者速读 - 用户能看到什么变化:软件包页的「收编散落项」按钮和 Studio「⋯」菜单里的同名项去掉了,旧的一次性收编接口改答 404;散落项改用上一个已合并的改动里的「勾选后移入软件包」。移入成功的提示现在写软件包名称,不再写编号。 - 为什么做:App Studio 改版专题的第二步。旧接口一次把全环境的散落项都收进一个包,不走保存时的检查,实测会收进没安装的包、收进前缀不对的对象。 - 出错会怎样:本改动只删东西,外加一处提示文字;出问题最多是某处还引用已删的入口,可以整体撤回。调用旧接口的脚本会收到 404,需要改用新的移入接口。 - 要你做什么:这张卡总行数超过 3000 行,属于需要你本人批准的一档,请审批。 ## Deliberate correction One pending release note, not added by this PR, was made false by it and is corrected in the same stroke: `.changeset/37958-studio-overview-full.md`, line 16. `check-empty-changeset` stays red on it by design (DELIBERATE CORRECTION class); the dispatching seat confirms it by its own record, and the file is not restored. - Before: "- The ⋯ menu keeps "Edit package info", "Duplicate as a new package", "Adopt loose items" and "Manage in Setup…"." - After: "- The ⋯ menu keeps "Edit package info", "Duplicate as a new package" and "Manage in Setup…"." ## What changes **Runtime.** The attribution docblock above `resolvePackageWriteActor` no longer says a body `actor` is ignored on `move-in`: there the strict body refuses it 400 and nothing moves (comment only). The `POST /packages/:id/adopt-orphans` block leaves `packages/runtime/src/domains/packages.ts`, with its mount in `dispatcher-plugin.ts`, its row in `route-ledger.ts` (the census line goes to 157 rows), and `reassignOrphanedMetadata` on the protocol handle type. The route answers 404 (pinned on a booted stack, below). **Protocol.** `ObjectStackProtocolImplementation#reassignOrphanedMetadata` and its facet body in `protocol-package-commits.ts` are removed, and so is `releaseAdoptedObjectOwner` (its only caller was the adoption): the class member, the host entry in `protocol-host.ts`, and the body in `protocol-object-owner.ts`. Comments that named the old door now name the move door, or say it retired. **SDK.** `client.packages.adoptOrphans` is removed from `@objectstack/client`. **Spec.** `ReassignOrphanedMetadataResponseSchema` and its two types leave `package-lifecycle.zod.ts`. The def is registered in `RETIRED_DEFS_BY_MAJOR` (`retired-defs/19.api__ReassignOrphanedMetadataResponse.ts`); its manifest line and shard keys are removed; `api-surface`, `declaration-map`, `export-origins` and the reference docs are regenerated on this base (the reference index now counts 1,741 schemas, 528 in API; main moved the per-module reference page to `packages/spec/docs/references/api/package-lifecycle.md`). `packages_orphan_adoption_unsupported` leaves `operation-message.ts` (four locales). The ADR-0087 disposition is the registered semantic entry `19.packages-adopt-orphans-door-retired.ts`. **Console.** The Packages page's development face loses the "Adopt loose items" button, its dialog, handler and state (`PackagesPage.tsx`); A2's loose-items banner stays as merged. Studio's 「⋯」 menu loses its `adopt` item: on this base (after objectstack#37958 moved Export and the revert to the overview page) `STUDIO_PACKAGE_MENU_ITEMS` is three items, `edit`, `duplicate`, `manage`. With the adoption gone the menu changes nothing a package holds, so its `onChanged` prop and its `run` helper go too, and `StudioDesignSurface` no longer passes `onChanged` to it (`onPackageChanged` still feeds the overview page). `packageActions.tsx` loses `adoptLooseItems`, `adoptedText` and `AdoptLooseItemsDialog`; `@object-ui/i18n`'s studio namespace loses the six `engine.packages.detail.adopt*` keys in en and zh. A2's `engine.looseMove.*` keys are untouched. **N1 (A2's L1 nit).** The move-in success toast filled `{package}` with `answer.targetPackageId` while the confirm title used the package name. `ResourceListPage.tsx` now passes the label the dialog was opened on (`looseMove.target.label`), which is already the id when the package list could not be read. **Docs.** `content/docs/api/metadata-api.mdx`, `protocol/knowledge.mdx` and the system-context register's row 55b name `move-in` where they listed `adopt-orphans`. Left as history: the three spec `18.*` semantic entries, `content/docs/releases/v18/*`, the consumed `.changeset/pre/*` entries, and the historical sentence in `http-dispatcher.ts`. **Changeset.** `38150-adopt-orphans-door-retired.md`, BREAKING with the FROM → TO table and the one-line fix: `@objectstack/spec` major (pre mode), metadata-protocol, runtime, client, `@object-ui/app-shell` and `@object-ui/i18n` patch. One sentence changed from objectstack-ai#38364: the console's move door is now named as "the move-in confirm step on Studio's cross-package list (`?source=loose`), which ships in the same release" (A2 landed first, so "the next change" was no longer true). ## Each removed assertion, and what pins its rule now Deleted files (the old door's own tests): | removed | what it pinned | now pinned by | |:--|:--|:--| | `metadata-protocol/…/protocol.adopt-orphans-owner-judges.test.ts` | the adoption asked the object-owner and permission-set-owner judges | `package-move-in.dogfood.test.ts`: "the object owner: … refused with the save door's mismatch" and "the permission-set owner: …" | | `metadata-protocol/…/protocol.adopt-orphans-platform-record.test.ts` | the platform's own record is not adopted | new facet case in `protocol-package-move-in.test.ts`: "the platform's own record is not loose: refused NOT_LOOSE …", with its control | | `metadata-protocol/…/protocol.reassign-orphans-durability.test.ts` | a refused rebind was logged once while the door answered success | the move door has no partial success; `protocol-package-move-in.test.ts` pins the fault (500, nothing moved) and the failed undo (500 naming what did not go back) | | `objectql/…/protocol-adopt-orphans-draft-view-registry.test.ts` | an adopted draft view reached no registry, before, after and at the next boot; a draft beside an active row served the active body | through `moveIntoPackage`: `package-move-in.dogfood.test.ts` (booted CRM stack) "objectstack-ai#23690: a loose DRAFT view moves as the target's draft, and the registry serves nothing before or after", "objectstack-ai#23690: a draft beside an active row of the same view: the active body is served at the target, never the draft" and "objectstack-ai#23690: at the next boot the moved draft is still served nowhere, and the pair still serves its active body"; and `protocol-package-move-in.test.ts` "a loose DRAFT moves as a draft: saved into the target in draft mode, never published, and answered states [draft]" and "a draft beside an active row: … states [active, draft]" (with an active-only control) | | `objectql/…/protocol-adopt-orphans-object-registry.test.ts` | the registry owner followed an adopted object | `package-move-in.dogfood.test.ts` A3 and "whole or nothing", and `package-first-authoring.dogfood.test.ts`'s D5 case, driven through `moveIntoPackage` | | `runtime/…/packages-adopt-orphans-readonly.test.ts` | the door's gates and their order | the `move-in` rows that replace `adopt-orphans` in the runtime route tables (capability gate, read-only remedy, walled refusal, knowledge-source gate, closed query, vetted org source, partial-host 501 and its message key) | | `ui/…/PackagesPage.adoptLooseItems-13339.test.tsx` | the console's Adopt dialog | the entry is removed; A2's `LooseMoveDialog-38150` and `ResourceListPage.looseMove-38150` pin the replacement | Edited files, as in objectstack-ai#38364 (metadata-protocol, objectql, runtime, client, spec, dogfood, `scripts/engine-double-contract.pinned.json`), with these changes at this head: - `packages-write-actor-session.test.ts`: its `adopt-orphans` row (a body naming another user, a body naming no one, a system context) is replaced by a `move-in` describe: a signed-in caller's move, and its dry run, hand the protocol the session user as `actor`; CONTROL: a system context sends no actor; a body `actor` (another user, or the session user itself) answers 400 `Invalid move-in body` naming the key, and the protocol is never called. - `StudioPackageMenu-37139.test.tsx`: three items (`edit`, `duplicate`, `manage`) in en and zh-CN, not five; the read-only case greys Edit and Duplicate; the adopt action case and the adopt rows of the one-copy list are removed; the guard that no surface spells the `/adopt-orphans` door stays. - `StudioPackageOverview-37454.test.tsx` (added on main by objectstack#37958 after objectstack-ai#38364 was built): the menu pin lists three rows, no adopt row. - `ResourceListPage.looseMove-38150.test.tsx` (N1): "the success toast names the package by its name, as the confirm title does", and its control "when the package list cannot be read the confirm and the toast both fall back to the id". - `package-move-in.dogfood.test.ts`: "the retired all-at-once door is gone: POST …/adopt-orphans answers 404 and moves nothing", and the three objectstack-ai#23690 cases above. - Comments that named the retired entry as live: `protocol.ts` (the object-owner import line) and `package-duplicate-adopt-org-scope.integration.test.ts` (two docblocks). ## Acceptance notes - `overlap-check.mjs` at `37aae5aa1`: clean against main; one textual overlap with open objectstack-ai#38541 in `content/docs/references/index.mdx` (generated; whichever lands second regenerates it with `gen:docs`). The overlap with objectstack-ai#38527 read at the previous head no longer shows. - The claim on objectstack-ai#38150 (7251650149) names the branch `claude/project-thread-j4n4b0` (A2's). This PR is on `claude/project-thread-pf8r6c`, the branch the seat's dispatch for this thread named. ## Verification Files to read first, by risk: 1. `ui/packages/app-shell/src/views/studio-design/StudioPackageMenu.tsx`: the conflict with objectstack#37958 resolved to three rows, with `onChanged` and `run` removed. 1a. `packages/qa/dogfood/test/package-move-in.dogfood.test.ts`: the objectstack-ai#23690 cases and their state fixture (draft rows inserted at the first boot). 2. `packages/runtime/src/domains/packages.ts` and `route-ledger.ts`: the route block and its ledger row. 3. `ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx`: N1's label hunk. Two-minute check: `pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioPackageMenu-37139.test.tsx packages/app-shell/src/views/metadata-admin/ResourceListPage.looseMove-38150.test.tsx`. Expect both files to pass, and the menu case to list three items. <details><summary>Suites (local; the package suites ran on the tree before the A2 merge commit `6742ce449`, the spec suite again after it; UI and gates at the heads named)</summary> | suite | result | |:--|:--| | `@objectstack/client` test | 59 files, 828 tests passed | | `@objectstack/spec` test | 913 files, 28,889 passed, 1 todo | | `@objectstack/metadata-protocol` test | 372 passed, 9 skipped files; 23,629 tests passed, 45 skipped | | `@objectstack/objectql` test | 640 files, 14,530 tests passed | | `@objectstack/runtime` test | 655 files, 12,481 passed, 25 skipped | | typecheck: client, spec, metadata-protocol, objectql, runtime | each lock VERDICT command-exit 0 | | UI touched files + `ui/packages/i18n` (8 named files + the i18n dir) | 117 files, 1,988 passed, 13 skipped | | full `@object-ui/app-shell` suite at `6742ce449` | 2,464 files: 2,462 passed, 1 skipped, 1 failed: `StudioPackageOverview-37454` "the ⋯ menu holds … adopt loose items …" (a main pin of the removed row). Fixed in `c9c49d97e`; that file and `StudioPackageMenu-37139` then 2 files, 71 tests passed | | `@object-ui/app-shell` and `@object-ui/i18n` type-check | lock VERDICT command-exit 0 | | `@objectstack/spec check:generated` after the A2 merge | all 14 artifacts current | | `check-platform-checklist --changed-from origin/main` | OK, 54 anchors judged, 0 lost | </details> <details><summary>Round 1 (review FAIL at `c9c49d97e`, M1 and M2), at `448cffe6f` and `37aae5aa1`</summary> - `packages-write-actor-session.test.ts` + `package-duplicate-adopt-org-scope.integration.test.ts`: 2 files, 25 tests passed. Ablation (`scripts/ablation-replace.mjs`, `resolvePackageWriteActor(_context)` before `protocol.moveIntoPackage` replaced by `undefined`, anchor 1 → 0): "a signed-in caller's move hands the protocol the session user" and "so does a dry run" failed, 2 failed and 20 passed (the system-context control and the 400 cases green); restored, blob equals HEAD. - `protocol-package-move-in.test.ts`: 11 passed. `Type Check · workspace` was red at `448cffe6f` on this file's new draft case (TS2532 / TS2493 on the commit read); `37aae5aa1` types it, and `pnpm --filter @objectstack/metadata-protocol run typecheck` (its `tsc` lists this file) and `@objectstack/runtime` typecheck exit 0, the file 11 of 11. Ablation (`mode: state === 'active' ? 'publish' : 'draft'` → `mode: 'publish'`): both draft cases failed, 2 failed and 9 passed; restored, blob equals HEAD. - `package-move-in.dogfood.test.ts`: 24 passed. Ablation of the same line on the built output (mutation held, `@objectstack/metadata-protocol` rebuilt, `ablation-dist-preflight.mjs` found the marker in `dist/`): all three objectstack-ai#23690 cases failed, 3 failed and 21 passed. Restored, rebuilt, preflight `--absent` clean, the file 24 of 24 again. - Derived gates for this round's seven paths (`dispatch-gates.mjs --commands PATHS`): 78 families, 77 exit 0, and `check-empty-changeset` exit 1 on the DELIBERATE CORRECTION above (expected). `--ran`: "78 derived, 78 run, 0 NOT-MEASURED, 0 UNRUN". `check-nul-bytes`: exit 0. </details> <details><summary>N1 ablation</summary> `scripts/ablation-replace.mjs` replaced `looseMove?.target.label ?? answer.targetPackageId` with `answer.targetPackageId` (anchor 1 → 0, blob `90937804f355` → `ed3e458acb2a`): "the success toast names the package by its name" failed (`expected "vi.fn()" to be called with arguments: [ 'Moved into Alpha: 1.' ]`), 1 failed and 8 passed, the control among the passing. Restored: blob equals HEAD, `git diff HEAD` empty. </details> <details><summary>Derived gates</summary> `node scripts/pm/dispatch-gates.mjs --commands` (no paths, change set from the merge base `dccf836a8`): 149 families. All 149 exit 0. Five first answered 99 or 3 (two vitest families queued behind the app-shell suite; `check:skill-examples`, `check:dual-build-cjs-loads`, `check:published-readme-exports` needed `client-react`, `studio` and `scenarios` built) and passed on the re-run after that build. `--ran`: "149 derived, 149 run, 0 NOT-MEASURED, 0 UNRUN". The commands re-derived at `c9c49d97e` give the same 149. </details> <details><summary>Dogfood battery</summary> Full battery at head `448cffe6f`, `pnpm --filter @objectstack/dogfood test` under the verify lock (no shard, no path): lock VERDICT command-exit 0; Test Files 495 passed, 3 skipped (498); Tests 4,187 passed, 68 skipped (4,255); no failure. `37aae5aa1` after it changes one line of a metadata-protocol unit test's typing, which no dogfood file reaches. (The battery at `c9c49d97e`: 495 / 4,184 passed.) </details> ## Owed before landing - CONTRACT_REVIEW_TIER L2 (the seat's). - A dogfood battery from the landing head. - Maintainer approval (Tier H). - Ships in the same version as PR-B2 (seat rule): after approval this PR is not enqueued until B2 is approved too; both enqueue together, with no Version Packages merge between them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#5 · os-project-manager · session_01FEkQ5pc3eJbLUEYRBLjxn5 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Part of #37766
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
addAuthoringGate:在某类型原有的发布闸门旁边再加一道闸门,原有的单槽和"后注册替换前者"的规则保持不变(plugin-security 占着object那一槽)。加上的闸门在草稿转发布时也会运行。What changes
ADR-0162 Execution item 7, "The same conditions are reported at authoring wherever the parts are in view together", made an error at publish on the seat's reading of 2026-11-29 05:24Z (N45). Slice N45 of #37766, on the trunk
claude/o5-data-approvals-trunkafter slice B (#38499, merged at 4cc09b1).@objectstack/metadata-protocol:addAuthoringGate(type, gate)(new public member).registerAuthoringGateholds one gate per type, and a second registration replaces the first; plugin-security holdsobject. An added gate runs after the owner gate, in the order added, on every write the owner gate runs on (runAuthoringGate: a save in either mode, a restore), and also when a draft is promoted toactive(promoteDraftForPublish, sopublishMetaItem, a package publish and a judge-only call), which the owner gate does not run on. A declaredpackage-authorchannel runs neither. The slot ofregisterAuthoringGateand its replace rule are untouched.protocol.tssits exactly at its facade line ceiling (11705), so the facade's net growth is zero: the touched docblocks are rewrapped, the added-gate map is handed to the class-head facet directly, and the promotion runs the added gates throughrunAuthoringGatewithaddedOnly: truerather than through a second private runner.MetadataAuthoringGateContext.pending(new optional member, L2 S3). At a package publish's promotion an added gate is handed theobjectandflowbodies of the batch's drafts (request.pending, the closure the runtime lint already reads), and the approvals check reads them in place of the live items of the same name. A package that declaresclosedStatesand repairs the flow it closes on in one publish goes through in either draft order; pinned by unit tests (reverse-verified) and a real-kernelpublishPackageDraftstest. Absent on a save, a restore and a single publish.approval-publish-check.ts(new). It is pure over aPublishCheckSource, and it reuses slice B'sjudgeApprovalOpeningwith the written item in place of the held one.subflow/map, to any depth. The walk up the callers keeps a visited set and stops at 64 roots.startnode'sobjectName, or a record start input, [Decision] flows and records: may a flow start input declare a record reference (A), and does a non-system create stop choosing the new record's id (C)? #29425), or that maps over its records (itemObject), is judged as a root. Only gaps on the written object are reported.approval-publish-gate.ts(new).registerApprovalPublishGatesadds theflowandobjectgates. The plugin wires them onkernel:ready.ApprovalPublishRefusedErroris the refusal:400 VALIDATION_FAILED,messageinen,userMessagein the first locale the door states.ApprovalService.judgePublishedItemsupplies the engine's readers.ApprovalResumeSurfacedeclareslistFlows, a methodAutomationEnginealready implements publicly.approvalPublishRefusedLead, the publish lead sentence, is added in all 11 catalog packs.publishRefusalTextshares the gap sentences withopeningRefusalText.allNodesinapproval-opening-check.tsis exported for reuse, with no change of verdict.Why
The maintainer's ruling 7205949718 on #36253, verbatim: 「平台拒绝这种配置」. The option it chose reads 「字段声明了关闭值、却缺少"审批中"状态或退回路径时,发布或开审批时直接报错」. Slice B made the opening the rule. This slice adds the publish half as early notice, on the seat's 05:24Z ruling.
Face readings
declaration→TIER_DEFAULT. This was read withreviewFaceover the PR's 16 paths (4cc09b1..d1ef745), with both changesets and this body as the declaration texts. It returned{ face: 'declaration', tierName: 'TIER_DEFAULT', hits: { schema: [], rules: [] } }. Nopackages/spec/src/**path is touched, no governed path is touched, and no(narrowing)arm is declared.addAuthoringGateis on the published surface:Clause-②: yes (widening).ObjectStackProtocolImplementationis exported from@objectstack/metadata-protocol's entry (packages/metadata-protocol/src/index.ts:3,export { ObjectStackProtocolImplementation, … } from './protocol.js'), so the new public member reaches the package's published types. It adds a member and changes no existing signature:registerAuthoringGate's single slot and its replace rule are as published, pinned byprotocol.add-authoring-gate-37766.test.ts.ApprovalService.judgePublishedItemand the optionalApprovalResumeSurface.listFlowswiden@objectstack/plugin-approvalsthe same way.Metadata-protocol: none, no(narrowing)arm. A gap can be raised only where an object declaresclosedStates. The approvals gate returns before reading anything unless some object, with the written one in place, declares the key, and every condition is keyed on a field the object closes on.closedStatesexists only on the trunkclaude/o5-data-approvals-trunk, and no released version of@objectstack/specaccepts it: ADR-0162 Execution item 1 releases the key together with items 7 and 8. So no body that any released version accepts can be refused by this slice, and nothing an author can write today is refused. If the key were released before this slice, the reading would fail, and the narrowing arm would owe a contract-tier L2 and the dogfood battery.Readings
activethrough a draft, which is the Studio and MCP path.unreadable_flowis dropped). The first request still refuses an approval it cannot read whole, and lint: a second batch of publish-time checks for metadata that saves and does not work — the ones only the hosted build check makes today #35143's gate (fix(lint)!: the publish gate refuses a subflow or map step that calls a flow the deployment does not hold #38241) owns a call to a flow the deployment does not hold. What can be read beside it is still judged.jobservice is not refused at publish (no_job_serviceis never raised there). It is a fact of the host, not of what is authored, and the first request refuses it.closedStates, with the written object in place, reads nothing.object_extensionwrite. The key is read off the object as the registry folds it, and the first request covers it.Metadata-protocol: none. The refusal reaches only an application in which an object declaresclosedStates, a key not yet released (ADR-0162 Execution item 1: the key is released with item 7 and item 8). No released author can write a body this refuses. This is graded here as the seat asked, and L2 may correct it.Verification
protocol.add-authoring-gate-37766.test.ts: 10 tests.draft, active saveactive, the promotionactiveand not the owner, a throw at promotion refusing before any active row, andpackage-authorrunning none.approval-publish-check.test.ts: 26 tests.mapover its records, flows that cannot be listed;enandzh-CN, a draft not judged, a failing judge, the cap sentence, the judge's input.approval-publish-gate-37766.integration.test.ts: 7 tests on the real kernel, ObjectQL with its metadata protocol, the automation engine and the approvals plugin booted whole.kernel:ready;zh-CNuserMessage;pnpm --filter @objectstack/plugin-approvals exec vitest run: 2139 tests, 138 files, green.pnpm --filter @objectstack/metadata-protocol exec vitest run: 23657 tests passed (45 skipped), 385 files (376 passed, 9 skipped), at the head.pnpm --filter @objectstack/plugin-approvals run typecheck(test layer held in its debt ledger) andpnpm --filter @objectstack/metadata-protocol run typecheck: OK.node scripts/check-facade-delegation-only.mjs: OK, withprotocol.tsat 11705 of 11705.node scripts/check-i18n-bundles.mjs: in sync.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi