-
-
Notifications
You must be signed in to change notification settings - Fork 2
Contributing a Micro task
itsmylab edited this page Aug 4, 2026
·
1 revision
Generated from
docs/contributions/micro-task.md. Edit the canonical source through a pull request.
Use this playbook for a focused agent job launched from a known Canopy surface, such as reviewing a PR, fixing CI, implementing research, or working on a note.
stateDiagram-v2
[*] --> Defined
Defined --> Launched: surface supplies typed payload
Launched --> Running: detached PTY starts
Running --> Reporting: progress/name updates
Reporting --> Running
Running --> Completed: canopy_job_done
Running --> Blocked: process exits or reports blocker
Completed --> Settled: history/provenance/store update
Blocked --> Settled
Settled --> [*]
src/microTasks.ts task definition and registry
src/components/ProjectView/index.tsx surface launch and settlement wiring
src/microRuns.ts run projection
src/taskHistory.ts completed task history
src-tauri/src/pty.rs detached PTY owner
- Choose a job whose scope and completion condition are known before launch.
- Define a typed payload from the source surface.
- Add a
MicroTaskDefwith stable ID, label, icon, placeholder, effect, source-surface note, cwd, environment, and context builder. - Make the brief state authority limits: whether the agent may edit, branch, commit, push, or only research.
- Add progress steps only when they are real, ordered milestones the task can report. Omit invented steps for open-ended work.
- Register the task in
MICRO_TASKS. - Wire the source CTA to supply the payload.
- Preserve
canopy_name_taskandcanopy_job_donefor micro-task terminals. - Define success, blocked, unexpected exit, project close, and cleanup paths.
- Settle task history, provenance, linked notes/research, and PTY state once.
- Test the generated brief and settlement behavior.
sequenceDiagram
participant Surface as PR, note, research, or other surface
participant Project as ProjectView
participant Def as MicroTaskDef
participant PTY as Detached PTY
participant Agent
Surface->>Project: launch with typed payload
Project->>Def: buildContext(payload, user text)
Def-->>Project: bounded task brief and env
Project->>PTY: spawn detached agent
PTY->>Agent: run task
Agent-->>Project: name/progress/job_done
Project->>Project: settle stores, history, provenance
Project->>PTY: reap terminal
npm run test -- src/microTasks.test.ts src/microRuns.test.ts src/taskHistory.test.ts
npm run typecheck- Task has a focused, knowable completion condition.
- Payload and source surface are typed.
- Brief states edit/Git authority explicitly.
- Progress steps are real or omitted.
- Completion and blocked paths call the existing settlement flow.
- Project close and process exit clean up detached PTYs.
- Generated brief and settlement behavior tested.
Generated from FluidWorksApp/canopy-ide. Canonical documentation changes belong in the main repository.
Canopy Architecture
- Home
- Architecture
- Core Rust System
- LLM Context
- Integration Guide
- Contribution Playbooks
- Testing and Coverage
- Publish the Wiki
Playbooks