feat(task-manager): durable task system with append-only event history#132
Open
codeaholicguy wants to merge 1 commit into
Open
feat(task-manager): durable task system with append-only event history#132codeaholicguy wants to merge 1 commit into
codeaholicguy wants to merge 1 commit into
Conversation
codeaholicguy
added a commit
that referenced
this pull request
Jul 1, 2026
) Add a guarded integration test proving the real TaskService (shipped on feature-task-system) satisfies the tracing ITaskService port end-to-end, with NO mapping-logic divergence. Round-trips every semantic (ensureFeatureTask, phase/progress/nextStep/blocker/evidence/attribution/note/custom/close) through the real service + file-backed store and asserts the exact contract event-type strings + persisted snapshot. - tests/integration.task-manager.test.ts: skips cleanly (1 passed | 5 skipped) when @ai-devkit/task-manager is not resolvable, so standalone CI is green before #132 merges; auto-activates once #132 lands. Both states verified. - .eslintrc.json: add package lint config (mirrors @ai-devkit/agent-manager). - README/implementation/testing: mark wiring SHIPPED; note the real TaskService is assignable to the port via method bivariance (no port change needed). Validation (fresh, real package resolvable): tsc --noEmit exit 0; vitest run 44 passed (38 unit + 6 real integration) exit 0; build exit 0; eslint 0 errors. Standalone (package absent): 39 passed | 5 skipped, exit 0.
e412ac7 to
852f83a
Compare
…story Introduce @ai-devkit/task-manager as the durable unit for development/debug work. A task has a stable id and encapsulates artifacts, evidence, progress, blockers, lifecycle phase, agent attribution, branch/worktree/PR links, and an append-only event history. - SQLite storage at ~/.ai-devkit/tasks.db via better-sqlite3 (same library and WAL/busy_timeout approach as @ai-devkit/memory): a tasks table of snapshots and a task_events table for the append-only history. Versioned migrations tracked with the user_version pragma. - Storage-agnostic: TaskService depends only on a TaskStore SPI so storage can be swapped without changing callers; SqliteTaskStore is the default impl. - Stable task ids (task-<YYYYMMDDHHMMSS>-<6 base36>), one task per feature with phase as a single advancing field, 14 task.* event types. - CLI: ai-devkit task create/list/show/update/phase/status/progress/next/ blocker/evidence/artifact/assign/note/event/close, with --json and attribution. - Tests: 890 passing repo-wide; task-manager coverage 92% stmt / 79% branch. Public API (Task/TaskEvent shapes, TaskService method signatures, CLI commands, event type strings) is stable. Note vs the original file-backed draft: exports swapped (FileTaskStore -> SqliteTaskStore, resolveStoreRoot -> resolveDbPath) and env var renamed (AIDEVKIT_TASKS_DIR -> AIDEVKIT_TASKS_DB); TaskService method signatures and event types are unchanged.
852f83a to
ce60124
Compare
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.
Summary
Introduces
@ai-devkit/task-manageras the durable unit for development/debug work. A task has a stable id and encapsulates artifacts, evidence, progress, blockers, lifecycle phase, agent attribution, branch/worktree/PR links, and an append-only event history.This also publishes a locked Task/TaskEvent contract that a separate tracing worker (
agent-session-tracing) builds against as a dependency-inversion port — type names, field names, event-type strings, and method signatures are frozen.What's included
@ai-devkit/task-managermirroring@ai-devkit/memory:TaskService(storage-agnostic; consume-only surface) — 18 async methods.TaskStoreSPI +FileTaskStore— atomictask.jsonwrites (temp-file + rename), append-onlyevents.jsonl.Actor,Task,TaskEvent, and a closed set of 14task.*event types.task-<YYYYMMDDHHMMSS>-<4 base36>), collision-safe, lexicographically sortable.ai-devkit task ...: create/list/show/update/phase/status/progress/next/blocker/evidence/artifact/assign/note/event/close, with--jsonand attribution flags.docs/ai/design/2026-07-01-feature-task-system.md+...CONTRACT.mdquick reference.Storage layout (file-backed MVP, frozen)
Storage-agnostic by design: a future
SqliteTaskStoreimplements the sameTaskStoreSPI without changing callers.Key decisions
phaseis a single advancing field (not one task per phase).Validation
nx run-many -t test(6 projects)nx run-many -t build(6 projects)nx run-many -t lint(6 projects)task-managercoverageTests
packages/task-manager/tests/unit/{ids,actor-resolver,errors}.test.tspackages/task-manager/tests/integration/{file-store,service,add-event-coverage}.test.tspackages/cli/src/__tests__/commands/task.test.ts(20 tests, mocked service)Risks / limitations (MVP)
package-lock.jsonincludes an npm-enforced version sync (0.45.0→0.46.0) required to add the new workspace entry; rootpackage.jsonwas already0.46.0.agent-session-tracinghas ACK'd the contract and is building against it; do not change Task/TaskEvent field names or event-type strings after merge without coordinating.🤖 Generated with assistance from the ai-devkit dev-lifecycle skills. Not for merge — awaiting review.