feat(task): persist task thinking effort on history items (DTE series 2/5) - #39
Closed
easonLiangWorldedtech wants to merge 1 commit into
Closed
Conversation
easonLiangWorldedtech
force-pushed
the
feat/dte-v2-3-task-runtime-effort
branch
from
September 4, 2026 07:42
d0b1a3d to
4075c8a
Compare
… 2/5) - historyItemSchema: optional thinkingEffort/thinkingEffortSource - taskMetadata: carries both keys (always present, even while undefined) so clearing the override propagates through the TaskHistoryStore merge - Task: constructor restore via setRuntimeThinkingEffort; saveClineMessages writes the active effort; abortTask snapshots the effort before dispose() clears it - dispose: task-end override reset + DTE JSDoc (boundary group split out of the DTE 2b PR per plan 2.6) - spec: taskMetadata key-presence contract + history round-trip / abort snapshot cases Part of #35 (DTE-v2 ship plan, unit 4/5).
easonLiangWorldedtech
force-pushed
the
feat/dte-v2-4-effort-persistence
branch
from
September 4, 2026 07:56
ac085bb to
111cf40
Compare
This was referenced Sep 4, 2026
Owner
Author
|
Superseded — U4 will be opened on upstream (Zoo-Code-Org/Zoo-Code) when its stack slot opens (max 3 open DTE-v2 PRs, ship plan 2.2). Head 111cf40 unchanged. |
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.
≤400-line redo of Zoo-Code-Org#1338 — DTE series 2/5, unit 4/5
Persistence for the task-local thinking effort: the history-item schema
fields,
taskMetadatapropagation (key-presence contract), the Taskconstructor restore, and the abort/dispose snapshot ordering. Also lands the
dispose boundary group split out of PR #38 per plan §2.6 — the task-end
override reset, its DTE JSDoc, and its test block.
Stack
feat/dte-v2-3-task-runtime-effort@4075c8a75(U3, PR feat(task): task-local runtime thinking effort state with per-request override (DTE series 2/5) #38 — amended in place with its 3 mutation-killing assertion lines; U4 rebased onto it)feat/dte-trial-allunion27a2e97df(tagdte-legacy/union), U4 sliceBudget (plan §2: a+d ≤ 400)
5 files changed, 248 insertions(+), 5 deletions(-)= 253 ≤ 400 ✓src/core/task/Task.tssrc/core/task/__tests__/Task.runtime-thinking-effort.test.tssrc/core/task-persistence/__tests__/taskMetadata.spec.ts(new)src/core/task-persistence/taskMetadata.tspackages/types/src/history.tsProvenance / fidelity
git merge-fileper file — base90b47b053(U3 tip, before the U4work), ours = U3 head, theirs =
77ec064d3(U4 tip).Task.tsandtaskMetadata.tsmerged clean (0 conflicts).history.tshad 2 conflictswhere main's newer
pendingTaskActionschema met the DTE import/fields —resolved by keeping both (imports alphabetical, DTE block above the
pendingActionfield; result = 7+/0− over U3 head).taskMetadata.spec.ts(new, 81 lines) is the byte-exact77ec064d3version. The runtime-effort test is the byte-exact
77ec064d3version(394 lines) plus the same 3 mutation-killing assertion lines that landed
with U3 (PR feat(task): task-local runtime thinking effort state with per-request override (DTE series 2/5) #38) plus the 13-line constructor-restore killing test added by
the mutation-diff fix below — 410 lines total; both carry no U5/U14 content.
Task.tsdispose boundary group (task-end reset + DTE JSDoc, 9 lines) andthe 13-line
describe("dispose")test block are the content PR feat(task): task-local runtime thinking effort state with per-request override (DTE series 2/5) #38 splitout under plan §2.6; they land here with the persistence work, matching the
plan's U4 scope ("persistence + boundary cases").
src/eslint-suppressions.json: untouched (no U4-owned count changes).Out of scope (next unit)
output_config.effortadaptive envelope.Mutation-diff fix (killing test, plan L42 — same PR)
The first CI
mutation-diffrun (headac085bbe6, based0b1a3dcd)reported 1 Survived
ConditionalExpressionmutant (replacement: true) onthe constructor restore guard
if (historyItem.thinkingEffort)(
Task.tsL594). Mechanism note: Stryker v10'sConditionalExpressionmutator mutates if-tests (the
?:ternary branch is commented out inthe mutator source), so this is the guard's condition →
true.It survived because the redundant restore call it introduces,
setRuntimeThinkingEffort(undefined, undefined), hits the setter'salready-inactive early return and leaves no observable state change — the
existing "leaves the override inactive" it only asserts state. Fix (same
PR): a 13-line
it("never calls the restore path when the history item has no persisted effort")with avi.spyOn(Task.prototype, "setRuntimeThinkingEffort")call-count assertion — fails on the mutant,passes on the real guard.
Local dev-stage gate on the amended head (§5.1):
node scripts/stryker-diff.mjs ci --base 4075c8a75 --head 111cf40ae→extension 22 changed lines, 10 ranges, exit 0, 0 Survived.
Verification (local)
pnpm --dir src exec eslint --prune-suppressions --max-warnings=0on the four src files → exit 0, no count changepnpm check-types→ 11/11 projectspnpm --dir src exec vitest run core/task/__tests__/Task.runtime-thinking-effort.test.ts→ 16/16 (3.81 s);core/task-persistence/__tests__/taskMetadata.spec.ts→ 3/3 (unchanged by this amend)git diff --shortstat 4075c8a75 HEAD→ 248+/5− = 253 ≤ 400 (the 3 shared killing-assertion lines already sit in the U3 base and do not appear in this diff)