refactor(e2e): split the session half of a worker from the runner
Merged
KD
9h ago+1345+1345+0123456789012345678901234567890123456789-1139-1139-0123456789012345678901234567890123456789
Stack 1/3: this PR → move into @e2e-dev/core → @e2e-dev/core API.
2026-11-15: rebased onto main 235986078 and the package renamed from e2e-core to @e2e-dev/core. Command output quoted below predates the rename.
A refactor inside packages/e2e with no behavior change. It separates the half of a worker that drives an engine from the half that runs tests, so the next PR can move the first half into its own package.
flowchart LR
subgraph engine["session half (moves to @e2e-dev/core in 2/3)"]
ES["EngineSessions<br/>engine init and dispose,<br/>attempt launch and close"]
W["openWorker + WorkerPolicy"]
A["launchAttempt + AttemptPolicy"]
P["resolveProjectConfig"]
end
subgraph runner["runner half (stays in e2e)"]
TE["TargetExecutor"]
K["standalone-kinds.ts<br/>hosted, one-shot"]
R["resolveConfig<br/>reporters, filters"]
end
TE -- extends --> ES
K -- policy --> W
K -- policy --> A
R -- over --> P
run/engine-sessions.ts:EngineSessionstakes engine init and dispose, and each attempt's session from launch to close, out ofTargetExecutor, which now extends it.run/standalone.tsandrun/standalone-attempt.ts: the standalone worker takes aWorkerPolicy(who claims the engine, what runs its sessions) and anAttemptPolicy(identity,reserve,launched,closedhooks). The hosted (openHost) and one-shot (MCP) kinds move torun/standalone-kinds.ts, with the publication, soft failures, and host trace they own.- Config:
resolveProjectConfig(config/resolve.ts) resolves everything but reporters and test filters.resolveConfigin the newconfig/resolve-run.tsadds those on top. - Types:
ProjectConfig(types.ts) isE2EConfigwithoutreportersandfilters.E2EConfig,Report,Reporter, and the filter types move tosrc/run-types.ts.e2eexportsProjectConfig(changeset). - Smaller moves:
describeTarget→run/provision.ts,TestIdentity/SkipInfo→run/records.ts, andpairRecording→internal/recording-modes.ts, so the session side never importscollect/.
Verified
Ran it locally: yes. A refactor shows no behavior on screen, so the evidence is the existing suites, unchanged, against the built packages:
pnpm test: e2e 4624 passed (unit and integration), web 810, mobile 531, every other package green.- Testbed through the built CLI (
pnpm --filter @e2e-dev/testbed test): 588 passed, 1 skipped. pnpm checkpasses.
🤖 Generated with Claude Code