refactor(dev): coalescing rebuild scheduler on Effect fiber + Semaphore + Deferred (wave 3.5 stage 3, PR 3) - #160
Merged
Conversation
…re + Deferred (wave 3.5 stage 3)
🦋 Changeset detectedLatest commit: f939694 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 1, 2026
This was referenced Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Subsystem 2 of 4 for #152 stage 3. Reordered ahead of the SSE hub and EpochStore with one sentence of justification: the scheduler is a single self-contained seam inside
DevCoordinatorwith unit-pool-only owning suites, while EpochStore carries cross-process durability contracts — smallest remaining blast radius first. (The SSE hub audit outcome is recorded below.)#startBuildruns#performBuildunder aSemaphore(1)permit (withPermit); admission already guarantees a single holder, the permit makes the serialization invariant structural rather than implicit.Deferred. Every rebuild that arrives while a build runs merges (unchangedmergeInvalidations) into one queued slot whose requesters share a singleDeferred<ArtifactEpochResult>; the drain hook (Effect.onExit, sitting exactly where the pre-Effectfinallychain sat) starts the follow-up fiber and completes the deferred with its result,failure('DevCoordinator is closing.')on close, or the sentinel failure if the follow-up rejects.#awaitStartupraces) is deliberately untouched: it is the startup lifecycle, not the rebuild scheduler, and its three blocked-startup suites pin Promise-level sequencing.SSE hub audit note (subsystem decision, code lands separately)
The planned "PubSub-backed SSE hub" fails the honesty test: the hub's public contract is synchronous re-entrant fan-out —
foreground-server.tsdocuments "EventHub delivery is synchronous" as the invariant that lets shutdown tombstones reach socket buffers before sockets are destroyed, and ~15 tests pin sync replay/removal/ordering. EffectPubSubis an async fan-out structure; fiber delivery changes that observable contract. The hub stays imperative;docs/effect-conventions.mdgets the record in the closing docs PR.Parity (all suites unchanged, zero pin flips)
dev-coordinator,dev-watcher,dev-server,dev-events,dev-events.contract): 74 passed / 0 failedpnpm lint+pnpm typecheck: greenRefs #152.