Repository navigation
Move tidy to Effect - #303
Merged
Merged
Conversation
Step tidy of #295 (child of #290): - runBounded runs Effect tasks with workers that cannot fail; a failure drains the started tasks and the lowest-index cause wins, so no started task is interrupted. - tidy.ts and tidyReport.ts: the host returns Effects, file work goes through FileSystem with the base outcome per call, base throws are tagged failures, legacy calls are bridged. - commands/tidy.ts: the apply lock is a scoped tryAcquireKitLock; the command runs inside exitOnSignal; the apply defers the signal exit except at its git and docker calls (deferSignalExit, signalExitPoint in engine.ts), until its result is printed. - Runner cases move to syncConcurrency.test.ts with the two error-order cases; tidy and report tests run on Effect stubs; new cases cover the untested paths and the spawned CLI. Verified: bun x --no-install vitest run cli/test/unit/syncConcurrency.test.ts cli/test/unit/engine-di.test.ts cli/test/unit/tidy.test.ts cli/test/unit/tidyReport.test.ts cli/test/unit/kitLock.test.ts cli/test/unit/scratch.test.ts cli/test/unit/skillMetadata.test.ts; bun run check:types; bun run lint; bun run check
Step guidance of #295: tidy-context names the scoped tryAcquireKitLock, the signal exit and deferral of the apply, the section failure rule, the runBounded gotcha, the paths that stay untested, and the new source line ranges. Verified: git grep -n -e 'a throw becomes' -e 'acquireUseRelease' -e 'Network removal, log rotation' -- .agents/skills/tidy-context; bun x --no-install vitest run cli/test/unit/skillMetadata.test.ts
Closed
DocksDocks
marked this pull request as ready for review
December 2, 2026 02:55
DocksDocks
marked this pull request as draft
December 2, 2026 03:01
Full CI failed on Ubuntu and Windows: RegExp.escape is not a function in the Node of the runners. The two assertions now compare the path part as a string. Verified: bun x --no-install vitest run cli/test/unit/tidy.test.ts; bun run lint; bun run format
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.
Plan run: #295 Move tidy to Effect
Child of #290 (step
tidy). Reviewed head:b7c49363. Checks: see the pull request.What changed
cli/src/engine-native/syncConcurrency.ts:runBoundedruns Effect tasks. Its workers cannot fail. After a task fails, no queued task starts, the started tasks finish, and the failure with the lowest index is reported. No started task is interrupted.index.tskeeps its exports.tidy.tsandtidyReport.ts: the host methods return Effects. File work goes through theFileSystemservice, and each call keeps its old outcome. The old throws are tagged failures (TidyCheckFailed,ReportSectionFailed,TidyLockFailed) that keep the original error ascause. Calls intoexec.ts,processes.ts,scratch.ts,ompFileDeploy.ts, andhome.tsgo throughbridge.ts.cli/src/commands/tidy.ts:Effect.promiseis gone. The apply lock is onetryAcquireKitLocktry inEffect.acquireRelease. At the command boundary, a typed failure dies with its original error.tidyexits 130 at once on SIGINT or SIGTERM, as before (exitOnSignal, now exported fromcli/src/engine.ts). During--apply, a signal waits until the apply result is printed. A signal during agitordockercall of the apply still exits at once (deferSignalExit,signalExitPoint).syncConcurrency.test.ts, which adds the two error-order cases of the first comment of Move the engine-native layer to Effect #290.--repolisting, the scratch recheck at apply time, and--repoinput resolution.tidy,tidy --report, and the signal paths.tidy-contextskill describes the lock scope, the signal rules, the section failure rule, and therunBoundedgotcha.Delegated decisions
Effect.forEachwithconcurrency. Record: Research, "The runner".FileSystemkeeps the old outcome of each call; the errno code comes from the cause of thePlatformError. Rejected: bridgednode:fscalls. Record: Research, "Files".tryAcquireKitLockreplaces the Promise poll withwaitMs: 0. Record: Research, "The apply lock".Reviews
Verification (on
9939bb6c)runner: exit 0, 8 passed. Red baseline: both error-order cases failed against anEffect.forEachrunner.tidy,untested: exit 0, 92 passed, 1 skipped.commands: exit 0, 9 passed. Red baseline: both deferral cases failed with the deferral disabled.scan: exit 1, no match.bridges: 7 matches, each an allowed wrap.goldens: OK, no golden change.red-dry,red-mut: exit 1 withprove-red OK.guidance,dry,types,ci-tools,smoke: pass.gate(bun run check): exit 0, 6507 passed, 12 skipped.Limits and failures
Full CIcovers Ubuntu, macOS, and Windows. The spawned signal cases run on Linux and macOS only.Full CIrun (46798663884) failed on Ubuntu and Windows: two assertions usedRegExp.escape, which the Node of those runners lacks. Commit b7c4936 compares those paths as strings;tidy.test.tspassed after it (63 passed).Kept resources
Merge now: none.Leave pull request open: the worktreeissue-295and the local and remote branch295-move-tidy-to-effect.After merge
tidyto done. The next child is Move the omp passes and the kit store to Effect #296.Checklist
bun run checkpassesCloses #295