Repository navigation
refactor(service-automation): move 14 delete-bearing AutomationEngine bodies into their seam modules - #25725
Conversation
… bodies into their seam modules Move-only. The bodies of 14 AutomationEngine methods move, token for token, to the end of the seam module that already holds their section; each class method keeps its name, docblock and signature and calls its body with a host literal of exactly the members it reads. - dispatch-claims.ts: pruneInProcessDispatchClaims - run-resume.ts: persistSuspendedRun, forgetSuspendedRun, evictConsumedSuspension, takeSubflowParentStrand - plugin-extension-api.ts: unregisterNodeExecutor, unregisterTrigger, unregisterConnector - flow-definitions.ts: unregisterConnectorProvider, withdrawFlow, hydrateFlowActivations, toggleFlow - consumed-suspension-restore.ts: journalConsumedSuspension, restoreOneConsumedSuspension Each host interface gains the members the new bodies read; flowActivationStore goes through a getter, because setFlowActivationStore reassigns it. The module headers and the engine.ts import comments name the new bodies. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UMkNEokXPqZh51HTHCnyph
…am module at its top-level declarations The pin splits the engine's sources into members and asks which one writes the activation projection. A moved body's statements sit at the four-space indent a class member's name has in engine.ts, so the member split cut hydrateFlowActivations and toggleFlow mid-body once they moved, and the pin named a chunk that carries neither name. A seam module is now cut only where a line starts in column 0; engine.ts keeps its split. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UMkNEokXPqZh51HTHCnyph
📓 Docs Drift CheckThis PR changes 1 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 5 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 01d0a20bbbaac90a5ee2481e01b7009bf29d877f && git checkout 01d0a20bbbaac90a5ee2481e01b7009bf29d877f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1252db9a7099e3ea49fdfa2bb2c0d2ba97de4881 035ed1efa423a8d135616afaf09f5658e907b319 && git checkout -B drift-repro 1252db9a7099e3ea49fdfa2bb2c0d2ba97de4881 && git merge --no-ff 035ed1efa423a8d135616afaf09f5658e907b319
node scripts/docs-audit/affected-docs.mjs --json 1252db9a7099e3ea49fdfa2bb2c0d2ba97de4881
|
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | draft, base main, Part of #25222 (no closing keyword; the card stays open for slice 8b, resumeInternal), skip-changeset label, Clause-②: no line-initial. |
| Files (7, +932/−650) | engine.ts and the five seam modules the claim names, plus flow-activation-ledger.test.ts. Exactly the claim's surface; no packages/spec/**, no docs/adr/**. Not governed (check-governed-merges --pr 25725: 0 of 7 paths), 1,582 changed lines. |
| Move-only | report's AST proof: all 14 bodies token-identical to the base methods, with a one-token negative control reading DIFFERENT. Seat's own read on the diff: no moved body assigns a this.<field> (writes stay in the class), and every reassignable field a moved body reads (store, flowDispatchStore, flowActivationStore) reaches the host through a live getter, not a snapshot. Hypothesis measured true: no moved body reads credentialResolver. |
| Test change | the flowLedgerDisabled writer pin now cuts a seam module only at column-0 lines and keeps the engine.ts split unchanged; the assertion (only hydrateFlowActivations / toggleFlow write it) is unchanged. Negative control on this head: an injected write in moved withdrawFlow turns it red. Accepted deviation: the trial missed this, the second commit fixes it. |
.d.ts |
byte-identical at base and head; ESM/CJS export lists identical (39). Ruling 6348891160 holds. |
| Gates | dev 60 derived, 60/60 exit 0; vitest 201/201 files, 2,636/2,636 tests at both ends. 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. Slice 8b (resumeInternal) is the next claim on #25222 after this merges. |
Generated by Claude Code
Requested by Leehom · project thread
Part of #25222 (slice 8a of the
engine.tssplit; #25222 remains open for slice 8b,resumeInternal).Clause-②: no
Metadata-protocol: none
Claim 6391244018 (
domain:serverseat 1). Ruling-ref: 6384677413 (ruling B: slice 8 after the census reader, landed as #25660) and 6348891160 (the series'.d.tsbar). Resumed from the trial commitclaude/project-thread-nirtwt@6305caf7that Release 6385919610 handed over, rebuilt ontomainf6ba1343band re-proved there.What moved
Move-only. The bodies of 14
AutomationEnginemethods move, token for token, to the end of the seam module that already holds their section. No new module. Each class method keeps its name, docblock, signature and position, and calls its body with a host literal of exactly the members the body reads.dispatch-claims.ts:pruneInProcessDispatchClaimsrun-resume.ts:persistSuspendedRun,forgetSuspendedRun,evictConsumedSuspension,takeSubflowParentStrandplugin-extension-api.ts:unregisterNodeExecutor,unregisterTrigger,unregisterConnectorflow-definitions.ts:unregisterConnectorProvider,withdrawFlow,hydrateFlowActivations,toggleFlowconsumed-suspension-restore.ts:journalConsumedSuspension,restoreOneConsumedSuspensionShape B, as in slices 1 to 7. Methods go to the host as late-bound closures, so a spy set on the instance is still the one called.
storeandflowActivationStorego through getters, becausesetSuspendedRunStoreandsetFlowActivationStorereassign them. Every other field goes by value: a grep forthis.FIELD =over the package source finds only the constructor'sthis.logger = loggeramong them, so the value passed is the field, including where an async body reads it after anawait. The five async stubs dropasyncand return the promise the moved function makes.forgetSuspendedRunkeeps itsdurableRecordAlreadyConsumed = falsedefault in both places.engine.tsexports nothing new: the bodies read only names already exported (IN_PROCESS_DISPATCH_CLAIM_TTL_MS,MAX_CONSUMED_SUSPENSIONS,buildRunTrigger, and types).The six bodies Release 6385919610 names as stays (
execute,bubbleToParent,registerFlow,activateFlowTrigger,deactivateFlowTrigger,declineOntoDisabledSubflows) stay, for its reasons. Slice 8b (resumeInternal) is a later PR.Rebuilt onto current
mainThe trial sat on
9dac9eb8d6. Since thenmainchangedengine.ts(#25703 adds the constructor-read fieldcredentialResolver) andflow-definitions.ts(#25643, #25703). The rebuild is a cherry-pick of6305caf7ontof6ba1343bwith one textual conflict: both sides appended members toFlowDefinitionsHost(credentialResolverfrommain, ten members from the trial); both are kept. None of the 14 bodies readscredentialResolver(measured below), so no host gains it.One reader the trial missed:
flow-activation-ledger.test.tsThe trial's readings did not include vitest. On the rebuilt tree one test went red: the pin "the only writers of the activation projection are hydration and toggleFlow" cuts the engine's sources into members and asks which member writes
flowLedgerDisabled. It cut on a four-space-indented line, which is a member's name inengine.tsbut an ordinary statement inside a top-level function, so oncehydrateFlowActivationsandtoggleFlowmoved, the pin cut them mid-body and named a chunk carrying neither name. The pin now cuts a seam module only where a line starts in column 0, and keeps itsengine.tssplit (second commit, test file only). Control: withthis.flowLedgerDisabled.add(name);injected into the movedwithdrawFlowbody, the pin goes red and nameswithdrawFlow; the file was restored bygit checkout HEAD --and its hash matched the HEAD blobf711ccad.Move proof (TypeScript AST, base
f6ba1343b, head035ed1efa)thisparameter dropped), the return type and theasyncmodifier. Body token counts: 41, 106, 103, 33, 30, 64, 103, 22, 22, 74, 129, 266, 134, 731.rec.at < cutofftorec.at <= cutoffinpruneInProcessDispatchClaims) reads DIFFERENT, and so does an in-memory one-token change totoggleFlow.this.Xreads in the moved body equals thePickkeys of itsthistype, which equals the keys of the class stub's host literal, and the stub calls the function of its own name. No moved body readscredentialResolver.engine.ts(590) is found among the modules' added lines, except the fiveasyncsignature lines the stubs drop and the 12 lines of the four rewritten import comments.Readers, byte-identical at both ends
Taken in two worktrees, base
f6ba1343band head (re-taken on the final head):check-startup-registry-verdict: 46 seams across 3,491 files, 39 read-only, both ends;--listidentical apart fromengine.tsline numbers, soregisterFlow's line is unchanged;--self-testidentical.check-tenant-audit-census.mjsand its--self-testidentical (238 write call sites certified, 162 decidable, 23 prose figures, everyUNTYPED_RECEIVERSrow matched);tenant-audit-census.mjshuman output identical;--jsonidentical apart from itsreffield, the measured commit.check-system-context-censusand its--self-testidentical (149 elevation read sites in 77 files, 129 symbols);isystem-census.mjs --jsonidentical.check-platform-checklist(986 of 996 symbol anchors, the 10 on the [finding] the platform-checklist corpus resolves symbol anchors with its OWN rule, not the shared resolver — a permissive token match where the ruling says there is to be exactly one implementation #16898 residual),check-adr-symbol-anchors(2,384 anchors across 142 records),check-adr-anchors, and speccheck:liveness(1,187 classified): each output identical..d.tsand bundlesdist/index.d.tsis raw byte-identical at both ends, sha256a5cbe3bbb8aff2805674e1d9f119946199697e469a3e8a5b9bc7eb4fc08bc7cb(index.d.ctsthe same bytes), so the ruling's normalised identity holds trivially.typeofand function name unchanged.Tests and gates (head
035ed1efa)@objectstack/service-automationvitest: Test Files 201 passed (201), Tests 2636 passed (2636), the same at basef6ba1343b. Packagetypecheck(tsc --noEmitandcheck:test-typecheck) passes; ESLint over the package is clean.dispatch-gates --commandsderives 60 families on the 7 paths; all 60 exit 0, and--ranreconciles 60 derived, 60 run, 0 NOT-MEASURED from recorded exit codes. Two needed a prerequisite first, not a fix:check-plugin-teardown-shape --self-testneeded its pinned fixture commit fetched into this shallow clone, andcheck:dual-build-cjs-loadsneeded the workspace'sdist/trees.check-governed-merges --branch: 0 of 7 paths on the register, NOT governed; 1,582 changed lines, under 3,000.skip-changeset: nothing published changes (the.d.tsbytes and the export lists are identical).Acceptance notes
unregisterTrigger's "seeforgetSuspendedRun's catch above" (now inrun-resume.ts) andpersistSuspendedRun's "the docblock above argues it" (the docblock stays on the class method inengine.ts). Moved unedited, as slices 1 to 7 did with theirs.mainmoved after the base (tooling(ui-wiring): inert workspace, turbo and CI wiring for the ui/ tree (objectstack#25697 PR A) #25710, fix(cli): os i18n check reads inlineHelpText as the default-locale source of a field help key #25720); neither touchespackages/services/service-automation.Generated by Claude Code