refactor(fb15a): split task/index.ts into modules - #170
Conversation
dirac-run
left a comment
There was a problem hiding this comment.
The #166 dependency is now resolved. This branch also contains #169's test commit, so the clean sequence is to merge #169 first and let GitHub reduce this PR to the task-loop extraction. I found no concrete semantic drift in the static review, but because this moves a large part of the core request loop, please provide a visible full task-suite result before merging.
|
Follow-up needed: The dependencies are now merged, and the effective diff is correctly reduced to the eight task modules plus Please rebase or otherwise update this branch onto current |
- Moves claim/commit/rollback/settle/enqueue/append/restore helpers out of src/core/task/index.ts into a focused helper module. - Keeps Task class as a thin façade that delegates via a context object, preserving the existing public/private method surface. - Verified: core/task tests 283 passing, tsc baseline unchanged, biome clean. Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…s.ts - Moves the ~120-line writePromptMetadataArtifacts implementation out of src/core/task/index.ts into a side-effect-isolated helper module. - Task.writePromptMetadataArtifacts becomes a thin façade; DiracContext receives an arrow wrapper so the public callback shape is preserved. - Verified: core/task tests 283 passing, tsc baseline unchanged, biome clean. Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…skRequestOutcome.ts Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…to helpers Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…nput.ts Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…to TaskRequestLoop.ts Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
03f862f to
a32675a
Compare
|
Two behavior gaps remain in the extracted
I’m merging this and will fix both forward before release by restoring the omitted request-builder wiring and adding focused regression coverage. |
Summary
Extract eight focused modules from
src/core/task/index.ts(reduced from ~1658 to ~140 lines):TaskApiRequestAttempt.ts— attemptApiRequest splitTaskMistakeLimit.ts— mistake-limit handlingTaskPromptArtifacts.ts— prompt metadata artifact writingTaskRequestBuilder.ts— buildApiRequestParamsTaskRequestLoop.ts— attemptApiRequest + recursivelyMakeDiracRequestsTaskRequestOutcome.ts— handleApiRequestError + processStreamResultTaskSteering.ts— steering/checkpoint orchestrationTaskUserInput.ts— waitForFollowUp + submitCardResponseWhy
FIX-BACKLOG FB-15a — single responsibility: each module owns one concern.
Review follow-up
master(was 36 behind + conflicting).index.ts(master evolvedbuildApiRequestParamsandrecursivelyMakeDiracRequests— kept the PR's delegate-call pattern).Task-suite results (rebase head)
SourceAstTraitBuilder— pre-existing assertion mismatch, confirmed on master.SubagentRunnerafterEach — pre-existing TCC EPERM (AgentConfigLoaderwatches~/Documents/Dirac), env-specific.Zero new failures from this PR.
Changes
src/core/task/index.ts— reduced to thin delegatestsconfig.unit-test.json— test glob adjustmentVerification
tsc -p tsconfig.unit-test.json --noEmit— only pre-existing baseline error.Closes FB-15a (FIX-BACKLOG).