Skip to content

[split-1066] U7 - fix(write-to-file): clean partial state on missing-param and rooignore denial #1938

Description

@easonLiangWorldedtech

Unit U7 of the PR #1066 split (6/6 + FINAL).

Split plan: #703
PR: #1928
Content source of record: tag pr1066-source = 46d1d218701f0ce2d675b1b315489bacb6b0f77d (easonLiangWorldedtech/Zoo-Code).

Unit contract

The early-return and rooignore-denial branches clear the per-task partial state and finalize the open ask, so a denied or truncated write does not leave stale state or a dirty diff document.

Why this unit exists on its own

Single provider group + single gate scope. This is the last unit, so its unit PR and the FINAL integration PR are the same PR (#1928) — the sole merge target of the series.

Boundary

Files and budget

  • src/core/tools/WriteToFileTool.ts +27/-2 — byte-identical to source
  • src/core/tools/__tests__/writeToFileTool.spec.ts +210/-2 — byte-identical to source
  • budget: 241 a+d / 2 files — UNDER-SOFT
  • mutation gate: 24 changed executable lines — 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 U7.json --worktree <wt> --head 646c7873926f — PASS (every changed file is a content subset of the source of record, or an explicitly sanctioned allowNew file).
  • Tests: 264 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: 12 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.
  • At the final state the whole series is 2125 a+d / 9 files (2025 from the source of record + 100 sanctioned new test lines + 1 allowNew mock line), and the final head is byte-identical to the content source of record for all 8 original files.

Reproduce

git fetch https://github.com/easonLiangWorldedtech/Zoo-Code p1066/u7-early-return-denial-cleanup
node zdt.mjs split verify --contract U7.json --worktree <wt> --head 646c7873926f
node zdt.mjs split measure --worktree <wt> --base 9b93a6f882a4 --head 646c7873926f
pnpm --dir src exec eslint --prune-suppressions --max-warnings=0 <touched file>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions