3.6 KiB
3.6 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 06-canvas-lifecycle | Canvas lifecycle | done | 6 |
|
plan.md |
|
|
|
Task 06: Canvas lifecycle
Summary
Create the plugin-backed canvas model from current main. Add atomic count
admission, task cleanup, workspace cleanup, archive, restore, and removal.
In scope
- Add the canvas-to-plugin-instance model, repository, and services.
- Add task and workspace canvas list and get operations.
- Add lifecycle WebSocket events without application content.
- Enforce 10 canvases per task and 100 canvases per workspace.
- Count archived canvases and make restore admission atomic.
- Remove task canvases during task cleanup.
- Remove every canvas during workspace deletion.
- Record durable artifact cleanup before release ownership disappears.
- Add restart, concurrency, cleanup, and unavailable-release tests.
Out of scope
- Declarative canvas cutover, agent publishing, promotion, editing, and host surfaces.
Acceptance
- Canvas scope and active release identity survive backend restart.
- Concurrent create or restore cannot exceed the task or workspace limit.
- Workspace removal leaves no live canvas authority or untracked artifact.
Verification
cd apps/backend && go test ./internal/canvas/... ./internal/gateway/websocket/... ./internal/task/service/... ./internal/backendapp/...
Files likely touched
apps/backend/internal/canvas/**apps/backend/internal/gateway/websocket/canvas_*.goapps/backend/internal/backendapp/**apps/backend/internal/task/service/**- plugin artifact cleanup integration
Dependencies
- Tasks 02 through 05 provide plugin instances, releases, runtime state, and event transport.
Risks
- Task cleanup can erase a promoted canvas if scope checks use origin data.
- Workspace deletion can lose artifact cleanup inventory before commit.
- Restore admission can race with create without one transaction boundary.
Parallelism
sequential
Inputs
- Canvas model, state machine, limits, cleanup, API, and failure sections.
- Current task and workspace cleanup transaction patterns.
Results
Implemented the canvas metadata repository and service, atomic task/workspace admission, atomic canvas and plugin-instance lifecycle transactions, archive and restore, task and workspace cleanup, lifecycle event projection, startup orphan reconciliation, and durable artifact-cleanup jobs.
Verification:
go test ./internal/plugins/instances ./internal/canvas ./internal/backendapp ./internal/plugins/webapp ./internal/mcp/server -count=1— passed.- The feature-related packages in
go test ./... -count=1passed. The full repository run still reports the known home-config discovery and launcher restart-fixture failures caused by this VM's/root/.kandev/config.yaml.