Skip to content

Move the toolchain passes to Effect - #312

Merged
DocksDocks merged 4 commits into
mainfrom
298-move-the-toolchain-passes-to-effect
Dec 2, 2026
Merged

DocksDocks merged 4 commits into
mainfrom
298-move-the-toolchain-passes-to-effect

Conversation

@DocksDocks

Copy link
Copy Markdown
Owner

Plan run: #298 Move the toolchain passes to Effect

Pull request: this one. Checks: Full CI requested. Reviewed head: c41d9d7d.

What changed

  • The dependency methods (probe, version, path), the toolchain report, and the toolchain outdated lookups are Effects with typed failures (cli/src/engine-native/deps.ts, toolchain.ts, services.ts).
  • One 8-second deadline covers each upstream request and its body, and each lookup recovers its own failure (toolchain.ts).
  • The Bun bootstrap of one engine context runs once, in an uninterruptible region; a folder creation or removal failure is a typed BunInstallFolderFailed with the original message, and the folder keeps its OS-resolved temporary parent (bun.ts, engineCtx.ts, index.ts, cli/src/engine.ts).
  • modes.ts, ompSync.ts, and ompPlugins.ts call the passes directly; versionReading is gone.
  • The toolchain, host-platform, omp-sync, and sync guidance names the Effect forms.

Decisions and corrections

Delegated decisions

  • Recorded in the Research of Move the toolchain passes to Effect #298 (Dependency methods, Toolchain, Bun, Logger, Bridges, Failure model). Rejected with evidence: delivering a typed cleanup failure to an interrupted waiter ahead of its interruption (plan round 6), because only a signal interrupts an engine run and it exits the process at once.

Reviews

Plan review passed in round 12. Code review passed in round 3.
Open findings: five LOW findings in #311.

Verification

Limits and failures

  • The spawned toolchain ensure bun staging case runs on Linux and macOS only, because Bun ignores TMPDIR on Windows.

Kept resources

  • None after the merge.

After merge

Checklist

  • bun run check passes
  • Tested locally end to end (deps, unit, commands, goldens, red-dry, red-mut, scan, bridges, guidance, dry, types, ci-tools, smoke, gate)
  • Code review passed

Closes #298

Step toolchain of #298 (child of #290): the dependency methods, the toolchain report and
outdated lookups, and the Bun bootstrap are Effects with typed failures. One deadline covers
each upstream request and its body; the Bun bootstrap of one engine context runs once, in an
uninterruptible region whose folder-removal failure is a typed BunInstallFolderFailed; modes,
ompSync, and ompPlugins call the passes directly; versionReading is gone. A spawned
toolchain outdated case proves the cache read with every proxy variable at a listener.

Verified: bun x --no-install vitest run (unit and commands rows of #298); bun run golden:dryrun; bun run golden:mutation; bun run check:types; bun run lint; bun run check
Step guidance of #298: the toolchain, host-platform, and dispatch guidance names the Effect
forms, and the skill source ranges follow the moved code.

Verified: bun x --no-install vitest run cli/test/unit/skillMetadata.test.ts
Step repairs of #298: the Bun temporary folder is made by the callback form of mkdtemp with
the original prefix, so the OS resolves TMPDIR; the bounded probe keeps its receiver; the
spawned toolchain cases skip the env file and have a child deadline; new cases cover a
folder-creation failure and a spawned ensure bun under a symlinked TMPDIR; the guidance names
the Bun bootstrap lock test, the mutationRegion signal deferral, and the version reader limits.

Verified: bun x --no-install vitest run (unit and commands rows of #298); bun run check:types; bun run lint; bun run format:check
Step repairs-2 of #298: the spawned ensure bun case runs with a fixture-only PATH and
builtin-only stubs, records each staging folder in its own file, ends the CLI process group on
expiry, and runs on Linux and macOS only; the sync guidance says that a synchronous folder
removal delays the signal handler.

Verified: bun x --no-install vitest run (unit row of #298, 200 tests); bun run check:types; bun run lint; bun run format:check
@DocksDocks DocksDocks linked an issue Dec 2, 2026 that may be closed by this pull request
@DocksDocks
DocksDocks marked this pull request as ready for review December 2, 2026 07:56
@DocksDocks
DocksDocks merged commit 19297d1 into main Dec 2, 2026
10 checks passed
@DocksDocks
DocksDocks deleted the 298-move-the-toolchain-passes-to-effect branch December 2, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move the toolchain passes to Effect

1 participant