Skip to content

[split-1066] U12(1+2) - task save-stage semantics + finalize open partial tool ask #1933

Description

@easonLiangWorldedtech

Unit U12 of the PR #1066 split (1/6).

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

Unit contract

Task.saveClineMessages() reports the message-write stage independently of the metadata / task-history stage, and Task.finalizePartialToolAsk() closes an open partial tool ask by type + text.

Why this unit exists on its own

Single provider group (Task persistence) + single gate scope. Planned as two units (U1 stage semantics, U2 finalize) and merged because the stage-semantics tests call finalizePartialToolAsk() — the test blocks cannot be split without orphaning them (test-block atomicity).

Boundary

Files and budget

  • src/core/task/Task.ts +75/-5 — byte-identical to source
  • src/core/task/__tests__/Task.spec.ts +400/-0 — byte-identical to source
  • src/core/assistant-message/__tests__/presentAssistantMessage-custom-tool.spec.ts +1/-0 — allowNew: one mock line, no source change
  • budget: 481 a+d / 3 files — SOFT-OVERSHOOT (rationale: single provider group + single gate scope; under the 1000 hard cap)
  • mutation gate: 41 changed executable lines (extension package) — 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 U12.json --worktree <wt> --head cf5abe64d6e8 — PASS (every changed file is a content subset of the source of record, or an explicitly sanctioned allowNew file).
  • Tests: 218 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: 18 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

  • U1 + U2 merged into this unit (test-block atomicity).

Reproduce

git fetch https://github.com/easonLiangWorldedtech/Zoo-Code p1066/u1-task-save-stages-and-partial-ask
node zdt.mjs split verify --contract U12.json --worktree <wt> --head cf5abe64d6e8
node zdt.mjs split measure --worktree <wt> --base 72143527fd33 --head cf5abe64d6e8
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