Unit U3 of the PR #1066 split (4/6).
Split plan: #703
PR: #1931
Content source of record: tag pr1066-source = 46d1d218701f0ce2d675b1b315489bacb6b0f77d (easonLiangWorldedtech/Zoo-Code).
Unit contract
BaseTool.onParameterParseFailure() teardown boundary plus the WriteToFileTool override: when the final block fails to parse, execute() never runs, so this boundary finalizes the open partial ask, restores the diff document, releases the per-task state, and reports the earlier streaming failure instead of the incidental parse error.
Why this unit exists on its own
Single provider group (BaseTool boundary + one tool override) + single gate scope.
Boundary
Files and budget
src/core/tools/BaseTool.ts +36/-3 — byte-identical to source
src/core/tools/WriteToFileTool.ts +22/-0 — content subset of source
src/core/tools/__tests__/writeToFileTool.spec.ts +192/-0 — content subset of source
- budget: 253 a+d / 3 files — UNDER-SOFT
- mutation gate: 30 changed executable lines (15 BaseTool + 15 WriteToFileTool) — under the 500 cap; valid mutants for the whole PR are 116 / 400, so no directive was added by this unit.
Verification (must pass by once, binary)
zdt split verify --contract U3.json --worktree <wt> --head e3c10401f760 — PASS (every changed file is a content subset of the source of record, or an explicitly sanctioned allowNew file).
- Tests: 243 passed / 5 skipped, exit 0 (narrowest relevant suites:
Task.spec.ts, writeToFileTool.spec.ts, writeToFileTool-partial-state-cleanup.spec.ts, removeClineFromStack-delegation.spec.ts, presentAssistantMessage-custom-tool.spec.ts).
- Changed-line coverage: 20 covered / 0 uncovered — PASS.
- ESLint
--prune-suppressions --max-warnings=0: clean on every touched file; suppression counts unchanged.
- No
.changeset file, no CHANGELOG edit (AGENTS.md).
Deviations recorded
- None.
- 1 Stryker directive in the diff (
hasPathStabilizedForTask, // Stryker disable next-line ConditionalExpression with a concrete reason: the !== undefined clause is not distinguishable by any test). It belongs to U4's content and travels with it.
Reproduce
git fetch https://github.com/easonLiangWorldedtech/Zoo-Code p1066/u3-parse-failure-boundary
node zdt.mjs split verify --contract U3.json --worktree <wt> --head e3c10401f760
node zdt.mjs split measure --worktree <wt> --base 4b23b6a270aa --head e3c10401f760
pnpm --dir src exec eslint --prune-suppressions --max-warnings=0 <touched file>
Unit U3 of the PR #1066 split (4/6).
Split plan: #703
PR: #1931
Content source of record: tag
pr1066-source=46d1d218701f0ce2d675b1b315489bacb6b0f77d(easonLiangWorldedtech/Zoo-Code).Unit contract
BaseTool.onParameterParseFailure()teardown boundary plus theWriteToFileTooloverride: when the final block fails to parse,execute()never runs, so this boundary finalizes the open partial ask, restores the diff document, releases the per-task state, and reports the earlier streaming failure instead of the incidental parse error.Why this unit exists on its own
Single provider group (BaseTool boundary + one tool override) + single gate scope.
Boundary
4b23b6a270aa(previous unit head, U5)e3c10401f760Files and budget
src/core/tools/BaseTool.ts+36/-3 — byte-identical to sourcesrc/core/tools/WriteToFileTool.ts+22/-0 — content subset of sourcesrc/core/tools/__tests__/writeToFileTool.spec.ts+192/-0 — content subset of sourceVerification (must pass by once, binary)
zdt split verify --contract U3.json --worktree <wt> --head e3c10401f760— PASS (every changed file is a content subset of the source of record, or an explicitly sanctionedallowNewfile).Task.spec.ts,writeToFileTool.spec.ts,writeToFileTool-partial-state-cleanup.spec.ts,removeClineFromStack-delegation.spec.ts,presentAssistantMessage-custom-tool.spec.ts).--prune-suppressions --max-warnings=0: clean on every touched file; suppression counts unchanged..changesetfile, no CHANGELOG edit (AGENTS.md).Deviations recorded
hasPathStabilizedForTask,// Stryker disable next-line ConditionalExpressionwith a concrete reason: the!== undefinedclause is not distinguishable by any test). It belongs to U4's content and travels with it.Reproduce