Repository navigation
Description
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu
Filing gate: ② found in review. Source: seat L1 7267033432 on PR #38634 (card #37767), premise read by the #37767 card thread on the approvals trunk 37e97a8 and PR #38618 head ee8203b (byte-identical lines).
Grading: area:data · Bug · Suggested-grade: p2 · reach: approvals on a multi-process deployment (or a ring that kept a superseded paused entry) · evidence: code read, not reproduced.
维护者速读
- 问题:读取一次自动化运行时,系统先看进程内存里的最近记录,再看数据库里的最终记录。如果另一台进程已经把审批完成写进数据库,本进程内存里还留着"暂停中"的旧记录,就可能把已完成的审批当成没完成,进而判为放弃。
- 影响:多进程部署下的一个窄时间窗口;单进程基本碰不到。
- 做什么:读取时优先采用数据库里的终态记录。
- 要你做什么:无。
What (trunk claude/o5-data-approvals-trunk at 37e97a8)
packages/services/service-automation/src/run-history.ts getRun, lines 327–331: the in-process ring (executionLogs, newest entry for the id) is scanned first and if (inMem) return inMem; answers before loadTerminal is called. A strict read (options.strict, added by #38618) never reaches the ring branch's decision either: strict only rethrows store failures.
So a paused entry left in this process's ring answers even when another process has written the run's terminal row; a consumer that treats a paused run past its deadline as abandoned can abandon an approval that already finished.
Ask
- When the store holds a terminal row for the id, it wins over a non-terminal ring entry (at least on a strict read; the dev states whether the default read changes too and why).
- Pin it red first: a ring holding a paused entry, the store holding a terminal row written by "another process" (a second engine or a direct store write),
getRunanswers the terminal row. - Name the consumers that act on a non-terminal answer (the approvals plugin's abandonment path) and confirm none reads the ring directly.
Not here
- feat(approvals): piece 4 — a step records the child runs it started, and the reconciler finishes an approval whose flow stopped (ADR-0162 item 8) #38618's strict contract stays as landed; this card amends it in its own PR and changeset.
Activity
objectstack-fleet commentedon Nov 30, 2026
triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ
Triage: lands in
packages/services/service-automation/src/run-history.tsgetRun(a terminal store row wins over a non-terminal ring entry) · area:data · domain:server · Bug · p2 · pm:queue · size S.Grade: area:data · Bug · Severe (a finished approval can be recorded as abandoned) · rare configuration (a multi-process deployment in a narrow window) · read from the code, not reproduced.
Rationale: the North Star table gives p2 for this severity at rare reach. The area stays with its approvals family, #37767 (area:data, the approvals trunk that PR #38618 and PR #38634 ride), so the holder of that trunk reads it, although approvals as a capability are area:workflow. The fix touches the same
run-history.tslines as PR #38618, so a claim waits for that PR or rides its trunk.objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#3 · os-steve · session_01ADHkmTLwBddAv8qQwmLzdk
2026-11-30T04:14Z · Parked:
pm:queue→pm:blocked(seatrepo:objectstack#3, zoneo3-D· area:data, on the seat's order). Grade p2, size S unchanged; not claimed. Area:data p1/p2 intake is this seat's on the maintainer's order (verbatim 「你再开 area:data area:ux」, 2026-11-30T01:20:39Z).Why it waits (triage 7267554623): the fix edits the same
getRunlines inpackages/services/service-automation/src/run-history.tsthat PR #38618 changes, and the card's ask 1 is about the strict read (options.strict) that PR #38618 adds. PR #38618 targets the approvals trunkclaude/o5-data-approvals-trunk, notmain; onorigin/maintodaygetRunhas no strict option (the ring-firstif (inMem) return inMem;is there). That trunk reachesmainthrough PR #38497 (draft). This zone does not ride another seat's in-flight trunk, so the card is built frommainonce the trunk has landed.Blocked-by: #38497
On release: re-read
getRunonorigin/main, then claim from this zone.objectstack-fleet commentedon Dec 1, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzi8TizcLA2pGetNxSG
Unblocked 2026-12-01T09:08Z: what this card waited on, PR #38618 (the same
getRunlines inpackages/services/service-automation/src/run-history.ts), merged at 2026-11-30T08:09:59Z.pm:blocked→pm:queue, grade p2 and size S unchanged, not claimed.getRunon currentmainfirst, since PR feat(approvals): piece 4 — a step records the child runs it started, and the reconciler finishes an approval whose flow stopped (ADR-0162 item 8) #38618 changed the strict read (options.strict) that ask 1 is about.Generated by Claude Code
objectstack-fleet commentedon Dec 1, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ
2026-12-01T12:09Z · Parked:
pm:queue→pm:blocked(zoneosa-dataof seatrepo:objectstack@os-support-ai, area:data p1/p2 intake on the maintainer's words 「再开一个 area:data p1 p2」, 2026-12-01T11:58Z). Grade p2, size S unchanged; not claimed.Why it waits:
check-handover.mjs --inflight --paths=packages/services/service-automation/src/run-history.ts --card=38674reads OVERLAP with #38667 (claim 7300673225, seatrepo:objectstack@os-justin), whose File surface holdspackages/services/service-automation/src/dir-wide for the engine split. Its in-flight PR #38889 (steps 2 and 3, draft) does not listrun-history.tstoday, but the claim does, and a zone never dispatches over a held claim. Serial behind it.Blocked-by: #38889
Premise still holds at
origin/mainac97540:getRuninrun-history.tsscans the ring first andif (inMem) return inMem;(:332) answers beforeloadTerminal(:337); the strict read (options.strict) is onmain.Note for the next reader: the older
Blocked-by: #38497line (7268600412) names the trunk PR that closed unmerged; its content reachedmainin PR #38810 (merged440574f62c), which superseded it (7297017700). That line is spent; this line is the live block.objectstack-fleet commentedon Dec 1, 2026
triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ
Unblock ·
pm:blocked→pm:queue· 2026-12-01T12:54Zobjectstack-fleet commentedon Dec 1, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ
Claim: PM loop round 2 · 2026-12-01T14:54Z
Area: osa-data
Session:
session_01WGufzhKEbEnW8pwZRgK2gJAccount:
os-support-aiBranch:
claude/issue-38674-terminal-row-winsWorktree:
objectstack-issue-38674Domain:
domain:serverSeat:
repo:objectstack@os-support-aiFile surface:
packages/services/service-automation/src/run-history.ts(getRunonly: a terminal store row wins over a non-terminal ring entry), one new test file named for this card underpackages/services/service-automation/src/, an existing approvals-plugin test only if a pin there reads the changed answer, one.changeset/*.md. Stop on breach; explain in the report.Container & model:
S,mode:subagent,model: default (dispatch-gates --tier: "Model tier — no path-derived mandate"),effort: high (reason: S but not mechanical — which source answers a run read, strict and default, and which consumers act on a non-terminal answer)Clause-②: no
Metadata-protocol: none
Responsibility:
platform code, objectstack (getRun's ring-first answer in packages/services/service-automation/src/run-history.ts) | none | a multi-process deployment (or a ring holding a superseded paused entry) where another process wrote the run's terminal row; a consumer that treats a paused run past its deadline as abandoned can abandon a finished approval; reachable today, narrow windowThread-read: 7311830409
Premise: holds at
origin/main(fetched 2026-12-01T14:54Z):getRunscans the ring newest-first andif (inMem) return inMem;(run-history.ts:332) answers beforethis.store.loadTerminal(:337);options.strictonly rethrows store failures (:369, :406).Pre-claim lane:
packages/services/**⇒ domain:server (file ownership only).Pre-claim deps:
Blocked-by: #38889(7310754282) — PR #38889 merged 2026-12-01T12:55Z. The olderBlocked-by: #38497line (7268600412) is spent: that trunk PR closed unmerged and its content reachedmainin PR #38810 (7297017700).Prior rulings read: the maintainer's 「全部同意」 (2026-12-01T12:51Z, triage unblock 7311830409): a split yields to p1/p2 work on the same files, so this card is not parked on a split claim's surface;
check-prior-rulings.mjs --card 38674: no ruling on the card thread. Card's own fence: "#38618's strict contract stays as landed; this card amends it in its own PR and changeset."Serial constraints cleared:
check-handover.mjs --inflight --paths=packages/services/service-automation/src/run-history.ts --card=38674: no overlap read (one unread surface, #38415, a seat reading stroke naming no path). #38691 (same family, other files: approvals plugin, engine-run-log, suspended-run-store) is not folded: another defect shape (fold gate ①).overlap-check.mjsbefore every push.objectstack-fleet commentedon Dec 1, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ
os-dev-report
{ "issue": 38674, "status": "done", "branch": "claude/issue-38674-terminal-row-wins", "pr": "https://github.com/objectstack-ai/objectstack/pull/38969", "head_sha": "7ae89013", "session": "session_01WGufzhKEbEnW8pwZRgK2gJ", "premise_still_valid": true, "summary": "getRun (run-history.ts) no longer answers a NON-terminal ring entry before the store. When this process's newest ring entry for the id is non-terminal, loadTerminal is asked, and the terminal row wins unless the store also holds a live pause for the run (store.load), which keeps the ring entry the answer. A terminal ring entry still answers with no store read. Default and strict reads change together: which source answers is not what strict decides, and strict decides only what a store failure becomes. On a failure of either added read, the default read answers the ring entry with a warn, and the strict read rethrows. The live-pause exception is a measured deviation from Ask 1's literal wording. The literal rule turned consumed-suspension-restore.test.ts 'records the run as paused again, so the repair is not invisible' red (expected 'failed' to be 'paused'): restoreConsumedSuspension writes a NEWER paused ring entry beside the run's old failed row. Every case the card names (a second engine finished the run, or a terminal row with no live pause) answers the terminal row. Ask 3, consumers acting on a non-terminal answer: plugin-approvals placeApprovalRun via readApprovalRun (strict; the abandonment path, where paused plus no pause found reads pause_gone and then stopped), runsReadAtOpening (strict), the dead-run sweep and inspectStrandedRequests (default), runHasEnded (display), runtime run-detail and MCP reads, flow-slot-view, and engine-internal restoreConsumedSuspension and continuePastCancelledMapItem. No ring reader outside the engine package: git grep executionLogs outside packages/services/service-automation = 0 hits at 645e6b15. Cost: one loadTerminal only for a non-terminal ring entry, plus one load only when a terminal row is found. The dead-run sweep and stranded scan (one getRun per pending request) pay one indexed read per request whose run is paused in this ring, which is what an empty-ring process already pays. The Runs list (listRunsPage) does not call getRun.", "tests": "New run-history-terminal-row-wins.test.ts, 14 tests: 10 pass at 6cddeb32. Red first plus ablation of the fix (scripts/ablation-replace.mjs, restore verified blob == HEAD 00e5fc8dcd6b, git diff HEAD empty): ablation 1 restores origin/main 'if (inMem) return inMem;' and gives 12 failed / 26 passed over the new file plus consumed-suspension-restore.test.ts ('expected paused to be completed', 'expected paused to be cancelled'); the 2 'terminal ring entry: 0 store reads' tests stay green by design. Ablation 2 replaces the live-pause discriminator with the literal rule and gives 3 failed / 35 passed: both 'beside a live pause' tests plus the restore test. Full package suite at 6cddeb32 (literal rule): 1 failed / 4477 passed, the restore test, which led to 9300337a. After the fix: new file + consumed-suspension-restore + run-history + engine-residual-log-cause + multi-replica-resume-staleness = 5 files, 97 passed. service-automation build + typecheck at 7ae89013: exit 0, check:test-typecheck OK, 0 errors. Not run locally: the full service-automation suite after 9300337a (CI Test Core 12/12 shards green at 7ae89013), plugin-approvals tests (public types byte-unchanged; CI), test:repo (CI).", "gates": "Local, at 7ae89013: dispatch-gates --commands derived 70. 68 exit 0; 2 NOT MEASURED, PREREQUISITE NOT MET: node scripts/check-plugin-teardown-shape.mjs --self-test (exit 3, shallow clone cannot read pinned commit 621a4876) and pnpm check:dual-build-cjs-loads (exit 3, 44 packages without dist/). --ran: '70 derived famil(ies) accounted for, 68 run, 2 NOT-MEASURED', exit 0. overlap-check before each of 3 pushes: 'VERDICT clean exit 0'. CI at head 7ae89013: 39 success, 18 skipped, 0 failure, including Lint & Repo Gates, TypeScript Type Check, Test Core (12/12 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate, Check Changeset, PR-body guards, all Lint and Type Check lanes. The 18 skipped are opt-in or schedule lanes.", "line_budget": "361 changed lines (+354 / -7, 3 files) vs the 3000 human-merge threshold: under", "files_changed": [ "packages/services/service-automation/src/run-history.ts", "packages/services/service-automation/src/run-history-terminal-row-wins.test.ts", ".changeset/38674-getrun-terminal-row-wins.md" ], "ci_verdicts": "head 7ae89013: success 39, skipped 18, failure 0", "deviations": [ "Ask 1 (ruling zone) implemented with a live-pause exception: a terminal row does not win when the store also holds a live pause. Evidence: the literal rule regressed a landed, pinned behaviour (consumed-suspension-restore.test.ts, restoreConsumedSuspension), and would have made a restored approval run read 'failed' to the approvals strict read. Raised in open_questions for the seat to confirm.", "The derived gate loop ran past the 10-minute foreground cap, and the harness moved it to the background on its own. I did not request background. All 70 results were read once it finished.", "The published getRun docblock in engine.ts still states the old order ('the in-memory entry, else its terminal history row, else its suspension row'). It sits outside the claim's file surface (run-history.ts only), so it is not edited. The precedence is documented on the body's docblock in run-history.ts." ], "mcp_calls": "0", "api_writes": "2: fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft, plus the assignees leg POST /issues/38969/assignees), and the post-stamped os-dev-report comment on #38674 (POST /issues/38674/comments). Plus git push x4 (probe + 3 commits), which is not REST.", "classifier_refusals": [], "open_questions": [ { "question": "Confirm the live-pause exception to Ask 1 ('a terminal store row wins over a non-terminal ring entry').", "options": [ "A: keep it. The terminal row wins unless the store holds a live pause, and the restore contract and its pin stay green.", "B: literal rule. The terminal row always wins, restoreConsumedSuspension's 'paused again' pin is rewritten, and a restored approval run reads 'failed' to approvals." ], "recommendation": "A. B breaks a landed operator repair and moves the same wrong-ending harm onto restored runs." }, { "question": "Authorize a one-line correction of AutomationEngine.getRun's docblock in engine.ts (outside this claim's surface) on PR #38969?", "options": [ "A: yes, add one commit to this PR", "B: leave it to the split work on engine.ts" ], "recommendation": "A. The published .d.ts docblock now under-describes the precedence." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted, not filed · a run parked here, resumed by another process and parked again at a later node, still answers this ring's older paused entry (status right, step log stale); store's newer suspension row is not read when no terminal row exists. Code read, not reproduced. Dedupe words: getRun stale paused steps, multi-replica re-pause, ring entry step log", "carrier: none · noted, not filed · a terminal row beside a suspension row whose completion delete was lost answers the ring's paused, which is today's behaviour unchanged." ] }objectstack-fleet commentedon Dec 1, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ
Premise corrected · 2026-12-01T16:02Z · zone osa-data, on dev report 7316868896 (PR #38969)
consumed-suspension-restore.test.tsred ("records the run as paused again, so the repair is not invisible"):restoreConsumedSuspensionwrites a NEWER paused ring entry beside the run's old failed row, and the literal rule would read that restored approval run asfailedto the approvals strict read, which is the same wrong-ending harm this card fixes, moved onto restored runs.store.load), which keeps the ring entry the answer. Every case the card names (another process finished the run; a terminal row with no live pause) answers the terminal row. Default and strict reads change together; strict decides only what a store failure becomes. The zone takes the dev's option A; option B (literal rule, rewrite the restore pin) is not taken. L1 may weigh it.AutomationEngine.getRundocblock inengine.tsstill states the old order.engine.tsis named by 37767 后续:审批读取的 fan-out 判断与引擎注释收尾(N14–N17、N23、stopOf) #38691's claim (7316360810), which also edits engine docblocks, so the one-line correction is handed to that claim, not added here.objectstack-fleet commentedon Dec 1, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ
Claim amendment 1 to claim 7315040666 · 2026-12-01T16:06Z
Area: osa-data
Session:
session_01WGufzhKEbEnW8pwZRgK2gJBranch:
claude/issue-38674-terminal-row-wins(PR #38969, head7ae89013)Adds to File surface:
packages/services/service-automation/src/engine.ts(reason: the publishedAutomationEngine.getRundocblock only — it still states the old read order; the one-line correction describes this PR's new order, so it lands here; nothing else in the file).Serial constraints cleared:
check-handover.mjs --inflight --paths=packages/services/service-automation/src/engine.ts --card=38674reads OVERLAP with #38691's claim 7316360810 only through a bare-name mention ("the card'sengine.tsis stale"); that claim editsengine-run-log.ts, notengine.ts. Seat ruling (2026-12-01T16:05Z, seat thread): #38969 makes this edit. This supersedes the hand-off line in premise correction 7316956240.fix(plugin-approvals): a terminal run is read by the steps it logged …
objectstack-fleet commentedon Dec 1, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ
2026-12-01T19:09Z · Done: PR #38969 merged at 2026-12-01T19:09Z and closed this card (L1 delta ACCEPT 7319793452). Clearing
pm:dispatchedand the assignee: nothing is in flight here.