Skip to content

feat(approvals): a decided request's step line says where the record's approval went next - #37148

Merged
objectstack-fleet[bot] merged 13 commits into
mainfrom
claude/project-thread-x90m5y
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 13 commits into
mainfrom
claude/project-thread-x90m5y

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #35863

repo:objectstack#3 · os-support-ai · session_01WGufzg3ayWUHg9nLoybejn

Clause-②: yes
Metadata-protocol: none

维护者速读

  • 审批人打开自己已经审过的审批单时,「审批进度」里在已决步骤下多出一行:审批已流转到哪一步并在等谁决定,或者整条审批已经结束、结果是什么。
  • 属于审批流程体验:解决审过的人看不到「后来怎么样了」的问题。
  • 出错时这一行不显示或说法不准,不影响审批本身,撤回这个改动即可恢复原样。
  • 无。

What changes

Served shape (@objectstack/spec/contracts, ApprovalRequestRow.flow_route). One optional member, outcome, served only beside ahead: 'decided':

  • step?: { id, label }: the run's latest request when it is a later one than this request (same flow_run_id, opened after it, on any node, a later round of the same node included; a pending one wins over a decided one). Absent when no later request was opened.
  • status: ApprovalStatus: that latest request's status, or this request's own when step is absent. pending with a step = the approval went on to that step and waits on its decision.
  • ended: boolean: the record's approval is known to have stopped: a root run, whose own flow body starts no child run (subflow / map), that has stopped for good. false = not known (rounds 1 to 3 below).

outcome is absent when nothing past the request is known (no later request in the run and the approval not known to have ended, or several later requests are pending at once), so nothing is guessed. A pending request's route never carries it.

Server (@objectstack/plugin-approvals). routeOutcome in approval-route.ts is the rule, a pure function over the run's own request rows (the same rows passedSteps already reads) and whether the run has ended. flowRoute calls it for decided rows only. ApprovalService.attachFlowRoute reads "ended" off the run itself through automation.getRun, judged by the dead-run sweep's own TERMINAL_RUN_STATUSES (derived from the total RUN_STATUS_LIVENESS map), in the new runHasEnded. An unreadable run reads as "not known to have ended", never as a failed read: the field is display-only like the rest of the route.

Docs. content/docs/automation/approvals.mdx gains the decided route's outcome, beside the existing flow_route example (the docs drift check named that page).

UI (@object-ui/app-shell, @object-ui/i18n, @object-ui/console). ApprovalStepLine takes an outcome prop and, with decided, draws one line under the decided step, outside the ordered list so assistive tech never counts it as a step: "Went on to STEP, waiting for a decision", "Went on to STEP: DECISION", "Went on to STEP, then ended: DECISION", or "The approval ended here". The approval request page's decision panel hands it the served outcome on a decided route only. Four new approvalsInbox rows in all eleven built-in locales. The console's ApprovalRequest type and app-shell's ApprovalRequestLite mirror the member.

Why this shape (card option 2, one outcome) and not option 1 (the steps after)

  • Option 1 needs a rejected step state: a widening of the state enum every step-line consumer switches on, and it still needs a separate marker for "ended".
  • The card asks the UI for one line under the decided step; one outcome is exactly that line's data.
  • Reading the run's latest request (rather than walking the graph) keeps the route's existing rule: history, never the graph, and nothing guessed.

Read first (by risk)

  1. routeOutcome in packages/plugins/plugin-approvals/src/approval-route.ts: which later row is "the latest", the parallel-pending refusal, and the ended-at-this-request arm.
  2. The outcome doc on flow_route in packages/spec/src/contracts/approval-service.ts: the contract text the L2 read judges.
  3. outcomeText in ui/packages/app-shell/src/views/approval-progress/ApprovalStepLine.tsx: which status draws which sentence, and when it draws nothing.

Two-minute verification

pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/flow-route.integration.test.ts: expect 14 passed, including "a request decided at step 1 of a two-step route: the outcome says step 2 is pending, then that the approval ended there".

Tests

  • approval-route.test.ts: a new routeOutcome describe (9 cases): later pending, ended at a later step (approved and rejected), ended at this request (approved, rejected, recalled, cancelled), not ended and nothing later (no outcome), a later round of the same node, pending wins over decided, parallel pending (no outcome), rows that are not later requests, and flowRoute carrying it on decided rows only.
  • flow-route.integration.test.ts (real ObjectQL over SQLite, real AutomationEngine and approval node): the existing decided pin now asserts outcome: { status: 'approved', ended: true } at the last step; new pins for the card's two cases (decided at step 1 of a two-step route shows step 2 pending, then rejected, ended once step 2 is rejected), a first-step rejection ending the approval, and a pending request carrying no outcome.
  • ApprovalDecisionPanel.stepLine-12491.test.tsx (the existing harness, a new top-level describe, 7 cases): each sentence, no line without an outcome or with nothing to say, no line on a pending route, and every locale pack carrying the four rows.

Acceptance notes

  • Size: 850 added / 18 removed lines over 24 files at 6080e34, under the 3,000-line human-merge threshold.
  • The line does not say who holds the later step. The card mentions it in passing; the approver names of a later step are information this request's reader was never served, so naming them is a read-access question, not a display one. Not filed: no defect, and the card's own ask (step N / ended approved / rejected / recalled) is met.
  • ended: true with status: 'approved' reports the last decision; a root run that failed after that approval also reads "ended". The run's own status is not served here; that would be a second widening for a rare case.
  • Claim file surface: the diff also touches ui/packages/i18n/src/locales/*.ts (the four rows the line needs), ui/apps/console/src/services/approvalsApi.ts (the console's type mirror of flow_route) and content/docs/automation/approvals.mdx (the page that documents flow_route).
  • The shape reported to the zone named { status, step? }; the landed shape adds ended, because "the approval ended" is a fact about the run, not about any one request's status.

Round 1 (L2 FAIL 7147867236, L1 REWORK 7147881964), head 99ab892

  • M1, a child run's end. The approval node now records on each new request whether its run is a root run or a child (subflow body, map item: the engine links those upward by $parentRunId), as __runRoot on the config snapshot (precedent __round; no schema change). attachFlowRoute asks the run for "ended" only when the snapshot says root; a child run's request, a request opened before the stamp, or an unreadable run is never served ended: true. New pin in flow-route.integration.test.ts: an approval inside a subflow whose child run completed while the root run went on to the general manager serves no outcome, and the root run's last request then served { status: 'approved', ended: true } (round 2 withdraws that: its flow hosts a subflow); a second pin removes the stamp from a decided last-step request and the outcome disappears. Ablations: root-run read forced true gives 2 failed / 9 passed; executor stamp forced true gives 1 failed / 10 passed; both restored.
  • S1, audience. The outcome contract doc and the attachFlowRoute docblock state the disclosure: every reader of the request gets the later step's node id and label and that request's status, never its id, approvers, comments or field values, within the request-visibility bound of ruling record 5299823744 as the seat ruled for this card.
  • S2, an unreadable run (option a). ended is now defined as "known to have stopped" (false = not known, including an unreadable run), and the contract, the changeset and approvals.mdx say an outcome with a later request is served even when the run cannot be read. N1: the contract says status is the last decision only when it is not pending.
  • Checks: @objectstack/plugin-approvals full suite Test Files 128 passed (128), Tests 1934 passed (1934); plugin-approvals and spec typecheck exit 0; spec rebuilt and check:generated all 14 up to date; overlap-check clean against main and the open PR heads, fix(plugin-approvals): the batch lock read answers a line of a held master as locked #37145 included. CI at 99ab892: 70 check-runs, 61 success, 9 skipped, 0 failed, every required context green; mergeable clean. The local re-run of the derived gate list at this head stopped at 9 of 121 (all exit 0) when the container restarted; CI ran the families.

Round 2 (L2 FAIL 7150840780, L1 REWORK 7150863825), head e264c10

  • M2, a later step in a child run. Chosen: the second of the two named ways. "Ended" is never claimed for a run whose flow can start a child run; child runs' rows are not read. flowHostsChildRuns (approval-route.ts) says whether the flow holds a subflow or map node anywhere, regions included (loop body, parallel branch, try_catch, every graph collectFlowGraphs walks), and attachFlowRoute asks the run for "ended" only when it does not. Two choices inside it, stated so they can be judged:
    • It is read off the flow definition (the same body the route's steps are read off), not off the run's step log: the persisted step log is compacted to a bounded number of steps, so "the run never ran a child-run node" cannot be proven from it, while "the flow has none" can. The cost is that a flow with a subflow on a branch the run never took also never says "ended"; the line is then left out, never wrong.
    • It covers the case with a step too, not only "ended with no later step": with manager → general manager → subflow legal → end, the manager's outcome would otherwise read { step: gm, status: 'approved', ended: true } and name the general manager's decision as the last one while legal came after. With this rule it reads { step: gm, status: 'approved', ended: false }, which is true.
    • Not chosen, reading child runs' rows: a request does not record its root run id (only __runRoot, a yes/no), the engine serves no "children of a run" read, and walking $parentRunId chains from the read side would need a new engine member, outside the claimed surface.
  • Served shape for the review's setup (manager in the root run, then a subflow holding legal, then the end; legal rejects, the root run completes): the manager's request is served flow_route: { steps: [manager done], ahead: 'decided' } with no outcome. Pinned exactly in flow-route.integration.test.ts ("a later step in a child run: the root run's end is not served as "ended here" for the request before it"). The round-1 hosted pin now asserts that the root run's own last request also gets no outcome, its flow hosting a subflow.
  • Contract, changeset and approvals.mdx: "known to have stopped" now names "runs a flow that can start a child run" among the false cases, and step says a request a child run opened is not among the run's requests.
  • N4: the attachFlowRoute docblock reads "as the seat ruled on PR feat(approvals): a decided request's step line says where the record's approval went next #37148".
  • Unit: a flowHostsChildRuns describe (3 cases): subflow and map at the top level; inside a loop body, a parallel branch, a try_catch catch, and nested two deep; none anywhere (approvals, gateways, a loop of approvals, an empty flow).
  • Ablations (through scripts/ablation-replace.mjs, restored to blob == HEAD each time): the gate in attachFlowRoute forced off gives Tests 2 failed / 10 passed (the new pin and the hosted pin); map removed from the child-run node types gives 2 failed / 26 passed; the region walk replaced by the top-level nodes gives 1 failed / 27 passed.
  • Checks: targeted approval-route.test.ts + flow-route.integration.test.ts Test Files 2 passed (2), Tests 40 passed (40); @objectstack/plugin-approvals full suite Test Files 128 passed (128), Tests 1938 passed (1938); plugin-approvals and spec typecheck exit 0; spec rebuilt and check:generated all 14 up to date; overlap-check clean against origin/main and PR heads fix(app-shell,console): the shell package list, AI chat lists and studio-design reads and writes send the stored bearer token #37185, feat(ai): ai_context context packs and the get_record_context tool over MCP (ADR-0160 row 5) #37173, feat(studio): remove the Studio home; /studio opens the last package or Setup > Packages #37166. CI at e264c10: 70 check-runs, 61 success, 9 skipped, 0 failed, every required context green; mergeable clean.

Round 3 (L2 PASS with S3 7151818256, L1 REWORK 7151830517), head 6080e34

  • S3, which flow body is judged. Chosen: refuse "ended" unless the run provably ran the body armed now; no new engine member. ranArmedBody (approval-service.ts) holds when the armed body is the flow's newest registration in the engine's version history (getFlowVersionHistory, compared as the very object) and was registered strictly before the run started (the run log's startedAt, which a resume carries over unchanged). A run starts on the body armed at its start and resumes pinned to it, so with nothing registered since, that body is the one it ran. runHasEnded now requires it beside the terminal status.
    • Not the run's flowVersion: it is the author's number and an edit need not change it (the edit pin re-registers under the same version).
    • Not judging the run's own version out of the history: the history is the engine's in-memory list since boot and a version number can repeat, so it can name the wrong body; the run log carries no body checksum to match.
    • getFlowVersionHistory and startedAt are declared on the plugin's automation surface as members AutomationEngine already implements and returns publicly, the existing precedent for that interface.
    • Cost, stated: a flow registered again after a run started (an edit, a rollback, the re-registration every restart makes) leaves that run's requests without "ended", so after a restart older decided requests drop the line until a new run. Omitted, never wrong.
  • Pins (flow-route.integration.test.ts): a run that started a subflow (legal rejects, the root completes), then its flow re-registered under the same version without the subflow: the manager's request still serves no outcome; a run started on the edited body then ends at the manager, { status: 'approved', ended: true }. A rollback: version 2 (with the subflow) runs, rollbackFlow re-arms version 1 (without): no outcome.
  • Wording: the contract, the changeset and approvals.mdx now say "the flow body the run ran" and when that body is known, and list "ran a body that is not known (its flow was registered again since it started)" among the false cases.
  • N5: the CHILD_RUN_NODE_TYPES docblock names the only two executors that set $parentRunId (builtin/subflow-node.ts, builtin/map-node.ts), says loop, parallel and try_catch stay in-run, and that a new child-run starter joins the set in the same change. A pin would have to read service-automation sources from this package's tests, which the cross-package test-input gate refuses, so it is a comment.
  • Left, with reasons. N2 (later is measured against created_at, not the decision): a run opens its requests one after another, so the order they were opened in is the order the approval moved in; the only same-run overlap is parallel branches, which routeOutcome already refuses to pick from. No reachable wrong case, so no change and no card needed in my view. N3, fixed after all: both UI mirrors now type outcome.status as the row's own status (ApprovalRequestRow['status'] in the console, ApprovalRequestLite['status'] in app-shell), the open union each already uses, rather than a bare string.
  • Ablations (through scripts/ablation-replace.mjs, restored to blob == HEAD each time): ranArmedBody dropped from runHasEnded gives Tests 1 failed / 12 passed (the edit pin); the time test forced true gives 1 failed / 12 passed (the edit pin); the identity test dropped gives 1 failed / 13 passed (the rollback pin).
  • Checks: targeted approval-route.test.ts + flow-route.integration.test.ts Tests 42 passed; @objectstack/plugin-approvals full suite Test Files 128 passed (128), Tests 1940 passed (1940) at bfff5d1 (6080e34 adds only the two UI type lines); ApprovalDecisionPanel.stepLine-12491.test.tsx Tests 20 passed (20) at 6080e34; plugin-approvals and spec typecheck exit 0; spec rebuilt and check:generated all 14 up to date; overlap-check clean against origin/main and the open PR heads before each push. Three pushes this round, not one: 30ec243 (S3), bfff5d1 (the rollback pin, once the identity ablation showed that branch unpinned), 6080e34 (N3); CI on the first two was cancelled by the next push. CI at 6080e34: 70 check-runs, 61 success, 9 skipped, 0 failed, every required context green; merges cleanly with main.

Verification

Targeted tests (code at 19f57ef; later commits touch only the changeset, the docs page and one test import)
  • pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/approval-route.test.ts src/flow-route.integration.test.ts: VERDICT command-exit 0, Test Files 2 passed (2), Tests 34 passed (34).
  • pnpm --dir ui exec vitest run packages/app-shell/src/views/approval-decision/ApprovalDecisionPanel.stepLine-12491.test.tsx packages/app-shell/src/views/RecordApprovalsPanel.stepProgressVertical.test.tsx packages/app-shell/src/views/RecordApprovalsPanel.servedRoute-26668.test.tsx: VERDICT command-exit 0, Test Files 3 passed (3), Tests 29 passed (29).
  • pnpm --filter @objectstack/plugin-approvals typecheck && pnpm --filter @objectstack/spec typecheck: VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date (spec dist built after the contract edit).
Ablations (each through scripts/ablation-replace.mjs, mutation proven on disk, restored, tree clean after)
  • flowRoute outcome replaced by undefined: Tests 4 failed / 30 passed (the flowRoute unit case and the three integration outcome pins).
  • runHasEnded forced false: Tests 3 failed / 6 passed in the integration file (every ended: true pin).
  • The decision panel's outcome hand-off deleted: Tests 4 failed / 16 passed (every drawn-line case).

All three suites import source, not dist/, so no rebuild leg applies.

Local gates (dispatch-gates, derived at 19f57ef and again at 1f6480a)

Derived by node scripts/pm/dispatch-gates.mjs --commands (120 families once the docs page joined the diff); --ran reconciliation: 120 of 120 accounted for. 117 exit 0. Exit 3 (prerequisite not met in this container, nothing measured; CI ran them green):

  • node scripts/check-plugin-teardown-shape.mjs --self-test: exit 3 (shallow clone cannot reach the pinned positive control)
  • pnpm check:dual-build-cjs-loads: exit 3 (reads built output of the whole workspace)
  • pnpm check:i18n: exit 3 (needs its package build closure; nothing compared)

Exit 0:

  • node scripts/check-adr-0087-registration.mjs --base origin/main
  • node scripts/check-adr-0087-registration.mjs --self-test
  • node scripts/check-changeset-no-major.mjs --base origin/main
  • node scripts/check-closing-keyword-parity.mjs
  • node scripts/check-closing-keyword-parity.mjs --self-test
  • node scripts/check-comment-mask-adoption.mjs
  • node scripts/check-comment-mask-adoption.mjs --self-test
  • node scripts/check-comment-mask-corpus.mjs
  • node scripts/check-dev-prereqs.mjs --self-test
  • node scripts/check-dts-emitted.mjs --self-test
  • node scripts/check-empty-changeset.mjs --base origin/main
  • node scripts/check-empty-changeset.mjs --self-test
  • node scripts/check-issue-citations.mjs
  • node scripts/check-plugin-teardown-shape.mjs
  • node scripts/check-sdui-manifest.mjs
  • node scripts/check-sdui-manifest.mjs --self-test
  • node scripts/check-tenant-audit-census.mjs
  • node scripts/check-tenant-audit-census.mjs --self-test
  • node scripts/ci/assert-turbo-remote-cache.mjs --self-test
  • node scripts/ci/plan-test-core-shards.mjs --self-test
  • node scripts/ci/prune-turbo-cache.mjs --self-test
  • node scripts/ci/snapshot-next.mjs --self-test
  • node scripts/docs-audit/check-affected-docs.mjs
  • node scripts/docs-audit/check-drift-comment.mjs
  • node scripts/pm/check-governed-queue-guard.mjs --self-test
  • node scripts/pm/release-rehearsal-clone.mjs --self-test
  • node scripts/release-pending-publish.mjs --self-test
  • pnpm --dir ui exec vitest run scripts/
  • pnpm --filter @objectstack/lint run check:doc-formula-expressions
  • pnpm --filter @objectstack/spec run check:api-surface
  • pnpm --filter @objectstack/spec run check:authorable-surface
  • pnpm --filter @objectstack/spec run check:browser-reachable-entries
  • pnpm --filter @objectstack/spec run check:docs
  • pnpm --filter @objectstack/spec run check:dual-source-exports
  • pnpm --filter @objectstack/spec run check:duration-unit-keys
  • pnpm --filter @objectstack/spec run check:empty-state
  • pnpm --filter @objectstack/spec run check:entry-nameability
  • pnpm --filter @objectstack/spec run check:error-code-provenance
  • pnpm --filter @objectstack/spec run check:export-origins
  • pnpm --filter @objectstack/spec run check:exported-any
  • pnpm --filter @objectstack/spec run check:liveness
  • pnpm --filter @objectstack/spec run check:llms-txt
  • pnpm --filter @objectstack/spec run check:skill-refs
  • pnpm --filter @objectstack/spec run check:strictness-ledger
  • pnpm --filter @objectstack/spec run check:variant-docs
  • pnpm --filter @objectstack/spec run check:yaml-examples
  • pnpm check:adr-anchors
  • pnpm check:adr-symbol-anchors
  • pnpm check:changeset-gate-self-tests
  • pnpm check:ci-filter-parity
  • pnpm check:cli-command-ids
  • pnpm check:closed-ceremony-text
  • pnpm check:cross-package-test-inputs
  • pnpm check:dispatcher-error-vocabulary
  • pnpm check:doc-authoring
  • pnpm check:driver-memory-census
  • pnpm check:dts-closure
  • pnpm check:engine-double-contract
  • pnpm check:error-status-conformance
  • pnpm check:gitlink-declared
  • pnpm check:i18n-stale-fill
  • pnpm check:issue-citations
  • pnpm check:keyed-text-bounds
  • pnpm check:lean-entry-closure
  • pnpm check:logger-receiver-detach
  • pnpm check:merge-driver
  • pnpm check:nul-bytes
  • pnpm check:object-def-param-keys
  • pnpm check:objectql-double-limit
  • pnpm check:optional-error-sink
  • pnpm check:org-identifier
  • pnpm check:page-declaration-shape
  • pnpm check:platform-object-tenancy-census
  • pnpm check:pm-expected-skips
  • pnpm check:pm-prior-rulings
  • pnpm check:published-files
  • pnpm check:query-options-erasure
  • pnpm check:refd-timer-probe
  • pnpm check:registry-log-declared
  • pnpm check:rest-log-spy-declared
  • pnpm check:role-word
  • pnpm check:settings-bind-window
  • pnpm check:skill-identifier-liveness
  • pnpm check:slot-lookup
  • pnpm check:sourcemap-no-sources-content
  • pnpm check:spec-docblock-symbol-anchors
  • pnpm check:spec-parsed-alias
  • pnpm check:system-context-census
  • pnpm check:test-source-alias
  • pnpm check:tier-file-adoption
  • pnpm check:type-check-coverage
  • pnpm check:type-check-debt
  • pnpm check:undeclared-dep-imports
  • pnpm check:vouch-for-reference-callers
  • pnpm check:watch-hint-literal
  • pnpm check:where-matcher
  • node scripts/check-adr-links.mjs
  • node scripts/check-adr-links.mjs --self-test
  • node scripts/check-doc-route-spelling.mjs --advisory
  • node scripts/check-doc-route-spelling.mjs --self-test
  • node scripts/check-docs-section-name.mjs
  • node scripts/check-docs-section-name.mjs --self-test
  • node scripts/check-section-landing-index.mjs
  • node scripts/check-section-landing-index.mjs --self-test
  • pnpm --filter @objectstack/lint run check:doc-security-posture
  • pnpm --filter @objectstack/spec run check:skill-examples
  • pnpm check:corpus-claim-drift
  • pnpm check:doc-anchors
  • pnpm check:doc-frontmatter
  • pnpm check:docs-audit-scope
  • pnpm check:docs-redirects
  • pnpm check:docs-single-h1
  • pnpm check:docs-spec-enumerations
  • pnpm check:docs-transcript-drift
  • pnpm check:published-readme-links
  • pnpm check:react-page-adapter-contract
  • pnpm check:vendor-version-stamps
  • After the docs page and the test import landed: pnpm check:test-source-alias exit 0 at 1f6480a (CI had flagged the decision panel harness reaching the lazy @object-ui/plugin-detail load without a module-top import; the harness now imports it at collection); the edited harness file re-run, Test Files 1 passed (1), Tests 20 passed (20).

CI at head 1f6480a: 61 success, 9 skipped, 0 failed of 70 check-runs; every required context green (Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate) and Check Changeset green. Mergeable: clean.

NOT MEASURED locally: Type Check UI (@object-ui/app-shell type-check needs the UI package closure built; the local run stopped on missing-module errors only, none in a touched line). CI's Type Check UI is the reading.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGufzg3ayWUHg9nLoybejn

@github-actions github-actions Bot added size/m 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 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/actions-as-tools.mdx (via /api/v1/automation/:name/runs (route, bridged from symbol getRun — its route source's handler names it), /automation/:name/runs/:runId (route, the route ledger binds it to client method automation.getRun))
  • content/docs/automation/approvals.mdx (via ApprovalService (symbol, a top-level class), flow_route (symbol, a field of interface ApprovalRequestRow), /api/v1/automation/:name/runs (route, bridged from symbol getRun — its route source's handler names it), /automation/:name/runs/:runId (route, the route ledger binds it to client method automation.getRun))
  • content/docs/automation/flows.mdx (via ApprovalService (symbol, a top-level class), getRun (symbol, a method of interface ApprovalResumeSurface), /api/v1/automation/:name/runs (route, bridged from symbol getRun — its route source's handler names it), /automation/:name/runs/:runId (route, the route ledger binds it to client method automation.getRun))

⛔ 6 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via getRun (symbol, a method of interface ApprovalResumeSurface))
  • content/docs/releases/v17/17-1.mdx (via /api/v1/automation/:name/runs (route, bridged from symbol getRun — its route source's handler names it), /automation/:name/runs/:runId (route, the route ledger binds it to client method automation.getRun))
  • content/docs/releases/v17/17-6.mdx (via ApprovalService (symbol, a top-level class), /api/v1/automation/:name/runs (route, bridged from symbol getRun — its route source's handler names it), /automation/:name/runs/:runId (route, the route ledger binds it to client method automation.getRun))
  • content/docs/releases/v17/17-7.mdx (via /api/v1/automation/:name/runs (route, bridged from symbol getRun — its route source's handler names it), /automation/:name/runs/:runId (route, the route ledger binds it to client method automation.getRun))
  • content/docs/releases/v18/18-1.mdx (via ApprovalService (symbol, a top-level class))
  • content/docs/releases/v18/18-2.mdx (via /api/v1/automation/:name/runs (route, bridged from symbol getRun — its route source's handler names it))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 124 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 — 175 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 bc3ec37a669f1b80c393e31393caea49fb4f7b09 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 65d235af8fa086d83ecb38146f7df91856f71f1b — the merge of head ee6bb2fbc12512d2426b9007a51d58a6d7c01158 into base bc3ec37a669f1b80c393e31393caea49fb4f7b09, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main 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 65d235af8fa086d83ecb38146f7df91856f71f1b && git checkout 65d235af8fa086d83ecb38146f7df91856f71f1b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bc3ec37a669f1b80c393e31393caea49fb4f7b09 ee6bb2fbc12512d2426b9007a51d58a6d7c01158 && git checkout -B drift-repro bc3ec37a669f1b80c393e31393caea49fb4f7b09 && git merge --no-ff ee6bb2fbc12512d2426b9007a51d58a6d7c01158

node scripts/docs-audit/affected-docs.mjs --json bc3ec37a669f1b80c393e31393caea49fb4f7b09

⚠️ 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 bc3ec37a669f1b80c393e31393caea49fb4f7b09 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

Contract-review-claim: session_01WGufzgv2LZN1W2qSYTZvYs · head 1f6480a · 2026-11-24T23:45Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 1f6480a2c9053de0ea8c75d7ffdeb2797b2897b4
Local-runs: none
Scope: packages/spec/src/contracts/approval-service.ts + packages/plugins/plugin-approvals/src/approval-route.ts, packages/plugins/plugin-approvals/src/approval-service.ts, ui/apps/console/src/services/approvalsApi.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts
Security-touching: yes

Inputs read: card #35863 (body and all four comments: triage 7042462136, unblock 7042569075, claim 7146092596, dev report 7147715077; no ruling and no earlier record on the card), PR #37148 body and file list, the net diff 517e4153..1f6480a2 (23 files), and the 74 check-runs on the head. The four implementing files were each confirmed against the diff: approval-route.ts holds the rule (routeOutcome, flowRoute), approval-service.ts reads the run state (attachFlowRoute, runHasEnded), and the two UI files are type mirrors of the served member. ApprovalStepLine.tsx and ApprovalDecisionPanel.tsx render the member and were read to judge the contract's first consumer; they, the tests, the changeset prose, the docs page and the locale bundles are the lane seat's accept.

① Derived judgments

  • Public surface: one optional member, outcome, on the exported contract type ApprovalRequestRow['flow_route'] in @objectstack/spec/contracts. Type-only, response-side, additive; no new export, no zod schema, no authorable key, no accept-set change. Right. Lint & Repo Gates (which carries check:api-surface, check:authorable-surface, check:export-origins), Spec property liveness and TypeScript Type Check all concluded success on the head.
  • routeOutcome and the fifth flowRoute parameter (runEnded = false) are module exports of approval-route.ts only; packages/plugins/plugin-approvals/src/index.ts re-exports nothing from that module, so the package's public surface does not move. Right.
  • Served wire shape: GET /api/v1/approvals/requests/ID (and the write echoes that share loadRequest) gain flow_route.outcome on decided rows. List reads are untouched: attachFlowSteps stays single-read enrichment. Right.
  • Check-runs on the head: 74, none failed and none pending; every conclusion is success or skipped. Check Changeset, Governed Surface Queue Guard, Test Core, Test UI, Type Check UI, Build Core, Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Flag docs affected by code changes and Check Documentation Links are success. The skipped ones are opt-in or queue-only jobs (upgrade harness, packed-tarball smoke, queue verdicts, temporal conformance, dogfood matrix and CLI, UI published artifacts, the schedule gate, and the superseded duplicate Auto Label and Check PR Size runs).

② Semver level

.changeset/35863-decided-route-outcome.md moves @objectstack/spec, @objectstack/plugin-approvals, @object-ui/app-shell, @object-ui/i18n and @object-ui/console, each at patch. The diff publishes from exactly those five packages. Metadata-protocol: none is right: nothing a metadata author can write changes. Under the AGENTS.md rule (the level follows the protocol kind alone; none takes patch; a non-protocol widening ships patch), patch is the right level for an additive optional member on a served contract type. Check Changeset concluded success.

Clause-②: yes — declared identically in the PR body and the changeset body; the change is an additive widening of a published contract type, no (narrowing) arm applies and none is claimed. Agreed.

③ Boundary flags

  • Dev report open_questions: empty. Nothing to answer.
  • Dev report security_findings: none: not agreed. The new member serves facts taken from a request the reader may be unable to read; see S1 below. This is the reason for Security-touching: yes.
  • Dev out-of-scope note 1 (the line does not name who holds the later step): agreed, and it is the right call. Approver names of a later request are request content; leaving them out keeps the disclosure to node, label, status and run end.
  • Dev out-of-scope note 2 (a run that fails after an approval reads ended with status: 'approved'): accepted as described; the contract says status is the last decision, which stays true. It does not cover the child-run case in M1, which is a different defect.
  • Claim widening (i18n bundles, console type mirror, docs page): recorded on the claim by the seat's edit; nothing for this review beyond the two type mirrors, which are in Scope.
  • Escalated to the seat and maintainer: whether a participant of an earlier request may learn the status of a later request of the same run that they cannot read. The live tree cites ruling 5299823744 on 【能力需求】plugin-approvals 审批请求可见性:对业务记录有读权者应可只读查看审批动态(或提供可见性 hook) #8652 ("request content stays behind approvalsVisibleToReaders", getRecordLock docblock). That ruling's text is not among this review's inputs, so this record does not decide the question; it records that the PR decided it silently. The precedent in the same field is passedSteps (plugin-approvals: ApprovalService.attachFlowSteps serves the flow's main trunk as a request's flow_steps, so a request routed off the trunk gets a step list without its own step #26668), which already serves "this earlier node was approved" from rows read as the system.
  • SQL push-down (Prime Directive 5): no finding. outcome adds no read of sys_approval_request: it reuses the one run-scoped find the route already makes (where: { flow_run_id }, five fields, limit: 1000), and picks the latest row in memory from that bounded set. No new id materialisation, no in-app join. The only new I/O is one automation.getRun per single read, on decided rows only; no N+1, since list reads never reach attachFlowRoute.

④ Design judgment

packages/spec/src/contracts/approval-service.ts (hits). The member's shape matches the card's option 2 and the claim's stated shape, plus ended, whose addition the PR explains and which the contract documents. The sentences on step, status, the pending-first rule, the later-round rule and the three absence cases agree with routeOutcome and runHasEnded line for line, with the exceptions below. Break attempts that held: several later requests (latest by created_at, pending first; two or more pending gives no outcome); a run that ended with no later request (status is this request's own, ended: true); an unreadable run (getRun absent, null or throwing reads as not ended, so no outcome without a later row); a request sent back and waiting on a resubmit (no later row, run live, no outcome); a later round of the same node (counted, as documented); cost per route (one getRun, no extra query).

M1 (must-fix) — ended is read off the request's own flow_run_id, and a child run's end is served as the end of the record's approval. An approval node takes its run id from $runId (approval-node.ts:173-192), and a subflow or map body runs as its own child run with its own id, linked upward only by $parentRunId (subflow-node.ts:103-110, map-node.ts:250); approval-service.ts already treats this as a supported shape (the subflow-parent strand handling around takeSubflowParentStrand). For a request hosted in such a child run, the child run completes as soon as its last approval is decided, so runHasEnded answers true and the route serves outcome: { status: 'approved', ended: true } while the parent run goes on, possibly to further approval requests on the same record under the parent's run id (rows routeOutcome never sees, because it reads one flow_run_id). The contract sentence "ended — the run has stopped and will never resume, so status is the last decision the record's approval took" is then false, and the first consumer draws "The approval ended here" for an approval that has not ended. This breaks the member's own rule ("read off the request's flow run and never guessed") and the route's existing treatment of the same node types on the forward walk, where stepsAhead stops at subflow / map / loop with ahead: 'undecided' rather than claim an end. Fix direction: a run that has a parent is not "ended" for this purpose (serve no ended: true, hence no outcome when there is no later row), or the contract narrows ended to the request's own run and the UI stops calling that the approval's end; either way with a pin for an approval inside a subflow. Read from source, not run.

S1 (should-fix) — the new member crosses the request-visibility boundary and neither the contract nor the service says so. visibleRequestIds admits a reader to a request as its submitter, a current approver or someone who acted on it; a step-1 approver is therefore a reader of the step-1 request and, with the record-reader tier off, not of the step-2 request. attachFlowRoute reads the run's rows under SYSTEM_CTX, and its docblock justifies that with "the route names steps and their labels, which flow_steps already served to the same reader". After this change the same system read also serves the later request's status (pending, approved, rejected, returned, recalled, cancelled) and whether the run ended, which flow_steps never served: the stated justification no longer covers what the read serves. What is disclosed is narrow (node id, label, status, run end; no request id, no approvers, no comments, no payload) and the card asks for exactly this, so this is graded should-fix rather than a refusal: the outcome docblock in the contract must state its audience (every reader of this request, whether or not they can read the later request) and what it deliberately leaves out, and the attachFlowRoute docblock must state the new disclosure and its reason in place of the labels-only sentence. Whether the disclosure itself is permitted under the #8652 ruling is escalated in ③.

Nits (no effect on the verdict):

  • N1 — ended: true beside status: 'pending' is reachable: a later request still pending on a run that has already turned terminal, in the window before releaseDeadRunRequests recalls it. The contract's "so status is the last decision" does not hold for that pair, and the UI then says "waiting for a decision". The sentence could say "when status is not pending".
  • N2 — "later" is created_at after this request's created_at, not after its decision. A sibling request of the same run opened while this one was still pending would read as "went on to". The parallel node refuses a durable pause inside a branch, so no reachable case was found; noted only because the contract's parallel carve-out counts pending later rows and a single one passes it.
  • N3 — the two UI mirrors type outcome.status as string where the contract says ApprovalStatus. Consistent with how both files already type the row's own status (a union widened by string); accepted deviation.

packages/plugins/plugin-approvals/src/approval-route.ts. routeOutcome agrees with the contract sentence by sentence apart from M1's premise, which it inherits through runEnded: later rows are same-run rows other than this one with a later created_at; more than one pending returns undefined; one pending wins; otherwise the latest; with no later row it returns this request's own status only when the run ended. flowRoute attaches it on non-pending rows only, so a pending route never carries it, as the contract says. The row filter does not check flow_run_id itself and relies on the caller's run-scoped read, as passedSteps does and documents.

packages/plugins/plugin-approvals/src/approval-service.ts. runHasEnded uses the dead-run sweep's TERMINAL_RUN_STATUSES, derived from the total RUN_STATUS_LIVENESS map, and degrades every unreadable case to false, which matches the contract's "the run's state cannot be read" absence arm. It is asked only for decided rows. Its defect is M1 (it cannot tell a child run from a root run); its docblock gap is S1.

ui/apps/console/src/services/approvalsApi.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts. Both mirror the member's three fields and optionality exactly; the useRecordApprovals comment restates the contract correctly. Only N3 applies. Both inherit whatever M1's fix changes in the meaning of ended.

Open on this head: M1 (must-fix), S1 (should-fix).

Implemented-by: claude/project-thread-x90m5y
Reviewed-by: session_01WGufzgv2LZN1W2qSYTZvYs

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

席位核对 — REWORK · repo:objectstack#3 · head 1f6480a · 2026-11-24T23:51Z

L1: REWORK (L1-w, zone wf-B)
Head-sha: 1f6480a2c9053de0ea8c75d7ffdeb2797b2897b4

The L2 at CONTRACT_REVIEW_TIER on this head is FAIL, comment 7147867236. Its M1 (must-fix) and S1 (should-fix) are adopted here as they stand, and the fix round answers them there. I checked M1 against the tree: an approval node takes $runId (approval-node.ts), and subflow starts a child run linked upward only by $parentRunId (service-automation/src/builtin/subflow-node.ts). So runHasEnded(row.flow_run_id) reads the child run's end as the end of the record's approval. One L1 finding of my own follows.

Should-fix (L1)

S2. Three texts say outcome is absent when the run cannot be read, but the code serves it. The spec docblock ("Absent when … the run's state cannot be read"), the changeset ("outcome is absent when … the run cannot be read") and content/docs/automation/approvals.mdx ("outcome is left out when … a run that cannot be read") all list an unreadable run as its own reason for absence. runHasEnded answers false for no getRun, no run, or a throw, and routeOutcome still returns { step, status, ended: false } whenever a later request row exists. Example: step 2 rejected and the run in fact ended, but getRun throws. The route serves ended: false, and the line reads "Went on to Finance: Rejected" instead of "…, then ended: Rejected". That false is a guess, against the member's own "never guessed". The plugin docblock does say "A run that cannot be read is not ended: the outcome then rests on the rows alone", so code and plugin doc agree, and the published texts are the ones that are wrong.

  • Fix, either way: (a) make the three texts say an unreadable run is absent only when no later request was opened, and define ended: false as "not known to have stopped"; or (b) serve no outcome when the run cannot be read. Choose together with M1's fix, which also changes what ended means.

Read and found right (head 1f6480a)

  • l1-face.mjs --pr 37148: 13 items clean. Draft, base main, Fixes #35863 binds only this card, Clause-②: yes / Metadata-protocol: none match claim 7146092596 as amended. The changeset names all five published packages moved: spec, plugin-approvals, app-shell, i18n, console. patch is right for Metadata-protocol: none (AGENTS.md: a non-protocol widening ships patch). All checks are green and nothing is pending. mergeable_state clean.
  • Scope. All 23 files sit inside the amended claim surface. The import '@object-ui/plugin-detail' added to the existing step-line test is a declared dependency of @object-ui/app-shell (it warms a lazy import before the clocked cases) and inside the claim's app-shell pins.
  • Fixes is right, once the findings close. The card's two pins are present. Step 1 decided with step 2 pending is shown in the integration test and the panel test. The last step decided reading "ended" is shown too. The card's "and who holds it now" is left out on purpose (the PR's acceptance notes). The card's own option 2 ("a single outcome") does not ask for it either.
  • Reads. The outcome reuses the route's existing run-scoped find and adds one getRun, only for decided rows and only on the single-request read (attachFlowSteps: "list reads skip it"). There is no per-row fan-out.
  • UI. One line below the ol, outside the list, so assistive tech does not count it as a step. It is drawn only with decided and never on a pending route (pinned). The four new approvalsInbox rows are in all 11 locale packs, zh-Hans and en included, and a pin covers every pack. The keys do not collide with the existing outcomeApprove / outcomeReject.
  • Tests. The two ablation runs fail exactly the new pins: flowRoute outcome forced off gives 4 failed, and runHasEnded forced false gives 3 failed. The decision panel hand-off removed gives 4 failed. Each was restored.

Path to ACCEPT

The card thread fixes L2 M1 (with a pin for an approval inside a subflow), L2 S1 (docblocks state the disclosure) and S2 above, then sends the new head. I post a new Contract-review-claim, the L2 reviewer reads the delta, and I read the L1 delta on the same head. The question L2 escalated, whether an earlier participant may learn a later request's status at all under the #8652 ruling, goes to the seat. Precedent: passedSteps (#26668) already serves an earlier step's state from the same system read.

…ord's approval; the outcome states its audience

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg3ayWUHg9nLoybejn
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

Contract-review-claim: session_01WGufzgv2LZN1W2qSYTZvYs · head 99ab892 · 2026-11-25T02:27Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 99ab892be2124f2684739442beead6ade367e638
Local-runs: none
Scope: packages/spec/src/contracts/approval-service.ts + packages/plugins/plugin-approvals/src/approval-route.ts, packages/plugins/plugin-approvals/src/approval-service.ts, packages/plugins/plugin-approvals/src/approval-node.ts, ui/apps/console/src/services/approvalsApi.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts
Security-touching: yes

Delta review of the round-0 record on head 1f6480a2 (PR comment 7147867236, FAIL: M1, S1, nits N1 to N3). Inputs read: card #35863 (body and its four comments; no comment was added since round 0), PR #37148 body including its "Round 1" section, the PR thread (round-0 record 7147867236, L1 REWORK 7147881964 with its S2, the claim on this head 7150762333), the delta 1f6480a2..99ab892b (8 files), the net diff 517e4153..99ab892b (24 files) and the 74 check-runs on this head. approval-node.ts joined the diff and implements the contract (it records which runs are root runs, the fact ended now rests on), so it joins Scope.

① Derived judgments

  • Public surface is unchanged from round 0: one optional, type-only member outcome on ApprovalRequestRow['flow_route']; this round changes its docblock only. No new export, no zod schema, no authorable key. Right.
  • openNodeRequest gains an optional input member runRoot. It is a method of the plugin's service class, not of IApprovalService in the contract file, and its one production caller is the approval node executor. Additive. Right.
  • Stored shape: a new private key __runRoot (boolean) inside sys_approval_request.node_config_json, written only when the caller passes a boolean. No column, no schema change, no migration; it sits beside the existing private keys of the same snapshot (__round, __flowLabel, __nodeLabel, __approverGroups, __resolvedFrom, __decisionOutputs). The snapshot is read back with parseJson only, never through ApprovalNodeConfigSchema, so the key is not validated and cannot be refused; every later rewrite of the snapshot spreads the stored object, so the key survives decisions and reassignments. It is not served on the approvals door (rowFromRequest projects round alone from the snapshot). It is visible where the raw node_config_json column already is (a readonly, searchable field of the object, for readers the object's own gates admit); a boolean about run nesting adds nothing sensitive there. A row without the key (every request opened before this release, or a caller that does not say) reads as "not known to be a root run": never ended: true, and an outcome only when a later request exists. That matches the contract text and is pinned. Right.
  • Check-runs on the head: 74, all completed, none failed; every conclusion is success or skipped. Check Changeset, Governed Surface Queue Guard, Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Type Check UI, Build Core, Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Spec property liveness and the docs checks are success. Skipped runs are the opt-in and queue-only jobs and the superseded duplicate Auto Label and Check PR Size. The PR body's count for this head (70) does not match the 74 served; no conclusion differs.

② Semver level

Unchanged and still right: the changeset moves @objectstack/spec, @objectstack/plugin-approvals, @object-ui/app-shell, @object-ui/i18n and @object-ui/console at patch, the five packages the net diff publishes from; Metadata-protocol: none holds (the snapshot key is engine-written, nothing an author can write). Check Changeset success on this head.

Clause-②: yes — declared identically in the PR body and the changeset; an additive widening of a published contract type. Agreed.

③ Boundary flags

  • Round-0 escalation (may a reader of an earlier request learn the status of a later request they cannot read): answered by the owning seat, as relayed to this review with the delta order: within ruling 5299823744 on 【能力需求】plugin-approvals 审批请求可见性:对业务记录有读权者应可只读查看审批动态(或提供可见性 hook) #8652, bounded to where the same approval went (step and status), never the later request's approvers, comments or field values. The tree keeps that bound: routeOutcome returns node id, label, status and ended and nothing else. ⚠️ The ruling is not on record in the inputs: the card has no new comment and the PR thread carries none, while the attachFlowRoute docblock now says "as the seat ruled for this card". See N4.
  • L1 S2 (7147881964, the unreadable-run texts), option a: taken and consistent. The contract, the changeset and the docs page now all say ended: false means "not known to have stopped" and that an outcome with a later request is served even when the run cannot be read; runHasEnded and routeOutcome do exactly that.
  • Dev report open_questions: still empty; no new dev report on the card for this round, the round's account is the PR body's "Round 1" section, judged against the tree below.
  • SQL push-down (Prime Directive 5): no finding. This round adds no read: the root-run fact comes from the request row the read already holds (raw.node_config_json), and getRun is now asked only for decided rows stamped as root runs.

④ Design judgment

M1: closed
S1: closed
N1: closed

  • M1 closure, read in the tree: the executor passes runRoot: !hasParentRun(context), where hasParentRun reads $parentRunId the way the engine's own readers do (subflow-node.ts, map-node.ts set it on the child's context; run-resume.ts reads it back from the persisted context, so a child's later round is stamped the same way). attachFlowRoute asks runHasEnded only when the stored stamp is literally true. A child run's request, an unstamped request and an unreadable run are never served ended: true. Pinned in flow-route.integration.test.ts on a real engine: a subflow-hosted request whose child run reads completed serves no outcome, the root run's last request serves { status: 'approved', ended: true }, and a request with the stamp removed serves none.
  • S1 closure: the outcome docblock in the contract now carries an Audience paragraph (every reader of this request, whether or not they can read the later request; node id, label and status only; never the later request's id, approvers, comments or field values, which stay behind that request's own read gate) and cites ruling record 5299823744. The attachFlowRoute docblock replaces the labels-only justification with the same statement and bound.
  • N1 closure: the contract now says status is the last decision only "when status is not pending".

M2 (must-fix) — the mirror of M1 is still open: a root run's request is served the end of the approval, and its own status as the last decision, when a later approval ran in a child run. routeOutcome still reads one flow_run_id. Take a root flow of manager approval, then a subflow whose body holds the legal approval, then end (the round's own HOSTED fixture with the two steps swapped). The manager's request is stamped __runRoot: true. The legal request lives in the child run, so the root run has no later row. Once legal decides and the root run completes, the manager's route serves outcome: { status: 'approved', ended: true } with no step, and the page draws "The approval ended here". That is false whenever legal decided anything: the approval went on to another step, and if legal rejected, the contract's sentence that status "is then the last decision the record's approval took" names the wrong decision. The same holds with a step: a root run whose latest own row is approved, followed by a rejected child-run step, reads "Went on to STEP, then ended: Approved". The contract's "Absent when no later request was opened, so the approval stands at this request" is equally false there. While the child step is still pending the route is honest (root run paused, no outcome); the false claim appears once the run ends. This is the defect class M1 named (the record's approval spans runs; one run's rows and one run's end are served as the whole approval's), fixed in one direction only; stepsAhead already refuses to see through subflow / map / loop on the forward walk for the same reason. Fix direction: before serving ended: true, establish that no request of the same record was opened in a descendant run after the row the outcome names (for example a bounded read of later same-record requests stamped __runRoot: false, or refusing ended: true when the flow graph past the request holds an opaque node), with a pin for a root step followed by a subflow-hosted step that rejects. Read from source, not run.

Nits (no effect on the verdict):

  • N2 — unchanged and still a nit: "later" is measured against this request's created_at, not its decision; no reachable sibling case was found (parallel refuses a durable pause in a branch).
  • N3 — unchanged, accepted deviation: the two UI mirrors type outcome.status as string.
  • N4 — the attachFlowRoute docblock cites a seat ruling "for this card" that is on neither the card nor the PR thread. The seat posts the ruling on the card, or the sentence cites only ruling record 5299823744.

packages/spec/src/contracts/approval-service.ts (hits). Apart from M2, each sentence now agrees with the code: ended true only for a stamped root run that reports a terminal status; false for a live run, a child run, an unstamped request or an unreadable run; absence only when there is no later request and no known end, or several later requests pending; served with ended: false when a later request exists and the run cannot be read.

packages/plugins/plugin-approvals/src/approval-node.ts. hasParentRun treats only a non-empty string as a parent, so a root run stamps true and a subflow body or map item stamps false. A loop body runs inside its own run and is rightly a root run's. Agrees with the contract's definition of a root run.

packages/plugins/plugin-approvals/src/approval-service.ts. The stamp is written only for a boolean input, and read with a strict === true, so anything else reads as not known. ended short-circuits before getRun for pending rows and non-root rows. Docblocks agree with the code. M2 applies here (the read stays within one run).

packages/plugins/plugin-approvals/src/approval-route.ts. Docblock-only change this round; runEnded is now described as "known to have stopped", which is what the caller passes. M2 applies to its no-later-row arm and its latest-row arm alike.

ui/apps/console/src/services/approvalsApi.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts. The app-shell comment now says false is "not known, never still going", matching the contract; the console mirror is unchanged. Only N3 applies.

Open on this head: M2 (must-fix).

Implemented-by: claude/project-thread-x90m5y
Reviewed-by: session_01WGufzgv2LZN1W2qSYTZvYs

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

席位核对 — REWORK · repo:objectstack#3 · head 99ab892 · 2026-11-25T02:32Z

L1: REWORK (L1-w, delta read, zone wf-B)
Head-sha: 99ab892be2124f2684739442beead6ade367e638

The L2 at CONTRACT_REVIEW_TIER on this head is FAIL: comment 7150840780, claim 7150762333.

Closed this round:

  • L2 M1: the approval node stamps __runRoot from $parentRunId, and "ended" is asked only when the stamp is true. The subflow, root and unstamped pins are in the tree.
  • L2 S1: the docblocks state the audience and the bound.
  • L2 N1.
  • My S2 (option a): the contract, the changeset and approvals.mdx now agree with the code on the unreadable run (ended: false = "not known to have stopped", served when a later request exists).

One new must-fix is open, so this is REWORK.

Seat ruling on L2's round-0 escalation (recorded here as the seat asked)

The owning seat (repo:objectstack#3) ruled that outcome's disclosure is within #8652 ruling record 5299823744, with one bound. outcome carries only where the same approval went: the step and its status (went on to step N and pending, ended approved, ended rejected, recalled). It carries no later approver's identity, comment or field values unless the viewer separately passes the read-visibility tier. Reason: a reader with that tier sees the record's whole approval history, which is more than this, and passedSteps (#26668) already serves the reverse direction from the same system read. The S1 docblocks state the bound and cite 5299823744, and the served shape (step {id, label}, status, ended) stays inside it. With the ruling now on this PR, L2 N4 ("as the seat ruled for this card" cited nothing reachable) can point here: "as the seat ruled on PR #37148".

Must-fix (from the L2, adopted)

  • L2 M2. A root run's request is told the approval ended when a later approval ran in a child run. This mirrors M1. Take a manager approval in the root run, then a subflow holding the legal approval, then the end. Once the root run completes, the manager's request is served { status: 'approved', ended: true } with no step, and the page draws "The approval ended here". If legal rejected, status names the wrong last decision. Cause: routeOutcome still reads only the rows of one flow_run_id, so later requests in a child run are invisible to the root request. The fix must make "ended with no later step" false whenever the run (or a child of it) opened a later request this read cannot see. Two ways: read the child runs' rows too (and say so in the contract), or claim no ended: true without a step when the root run hosted a child run. Add a pin with the shape above (root approval, then a subflow approval, then the end).

Nit

Read and found right on the delta 1f6480a2..99ab892b

  • l1-face --pr 37148: 13 items clean. 63 success, 11 expected skips, 0 failed. Floors are green and mergeable_state is clean. 643 changed lines, single PR on the card, no governed path: Tier S.
  • openNodeRequest has one production caller (approval-node.ts), so every new request is stamped. Rows from before the stamp read "not known", as documented and pinned.
  • Changeset and approvals.mdx, sentence by sentence: the new ended definition, the absence rule ("no later request was opened and the approval is not known to have ended, or several later requests are pending") and the audience sentence all match attachFlowRoute / routeOutcome at this head. Once M2 is fixed they need one more read: "known to have stopped" must also cover child runs opened after the request.
  • The integration rig now uses installBuiltinNodes in place of registerLogicNodes, so the subflow built-in is present. The test file is inside the claim's plugin-approvals surface.

Path to ACCEPT

The card thread fixes M2 (with the pin) and N4. Then I post a new claim, the same L2 reviewer reads the delta, and I read the L1 delta on that head.

…d "ended"

A request a subflow body or a map item opens is filed under the child run's
own id, so the root run's request rows cannot show it. A decided request
before such a step was served "the approval ended here" with its own
decision once the root run completed, though the approval went on to the
child's step and that step may have decided otherwise. "Ended" is now
claimed only for a root run whose flow holds no subflow or map node
anywhere, regions included (flowHostsChildRuns, read off the definition,
not the compacted step log). The contract, changeset and approvals docs say
so; the route docblock cites the seat's ruling on PR #37148.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg3ayWUHg9nLoybejn
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

Contract-review-claim: session_01WGufzgv2LZN1W2qSYTZvYs · head e264c10 · 2026-11-25T03:17Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e264c10ab2db6dcb588ac2532b00d4092f9aea34
Local-runs: none
Scope: packages/spec/src/contracts/approval-service.ts + packages/plugins/plugin-approvals/src/approval-route.ts, packages/plugins/plugin-approvals/src/approval-service.ts, packages/plugins/plugin-approvals/src/approval-node.ts, ui/apps/console/src/services/approvalsApi.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts
Security-touching: yes

Delta review under claim 7151775534, of the record on head 99ab892b (PR comment 7150840780, FAIL: M2, nit N4; M1, S1, N1 closed there). Inputs read: card #35863 (body and its four comments, none added), PR #37148 body and thread (records 7147867236 and 7150840780, L1 comments 7147881964 and 7150863825, the claim on this head), the delta 99ab892b..e264c10a (7 files), the net diff against 517e4153, and the 74 check-runs on this head. No file joined or left Scope; approval-node.ts, the two UI mirrors and the UI rendering are untouched this round.

① Derived judgments

  • Public surface unchanged: the optional, type-only outcome member; this round edits its docblock only. Right.
  • flowHostsChildRuns is a new module export of approval-route.ts, not re-exported from the plugin index; it imports collectFlowGraphs from @objectstack/spec/automation, an existing public export of a package the plugin already depends on. No package surface moves. Right.
  • No stored-shape change this round; __runRoot is as judged on the previous head.
  • Check-runs on the head: 74, all completed, 63 success and 11 skipped, none failed. Check Changeset (both runs), Governed Surface Queue Guard, Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Type Check UI, Build Core, Build & E2E UI, Live E2E UI, Dogfood Regression Gate and Spec property liveness are success; the skipped ones are the opt-in and queue-only jobs and the superseded duplicate Auto Label and Check PR Size.

② Semver level

Unchanged and right: patch on @objectstack/spec, @objectstack/plugin-approvals, @object-ui/app-shell, @object-ui/i18n, @object-ui/console; Metadata-protocol: none. Check Changeset success.

Clause-②: yes — as declared in the PR body and the changeset; an additive widening of a published contract type. Agreed.

③ Boundary flags

  • The round-0 escalation is now on record: the seat ruling is written out in PR comment 7150863825 (within ruling record 5299823744, bounded to step and status, no later approver identity, comment or field values). The served shape stays inside that bound; nothing this round widens it.
  • No new dev report on the card and no open_questions; the round's account is the PR thread's, judged against the tree below.
  • The round's stated reason for not reading child rows (requests carry no root run id; the engine has no children-of-a-run read) is accepted: suppressing the claim is the honest alternative, and the cost is an omitted line, never a wrong one.
  • SQL push-down (Prime Directive 5): no finding. The round adds no read; flowHostsChildRuns is a pure walk of the flow definition the read already holds, evaluated before getRun.

④ Design judgment

M1: closed
S1: closed
M2: closed
N1: closed
N4: closed

  • M2 closure, by every way a child run can host a later approval. The engine's only setters of $parentRunId are the subflow executor (subflow-node.ts:110) and the map executor (map-node.ts:251); loop, parallel and try_catch run their regions inside the same run. CHILD_RUN_NODE_TYPES is exactly that pair. flowHostsChildRuns walks every graph collectFlowGraphs yields, so a subflow or map node inside a loop body, a parallel branch or a try_catch arm, nested, counts; pinned by three unit cases. attachFlowRoute now serves ended: true only when the stamp is root, the flow holds no such node, and the run reports a terminal status. The round-1 shape (manager in the root run, legal in a subflow rejecting, root run completing) is pinned on a real engine to a route with no outcome; the earlier HOSTED fixture's root request now also serves none.
  • A definition that cannot be read fails away from "ended": attachFlowSteps returns before attachFlowRoute when requestFlow yields nothing or a graph with no nodes, a refused read throws into its catch, and a throw inside flowHostsChildRuns lands in attachFlowRoute's own catch. In each case no route is attached at all.
  • A child-run node on an untaken branch also suppresses "ended". That is an omission, stated in the docs page, and consistent with "never guessed".
  • N4 closure: the docblock now cites "as the seat ruled on PR feat(approvals): a decided request's step line says where the record's approval went next #37148", and that ruling is on the thread (7150863825).

S3 (should-fix) — "its flow" is the definition armed when the request is read, not the version the run ran, and the difference fails toward "ended". attachFlowSteps hands attachFlowRoute the body requestFlow returns: the slot's current body (getFlowSlot / getFlow). A run executes the version it was started on: the engine stamps flowVersion on the run's log entry and keeps a version history (getFlowVersionHistory), and resumes a pinned body. So for a request whose run ran a version holding a subflow or map node, once the flow is edited to hold none, flowHostsChildRuns answers false, the completed root run is asked, and the old request is served ended: true with "The approval ended here", the M2 claim again, for a run that did start a child run. Requests outlive flow edits, so every historical request is judged by the latest graph. The opposite drift (a child-run node added later) only omits the line. The contract's sentence "its flow holds no subflow or map node anywhere" does not say which definition, and a reader takes it as the one the run ran. Graded should-fix, not must-fix: it needs a structural edit of the flow between the run and the read. Fix direction: judge the run's own version (the run's flowVersion against the version history), or refuse "ended" when the run's flowVersion is not the armed definition's version or cannot be read, and say in the contract which definition is meant; with a pin for a run whose flow was re-registered without its subflow. Read from source, not run.

Nits (no effect on the verdict):

  • N2 — unchanged: "later" is measured against this request's created_at, not its decision; no reachable sibling case found.
  • N3 — unchanged, accepted deviation: the two UI mirrors type outcome.status as string.
  • N5 — CHILD_RUN_NODE_TYPES is a hand list beside OPAQUE_NODE_TYPES; nothing ties it to the executors that set $parentRunId, so a third child-starting node kind would reopen M2 silently. A comment naming the two setters, or a pin, would hold it.

packages/spec/src/contracts/approval-service.ts (hits). The new text is exact against the code except for S3: step is now scoped to "that run" with the child-run exclusion stated; ended lists the three conditions and the false cases, including "runs a flow that can start a child run"; the absence, unreadable-run and Audience paragraphs are unchanged and still agree.

packages/plugins/plugin-approvals/src/approval-route.ts. flowHostsChildRuns and its docblock agree with the contract; the routeOutcome docblock describes runEnded as the caller now computes it. routeOutcome itself is unchanged.

packages/plugins/plugin-approvals/src/approval-service.ts. The ended expression short-circuits in the documented order (decided, root stamp, no child-run node, then getRun). The docblock agrees. S3 applies here (which definition flow is).

packages/plugins/plugin-approvals/src/approval-node.ts, ui/apps/console/src/services/approvalsApi.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts. Unchanged this round; earlier judgments stand.

Open on this head: S3 (should-fix).

Implemented-by: claude/project-thread-x90m5y
Reviewed-by: session_01WGufzgv2LZN1W2qSYTZvYs

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

席位核对 — REWORK · repo:objectstack#3 · head e264c10 · 2026-11-25T03:20Z

L1: REWORK (L1-w, delta read, zone wf-B)
Head-sha: e264c10ab2db6dcb588ac2532b00d4092f9aea34

The L2 at CONTRACT_REVIEW_TIER on this head is PASS, with one should-fix open: comment 7151818256, claim 7151775534. Under the merge standard, a should-fix is fixed and re-read before landing, so this head is REWORK.

Closed this round:

  • L2 M2. flowHostsChildRuns refuses "ended" for any flow holding a subflow or map node, in any region. Those are the only two executors that set $parentRunId (subflow-node.ts, map-node.ts; screen-nodes.ts only reads it). The shape from M2 (manager, then a subflow in which legal rejects, then the root completes) is pinned to no outcome in flow-route.integration.test.ts, with the child run's distinct flow_run_id asserted.
  • L2 N4. The docblock now reads "as the seat ruled on PR feat(approvals): a decided request's step line says where the record's approval went next #37148".

Should-fix (from the L2, adopted)

  • L2 S3. "Its flow" is today's definition, not the one the run ran. That drift fails toward "ended". attachFlowSteps reads the flow through requestFlow, which is getFlowSlot(packageId, name) or getFlow(name), the currently armed definition. Confirmed on the tree. Example: a run that did start a subflow, with the flow later edited to drop that node. The old root request is then served ended: true, and the page draws "The approval ended here". The contract sentence does not say which definition it means.
    • Fix, either way: judge the run's own version (runs carry flowVersion, and the engine keeps a version history), or refuse "ended" when the run's version is not the armed one. Pin it with a flow edited between the run and the read.
    • Then say in the contract, the changeset and approvals.mdx which definition is judged.

Nits

L2 N2, N3 and the new N5 (CHILD_RUN_NODE_TYPES is a hand list with nothing tying it to the executors that set $parentRunId) are in the record. Fix any that ride the S3 push. Each one left needs a follow-up card under the nit rule.

Read and found right on the delta 99ab892b..e264c10a (7 files)

  • l1-face --pr 37148: 13 items clean. The changeset covers spec, plugin-approvals, console and i18n. Floors are green. At my read there were 62 success, 11 expected skips, 0 failed and 1 pending (Check Changeset). The L2's later read was 63 success and 11 skipped. Single PR on the card, no governed path: Tier S.
  • Changeset, the spec docblock and approvals.mdx, sentence by sentence, against attachFlowRoute and flowHostsChildRuns.
    • The new step limit ("absent when no later request was opened in that run; a request a child run opened is not among them") matches the run-scoped find.
    • The new ended condition ("its flow holds no subflow or map node anywhere, regions included") and the added false case ("runs a flow that can start a child run") match !flowHostsChildRuns(flow) in the conjunction.
    • The mdx consequence sentence ("names the later steps of its own run but never says the approval ended") holds.
    • The one inexact part is "its flow", which is S3.
  • An unreadable definition fails away from "ended": attachFlowSteps returns before attachFlowRoute when the flow is missing or has no nodes, so no route is served.
  • Tests:
    • three unit cases for flowHostsChildRuns: top level; loop, parallel, try_catch and nested regions; none present;
    • two integration cases: the root run completing with a subflow in the flow, and M2's exact shape.
  • The card thread reports ablations.

Path to ACCEPT

The card thread fixes S3 with its pin and the wording. Then I post a new claim, the same L2 reviewer reads the delta, and I read the L1 delta on that head.

…oday's

The read holds only the flow body armed now. A run that started a subflow,
whose flow was later edited to drop it, was judged by the edit and served
"the approval ended here". "Ended" now also needs the run to have provably
run the armed body: that body is the flow's newest registration (the engine's
version history, the very object) and was registered strictly before the run
started. An edit, a rollback or a restart's re-registration since the run
started leaves "ended" unclaimed. The run's flowVersion is not the witness:
an edit need not change the author's number.

The contract, changeset and approvals docs say which body is judged; the
child-run node list names the two executors that set $parentRunId.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg3ayWUHg9nLoybejn
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

Contract-review-claim: session_01WGufzgv2LZN1W2qSYTZvYs · head 6080e34 · 2026-11-25T04:04Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6080e341e7e8b0f08f8c41736eae265b8a9ae9f2
Local-runs: none
Scope: packages/spec/src/contracts/approval-service.ts + packages/plugins/plugin-approvals/src/approval-route.ts, packages/plugins/plugin-approvals/src/approval-service.ts, packages/plugins/plugin-approvals/src/approval-node.ts, ui/apps/console/src/services/approvalsApi.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts
Security-touching: yes

Delta review under claim 7152521595, of the record on head e264c10a (PR comment 7151818256, PASS with S3 open). Inputs read: card #35863 (body and its four comments, none added), PR #37148 body and thread (the earlier records, the L1 comments through 7151830517, the claim on this head), the delta e264c10a..6080e341 (8 files), the net diff against 517e4153, and the 74 check-runs on this head. Scope is unchanged; approval-node.ts is untouched this round.

① Derived judgments

  • Public surface unchanged: the optional, type-only outcome member; this round edits its docblock only. Right.
  • ApprovalResumeSurface (the plugin's own declaration of the engine members it reads) gains an optional getFlowVersionHistory and a startedAt field on getRun's answer. Both exist on the engine with the declared meaning: AutomationEngine.getFlowVersionHistory(name) returns the per-key array registerFlow appends to ({ version, definition, createdAt }, oldest first, createdAt taken at registration), and getRun answers an ExecutionLogEntry, whose startedAt is set once at execute and carried untouched across resumes. No engine surface is widened. Right.
  • No stored-shape change this round.
  • Check-runs on the head: 74, all completed, 63 success and 11 skipped, none failed. The required contexts, Check Changeset, Governed Surface Queue Guard and Spec property liveness are success; the skipped ones are the opt-in and queue-only jobs and the superseded duplicate Auto Label and Check PR Size.

② Semver level

Unchanged and right: patch on @objectstack/spec, @objectstack/plugin-approvals, @object-ui/app-shell, @object-ui/i18n, @object-ui/console; Metadata-protocol: none. Check Changeset success.

Clause-②: yes — as declared in the PR body and the changeset; an additive widening of a published contract type. Agreed.

③ Boundary flags

  • The seat ruling on the round-0 escalation stays on record (PR comment 7150863825); nothing this round touches what outcome discloses.
  • No new dev report on the card and no open_questions.
  • The round's choice not to use the run's flowVersion is accepted: it is the author's number, and the round's own pin re-registers a different body under the same version.
  • The stated cost is accepted and is in the published text: any registration of the flow after a run started, a process restart included, drops "ended" for that run. The line is then omitted, never wrong. See N6.
  • SQL push-down (Prime Directive 5): no finding. No new read: ranArmedBody is an in-memory lookup, evaluated only after the existing single getRun.

④ Design judgment

M1: closed
S1: closed
M2: closed
S3: closed
N1: closed
N3: closed
N4: closed
N5: closed

No must-fix, no should-fix.

  • S3 closure, read in the tree. runHasEnded now also requires ranArmedBody(run.startedAt, flowName, flow): the body the read holds must be the very object of the newest history entry for the name, and that entry's createdAt must be strictly before the run's startedAt. Tried against each way it could fail toward "ended":
    • Edit after the run: the edit appends a newer entry with a later createdAt, so the comparison fails. Pinned (same version number, subflow dropped: no outcome; a new run on the edited body: ended: true).
    • Rollback: rollbackFlow re-arms an older entry's object without appending, so the armed body is not the newest entry. Pinned.
    • Restart or hot reload: the history is per process and refilled at registration, so every entry is newer than any earlier run; object identity cannot survive a reload. Fails away.
    • Missing pieces: no getFlowVersionHistory, an empty history (a withdrawn flow's history is deleted), no startedAt, or an unparseable time each return false.
    • Package-slotted flows: the history read goes through the bare name. A name two packages hold is refused there, the throw lands in runHasEnded's catch, and the answer is false; a key mismatch yields another body or none, and the identity test fails. Fails away.
    • Ordering: registerFlow is synchronous from the history append to arming the body, so no run can start on the old body with a start time after the new entry's; an equal millisecond fails the strict comparison.
    • Capping: the history is append-only until the flow is withdrawn; nothing prunes it.
  • N3 closure: both UI mirrors now type outcome.status as the row's own status.
  • N5 closure: CHILD_RUN_NODE_TYPES now names the two executors that set $parentRunId and says a new child-starting node kind joins the set in the same change.

Nits (no effect on the verdict):

  • N2 — unchanged, left with reasons: "later" is measured against this request's created_at, not its decision; no reachable sibling case found.
  • N6 — follow-up card rather than a fix here: because the witness is an in-process history, every restart or re-registration removes "ended" from all earlier runs' requests, so the card's second pin (a request decided at the last step shows that the approval ended) holds only until the flow is next registered. The engine already keeps a durable content identity for the body a run runs (the run's flow checksum, service-automation: a suspended run resumes on the flow version it started on, not on the definition registered under its name #28405); a witness built on it would survive restarts.
  • N7 — two narrow cases still answer true for a body the run did not run, both outside what the pins cover: a rollback made before the run started and undone after it (the newest entry is armed again without a new registration; rollbackFlow has no caller outside the engine in this tree), and a multi-replica deployment where the reading process registered an edit before the run started on a process that had not yet received it. Each also needs the edit to remove every subflow and map node. The contract's "rolled back ... since the run started" sentence is not exact for the first.

packages/spec/src/contracts/approval-service.ts (hits). The ended paragraph now says "the flow body the run ran", states when that body is known, and adds "ran a body that is not known" to the false cases. Each sentence agrees with runHasEnded and ranArmedBody, apart from N7's corner. The rest of the member's text is unchanged and still agrees.

packages/plugins/plugin-approvals/src/approval-service.ts. ended short-circuits in the documented order: decided, root stamp, no child-run node in the armed body, terminal run status, armed body proven to be the run's. The docblocks on attachFlowRoute, runHasEnded and ranArmedBody agree with the code.

packages/plugins/plugin-approvals/src/approval-route.ts. Comment-only change (N5). packages/plugins/plugin-approvals/src/approval-node.ts. Unchanged; earlier judgment stands.

ui/apps/console/src/services/approvalsApi.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts. The status type change only (N3); both still mirror the member's fields and optionality.

Implemented-by: claude/project-thread-x90m5y
Reviewed-by: session_01WGufzgv2LZN1W2qSYTZvYs

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

席位核对 — ACCEPT · repo:objectstack#3 · head 6080e34 · 2026-11-25T04:10Z

L1: ACCEPT (L1-w, delta read, zone wf-B)
Head-sha: 6080e341e7e8b0f08f8c41736eae265b8a9ae9f2

No must-fix, no should-fix. The L2 at CONTRACT_REVIEW_TIER on this head is PASS with no must-fix and no should-fix open: comment 7152581110, claim 7152521595. Tier S: no governed path, a single PR on the card, under 3,000 lines. needs:contract-review is not owed, since a same-head PASS is on record. wf-B lands it after green.

Delta e264c10a..6080e341

  • L2 S3 closed. runHasEnded now also requires ranArmedBody(run.startedAt, flowName, flow): the armed body must be the very object of the newest getFlowVersionHistory entry, registered strictly before the run's startedAt. Every unknown answers false: no history, no startedAt, an unparsable time, a newer registration, or a rollback re-arming an older body. So the drift no longer fails toward "ended". Both members are declared as optional on ApprovalResumeSurface and documented as members the engine already has. Absent, no request is served "ended". The edit and rollback pins are in flow-route.integration.test.ts.
  • Changeset, spec docblock and approvals.mdx, sentence by sentence. "The flow body the run ran", the "known only when the body armed now is the flow's newest registration and was registered before the run started" rule, and the two added false cases ("ran a body that is not known") match ranArmedBody. L2 N7 marks the one narrow case where "rolled back … after a run started" is not exact.
  • The two UI mirrors (approvalsApi.ts, useRecordApprovals.ts) type outcome.status as the row's own status union. That is the L2's N3, and it is closed.
  • l1-face --pr 37148: 13 items clean. 63 success, 11 expected skips, 0 failed, 0 pending. Floors are green and mergeable_state is clean.

Accepted deviations (nits; each needs a follow-up card under the nit rule, filed by the zone before or at landing)

  • L2 N6. The witness lives in memory, so every restart or re-registration of a flow drops "ended" from all of that flow's earlier runs. "The approval ended here" then shows only for runs started since the last boot or edit. The run's durable flow checksum (service-automation: a suspended run resumes on the flow version it started on, not on the definition registered under its name #28405) would survive restarts. This is the card worth filing first: it is the card's own "ended at the last step" pin, which holds only until the next registration.
  • L2 N7. Two narrow cases can still answer true for a body the run did not run: a rollback before the run, undone after it, and a multi-replica edit not yet propagated at start. Each also needs the edit to remove every subflow/map node. The contract's "rolled back since the run started" wording is not exact for the first.
  • L2 N2. Unchanged, with the card thread's reasons in the PR body.

Everything earlier rounds found right still stands. M1, S1, M2, N1, N4, N3 and N5 are closed (records 7150840780, 7151818256 and 7152581110). The seat's disclosure ruling is recorded on this PR (7150863825).

Landing to-do

Fixes #35863 closes the card on merge. File the N6 / N7 / N2 follow-up cards (one card may carry N6 and N7).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzeiHatzB4rRx1t4Php

Landing · 2026-11-25T04:49Z · head ee6bb2f

Probe Reading at head ee6bb2fbc12512d2426b9007a51d58a6d7c01158
check-governed-merges.mjs --pr 37148 NOT governed — 0 of 24 paths hit the register; 868 changed lines (+850 / -18) ≤ 3000
landing-k.mjs --pr 37148 OK — K = 1 < 15, no new locale pack under a label PR, no shared book moved (the earlier MERGE MAIN FIRST on the ui eager-closure book is cleared by the merge)

Verdicts: L1 ACCEPT 7152601812 and L2 (CONTRACT_REVIEW_TIER) PASS 7152581110 on 6080e341, nothing open. 6080e341..ee6bb2fb is one merge commit of origin/main with no conflicts and no other change, made on landing-k's merge-main-first leg; check:eager-closure exit 0 locally after it. 70 check-runs on this head, 61 success and 9 expected skips, none failed; mergeable_state clean. Single PR on the card, Tier S.

State change: ready for review + auto-merge (merge queue). On merge, Fixes #35863 closes the card and wf-B removes pm:dispatched with the close-out. Accepted nits N6, N7 and N2 are carried on #37218.

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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants