Skip to content

refactor(service-automation): AutomationEngine becomes a delegating facade over eight facet modules (steps 2 and 3 of the engine split) - #38889

Merged
os-zhuang merged 6 commits into
mainfrom
claude/issue-38667-split-automation-engine-step2
Dec 1, 2026
Merged

os-zhuang merged 6 commits into
mainfrom
claude/issue-38667-split-automation-engine-step2

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Fixes #38667

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:自动化引擎的主类按职责拆成八个文件,类本身只留下各方法的签名和一行转发,流程运行、恢复、注册的行为都不变。
  • 属于自动化引擎拆分(大文件计划第四张卡)的第二、三步:第一步已合并;这一步之后,后续自动化相关的卡可以各改各的文件,并且有门禁防止主类重新长回去。
  • 若拆分有误,会表现为自动化流程注册或运行出错;这次只搬代码,整体撤回这次合并即可恢复原状。
  • 改动超过三千行,需要你批准后才能合并。

What changes

Steps 2 and 3 of the card, on top of step 1 (#38846, merged). Per the maintainer's ruling on this card (7305055957: 「A: keep the facade (Recommended)」), the 2,000-line target is dropped and the facade form holds.

AutomationEngine in packages/services/service-automation/src/engine.ts becomes a delegating facade: the bodies of 145 members move into static methods of eight facet classes, each body exactly as it stood (not re-indented, not formatted, not edited), with a this parameter added where the body reads the engine. Every member stays on the class with its signature and (when public) its docblock as a one-call stub, return XFacet.m.call(xHost.of(this), …), so the published declaration, an instance spy and a subclass override are what they were. A private member's docblock moved with its body. The engine's state (all 74 fields) stays on the class. engine.ts goes from 9,813 to 7,735 lines.

The shape is the objectql registry.ts split's: each facet module declares the AutomationEngine members its bodies read as an interface typed by indexed access on the class (AutomationEngine['x']), so a member renamed or retyped on the class is a compile error in the facet; each method's this is the Pick of that interface it reads. engine-facet-hosts.ts holds one host per facet per engine (a WeakMap, built on first use), filled by the factory the class's one static block installs: a method goes as a closure that calls it on the engine at call time, a field as a getter, and the five fields a body assigns (nodeTypeVocabularySealed, packagedFlowSource, packagedFlowDefaults, packagedFlowDefaultSource, flowCredentialSource) also with a setter. Facet modules import engine.ts for types only, so there is no evaluation cycle; index.ts re-exports nothing from them.

Every moved member and its new file

* marks a public member (its docblock stays on the class); every other member is private and its docblock moved with its body. "Host" is the number of engine members the facet's bodies read.

New module Lines Members Host Members moved
engine-dispatch-facet.ts 157 5 9 readScheduledWorkPolicy, slotKeyedRunStore, missedRunLimit, recordMissedRun, noteRunStarted
engine-extensions-facet.ts 686 26 37 resolveTriggerBinding, activateFlowTrigger, triggerRun, deactivateFlowTrigger, getActiveTriggerBindings, assertSameOriginOrFree, connectorInstance, resolveConnectorAction, resolveConnectorActionInputSchema, resolveConnectorActionEffect, organizationLocale, getConnectorOrigin, getConnectorDegradedReason, getConnectorDegradedHold, registerConnectorProvider, unregisterConnectorProvider, getRegisteredConnectorProviders, getConnectorDescriptors, getRegisteredNodeTypes, getActionDescriptors, getRegisteredTriggerTypes, knownNodeTypes, getUnknownNodeTypeAudit, sealNodeTypeVocabulary, getSealedNodeTypeVocabulary, warnUnknownNodeTypes
engine-flow-slots-facet.ts 814 41 55 flowArmHolder, loaderOwnerOf, placeFlowSlot, bindPackagelessActivation, flowActivationBinds, moveFlowRecords, flowKeyNow, sharedFlowNameRefusal, resolveFlowKey, bareFlowKey, servedBareFlowKey, isDisabledHolderSlot, isDisabledSoleHolder, flowSlotPackage, flowSlotName, flowSlotKeysOf, loneSharedFlowKey, settleFlowName, isSharedFlowKey, executeSlot, setPackagedFlowSource, setPackagedFlowDefaultSource, packagedFlowOwner, inboundHookSlot, disabledHolderHookRefused, packagedFlowSlotOwner, isPackagedFlow, refuseUnpackagedDefaultActive, isShippedFlowName, packagedFlowDefault, refreshPackagedFlowDefaults, flowNameRefusal, connectorNameRefusal, resolveConnectorInstanceFor, codeRegisteredInstance, flowCallerPackage, armedFlowPackage, flowHolder, durableFlowHolder, flowHolderPackage, flowDispatchHolder
engine-registration-facet.ts 585 21 58 judgeFlowRegistration, dryRun, registerFlow, unregisterFlow, withdrawFlow, withdrawFlowSlot, withdrawFlowKey, recordFlowRefusal, getFlowRegistration, recordFlowShadowing, getShadowedFlows, listFlows, getFlow, getRunFlow, flowKeyOfRun, getFlowSlot, getHeldFlow*, registrationChecks, validateFlowExpressions, getValueType, validateNodeInputSchemas
engine-connector-doors-facet.ts 247 16 9 setFlowCredentialSource, pullConnectorSource, requireConnectorCredentialDoor, attachConnectorCredentialPubSub, resyncConnectorCredentialPubSub, listConnectorCredentialRefs, setConnectorCredential, clearConnectorCredential, requireConnectorConnectionDoor, getConnectorConnection, beginConnectorConnection, completeConnectorConnection, revokeConnectorConnection, holdsFlowCredential, resolveFlowCredential, flowCredentialHoldings
engine-enablement-facet.ts 410 12 20 isFlowEnabled, describeDisabledFlow, subflowTargets, resolvedFlowCallKey, declineOntoDisabledSubflows, declineOntoSuspendingSubflowNotice, declineOntoRegionSuspendingCall, declineOntoSubflowRetriedCallout, toggleFlow, toggleFlowSlot, getFlowVersionHistory, rollbackFlow
engine-run-facet.ts 1084 8 35 getFlowBodyChecksum, execute, failRunBeforeFirstNode, executeKey, runRegion*, retryExecution, recordLog, compactStepsForHistory
engine-resume-facet.ts 676 16 20 persistSuspendedRun, claimAdvance, resolveSuspendedNodeType, resolveDeclaredResumeAuthority, resolveSuspensionChainForCancel, hasSuspendedRun, unresumableSuspensionCause, recoverStoredFlow, heldFlowVersion, suspendedMapParentOf, suspensionOf, refuseInvalidScreenInput, buildSubflowResumeSignal, bubbleToParent, refuseRestore, getSuspendedScreen*
engine-facet-hosts.ts 61 the FacetHost holder and the eight host instances

The cut: run (getFlowBodyChecksum with the run checksum from #38825, execute, executeKey, runRegion, retryExecution, the run log), resume (suspension persistence and claims, resume authority, the suspension chain, screen input, bubbling to the parent, restore refusals), registration (registerFlow, judging, withdrawing, refusals, shadowing, reading flows back, the registration-time checks), plus flow slots, dispatch, extensions (triggers, connectors, providers, resolvers, the node-type vocabulary), connector doors and enablement (subflow guards, toggles, version history, rollback). getRunFlowChecksum was already a one-call delegation to run-flow-checksum.ts and stays as it was.

Stay on the class. All fields; the 127 members that were already delegations at the base (the #25222 per-call host stubs and plain forwards: the facade gate accepts them as they are, and converting them is not part of this card per the ruling); and seven members with exceptions rows (card #38667), each with its reason in the registry:

  • constructor: state-owning, it writes the engine's fields from its arguments.
  • flowSlots, flowLedgerDisabled, flowCallKey: fields whose initializers hold arrows over the engine's own state; they run at construction, or are the value itself.
  • resolveCanonicalDescriptor, resolveResumeAuthority, walkSuspensionChain: their bodies read private statics of the class (MAX_ALIAS_HOPS, RESUME_AUTHORITY_WHEN_UNDECLARED, MAX_SUSPENSION_CHAIN_DEPTH, LINKED_RUN_PREFIXES), which a module outside the class cannot read.

The facade gate (ask 3)

scripts/facade-delegation-registry.json gains a facades row for AutomationEngine (card #38667), a ceilings row for engine.ts (baseLines 7735 at baseCommit 53e745f, maxLines 7835 = CEILING_MARGIN 100, ruling 6897467376) and the seven exceptions rows above. The gate's self-test holds DECLARED_WATCH_HINTS equal to the registry's facade files, so scripts/check-facade-delegation-only.mjs gains the one path string; nothing else in the gate changes.

Gate citations of the moved code, edited outside the package (declared)

  • scripts/facade-delegation-registry.json: the rows above.
  • scripts/check-facade-delegation-only.mjs: one DECLARED_WATCH_HINTS string.
  • scripts/tenant-audit-census.mjs: 14 UNTYPED_RECEIVERS rows (engine: false), one per facet file and receiver: the engine's own in-memory Map/Set fields a facet body calls .delete(...) on. Inside the class the census read the field's type; through AutomationEngine['x'] on the host it cannot.
  • docs/audits/2026-08-tenant-audit-write-call-sites.counts/services/service-automation.md: the shard regenerated by node scripts/tenant-audit-census.mjs --write. Two of those deletes, this.flowRefusals.delete(name) and this.sharedSlotTriggerWarned.delete(name) in engine-registration-facet.ts, are now placed as engine writes by the census's name: string parameter rule (they are in-memory map deletes, not data-engine writes), so the shard counts 42 write sites where it counted 40. A precision limit of the census through the host, noted here, not worked around: the bodies are moved unedited.
  • packages/spec/liveness/flow.json and connector.json: 10 citations re-pointed to the module that now holds the body they name (engine-run-facet.ts#retryExecution and the retry-backoff keys; engine-extensions-facet.ts#getConnectorDescriptors); no verdict changes. The ledger ships in @objectstack/spec, so the changeset names that package with a patch too.

Net growth past a pure move (package source: 9,813 lines in engine.ts before; 7,735 + 4,659 in the facets + 61 in the hosts module after, +2,642)

  • engine.ts (git diff --numstat: +469 -2,547): 145 one-line forwarding calls; the static host block (266 lines); a 12-line import block for the facets and hosts; the rest are stub signatures re-spelled (async dropped so each stub returns the facet's own promise; registrationChecks and validateFlowExpressions take their destructured option bag as options and hand it on). Import specifiers only the moved bodies read are pruned.
  • Each facet: the moved text (the base member from its signature, or its docblock when private, to its closing brace) plus what is new: header, imports, host interface, class wrapper, a one-line docblock pointing each public member's body at the class's docblock, and a this: line where the parameter list is multi-line. The signatures exist on both sides by design (the class keeps the contract).
Facet Lines Moved base text New Public pointers this lines
engine-dispatch-facet.ts 157 88 69 2 0
engine-extensions-facet.ts 686 528 158 18 2
engine-flow-slots-facet.ts 814 630 184 16 2
engine-registration-facet.ts 585 426 159 15 2
engine-connector-doors-facet.ts 247 135 112 14 0
engine-enablement-facet.ts 410 318 92 4 0
engine-run-facet.ts 1084 968 116 3 3
engine-resume-facet.ts 676 551 125 5 5
  • engine-facet-hosts.ts: 61 lines, new.
  • No type is re-declared, no name changes, no body is edited.

Tests

No test file changed.

service-automation typecheck and suite at 91b6bff: 301 files, 4,468 tests pass

Dependency closure built (os-verify-lock.sh -c "pnpm --filter '@objectstack/service-automation^...' build --concurrency=2", VERDICT command-exit 0); pnpm --filter @objectstack/service-automation typecheck (tsc plus check:test-typecheck) VERDICT command-exit 0; pnpm --filter @objectstack/service-automation exec vitest run --maxWorkers=2: Test Files 301 passed (301), Tests 4468 passed (4468), VERDICT command-exit 0. The same 301 files and 4,468 tests as main. Taken at 91b6bff, whose package source is the head's: the head's one later commit changes only the registry's baseCommit.

Move verifier: 145 facet methods identical to the base member

A throwaway verifier (not committed) parses engine.ts at main (f3f3265) and every facet module, and compares each facet method with the base member of the same name: body text, parameters (the added this aside), return type, type parameters, async, and for a private member its docblock. 145 facet methods: 145 identical to the base member (body, parameters, return type, type parameters, async; a private member's docblock), 0 problem(s). Negative control: one token changed in engine-run-facet.ts reds getFlowBodyChecksum: body.

Published declaration, built at main (f3f3265) and at the head

dist/index.d.ts (and dist/index.d.cts, identical to it in both builds): 156 top-level declarations before and after, none added or dropped, the export list equal as a set (130 names), each module's import specifiers equal as sets. 152 declarations byte-identical, AutomationEngine among them. The other 4 (SysAutomationRun, SysSyncRun, SysFlowDispatch, SysFlowCredential, Zod-inferred object shapes) are equal once the order the printer lists a string-literal union's members in is set aside ("code" | "secret" | "user" | "record" vs "user" | "secret" | "record" | "code": the same members). Positive controls on copies of the head build: renaming one AutomationEngine member, and changing getFlowBodyChecksum(flow: unknown) to (flow: string), each red AutomationEngine.

Facade gate

node scripts/check-facade-delegation-only.mjs: exit 0, AutomationEngine: 351 members — 273 delegations, 71 fields, 7 named exception(s) (#38667), engine.ts: 7735 lines, ceiling 7835 (100 left; ruling 6897467376), 8 facade class(es) in 6 file(s) hold delegations only, 28 named exception(s). --self-test: 44 cases pass.

Derived gate families at 8b19bf8

node scripts/pm/dispatch-gates.mjs --commands (no paths; derived from the tree of objectstack-ai/objectstack at 8b19bf8) named 100 commands; all 100 were run there, each exit code captured before any pipe, and --ran reconciled the record: 100 derived famil(ies) accounted for — 98 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).

Among the 98 at exit 0: check:facade-delegation-only and the gate's --self-test, check-tenant-audit-census and its self-test (with the 14 rows and the regenerated shard), pnpm --filter @objectstack/spec run check:liveness (red before the 10 citations were re-pointed, green after), check:platform-checklist, check:adr-anchors, check:system-context-census, check:dispatcher-error-vocabulary, check:pm-dispatch-gates, check-plugin-teardown-shape and its self-test, and the changeset gates.

NOT MEASURED (each exited 3, prerequisite not met: they read the built dist/ of every workspace package, and this container built only this package's dependency closure; CI runs them):

  • pnpm check:dual-build-cjs-loads
  • pnpm check:published-readme-exports

Outside the derived set: node scripts/check-platform-checklist.mjs --changed-from origin/main exit 0 (15 anchors judged, 0 lost). scripts/pm/overlap-check.mjs: merges cleanly into origin/main 3c617a2 (4 commits past this branch's base; they touch spec form/view conversions and the CLI, none of this PR's files).

Acceptance notes

  • engine.ts is 7,735 lines, not below 2,000: the maintainer ruled the facade form holds and the 2,000-line target is dropped for this card (7305055957). What remains is the public docblocks (the published contract), the 74 documented fields, the stubs, the 127 earlier delegations with their docblocks, and the host block.
  • plugin.ts is untouched: no helper of it moves with the engine's.
  • The cards that follow on the engine land in the facet of their concern; the ceiling reds a PR that grows engine.ts by more than 100 lines.

Verification

Read first, by risk:

  1. engine.ts, the static block at the end of the class: every field a body assigns needs its setter there (five do), or the write lands on nothing; the eight host interfaces type-check that every member a body reads is there.
  2. engine-facet-hosts.ts: the host is built once per engine and cached, so a body's this is the same object across calls.
  3. engine-run-facet.ts executeKey: its one bare this (startConditionHolds.call(this, …)) now hands the run host, which carries evaluateCondition, the one member startConditionHolds reads.

Two-minute check: pnpm --filter @objectstack/service-automation test (expect 301 files, 4,468 tests passing) and node scripts/check-facade-delegation-only.mjs (expect the AutomationEngine line: 351 members, 273 delegations, 71 fields, 7 named exceptions, and engine.ts: 7735 lines, ceiling 7835).


Generated by Claude Code

…nto eight facet modules behind one-call stubs (wip)

Claude-Session: https://claude.ai/code/session_01QSeKYka8mG8XtvFU8AvP9X
Co-authored-by: Claude <noreply@anthropic.com>
… line ceiling and its seven exceptions

Claude-Session: https://claude.ai/code/session_01QSeKYka8mG8XtvFU8AvP9X
Co-authored-by: Claude <noreply@anthropic.com>
…aps a facet body deletes from, and the regenerated service-automation shard

Claude-Session: https://claude.ai/code/session_01QSeKYka8mG8XtvFU8AvP9X
Co-authored-by: Claude <noreply@anthropic.com>
…odules that now hold the engine bodies they name

Claude-Session: https://claude.ai/code/session_01QSeKYka8mG8XtvFU8AvP9X
Co-authored-by: Claude <noreply@anthropic.com>
…commit on this branch

Claude-Session: https://claude.ai/code/session_01QSeKYka8mG8XtvFU8AvP9X
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/service-automation, @objectstack/spec, touching 443 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/spec/liveness/connector.json, packages/spec/liveness/flow.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

55 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3c617a28ea51f0d4a2d11f180dc3ee57106a7151.

⛔ 19 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/liveness/connector.json, packages/spec/liveness/flow.json) — pages documenting those are invisible to this run
  • 10 name(s) were too generic to anchor anything (single lowercase words)
  • 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 — 182 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 3c617a28ea51f0d4a2d11f180dc3ee57106a7151 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 190e3d63723078f53b7c0639955d46c6245e7085 — the merge of head 8b19bf8bbfdf745e0130172a7174c8a725102c9e into base 3c617a28ea51f0d4a2d11f180dc3ee57106a7151, 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 190e3d63723078f53b7c0639955d46c6245e7085 && git checkout 190e3d63723078f53b7c0639955d46c6245e7085
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3c617a28ea51f0d4a2d11f180dc3ee57106a7151 8b19bf8bbfdf745e0130172a7174c8a725102c9e && git checkout -B drift-repro 3c617a28ea51f0d4a2d11f180dc3ee57106a7151 && git merge --no-ff 8b19bf8bbfdf745e0130172a7174c8a725102c9e

node scripts/docs-audit/affected-docs.mjs --json 3c617a28ea51f0d4a2d11f180dc3ee57106a7151

⚠️ 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 3c617a28ea51f0d4a2d11f180dc3ee57106a7151 → 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@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 8b19bf8bbfdf745e0130172a7174c8a725102c9e
Local-runs: none

Read-only by the lane seat: the diff from merge base to this head (17 files, +5,369/-2,567), the PR body's move evidence, card #38667 with the maintainer's ruling 7305055957 and dev report 7307158011, and the head's check-runs. The diff is on the declaration face only: no file under packages/spec/src/**, no governed path, no narrowing. It is Tier H by the size limb alone.

① Derived judgments

  • Move-only. The bodies of 145 AutomationEngine members move into static methods of eight facet classes. The PR body's verifier reads all 145 as identical to the base member (body, parameters, return type, type parameters, async, a private member's docblock), with 0 problems and a negative control that reds getFlowBodyChecksum. The seat checked the added lines of engine.ts itself: each member left behind is a one-call stub of the form return XFacet.member.call(xHost.of(this), …), with no logic.
  • Public declaration unchanged. dist/index.d.ts built at main and at this head: 156 declarations, the export list equal (130 names), import specifiers equal per module, 152 byte-identical including AutomationEngine. Positive controls: renaming an AutomationEngine member, or changing getFlowBodyChecksum's parameter type, in copies of the head build reds the comparison.
  • Facade registered. scripts/facade-delegation-registry.json holds the facade, a ceiling (7,735, max 7,835) and seven named exceptions; check:facade-delegation-only passes ("351 members — 273 delegations, 71 fields, 7 named exception(s)"). This is the form the maintainer chose (ruling A, 「A: keep the facade (Recommended)」); the 2,000-line target is dropped for this card.

② Semver level

  • @objectstack/service-automation patch: no exported name or signature changes. @objectstack/spec patch: only packages/spec/liveness/flow.json and connector.json change, 10 citations re-pointed to the moved code with no verdict change; nothing under packages/spec/src/** moves.

③ Boundary flags

  • Clause-②: no, Metadata-protocol: none: hold. No accept set, public surface or authorable metadata moves.
  • The gate citations outside the package (scripts/check-facade-delegation-only.mjs one watch-hint string, scripts/tenant-audit-census.mjs 14 UNTYPED_RECEIVERS rows, the regenerated census shard) re-point existing checks at the moved code; each gate passes at this head. The census counts two in-memory map deletes through the facet host as engine writes (42 sites where it showed 40), a precision limit of the census, not a code change.
  • No test file changed; service-automation 301 files, 4,468 tests pass. No security behaviour touched.

Implemented-by: claude/issue-38667-split-automation-engine-step2
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

@objectstack-fleet

objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

L1 ACCEPT · PR #38889 (#38667, steps 2+3) · head 8b19bf8bbfdf745e0130172a7174c8a725102c9e · read 2026-12-01T11:04Z

席位核对 · ACCEPT

ACCEPT · repo:objectstack@os-justin · head 8b19bf8bbfdf

  1. Shape. Draft, base main, Fixes #38667 first after the seat signature; no keyword binds another card. This PR delivers the rest of the card under the maintainer's ruling A (7305055957), so Fixes is right; step 1 landed as PR refactor(service-automation): move the automation engine's top-level declarations into eight leaf modules (step 1 of the engine split) #38846 with Part of.

  2. Premise measured. engine.ts is 9,813 lines on main after step 1; this PR makes AutomationEngine a delegating facade (145 member bodies into eight facet classes) and takes it to 7,735, under a registered ceiling of 7,835.

  3. Gates (check-runs at this head). 62 success · 15 expected skip; Lint & Repo Gates and TypeScript Type Check success. One PR-body guards check-run reads failure at 09:45Z: it ran before the seat amended the claim's Branch: line to this branch; the same guard re-ran on the body edit at 10:05Z and is success (both runs sit on this head in two check suites; the newer is the reading, and the guard runs again on merge_group). Contract review at TIER_DEFAULT (the declaration face; Tier H by size only): PASS 7309121511 on this head. Move evidence: verifier 145/145 identical with a negative control; dist/index.d.ts equal with two positive controls; the seat's own reading: every member left in engine.ts is a one-call XFacet.member.call(xHost.of(this), …) stub.

  4. Accepted deviations. (a) The claim's surface was widened in place (claim 7300673225) to the gate citations the move re-points: scripts/check-facade-delegation-only.mjs, scripts/tenant-audit-census.mjs, the census shard, and two spec liveness files. (b) The ceiling row's baseCommit was re-pointed once on the branch before any PR existed. (c) The dev's open question, re-merge main now or not, taken as A: merge only on a conflict, a main-caused red or a queue kick; overlap with main is zero files and the queue tests the merged tree.
    4b. Net growth past a pure move: +2,642 lines in the package source, itemised (added to this record at the maintainer's question, 2026-12-01; seat's own numstat: engine.ts +469/−2,547, eight facets 4,659, hosts module 61). ① ≈1,097 lines are signatures and public docblocks present on both sides: ruling A keeps every member's signature and public docblock on AutomationEngine (the published declaration stays byte-identical), and each facet method carries its own signature (moved base text 3,644 against 2,547 removed). ② 1,015 lines are new in the facet files: headers, imports, the host interface, the class wrapper, a one-line pointer on each public member to the class docblock, and this: lines on multi-line parameter lists (itemised per file in the PR body). ③ 327 lines are the host mechanism: the 266-line static block in engine.ts lists, per facet, each engine field or method that facet reads (a getter or a forwarder per line), plus the 61-line hosts module; a facet is a separate class and cannot read the engine's private state otherwise. ④ ≈203 lines are the 145 one-line forwarders, a 12-line import block and about 46 re-spelled stub signatures. No line of logic is added. The growth is the structural cost of the facade form the maintainer chose; a smaller form either drops the class-side signatures and docs (changes the published declaration, ruling option C) or collapses the host block (option B's kind of follow-up, not ordered).

  5. Out of scope. The census now counts two in-memory map deletes through the facet host as engine writes (40 → 42): a precision limit of the census, recorded in the PR body, not filed. The superseded branches claude/issue-38667-split-automation-engine (merged) and …-wip are to be deleted after this lands. Skills-docs: not owed.

  6. Landing. Tier H by the size limb (check-governed-merges --pr 38889: 7,936 changed lines over 3,000; 0 of 17 paths governed): the maintainer approves and lands it, or authorises the landing. pm:awaiting-merge and the review request follow in the hand-off stroke.

Clause-②: no · Metadata-protocol: none

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

维护者速读

Head-sha: 8b19bf8bbfdf745e0130172a7174c8a725102c9e

Approval requested for PR #38889 at the head above: the seat's L1 ACCEPT is 7309148209 and the contract review PASS (TIER_DEFAULT, the declaration face) is 7309121511. Tier H by size only; it stays draft until an approval is on record, after which the seat lands it (or the approver enqueues it).

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 1, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 1, 2026 11:06
@os-zhuang
os-zhuang marked this pull request as ready for review December 1, 2026 12:27
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 8338d07 Dec 1, 2026
85 of 86 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-38667-split-automation-engine-step2 branch December 1, 2026 12:55
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/xl tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

拆分 service-automation engine.ts(12,298 行)为职责模块,只搬不改

3 participants