Skip to content

feat(approvals): the opening check's conditions are reported where a flow or an object is published (ADR-0162 item 7, slice N45) - #38527

Closed
objectstack-fleet[bot] wants to merge 4 commits into
claude/o5-data-approvals-trunkfrom
claude/project-thread-fkdrk9
Closed

objectstack-fleet[bot] wants to merge 4 commits into
claude/o5-data-approvals-trunkfrom
claude/project-thread-fkdrk9

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Part of #37766

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 审批开启检查(slice B,已进主干)的条件,现在在发布时也会报出:发布流程或对象时,如果某个审批因此无法在关闭字段上显示「审批中」,发布以 400 VALIDATION_FAILED 被拒,并用与开审批时相同的句子逐条说明缺什么,语言按请求的语言。
  • 只拦 active 写入。草稿保存不拦,草稿转为发布时才判断。看不到的被调用流程不拒,没有作业服务的宿主也不在发布时拒;这两种情况在审批第一条请求时仍然会被拒。
  • 元数据协议新增一个成员 addAuthoringGate:在某类型原有的发布闸门旁边再加一道闸门,原有的单槽和"后注册替换前者"的规则保持不变(plugin-security 占着 object 那一槽)。加上的闸门在草稿转发布时也会运行。
  • 状态(07:50Z 席位):L2 认为新增闸门成员需要 ADR 注记(S1),且 ADR-0162 写明「发布时不拒」(S2),已交维护者在 A / B / C 三个选项中定;定之前本 PR 保持草稿,不进主干。
  • 规则仍是开审批时的拒绝;发布时的拒绝是提前告知。ADR-0162 里"发布时不拒"那一行,按席位 05:24Z 的裁定在本片进入主干时写到 ADR revisions, week of 2026-11-29: rolling checklist of ADR text out of step with main (one governed PR) #38438。

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-trunk after slice B (#38499, merged at 4cc09b1).

  • @objectstack/metadata-protocol: addAuthoringGate(type, gate) (new public member). registerAuthoringGate holds one gate per type, and a second registration replaces the first; plugin-security holds object. 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 to active (promoteDraftForPublish, so publishMetaItem, a package publish and a judge-only call), which the owner gate does not run on. A declared package-author channel runs neither. The slot of registerAuthoringGate and its replace rule are untouched. protocol.ts sits 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 through runAuthoringGate with addedOnly: true rather than through a second private runner.
  • MetadataAuthoringGateContext.pending (new optional member, L2 S3). At a package publish's promotion an added gate is handed the object and flow bodies 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 declares closedStates and repairs the flow it closes on in one publish goes through in either draft order; pinned by unit tests (reverse-verified) and a real-kernel publishPackageDrafts test. Absent on a save, a restore and a single publish.
  • approval-publish-check.ts (new). It is pure over a PublishCheckSource, and it reuses slice B's judgeApprovalOpening with the written item in place of the held one.
  • approval-publish-gate.ts (new).
    • registerApprovalPublishGates adds the flow and object gates. The plugin wires them on kernel:ready.
    • ApprovalPublishRefusedError is the refusal: 400 VALIDATION_FAILED, message in en, userMessage in the first locale the door states.
    • A judge that throws is logged and refuses nothing.
    • A walk that hit the cap logs one sentence and refuses nothing for it.
  • ApprovalService.judgePublishedItem supplies the engine's readers. ApprovalResumeSurface declares listFlows, a method AutomationEngine already implements publicly.
  • approvalPublishRefusedLead, the publish lead sentence, is added in all 11 catalog packs. publishRefusalText shares the gap sentences with openingRefusalText. allNodes in approval-opening-check.ts is 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

  • Review face: declaration → TIER_DEFAULT. This was read with reviewFace over 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: [] } }. No packages/spec/src/** path is touched, no governed path is touched, and no (narrowing) arm is declared.
  • (1) addAuthoringGate is on the published surface: Clause-②: yes (widening). ObjectStackProtocolImplementation is 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 by protocol.add-authoring-gate-37766.test.ts. ApprovalService.judgePublishedItem and the optional ApprovalResumeSurface.listFlows widen @objectstack/plugin-approvals the same way.
  • (2) The publish refusal is not a narrowing: Metadata-protocol: none, no (narrowing) arm. A gap can be raised only where an object declares closedStates. 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. closedStates exists only on the trunk claude/o5-data-approvals-trunk, and no released version of @objectstack/spec accepts 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

  • Active writes only. A draft save is not refused (ADR-0094 D1, [runtime/metadata] 作者时规则只存在于 CLI:Studio/REST/MCP 的运行时授权面是第四扇门,26 条规则一条不跑——#4409 修完后最大的敞口 #4463 D1). Since the owner gate does not run at promotion, the promotion now runs the added gates. Without that, an active-only gate would never see a body that reaches active through a draft, which is the Studio and MCP path.
  • A callee that cannot be read is not refused at publish (unreadable_flow is 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.
  • A host with no job service is not refused at publish (no_job_service is never raised there). It is a fact of the host, not of what is authored, and the first request refuses it.
  • An application in which no object declares closedStates, with the written object in place, reads nothing.
  • The cap. The walk up the callers, or the scan of flows on an object, stops at 64 roots. Past that it judges the roots it holds, refuses nothing for the cap, and logs one sentence. A flow that calls itself, and two flows that call each other, end the walk through the visited set.
  • An object publish reports only the written object's gaps, so publishing one object is not refused for another object's configuration.
  • Shared flow names. For a name two packages hold, the written body stands in for the name in every read. The publish is early notice, and the first request reads by package slot.
  • Not covered at publish: an object_extension write. 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 declares closedStates, 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.
  • The door, for L2 (seat condition 1): a new member beside the slot, instead of the slot's holder composing other plugins' gates. See the L2 brief.

Verification

  • protocol.add-authoring-gate-37766.test.ts: 10 tests.
    • the order (owner, then added in order);
    • one shared context;
    • the owner not displaced, and a second owner registration still replacing only the owner;
    • no owner, plural types;
    • a throw propagating, and an owner throw stopping the added gates;
    • through the doors: draft save draft, active save active, the promotion active and not the owner, a throw at promotion refusing before any active row, and package-author running none.
    • Reverse-verified: removing the promotion call turns the two promotion arms red.
  • approval-publish-check.test.ts: 26 tests.
    • the flow arms: refused, clean, the written body, a caller as root, any depth, a self-call, a mutual call, the cap, a record start input;
    • the object arms: refused, the written object, dropping the key, only its own gaps, a map over its records, flows that cannot be listed;
    • what is not refused: an unreadable callee alone and beside a gap, the host, no declaration, a body with no nodes;
    • the gates: registration and feature detection, the 400 in en and zh-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.
    • the plugin adds its gates on kernel:ready;
    • an active flow save refused with the sentence and no active row;
    • the zh-CN userMessage;
    • a clean flow;
    • a flow on an object with no declaration;
    • a draft let through and its promotion refused;
    • an authored object refused as it starts to close on its approval field.
    • Reverse-verified: without the plugin's wiring, the 5 refusal arms turn red and the 2 "not refused" arms stay green.
  • Suites:
    • 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.
  • Gates:
    • pnpm --filter @objectstack/plugin-approvals run typecheck (test layer held in its debt ledger) and pnpm --filter @objectstack/metadata-protocol run typecheck: OK.
    • node scripts/check-facade-delegation-only.mjs: OK, with protocol.ts at 11705 of 11705.
    • node scripts/check-i18n-bundles.mjs: in sync.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi

…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
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/metadata-protocol, @objectstack/plugin-approvals, touching 103 documentable anchor(s).

21 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 4cc09b16f4eae866c94e99a12bde24470bf1eab4.

⛔ 12 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: VALIDATION_FAILED (literal, 52 pages)
  • 8 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 253 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 125 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 13 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 4cc09b16f4eae866c94e99a12bde24470bf1eab4 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 6b1de698c041e9d92f822b7f6f0acad79ebb0a7e — the merge of head a19894535435007a9ccc5f6c4f02355e5066b69f into base 4cc09b16f4eae866c94e99a12bde24470bf1eab4, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older claude/o5-data-approvals-trunk holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 4cc09b16f4eae866c94e99a12bde24470bf1eab4 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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 @ d1ef745e185c01a62239ed506f90615bdbe444f7 (card #37766)

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face declaration — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #37766: its body and EVERY comment (rulings and earlier records included)
· PR #38527: its body, its file list, and the net diff against its base claude/o5-data-approvals-trunk (4cc09b1) at d1ef745e185c01a62239ed506f90615bdbe444f7
· the check-runs on d1ef745e185c01a62239ed506f90615bdbe444f7: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the declaration face: the widened surface the Clause-②: yes (widening) line declares. That is:
· the new public member ObjectStackProtocolImplementation.addAuthoringGate (packages/metadata-protocol/src/protocol.ts), with its body (protocol-class-head.ts) and its run (runAuthoringGate in protocol-authoring-gate.ts, and the promotion call in protocol-history-and-publish.ts promoteDraftForPublish);
· ApprovalService.judgePublishedItem and the optional ApprovalResumeSurface.listFlows (approval-service.ts);
· the catalog key approvalPublishRefusedLead (translations/messages.ts).
Also in scope: every file IN THIS DIFF that implements or enforces them: approval-publish-check.ts, approval-publish-gate.ts, approvals-plugin.ts, approval-opening-refusal.ts, and approval-opening-check.ts (where allNodes is now exported).
Tests and changesets are the lane seat's ACCEPT at TIER_DEFAULT.

Questions the seat set for this review (seat ruling relayed 2026-11-29 07:08Z). Answer each one in ③ by name:
Q1. The door. Is addAuthoringGate, a new member beside the single slot, the right design? The alternative is that the slot's holder composes other plugins' gates inside the existing single slot. Check for an existing multi-gate precedent on the protocol, or an ADR that forbids one (ADR-0094 and its addendum seam, #3050, the "Deliberately NOT a registerAuthoringGate registration" note above assertRuntimeAuthoringRules). If you judge that it needs an ADR note, or that it amounts to a second registration mechanism (two implementations of one seam), say so as a finding and STOP there. ⛔ Do not redesign; the seat decides.
Q2. Walking up the callers "to any depth" must have a cycle guard and a cap. Check that a flow calling itself and two flows calling each other are both pinned, and that the behaviour past the cap is pinned too: not refused, with one sentence reported.
Q3. These must each be pinned: the refusal happens on active writes only; a draft is not refused; a callee that cannot be read is not refused; a host with no job service is not refused at publish.
Q4. The Metadata-protocol: none grade. AGENTS.md says "a value refused or a requirement tightened is narrowed". This slice refuses a publish only where an object declares closedStates, a key that is on the trunk and not yet released (ADR-0162 Execution item 1). Judge whether none holds, or whether it must be narrowed.
Q5. protocol.ts sits exactly at its facade line ceiling (11705), so the change is fitted at zero net growth. Check that what was cut to fit (rewrapped docblocks, the map handed to the facet directly, addedOnly in place of a second runner) loses no contract text the class docblocks carried.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/98b97fe0-1d71-5765-93e6-b5f728112098/scratchpad/pr-38527/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.
----- to here -----

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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 review

Served-tier: TIER_DEFAULT
Head-sha: 4b91cd2e6f5e615fd571323a910a006c1aaad233
Local-runs: none
Regen-provenance: 4b91cd2 = d1ef745 + engine-double ledger rows only (check-engine-double-contract --write)

Scope: the declaration face of Clause-②: yes (widening) on PR #38527 (card #37766, slice N45), net diff 4cc09b16f..d1ef745e1 against the trunk. The PR head then moved to 4b91cd2e6. I checked the compare d1ef745e1...4b91cd2e6 (1 ahead, 0 behind): it changes one file, scripts/engine-double-contract.pinned.json, adding three rows (delete, findOne, update, each pinned: 1) for protocol.add-authoring-gate-37766.test.ts. That file is outside the face, so every judgment below holds for 4b91cd2e6. The trunk is claude/o5-data-approvals-trunk. The surface: ObjectStackProtocolImplementation.addAuthoringGate (protocol.ts), its body (protocol-class-head.ts) and its run (runAuthoringGate, protocol-authoring-gate.ts; the promotion call in promoteDraftForPublish, protocol-history-and-publish.ts); ApprovalService.judgePublishedItem and the optional ApprovalResumeSurface.listFlows (approval-service.ts); the catalog key approvalPublishRefusedLead (translations/messages.ts). Also reviewed, because they implement or enforce that surface: approval-publish-check.ts, approval-publish-gate.ts, approvals-plugin.ts, approval-opening-refusal.ts, approval-opening-check.ts (allNodes exported). Tests and changesets are the lane seat's ACCEPT at TIER_DEFAULT; I read them only to answer Q2 and Q3. Inputs: the card body and all 11 comments, the PR body and file list (16 files, +1292 −36), the net diff, and the head's check-runs. Code outside the diff was read but not reviewed.

① Derived judgments

Each public-surface change the diff implies, and each change to what the system accepts, judged:

  1. addAuthoringGate(type, gate): new public member. The judgment of the member's behaviour is right; its design is open (S1). The behaviour matches its docblock and changeset:
    • singular and plural types resolve, and each call appends one gate (ProtocolClassHeadFacet.addAuthoringGate);
    • added gates run after the owner gate, in the order added, with one shared context (runAuthoringGate);
    • an owner throw stops the run before any added gate;
    • a declared package-author channel runs neither kind of gate, at save (protocol-save.ts:2010) or at promotion.
    • The registerAuthoringGate slot and its replace rule are byte-for-byte unchanged. plugin-security's object, permission and position registrations are unaffected.
  2. runAuthoringGate (private) gains addedOnly: right. With addedOnly, the owner lookup is skipped (evt.addedOnly ? undefined : …). Without it, every existing caller behaves as before, because with no added gates registered added is [] and the original early return still holds.
  3. promoteDraftForPublish runs the added gates on a draft's promotion: right, with one hole (S3).
    • The call is placed after assertRuntimeAuthoringRules, before the override refusal and before the judgeOnly return. So a judge-only call and a package publish's Phase 0 both see it, and a throw refuses before any active row. That is pinned by the protocol test "a throw of the added gate at promotion refuses the publish before it writes".
    • The body is storedFlowVerdictBody(...), as the runtime lint is given. userTextLocales and packageId are threaded.
    • This changes behaviour only for a plugin that adds a gate. Today that is plugin-approvals alone.
  4. ApprovalService.judgePublishedItem(item): right. Every reader catches and answers undefined, null or 'unread', so a failed read is a part that cannot be read, and it is not refused. All the reads are in memory: the registry's getAllObjects, and the engine's listFlows, getFlow, getFlowSlot(s) and getActionDescriptor, which are map reads (service-automation engine.ts:6137–6151). There is no storage read.
  5. ApprovalResumeSurface.listFlows?(): Promise<string[]>: right. It is optional, it is already public on AutomationEngine (engine.ts:6137), and it is feature-detected at the call. It widens what an implementer may supply and does not require it.
  6. approvalPublishRefusedLead: right. It is present in all 11 packs (en, zh-CN, ja-JP, es-ES, zh-Hant, ar, fr, pt-BR, ru, de, ko), with {{type}} and {{name}} in every pack. publishRefusalText reuses the gap sentences that openingRefusalText uses. The refactor of openingRefusalText into gapSentences keeps its output identical.
  7. allNodes exported from approval-opening-check.ts: right. The module is not re-exported from the package's src/index.ts, so this widens nothing a consumer can import. Slice B's verdict path is untouched.
  8. What the system accepts: a new refusal, 422 VALIDATION_FAILED (ApprovalPublishRefusedError), on an active save, restore or promotion of a flow or object. Right in shape, with one ledger gap (S4).
    • The refusal applies only where some object, the written one included, declares closedStates. Otherwise nothing is read, which is pinned.
    • message is in en. userMessage is in the first locale the door states. The class field also carries status and statusCode 422.
    • A judge that throws refuses nothing and logs one warning.
    • Past the cap, nothing is refused for the cap, and one warning names MAX_PUBLISH_ROOTS.
  9. Wiring: right. wirePublishGates runs on kernel:ready, reads ctx.getService('protocol') inside a try, and feature-detects addAuthoringGate. A protocol without the member gets no gates, and the first request still refuses.

Findings, graded:

  • S1 (should-fix, the door: needs an ADR note, and the seat decides). See Q1 in ③. addAuthoringGate is a second way to register on the one authoring-gate seam of ADR-0094's addendum (OWD posture is lint-only at runtime: env can widen a packaged object's sharingModel via OS_METADATA_WRITABLE, and external≤internal (ADR-0090 D11) is never enforced on the write path #3050). That seam is documented as one slot per type (ADR-0094 lines 442 and 452–455; the protocol.ts note above assertRuntimeAuthoringRules: "per-type and single-slot, owned by the domain plugin"). The new member differs from the slot in three ways:
  • S2 (should-fix, must land before the trunk reaches main). ADR-0162, under "Points the ruling does not settle" (line 432), says verbatim: "the refusal is made when an approval opens and reported at authoring, and is not made at publish". This slice makes the refusal at publish. Prime Directive 13 says an accepted ADR binds until amended. The PR does not hide the change: its body and changesets say so, and they defer the ADR line to card ADR revisions, week of 2026-11-29: rolling checklist of ADR text out of step with main (one governed PR) #38438 "when this slice lands". The seat's 05:24Z ruling that this relies on is cited in claims 7252284600 and 7252492357, but it is not itself on the card. The amendment to ADR-0162 (an amended status line or note) must be merged before the trunk carries this to main. A row on a weekly card is not by itself the amendment PD13 asks for.
  • S3 (should-fix). A package publish judges each item against the engine as it stood before the batch, not as it will stand once the batch lands. The changeset says the gates judge "as the engine will hold things once the write lands". That is true for one write and false for publishPackageDrafts:
    • Phase 0 (an engine with no rollback) judges every draft before any is promoted.
    • Phase 1 judges the drafts in draft-list order (ordered, protocol-history-and-publish.ts:2151), with no dependency sort.
    • The added gate is given no pending, unlike assertRuntimeAuthoringRules (publishPackageDrafts validation closure omits same-batch dataset drafts: a package shipping dashboard+dataset together can never publish (widget-dataset-unknown) #10377, "publishable in either order").
    • So a self-consistent package that adds closedStates to an object and fixes the held flow in the same batch is refused on the object when the object comes first. The workaround is to publish the flow first.
    • No reading in the PR and no test covers a batch.
      The fix is one of: thread the batch's pending flows and objects into the judgement; state the batch reading as a pinned limitation; or narrow the changeset sentence. The seat's choice.
  • S4 (should-fix). plugin-approvals now puts VALIDATION_FAILED on the wire from a class field (readonly code = 'VALIDATION_FAILED', approval-publish-gate.ts). The @objectstack/plugin-approvals row of the error-code ledger lists only FORBIDDEN, RECORD_LOCKED and RESUME_FAILED, and there is no waiver for this code. ADR-0112 D3's provenance rule ("listed once per emitting package") is therefore not met. check:error-code-provenance will not catch it, because it is declared blind to class fields (check-error-code-provenance.ts:70–77). So this is a real ledger gap that the gates leave green. The fix is a row with its reachability comment, or a waiver. Either touches packages/spec, so it may be its own trunk PR before release.
  • N1 (nit). The cap test ("stops at 64 roots…") makes every root clean. It pins capped === true and the absence of a refusal for the cap, but it would stay green if roots past the cap were still judged. A gap on root 65 would pin "not judged past the cap".
  • N2 (nit, see Q5). Two pieces of contract text sit away from the addAuthoringGate docblock, which is the member's contract:
    • its docblock leaves out the package-author exception at promotion, which the code applies (host.authoringChannel !== 'package-author');
    • "singular or plural type names both resolve" now appears only on the facet's docblock.
  • N3 (nit). The lead sentence says {{type}} {{name}} was not published for every door the gate runs on, including a draft promotion, a judge-only call and a restore. "Published" reads oddly on a restore.

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

  • .changeset/37766-publish-gate-door.md: '@objectstack/metadata-protocol': patch, Clause-②: yes (widening), Metadata-protocol: none. Right. It adds a public member and narrows nothing that is released. none takes patch, and a widening that is not a protocol change ships patch (AGENTS.md, Post-Task Checklist item 3).
  • .changeset/37766-publish-gate-approvals.md: '@objectstack/plugin-approvals': patch, the same two lines. Right. It names what is widened: judgePublishedItem and the catalog key. It does not name the optional ApprovalResumeSurface.listFlows (an omission at nit level, already covered by "Widened" being a list of examples rather than a full inventory). That member is optional and widens only what an implementer may supply.
  • The PR body carries the same Clause-②: yes (widening) and Metadata-protocol: none lines. The (widening) arm is right: nothing released is narrowed. The new refusal applies only where an object declares the unreleased closedStates key (Q4).
  • Check-runs on the head, as they stand:
    • Check Changeset: one run success, one in progress.
    • Success: Governed Surface Queue Guard, PR-body guards (×2), Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Dogfood Regression Gate, Test UI, Check PR Size.
    • In progress: Build Core; Test Core 1–12 of 12; Type Check (workspace, source gates, consumer gates, debt ledger); Lint (ESLint, docs & code guards, repo & tooling gates, CI/release/engine gates, two scoped); Live E2E UI.
    • None has failed.
    • On the reviewed head 4b91cd2e6, at the time of writing: Governed Surface Queue Guard success. In progress: Check Changeset, Check PR Size, PR-body guards, Flag docs affected by code changes, every Lint job but two, and all four Type Check jobs. Queued: the two scoped Lint jobs (query-options erasure; slot lookup & corpus). Build Core and Test Core had not started. Nothing has failed. Those checks give the verdict on whether the head is green; this record does not.
    • The facade-ceiling check (protocol.ts at 11705 of 11705) and the i18n bundle check run inside the in-progress Lint families. Their verdicts are not yet in, and this record does not stand in for them.

③ Boundary flags

The five questions the seat set (ruling relayed 2026-11-29 07:08Z):

  • Q1. The door.
  • Q2. The walk up the callers.
    • The cycle guard is the seen set, seeded with the written name. The held-flow scan also skips the written name.
    • Pinned: "ends the walk on a flow that calls itself" and "ends the walk on two flows that call each other", each asserting the gap and capped === false.
    • The cap is MAX_PUBLISH_ROOTS = 64, on both the flow walk and the object scan. Past it: no refusal for the cap, and one sentence, pinned twice:
      • the check test asserts capped === true and no gaps;
      • the gate test asserts exactly one warning containing "first 64 approval flows", and that nothing is refused.
    • The "not judged past the cap" half is pinned only weakly (N1). The object scan's cap has no test of its own (nit, covered by N1).
  • Q3. What is not refused. Each is pinned:
    • Active writes only: the gate test "does not judge a draft" (both types, and the judge is never called); the protocol test "a draft save runs the added gate with state draft"; the integration test "does not refuse a draft, and refuses its promotion".
    • A callee that cannot be read: "does not refuse a callee it cannot read" and "judges what it can read beside a callee it cannot read". unreadable_flow is filtered out by NOT_AT_PUBLISH.
    • A host with no job service: "does not refuse for the host". The integration kernel boots ObjectQL, automation and approvals with no job service, and its clean-flow arm passes. The unit pin is doubly guarded: hostRunsReconciler: true and the NOT_AT_PUBLISH filter. Removing either one alone keeps it green; only removing both turns it red. That is acceptable, because both say the same reading.
  • Q4. The Metadata-protocol: none grade holds.
    • The refusal applies only where an object declares closedStates. That key is on the trunk (.changeset/37768-closed-states-spec.md, @objectstack/spec minor, Metadata-protocol: added), and it is not on main (base 4cc09b16f is not an ancestor of origin/main).
    • No released author can write a body this refuses. The key's own changeset already counts the refusals at the save and publish door as part of what added means. Slice B (feat(approvals): the check when an approval opens, and the between-two-steps stamp (ADR-0162 item 7, slice B) #38499) was graded none on the same reasoning, and CI accepted it.
    • addAuthoringGate is a protocol API, not something a metadata author can write.
    • The grade depends on the card's release rule: the key is not published before slices A, B and C, and this slice, share a release. If the key ever shipped without this slice, a later release carrying this refusal would be narrowed. The seat should keep that rule attached to the trunk's merge.
  • Q5. Fitting protocol.ts to its ceiling (+19 −19). No contract text was lost; I compared each rewrapped docblock word for word:

Dev flags and open_questions:

  • No os-dev-report for feat(approvals): the opening check's conditions are reported where a flow or an object is published (ADR-0162 item 7, slice N45) #38527 is on the card. The 06:08Z report is for feat(approvals): the check when an approval opens, and the between-two-steps stamp (ADR-0162 item 7, slice B) #38499 and has open_questions: []. The PR names two points for this review:
    • "the door, for L2 (seat condition 1)": answered by Q1 and S1, escalated to the seat;
    • "Metadata-protocol … L2 may correct it": answered by Q4, none holds.
  • Claim 7252492357 said "one new module for the publish judgement". The diff adds two: approval-publish-check.ts and approval-publish-gate.ts, both inside the claimed plugin directory. This is a minor departure from the claim's file surface; no other path is outside it. protocol-host.ts and protocol-authoring-channel.ts were claimed and needed no change, as the amended claim says.
  • Identity: the Reviewed-by session below is the same session id that claim 7252492357 names as the implementing thread (session_01FEkQ5nzgcVrZ8Neqqd1AFi). This review ran as an isolated subagent on a read-only brief, but the seat should judge whether a record signed by the same session meets its rule on independent review before relying on it.

Implemented-by: claude/project-thread-fkdrk9
Reviewed-by: session_01FEkQ5nzgcVrZ8Neqqd1AFi

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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 os validate / build and by the runtime publish door; this PR's separate authoring-gate door is set aside. The work is redone as one new slice PR on the approvals trunk under a re-posted claim on #37766. Nothing here is merged into the trunk.

Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants