Repository navigation
feat(lint): an approval's closed-state gap is refused at every authoring door, through the first request's one judge (ADR-0162 item 7, slice N45) - #38562
Conversation
…door, through the first request's one judge The judge of ADR-0162 D5's opening conditions moves from the approvals plugin to @objectstack/metadata-core (approval-opening.ts), with an awaiting driver for the first request and a synchronous one over a stack in hand. The plugin re-exports it; its verdict is unchanged. A new reference-integrity member, validateApprovalClosedStates (approval-closed-state-gap, error), asks the same judge on each flow of a stack, so os validate, build and lint refuse the gap, and the runtime publish door refuses it (INVALID_METADATA) on a flow write and, with the written package's live flows as subjects, on an object write. A flow the stack does not hold, a node type the spec does not ship, the host's job service and an object without closedStates are not refused there; the first request still judges them. Sentences in 11 locales. ADR-0162 gains one dated note under D5 for the maintainer's hand. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
…into claude/project-thread-fkdrk9
📓 Docs Drift CheckThis PR changes 3 package(s): 22 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 8 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 ff63329bef3f172553255c62d2c69cd386d41ba1 && git checkout ff63329bef3f172553255c62d2c69cd386d41ba1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 97f9f1f236d67647b8521f0bdd500d430afbe063 f6110c77780cd4cb3de7ea977e23340010a0a942 && git checkout -B drift-repro 97f9f1f236d67647b8521f0bdd500d430afbe063 && git merge --no-ff f6110c77780cd4cb3de7ea977e23340010a0a942
node scripts/docs-audit/affected-docs.mjs --json 97f9f1f236d67647b8521f0bdd500d430afbe063
|
…d the two gap catalogs equal The note now splits what the maintainer ruled from what the analysis carried and what the seat proposes, quotes the option's line in full and reads each of the four passages it touches. The rule's header, its changeset and the door test's batch case now say what the door does in a package publish: a redrafted flow leaves the object write's subjects and is judged at its own write. A gap that shows only across two flows is refused by the CLI and at the first request, not at a single flow write. A plugin-approvals test holds the authoring rule's sentences equal to the first request's, gap kind by gap kind, in all 11 locales. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
…into claude/project-thread-fkdrk9
…-state gap is refused at authoring A subsection after the refused opening: os validate, build and lint fail with approval-closed-state-gap, and Studio, REST /meta and MCP refuse the save or publish with INVALID_METADATA, in the same words as the opening. It names what is left to the first request: a flow not in view, a node type a plugin adds, and the host's job service. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nzgcVrZ8Neqqd1AFi Contract-review-claim: session_01FEkQ5nzgcVrZ8Neqqd1AFi · head 2a8d0a7 · 2026-11-29T11:02Z The card thread starts an isolated contract-review sub-agent at |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5kjJ6Qm1z2mRox4ZbB 席位核对 — ACCEPT · L1-b · area o5-data · Head-sha
|
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nzgcVrZ8Neqqd1AFi Contract reviewServed-tier: ① Derived judgmentsGate verdicts, read off the check-runs on this head: 73 runs, 62 success, 10 skipped, 1 cancelled, 0 failure. The cancelled run is PR-body guards; a later run of the same name succeeded, so its verdict is success. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core (the aggregate and its 12 shards), Build Core, Check Changeset, Governed Surface Queue Guard, Spec property liveness, Build Docs and Dogfood Regression Gate. What the diff changes in what is accepted and what is published:
② Semver levelThree patch changesets, one per package whose source moved: lint ( One condition holds ③ Boundary flagsNo
The ruling record's carried lines, which bind the build unless the review or the maintainer's approval changes them:
The three findings of the review of closed PR #38527 that the ruling record disposes: the protocol member is not added (confirmed, no protocol file in the diff); the batch reading is confirmed by the two package-publish integration tests; the refusal leaves under a code the door already gives (confirmed). Open questions on the card belong to other PRs and are not answered here: two in 7251445681 (PR #38485) and one in 7253794078 (PR #38546). SQL push-down: the diff adds no query, no id materialisation and no in-app join. The rule reads a stack in memory, and the runtime door reads the snapshots it already gathers. Security: no changed hunk teaches permission, sharing, credential, token or authentication behaviour. The hunks add an authoring-time configuration check and its sentences. For the seat, none of it a finding on a scope file:
④ Design judgmentThe ADR note and the status-line sentence (the hit).
S1 (should-fix) — the rule reads a record input's object as the object of the run's record, and the first request does not.
A run's object is a fact of how it was started, not of its variables:
No door reads a variable's Two consequences, traced by reading:
Grade: should-fix, not must-fix. No shipped flow declares a record start input, no shipped object declares The fix is the seat's choice, and either form moves the head:
In both, the note lists the flow that declares no object among what a door does not judge. The implementing files.
Nits. None affects correctness or the contract. Nit A can ride the S1 fix head; the others are follow-ups or accepted deviations.
No must-fix. One should-fix, S1, is open on this head. Its fix earns a delta review, and the delta record closes it by id. This record was rendered by an isolated sub-agent that the card thread (session_01FEkQ5nzgcVrZ8Neqqd1AFi) started for this review. It drafted neither this diff nor the ADR note, and it was fed only the brief's inputs: card #37766 with every comment, this PR's body, file list and net diff against Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nzgcVrZ8Neqqd1AFi The brief the isolated contract-review sub-agent was handed for record 7255121575, verbatim, for the seat to read before it adopts the record: BriefContract review brief — PR #38562 @
|
…equest reads the run's The first request judges on the object its root run was started on, and no door sets that from a variable. The rule now reads the start node's object where a flow declares one, and a record input's object only where it declares none; a record input beside a start object is no longer read as a root. A flow that declares neither is left to the first request, and the ADR-0162 note, the rule's header and hint, and the approvals guide say so. allNodes is no longer exported from metadata-core. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Contract-review-claim: session_01QsR2jSyQBDMyRnrrWKy7WS · head f6110c7 · 2026-11-29T12:15Z Delta review at |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Contract reviewServed-tier: Delta review, 2026-11-29T12:17Z. Record 7255121575 reviewed ① Derived judgmentsGate verdicts, read off the check-runs on this head: 73 runs, 63 success, 10 skipped, 0 failure, 0 pending. Every skipped name is in the base branch's roster ( What the delta changes in what is accepted and what is published, against
② Semver levelThe three changesets keep their level (patch) and their declaration lines, and the PR body's two lines agree with them. The metadata-core changeset no longer lists ③ Boundary flags
④ Design judgmentS1: closed. The fix is the first of the two forms 7255121575 offered, with the disclosure of the second for the fallback.
Nit A: closed ( What the delta leaves, none of it graded above a nit:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS 维护者速读
席位意见:建议合并。注记后半不是您的原话,是席位的提议,请随合并一并接受或划掉;其中两处和您当时看到的分析不同:插件自带的节点类型在线上发布入口也不算「会暂停」,只留给首次发起时拒绝;流程没有声明起始对象时,按它的记录型输入来判断,结论可能和首次发起时不一致。 席位核对 — ACCEPT · L1 · seat repo:objectstack#1, review thread R1 · Head-sha
|
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Tier H approval request · 2026-11-29T12:21Z This pull request carries one dated note on ADR-0162 ( |
Requested by Leehom · project thread
Part of #37766
Clause-②: yes (widening)
Metadata-protocol: none
Ruling-ref: 7253749311 (option D, 「D 统一校验,各入口都拒绝」)
维护者速读
os validate/os build/os lint时报错;设计器、REST/meta和 MCP 在正式保存、草稿转发布、恢复和整包发布时(草稿保存不拦)以INVALID_METADATA(422,入口已有的错误码)拒绝,并逐条说明缺什么(11 种语言)。validateApprovalClosedStates,放在共享的编写期规则表里),只有一份判定(移到@objectstack/metadata-core),开审批时的检查调用的是同一份代码,所以作者看到的和开审批时看到的是同一个结论;两份句子目录由测试逐条保持一致。What changes
One judge, moved.
packages/metadata-core/src/approval-opening.ts(new) holds the judge slice B put in the approvals plugin, unchanged in verdict, with two drivers over one walk (approvalFlowWalk):judgeApprovalOpeningawaits each flow it reads (the first request), andjudgeApprovalOpeningSyncjudges a stack in hand (the rule; a read that answers a promise counts as unreadable). The plugin'sapproval-opening-check.tsre-exports it under the names it exported before. metadata-core depends on spec only, asflow-cycle.ts("the ONE judge") does; plugin-approvals and lint already depend on metadata-core, so no dependency edge is added.One rule.
packages/lint/src/validate-approval-closed-states.ts(new), findingapproval-closed-state-gapat error, a member of the reference-integrity suite withruntimeTypes: ['flow', 'object']andsubjects: ['flows'], the shapevalidateReadonlyFlowWriteshas. Each flow of the stack is judged as an approval's root on the object its run can be started on, read off the definition as the first request reads it off the run: thestartnode'sobjectNamewhere the flow declares one, and only where it declares none, each record start input's object ([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); its callees are read from the same stack; a gap reached from several roots is reported once. Its developer sentence is the first request'sensentence for the gap, and its user sentence (validate-approval-closed-states.user-text.ts) is the first request's catalog sentence in all 11 platform locales.ADR-0162: one dated note under D5 and an Amended pointer on the status line, prepared for the maintainer's hand and worded by an at-tier pen (
CONTRACT_REVIEW_TIER). It quotes the ruling and the option's line verbatim, reads line 242 ("reported … early notice"), Execution item 7, the Points bullet at 432 ("is not made at publish") and the Alternatives entry on publish with the ruling, leaves each as written, and marks apart what the ruling record carried from the analysis and what the seat proposes.The approvals guide (
content/docs/automation/approvals.mdx, on o5-data's ask after the guide landed on the trunk at97f9f1f23): a subsection after the refused opening, "Refused where the approval is authored", naming the three commands, the publish door, what is left to the first request.Proposals for the points the ruling left open
validateApprovalClosedStates, findingapproval-closed-state-gap, refused at the door asINVALID_METADATA(422), the code every reference-integrity refusal already leaves under.@objectstack/metadata-core, besideflow-cycle.ts. Not in lint (plugin-approvals has lint as a devDependency only) and no new edge.unreadable_flowdropped; 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 owns a call to a flow the deployment does not hold); a node type the spec does not ship, which counts as one that does not pause (onlyFLOW_PAUSE_CAPABLE_NODE_TYPESare judged; the first request reads the engine's descriptors); the host'sjobservice (no_job_serviceis never raised).subjects: ['flows'], the runtime gate's subject pass), and the differential charges the write only with what it adds, so a gap the stored universe already holds is not charged to an unrelated object write.e5760397c).Dispositions from the ruling record
addAuthoringGateis not added).publishPackageDraftswith the closing object and the repaired flow as drafts of one package passes; the closing object alone is refused. The door's pending declarations already carry the batch; no protocol change.INVALID_METADATA(422), which the door already lists. The ledger row built for the old shape is not pushed.Readings
flows[0]). A gap that shows only across the written flow and a flow it calls, or one that calls it, is refused by the CLI over the whole stack and at the first request, not at that write.objectWriteFlowSubjects) and is judged as its draft at its own write. So declaringclosedStatesand repairing the flow in one publish passes, and declaring it without the repair is refused.startobject, no record input), started by an action or by name, is judged with no object for the run's record at authoring and on the run's record at the first request. A record input beside a declared start object is not read as the run's object (contract review S1, fixed atf6110c777).closedStatesreads nothing, at authoring and at the first request alike. No shipped object declares it, so the rule finds nothing over the shipped corpus.Metadata-protocol: none: the rule reads onlyclosedStates, which the trunk adds and no released version accepts, so nothing publishable today is refused. The ruling record's release rule: the release that first publishes the key carries this refusal.Face and tier
node scripts/pm/dispatch-gates.mjs --tierover the diff:docs/adr/**⇒ contract tier (CONTRACT_REVIEW_TIER), no one-line exit; the ADR note is Tier H and lands by the maintainer's hand.Clause-②: yes (widening): metadata-core and lint gain exports.packages/lint/**sits inside #35143's claim (seat 6);node scripts/pm/overlap-check.mjs --base=origin/claude/o5-data-approvals-trunkatc0021e910: clean against the trunk and the three open PRs that share a file (#38550, #38497, #38241).Verification
packages/metadata-core/src/approval-opening.test.ts(3): the two drivers agree; a promise in the sync driver is unreadable; the walk asks each callee once, with its caller.packages/lint/src/validate-approval-closed-states.test.ts(14): each field condition, the pause, another field, a subflow judged through its caller, a record start input, one report for many roots, a clean approval; what is not refused (an unheld callee, a plugin node type, the host, no declaration, an object not in the stack, another closing field); the user sentence inenandzh-Hans.packages/lint/src/runtime-gate.approval-closed-states.test.ts(8): throughrunRuntimeAuthoringRules, flow writes refused and let through, object writes refused and not charged for a stored gap, and a package publish's two halves (the object write without the redrafted flow, the flow at its own write).packages/plugins/plugin-approvals/src/approval-closed-states-sentences.test.ts(11): the rule's sentence equals the first request's for each of the 9 gap kinds, in each locale. Reverse-verified: one changed word in the lint catalog turns its locale red.packages/plugins/plugin-approvals/src/approval-closed-states-37766.integration.test.ts(6, real kernel): an active flow save refused (INVALID_METADATA, 422), a clean one saved, a draft saved and its promotion refused, a closing object save refused, the package publish passing with the repaired flow and refused without it.97f9f1f23(the guide and Approval status mirror: a write that does not land, a run that ends between two steps, and a decision whose run cannot resume must not leave a document closed on an unfinished approval (ADR-0162 item 8) #37767 piece 3) merged in at2a8d0a7d6; the approvals opening, closed-state and outcome-when-over files re-run green (105 tests).check:doc-anchors,check:doc-authoring,check:docs-transcript-drift: OK.tsc --noEmiton the three packages, eslint on the changed files,check:doc-anchors,check:test-source-alias,check:error-status-conformance,check-changeset-no-major,check-adr-0087-registration: OK.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi