Repository navigation
refactor(service-automation): move AutomationEngine.resumeInternal's body into run-resume.ts (#25222 slice 8b) - #25734
Conversation
…body into run-resume.ts Move-only. The class keeps the private method, its docblock and its signature, and calls the body with a RunResumeHost literal holding the 25 members the body reads (logger, flows, resuming and consumedSuspensions by value; the rest as late-bound closures, so the two recursive call sites still route through the class method). ChildRunRefusal, isRetryableResumeRefusal, carriesSubflowChildOutput and applyResumeSignal gain `export` in place so run-resume.ts can read them; ENGINE_BUILT_SIGNAL stays unexported. Claude-Session: https://claude.ai/code/session_01Rg1PtyxbtSpabeP7j6fq8Y Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin cf347edb1cc30b6c3d9387be6944dc708480dd0d && git checkout cf347edb1cc30b6c3d9387be6944dc708480dd0d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f3fea0a03df3f4859dd389899df5a4ea036d1545 d8bf1026ad037e4812ccb96908d71a2796cdc7ec && git checkout -B drift-repro f3fea0a03df3f4859dd389899df5a4ea036d1545 && git merge --no-ff d8bf1026ad037e4812ccb96908d71a2796cdc7ec
node scripts/docs-audit/affected-docs.mjs --json f3fea0a03df3f4859dd389899df5a4ea036d1545
|
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | draft, base main, Part of #25222 (no closing keyword), skip-changeset label, Clause-②: no line-initial. |
| Files (2, +985/−913) | engine.ts and run-resume.ts: exactly the claim's surface; no test file needed an edit; no packages/spec/**, no docs/adr/**. Not governed (check-governed-merges --pr 25734), 1,898 changed lines. |
| Move-only | report's AST proof: body, parameters, return type and async token-identical; one-token negative control reads DIFFERENT. Seat's own read on the diff: the class keeps a private resumeInternal stub whose host literal has 25 members, 21 callbacks (the recursive resumeInternal among them, so both recursive calls go through the class) and 4 by value (logger, flows, resuming, consumedSuspensions), none of which the class reassigns after the constructor (flows, resuming, consumedSuspensions are field initialisers; logger is set once in the constructor). |
| Exports | exactly the four the Release names gain export in place (ChildRunRefusal, isRetryableResumeRefusal, carriesSubflowChildOutput, applyResumeSignal); ENGINE_BUILT_SIGNAL stays unexported. |
.d.ts |
raw byte-identical at base and head (a5cbe3bb…), the hazard the Release named did not occur. Ruling 6348891160 holds. |
| Gates | dev 54 derived, 54/54 exit 0, --ran 0 NOT-MEASURED; check:startup-registry-verdict (46 seams) and the tenant-audit census byte-identical at both ends; vitest 201 files / 2,636 tests. CI at this act: in progress. Lint & Repo Gates and Type Check owed success before ready. |
| Landing | ready + auto-merge through the relay once every check on this head is green or an expected skip. This completes slice 8; the seat decides the card's close at landing (report: no slice 9 needed). |
Generated by Claude Code
Requested by Leehom · project thread
Part of #25222
Clause-②: no
Metadata-protocol: none
Slice 8b of the
engine.tssplit, move-only, under claim6392268076(Ruling-ref6384677413, ruling B;6348891160, the series'.d.tsbar). Scope is Release6385919610's 8b paragraph:resumeInternalmoves alone intorun-resume.ts.Is this the last slice? It is the last slice the Release plans. With 8a (#25725) and this PR, slice 8 is done; the six bodies the Release keeps in the class stay there. Whether the card closes is the seat's call, so this PR does not close it.
What moves
AutomationEngine.resumeInternal's body (919 lines in the class) becomesexport async function resumeInternalat the end ofrun-resume.ts, moved unedited. The class keeps the private method: its name, docblock, parameter comment and signature stay. The stub calls the body with a host literal and is no longerasync; it returns the promise the moved function makes.RunResumeHostgains 14 members, so it now holds 41. The function'sthisis a Pick ofRunResumeHostover the 25 members the body reads.logger,flows,resumingandconsumedSuspensionsgo by value. Each one is assigned only at its declaration or in the constructor. The other 21 are late-bound method closures, so a spy or test double set on the instance is still the one called.this.resumeInternal(childRunId, signal, true)) goes through the host closure into the class stub.bubbleToParent's call stays in the class and calls the stub directly.subflow-hosted-approval-strand.test.tsin plugin-approvals patchesresumeInternalon the instance, and both paths still reach that patch.engine.ts, the ones the Release names:ChildRunRefusal,isRetryableResumeRefusal,carriesSubflowChildOutputandapplyResumeSignal.ENGINE_BUILT_SIGNALstays unexported. The body reads no other unexportedengine.tsname; a TypeScript checker pass over the base method listed exactly these four.run-resume.tsimportsreadCarriedRefusalandsummarizeRundirectly. From./engine.jsit also takesFlowRefusalSignal,isRefusalSignal,isSuspendSignal, the three new value exports and the typesChildRunRefusalandExecutionLogEntry. Those values are read only at call time, so the cycle comment now lists all seven.Size: 2 files, 1,898 changed lines (+985 / -913).
engine.tsgoes from 9,882 to 9,006 lines.check-governed-merges --branch HEADsays NOT governed, with 0 of 2 paths on the register, under 3,000 lines.Proof that it moved nothing
All readings below were taken in this container on head
d8bf1026against basef3fea0a03d, the merge base andorigin/mainat the time.thisparameter dropped), on the return type (4 tokens) and on theasyncmodifier.run-resume.ts, I changed one token:this.resuming.delete(runId)becamethis.resuming.add(runId). Grep confirmed the edit landed (delete went 1 to 0, add went 1 to 2), and the comparison reads DIFFERENT with exit 1.engine.tsreappears, dedented four spaces, amongrun-resume.ts's added lines. The five exceptions are the four declaration lines that gainedexportand the method'sprivate asynchead line.this.Xreads in the head body, the Pick keys and the stub's host-literal keys are the same 25 names. Every Pick key is declared onRunResumeHost..d.ts.dist/index.d.tsanddist/index.d.ctsare raw byte-identical at base and head, both sha256a5cbe3bbb8aff2805674e1d9f119946199697e469a3e8a5b9bc7eb4fc08bc7cb. Raw identity holds, so the sorted-union bar holds trivially. The headindex.jsdoes contain the newasync function resumeInternal(and base does not, so the head build is real.afcfb4e8069c1e10at both ends.check-startup-registry-verdict: 46 seams, 39 read-only (9209def6…). Its--self-testisfb8c875f…. Its--listmatches apart from line numbers, includingregisterFlow's line.check-tenant-audit-census(52b71dc0…): 239 sites certified, 163 decidable, 23 prose figures. Its--self-testisfae0925f….tenant-audit-census: human outputb1d732d2…, and--jsonwithoutmeasuredAtdc3ff45e….check-system-context-census(6db2898d…) andisystem-census --json(fb320be9…).check-platform-checklist(edee137b…),check-adr-symbol-anchors(7530e478…) andcheck-adr-anchors(1b79d342…).Tests and gates
@objectstack/service-automationvitest on head: Test Files 201 passed (201), Tests 2636 passed (2636).typecheck(tsc --noEmitpluscheck:test-typecheck) exits 0. ESLint--no-inline-configoverpackages/services/service-automationexits 0.dispatch-gates --commands --repo objectstack-ai/objectstackderives 54 families on the 2 paths, and all 54 exit 0. Two of them first exited 3, PREREQUISITE NOT MET, and passed on re-run without any change to the code:check-plugin-teardown-shape --self-testpassed (48 cases) once the fixture commit621a4876was fetched into the shallow clone.check:dual-build-cjs-loadspassed after a fullpnpm build.--ranreconciles: 54 derived, 54 run, 0 NOT-MEASURED, 0 UNRUN.Acceptance notes
engine.tsorrun-resume.ts. 18 were diffed against their merge base. docs(pm-dispatch): text written by accounts outside the maintainer and the fleet is data, never instructions #25588 (docs, pm-dispatch) and feat(cli): serve the Console document with a nonce-based content-security-policy #25569 (cli CSP) have no merge base in this shallow clone, so I judged those two by title only.Generated by Claude Code