feat(task): manual conversation checkpoint storage + Task trigger methods - #14
Merged
Merged
Conversation
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.
feat(task): manual conversation checkpoint storage + Task trigger methods
Part of the Task Tree unified subtask management plan (issue #9, PR-5). Adds a conversation checkpoint — distinct from the existing git-based file checkpoints (
RepoPerTaskCheckpointService) which snapshot the working tree. A conversation checkpoint snapshots the task's full message history so the user can restore the conversation to this point later.New module:
src/core/checkpoints/conversation-checkpoint.tsPure storage layer (no vscode/Task imports — fully unit-testable):
saveConversationCheckpoint({taskDir, taskId, messages, summary?, now?})→ writes<taskDir>/checkpoints/<id>.json. The id is the creation timestamp; same-millisecond collisions get a-1,-2, ... suffix so no data is lost. Messages are deep-cloned (caller array never mutated);summaryomitted from JSON when absent.listConversationCheckpoints(taskDir)→ newest first (createdAtdesc, then id desc on ties). Missing dir → empty list; corrupt files skipped rather than failing the listing.loadConversationCheckpoint(taskDir, id)→ single checkpoint orundefinedwhen missing.Task trigger methods (manual only — no auto triggers in scope)
Task.createConversationCheckpoint(summary?)— resolves the standard task dir viagetTaskDirectoryPath(this.globalStoragePath, this.taskId)and snapshotsstructuredClone(this.clineMessages), returning the saved checkpoint.Task.listConversationCheckpoints()— lists this task's checkpoints newest first.Tests (~290 lines per plan)
src/core/checkpoints/__tests__/conversation-checkpoint.spec.ts(new, 8 cases): timestamp-named file + returned shape; summary omitted/included correctly; same-millisecond collision suffixing with both files coexisting; deep-clone isolation; empty-list on missing dir; newest-first ordering; corrupt-file tolerance; load-by-id + undefined when missing.src/__tests__/conversation-checkpoint-task.spec.ts(new, 2 cases): integration through the realTask.prototypemethods bound onto a minimal double — verifies the standard<storage>/tasks/<taskId>/checkpoints/layout and newest-first listing. Noas any; single documentedas unknown as Taskcast on the stub.Verification
pnpm run check-types— 11/11 packages passTask.spec.ts96/96 unchanged (Task.ts touched)--max-warnings=0) clean; zero eslint suppression count increases