cairn-ai 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/workflows/cairn-memory.md +1 -1
- package/.agents/workflows/cairn-plan.md +6 -2
- package/.agents/workflows/cairn-review.md +1 -1
- package/.agents/workflows/cairn-work.md +5 -1
- package/.claude/agents/explorer.md +1 -1
- package/.claude/agents/worker.md +1 -1
- package/.codex-plugin/plugin.json +4 -4
- package/README.ko.md +2 -0
- package/README.md +8 -4
- package/agents/explorer.md +2 -2
- package/agents/worker.md +6 -2
- package/commands/cairn-memory.md +1 -1
- package/commands/cairn-plan.md +7 -3
- package/commands/cairn-review.md +1 -1
- package/commands/cairn-uninstall.md +1 -1
- package/commands/cairn-work.md +5 -1
- package/docs/model-guidance/README.md +14 -2
- package/docs/model-guidance/claude.md +2 -0
- package/docs/model-guidance/codex.md +3 -1
- package/package.json +2 -2
- package/scripts/cairn-cleanup.mjs +61 -0
- package/scripts/cairn-goal.mjs +143 -24
- package/scripts/cairn-paths.mjs +47 -1
- package/scripts/cairn-state.mjs +41 -15
- package/scripts/cairn-state.sh +6 -6
- package/scripts/cairn.mjs +32 -24
- package/skills/cairn-memory/SKILL.md +3 -3
- package/skills/cairn-plan/SKILL.md +28 -9
- package/skills/cairn-review/SKILL.md +4 -4
- package/skills/cairn-work/SKILL.md +33 -20
- package/templates/PLAN.md +3 -1
- package/templates/work-plan.md +21 -0
|
@@ -11,15 +11,15 @@ Use this when domain knowledge, repository policy, or pre-plan context compressi
|
|
|
11
11
|
|
|
12
12
|
The root `MEMORY.md` is an index, not detailed knowledge. Record details in `docs/memory/<domain>.md`.
|
|
13
13
|
|
|
14
|
-
Every delegated agent
|
|
14
|
+
Every delegated agent reads project-root `MEMORY.md` when present and continues when absent before doing its assigned discovery, evidence, or update task.
|
|
15
15
|
|
|
16
|
-
When subagent tools are available, each agent may recursively delegate bounded sub-tasks to subagents. Every child subagent
|
|
16
|
+
When subagent tools are available, each agent may recursively delegate bounded sub-tasks to subagents. Every child subagent reads project-root `MEMORY.md` when present and continues when absent, keeps the assigned scope, and preserves others' edits.
|
|
17
17
|
|
|
18
18
|
## Runtime Location
|
|
19
19
|
|
|
20
20
|
Resolve Cairn's read-only runtime from `references/cairn-runtime.json` next to this `SKILL.md`. Its `pluginRoot` contains Cairn's `scripts/`, `templates/`, commands, agents, and model guidance. In a source checkout where the locator does not exist, resolve the plugin root from this `SKILL.md` location (`../..`). Never look for Cairn runtime files in the target repository or derive the plugin root from the current working directory.
|
|
21
21
|
|
|
22
|
-
Keep the target repository root separate. Pass it explicitly with `--root <repoRoot>` when invoking the installed runtime.
|
|
22
|
+
Keep the target repository root separate. Pass it explicitly with `--root <repoRoot>` when invoking the installed runtime. Repository artifacts include `MEMORY.md`, `PLAN.md`, `docs/memory/`, and `docs/plan/`; runtime goal state lives only under the user-home Cairn directory.
|
|
23
23
|
|
|
24
24
|
## Procedure
|
|
25
25
|
|
|
@@ -11,15 +11,15 @@ Use this before non-trivial implementation, refactoring, migrations, debugging,
|
|
|
11
11
|
|
|
12
12
|
Plans must reduce execution tokens. Do not leave long plans only in chat. Store the topic in `PLAN.md` and details in `docs/plan/<topic>.md`.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
When project-root `MEMORY.md` exists, read it as the repository policy and domain-knowledge index before exploring or delegating work. If it is absent, continue without repository memory; never invoke another memory service or block solely because the file is missing. Delegated agents follow the same rule.
|
|
15
15
|
|
|
16
|
-
Do not treat planning as optional for implementation work that is more than a narrow single-file fix.
|
|
16
|
+
Do not treat planning as optional for implementation work that is more than a narrow single-file fix. Produce or update a plan when the request changes behavior, architecture, data, or multiple files, or when an external operation requires code edits, conflict resolution, destructive recovery, release/deploy, or design. External-state mutation alone is not a planning trigger: routine known-target Git/GitHub operations such as status, fetch, checkout, branch, merge, push, and PR management stay plan/goal-free.
|
|
17
17
|
|
|
18
18
|
Plan from the whole work down. First understand the full requested outcome and affected surfaces, then classify the work into small executable tasks. If one task is still too broad to verify cleanly, split that task into sub-tasks.
|
|
19
19
|
|
|
20
20
|
## Re-entry and Required References
|
|
21
21
|
|
|
22
|
-
At the start and after compaction, restart, or handoff, restore context in this order: root `MEMORY.md` → `cairn-plan` → the active plan → current-task references → model guidance recorded by the plan. A new implementation request with no persisted goal may create its initial plan through the procedure below. If persisted state names a plan or task and that reference is missing, unreadable, or inconsistent, do not explore, edit, delegate, or complete work; report or record a blocker first. Do not add a read-receipt field that claims the model read a file: filesystem/state consistency and bound tool evidence remain the fail-closed authority.
|
|
22
|
+
At the start and after compaction, restart, or handoff, restore context in this order: optional root `MEMORY.md` → `cairn-plan` → the active plan → current-task references → model guidance recorded by the plan. A new implementation request with no persisted goal may create its initial plan through the procedure below. Missing `MEMORY.md` is not an inconsistency. If persisted state names a plan or task and that required reference is missing, unreadable, or inconsistent, do not explore, edit, delegate, or complete work; report or record a blocker first. Do not add a read-receipt field that claims the model read a file: filesystem/state consistency and bound tool evidence remain the fail-closed authority.
|
|
23
23
|
|
|
24
24
|
## Runtime Location
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ Resolve Cairn's read-only runtime from `references/cairn-runtime.json` next to t
|
|
|
27
27
|
|
|
28
28
|
Use logical resource IDs such as `cairn://templates/work-plan.md` and `cairn://docs/model-guidance/codex.md` in repository plans. Resolve those IDs through `pluginRoot` only while executing. Keep `repoRoot` separate and pass it explicitly as `--root <repoRoot>`.
|
|
29
29
|
|
|
30
|
-
For
|
|
30
|
+
For a non-trivial implementation request or continuation of already planned work, treat the request itself as authorization to create or restore a two-phase plan and activate its roadmap, even when the user does not mention a goal. Do not create a plan or goal for a routine known-target Git/GitHub operation unless it crosses one of the escalation boundaries above. The initial plan is decision-complete for the `triage-plan` task but is not implementation-ready. After writing it and its `PLAN.md` index entry, synchronize the same ordered steps to Codex UI tools when available (`update_plan` first, then `create_goal`) and start the repository goal before exploration, toolcheck, complexity triage, or a non-blocking user question:
|
|
31
31
|
|
|
32
32
|
```sh
|
|
33
33
|
node "<pluginRoot>/scripts/cairn.mjs" goal start --root "<repoRoot>" --goal "<objective>" --plan "docs/plan/<topic>.md" --tasks '[{"id":"triage-plan","title":"Run planned triage and finalize the plan","requiredEvidence":["planArtifact","triageDecision"]},{"id":"implement","title":"Implement the finalized plan"},{"id":"verify","title":"Verify and review the result"}]' --criteria "<completion criterion>" --session "<current session_id>"
|
|
@@ -38,11 +38,11 @@ Use the current Codex hook `session_id` when it is available. If the surface doe
|
|
|
38
38
|
## Procedure
|
|
39
39
|
|
|
40
40
|
1. Run `node "<pluginRoot>/scripts/cairn.mjs" init --root "<repoRoot>"` through the resolved runtime. If the runtime is unavailable, ensure `MEMORY.md`, `PLAN.md`, `docs/memory`, and `docs/plan` directly and report that `cairn doctor` or `cairn upgrade` is required.
|
|
41
|
-
2. Read
|
|
42
|
-
3. Classify the request as implementation/
|
|
41
|
+
2. Read project-root `MEMORY.md` when present; otherwise continue without repository memory.
|
|
42
|
+
3. Classify the request as non-trivial implementation/planned-work continuation, routine known-target Git/GitHub operation, or consultation/explanation/plan-only. For a routine operation, execute without creating a plan or goal unless it requires code edits, conflict resolution, destructive recovery, release/deploy, or design. For non-trivial implementation/planned-work continuation, immediately create an initial `docs/plan/<topic>.md` from `cairn://templates/work-plan.md` and add its `PLAN.md` index entry. Based only on the request and `MEMORY.md`, describe the observable outcome, anticipated affected surfaces, and stable top-level roadmap. Make `triage-plan` the first active task and specify its memory inputs, investigation scope, toolcheck, Heavy Path criteria, and exact condition for updating the plan. Mark the plan `initial: decision-complete for triage; not implementation-ready`.
|
|
43
43
|
4. Before reading detailed memory, toolcheck, repository exploration, complexity triage, delegation, or any non-blocking user question, synchronize the initial roadmap:
|
|
44
44
|
- Call Codex `update_plan` first when available so the UI displays the ordered tasks with `triage-plan` in progress.
|
|
45
|
-
- Call Codex `create_goal` next when available so the UI displays the active objective. The implementation request plus this developer-level skill instruction is authorization; do not use it for consultation, explanation, or plan-only requests.
|
|
45
|
+
- Call Codex `create_goal` next when available so the UI displays the active objective. The non-trivial implementation request plus this developer-level skill instruction is authorization; do not use it for routine known-target Git/GitHub operations, consultation, explanation, or plan-only requests.
|
|
46
46
|
- Start or attach the repository Cairn goal with the same objective, plan ID, stable task IDs, and current session ID.
|
|
47
47
|
- If a UI tool is unavailable, record the limitation in the plan and continue with repository state.
|
|
48
48
|
5. Execute the planned `triage-plan` task: read only the relevant `docs/memory/*.md`, read applicable installed model guidance, run toolcheck, and explore the repository with focused search and LSP/symbol tools.
|
|
@@ -62,15 +62,32 @@ Use the current Codex hook `session_id` when it is available. If the surface doe
|
|
|
62
62
|
- When subagent tools are available, each agent may recursively delegate bounded sub-tasks to subagents, subject to the current surface's depth and concurrency limits.
|
|
63
63
|
- If subagent tools are unavailable, the main agent takes over implementation directly and records that takeover in evidence; do not stop before local implementation solely because subagent tools are unavailable.
|
|
64
64
|
- Keep urgent non-implementation blocking work local when the next step depends immediately on the result.
|
|
65
|
-
- Tell every delegated agent and child subagent to read
|
|
65
|
+
- Tell every delegated agent and child subagent to read project-root `MEMORY.md` when present and continue when absent, keep scope, and tell workers they are not alone in the codebase and must not revert others' edits.
|
|
66
66
|
11. Give every plan and ordered task step a stable ID and declare task-level and goal-level required evidence. The task order must be sufficient for both Codex UI and hook context to show the roadmap and restore the current task after side questions.
|
|
67
67
|
12. Advance a Codex UI step only after the matching repository Cairn task transition succeeds with all required bound evidence records. The repository state is the fail-closed transition authority; UI state is its synchronized projection.
|
|
68
68
|
13. Write user-visible responses and generated or updated documentation, plans, and memory artifacts in the OS locale unless the user asks for another language.
|
|
69
69
|
|
|
70
|
+
## Reasoning Effort Routing
|
|
71
|
+
|
|
72
|
+
- Models always inherit the host/user default; never configure or override them.
|
|
73
|
+
- Light Path planning, implementation, and verification request `medium`.
|
|
74
|
+
- Heavy Path planning, review, and implementation request `high`; final verification and review request `xhigh`.
|
|
75
|
+
- Every module task records `Requested reasoning effort` and `Effective reasoning effort` in `docs/plan/<topic>.md`.
|
|
76
|
+
- Pass requested effort only when dispatching a new task/worker and the host exposes a reasoning-effort option or host-native equivalent. Omit model overrides. For an unsupported host or value, record effective reasoning effort `inherited` with the reason and leave model/global config unchanged.
|
|
77
|
+
- On every route change, synchronize the plan artifact, repository goal task roadmap through `goal replan`, native UI plan, and reasoning effort profile before mutation. Completed task profiles are preserved as audit history; incomplete task profiles are recalculated for the new path.
|
|
78
|
+
|
|
70
79
|
## Complexity Triage
|
|
71
80
|
|
|
72
81
|
Decide triage from repository evidence without asking the user.
|
|
73
82
|
|
|
83
|
+
Use three mandatory checkpoints and record each result, evidence, newly discovered Heavy Path signals, and current route in the plan artifact:
|
|
84
|
+
|
|
85
|
+
1. **Request checkpoint:** before exploration, make a provisional classification from the request and `MEMORY.md`; uncertainty stays explicit and this result is not implementation authority.
|
|
86
|
+
2. **Planning checkpoint:** after repository exploration, affected-surface analysis, and test design, re-evaluate the provisional route and finalize the implementation plan.
|
|
87
|
+
3. **Code checkpoint:** during `cairn-work`, inspect the exact files, callers, and tests, then record one final re-evaluation immediately before the first edit. A pending or missing code checkpoint blocks mutation.
|
|
88
|
+
|
|
89
|
+
Before the first edit, the planning or code checkpoint may change Light Path to Heavy Path or Heavy Path to Light Path when the evidence supports it. Every route change must rebuild and synchronize the plan artifact, repository goal task roadmap through `goal replan`, and native UI plan, including assignments, reviews, and required evidence; do not mutate until all three agree. After editing starts, only promote Light Path to Heavy Path: stop further edits, mark affected evidence stale, revise and synchronize all three roadmaps, run newly required Heavy Path review, and repeat the code checkpoint before resuming.
|
|
90
|
+
|
|
74
91
|
This decision takes priority over plugin, agent, or delegated workflow guidance unless higher-priority system or developer instructions say otherwise. The default is Light Path; use Heavy Path only when a Heavy Path condition clearly applies.
|
|
75
92
|
|
|
76
93
|
### Light Path
|
|
@@ -122,11 +139,13 @@ Heavy Path flow: plan -> pre-implementation review -> bounded `worker` implement
|
|
|
122
139
|
- Roles or delegation omitted in Light Path and why.
|
|
123
140
|
- Any unavailable subagent tool main-agent takeover and its evidence record.
|
|
124
141
|
- Pre-implementation decisions that review must resolve in Heavy Path.
|
|
142
|
+
- Request checkpoint, planning checkpoint, and code checkpoint status, evidence, newly found signals, and route.
|
|
143
|
+
- Every route change and the synchronized plan artifact, repository goal task roadmap, native UI plan, assignments, reviews, required evidence, and stale evidence invalidation.
|
|
125
144
|
|
|
126
145
|
## Planning Rules
|
|
127
146
|
|
|
128
147
|
- Every initial plan must be decision-complete for its triage task and explicitly not implementation-ready; the post-triage revision must be decision-complete for implementation.
|
|
129
|
-
- Every implementation or
|
|
148
|
+
- Every non-trivial implementation or planned-work continuation plan must be shown through Codex `update_plan` and `create_goal` before triage when those tools are available, then synchronized again after triage. Routine known-target Git/GitHub operations do not create a plan or goal. Repository plan/goal persistence remains required for work that crosses the planning boundary.
|
|
130
149
|
- Every plan must describe the whole work first, then classify it into executable tasks and any needed sub-tasks.
|
|
131
150
|
- Every plan must treat the user-called/main agent as the orchestrator and assign actual implementation edits to `worker` whenever subagent tools are available, regardless of Light Path or Heavy Path.
|
|
132
151
|
- Every plan must require subagents to report status when the subagent tool provides a progress-reporting channel. If no mid-run reporting channel exists, the orchestrator must relay observable events such as assignment, waiting, and final completion.
|
|
@@ -11,18 +11,18 @@ Use this after meaningful implementation with Cairn.
|
|
|
11
11
|
|
|
12
12
|
Review is not another implementation loop. Confirm that the completed task satisfies the plan and that memory and plan artifacts are useful to the next agent.
|
|
13
13
|
|
|
14
|
-
Every review run and
|
|
14
|
+
Every review run and delegated review agent reads project-root `MEMORY.md` when present. If it is absent, continue without repository memory and do not invoke another memory service.
|
|
15
15
|
|
|
16
|
-
At the start and after compaction, restart, delegation, or handoff, restore context in this order: root `MEMORY.md` → `cairn-review` → the active plan → completed/current-task references → model guidance recorded by the plan. Confirm
|
|
16
|
+
At the start and after compaction, restart, delegation, or handoff, restore context in this order: optional root `MEMORY.md` → `cairn-review` → the active plan → completed/current-task references → model guidance recorded by the plan. Missing `MEMORY.md` is not an inconsistency. Confirm the remaining references agree with persisted goal state before reviewing. If any required reference is missing, unreadable, or inconsistent, do not approve, delegate, record final review, or complete the goal; report a blocker. Do not use a read-receipt field as evidence that a model understood a reference.
|
|
17
17
|
|
|
18
|
-
When subagent tools are available, each agent may recursively delegate bounded review sub-tasks to subagents. Every child subagent
|
|
18
|
+
When subagent tools are available, each agent may recursively delegate bounded review sub-tasks to subagents. Every child subagent reads project-root `MEMORY.md` when present and continues when absent, keeps the assigned scope, and preserves others' edits.
|
|
19
19
|
|
|
20
20
|
Resolve any `cairn://...` resource through `references/cairn-runtime.json` next to this `SKILL.md` (or this skill's `../..` source root during development). Never look for Cairn runtime resources in the target repository.
|
|
21
21
|
|
|
22
22
|
## Procedure
|
|
23
23
|
|
|
24
24
|
1. Read the completed task in `docs/plan/<topic>.md`.
|
|
25
|
-
2. Read `MEMORY.md` and relevant `docs/memory/*.md
|
|
25
|
+
2. Read `MEMORY.md` when present and relevant `docs/memory/*.md`; continue when repository memory is absent.
|
|
26
26
|
3. Check changed files, tool readiness evidence, and evidence paths.
|
|
27
27
|
4. Delegate independent review when it materially improves speed or quality and the current tool policy allows it.
|
|
28
28
|
- Use `explorer` for read-only impact analysis, pattern checks, and independent diff inspection.
|
|
@@ -11,7 +11,7 @@ Use this to implement a plan created by `cairn-plan`. Do not use this as a short
|
|
|
11
11
|
|
|
12
12
|
Execute only one module task at a time, but keep advancing the active goal after each task passes until every task and the goal-level final review are complete. Instead of a repeated red-green loop, prove each small task with two strong verification gates.
|
|
13
13
|
|
|
14
|
-
Every work run
|
|
14
|
+
Every work run reads project-root `MEMORY.md` when present before choosing or executing a task. If it is absent, continue without repository memory; never invoke another memory service or block solely because the file is missing. Delegated agents follow the same rule.
|
|
15
15
|
|
|
16
16
|
The user-called/main agent is the orchestrator for work execution: it selects the task, assigns implementation, verifies results, and records evidence. Actual implementation edits belong to `worker` subagents whenever subagent tools are available, regardless of Light Path or Heavy Path.
|
|
17
17
|
|
|
@@ -23,9 +23,9 @@ If the user asks a side question, status question, or narrow clarification while
|
|
|
23
23
|
|
|
24
24
|
## Re-entry and Required References
|
|
25
25
|
|
|
26
|
-
At the start and after compaction, restart, delegation, or handoff, restore context in this order: root `MEMORY.md` → `cairn-work` → the active plan → current-task references → model guidance recorded by the plan. Confirm that the plan task, persisted current task, and worker assignment agree before acting. If state, skill, plan, assignment, or
|
|
26
|
+
At the start and after compaction, restart, delegation, or handoff, restore context in this order: optional root `MEMORY.md` → `cairn-work` → the active plan → current-task references → model guidance recorded by the plan. Confirm that the plan task, persisted current task, and worker assignment agree before acting. Missing `MEMORY.md` is not an inconsistency. If state, skill, plan, assignment, or another required reference is missing, unreadable, or inconsistent, do not edit, delegate, record completion evidence, or complete work; report a blocker to the orchestrator. Do not introduce read receipts as proof of model attention: current state, readable references, and fresh tool-bound evidence are the authority.
|
|
27
27
|
|
|
28
|
-
When subagent tools are available, each agent may recursively delegate bounded sub-tasks to subagents. Every child subagent
|
|
28
|
+
When subagent tools are available, each agent may recursively delegate bounded sub-tasks to subagents. Every child subagent reads project-root `MEMORY.md` when present and continues when absent, keeps the assigned scope, and preserves others' edits.
|
|
29
29
|
|
|
30
30
|
## Runtime Location
|
|
31
31
|
|
|
@@ -35,6 +35,7 @@ Use the installed CLI for durable state. Important forms are:
|
|
|
35
35
|
|
|
36
36
|
```sh
|
|
37
37
|
node "<pluginRoot>/scripts/cairn.mjs" goal status --root "<repoRoot>"
|
|
38
|
+
node "<pluginRoot>/scripts/cairn.mjs" goal replan --quiet --root "<repoRoot>" --tasks '[{"id":"<task-id>","title":"<task-title>","requiredEvidence":["moduleAcceptance","surfaceIntegration"]}]'
|
|
38
39
|
node "<pluginRoot>/scripts/cairn.mjs" goal assign --quiet --root "<repoRoot>" --task "<task-id>" --agent "<agent-id>"
|
|
39
40
|
node "<pluginRoot>/scripts/cairn.mjs" goal verify --quiet --root "<repoRoot>" --task "<task-id>" --kind moduleAcceptance --watch "<path|path>" -- <tool> <arg> ...
|
|
40
41
|
node "<pluginRoot>/scripts/cairn.mjs" goal verify --quiet --root "<repoRoot>" --task "<task-id>" --kind surfaceIntegration --watch "<path|path>" -- <tool> <arg> ...
|
|
@@ -66,30 +67,42 @@ Use this verification ladder:
|
|
|
66
67
|
|
|
67
68
|
Any relevant mutation after a gate makes that result stale evidence. Rerun the affected focused gate and, when integration could change, the full gate. Use `--quiet` for successful Cairn state mutations so full state JSON does not consume conversation tokens. `goal status` is read-only and always returns state, including when `--quiet` is supplied.
|
|
68
69
|
|
|
70
|
+
## Reasoning Effort Routing
|
|
71
|
+
|
|
72
|
+
- Models always inherit the host/user default; never configure or override them.
|
|
73
|
+
- Light Path planning, implementation, and verification request `medium`.
|
|
74
|
+
- Heavy Path planning, review, and implementation request `high`; final verification and review request `xhigh`.
|
|
75
|
+
- Every module task records `Requested reasoning effort` and `Effective reasoning effort` in `docs/plan/<topic>.md`.
|
|
76
|
+
- Pass requested effort only when dispatching a new task/worker and the host exposes a reasoning-effort option or host-native equivalent. Omit model overrides. For an unsupported host or value, record effective reasoning effort `inherited` with the reason and leave model/global config unchanged.
|
|
77
|
+
- On every route change, synchronize the plan artifact, repository goal task roadmap through `goal replan`, native UI plan, and reasoning effort profile before edits resume. Completed task profiles are preserved as audit history; incomplete task profiles are recalculated for the new path.
|
|
78
|
+
|
|
69
79
|
## Procedure
|
|
70
80
|
|
|
71
|
-
1. Read
|
|
81
|
+
1. Read project-root `MEMORY.md` when present; continue without repository memory when absent.
|
|
72
82
|
2. Read `PLAN.md`, the selected `docs/plan/<topic>.md`, and relevant memory notes.
|
|
73
83
|
3. Read the `cairn://docs/model-guidance/*.md` inputs recorded in the plan through the installed runtime.
|
|
74
|
-
4. Read
|
|
84
|
+
4. Read user-home, project/worktree-scoped state through `cairn goal status --root "<repoRoot>"`. Select only the active goal's current task. If implementation was requested but no goal exists, create one from the decision-complete plan before editing.
|
|
75
85
|
5. Confirm that required LSP, typecheck, lint, dry-run, and verification tools are available from the plan's tool readiness section.
|
|
76
86
|
6. If a required tool is missing, do not install it implicitly. Obtain explicit user approval, then run the installed runtime's `toolcheck --install --yes --root "<repoRoot>"` only for pinned/supported installers or run the approved repository-native command. Otherwise record a blocker.
|
|
77
87
|
7. Confirm the selected Light Path or Heavy Path in the plan. If the plan lacks complexity triage, stop and update the plan before mutating files.
|
|
78
|
-
8.
|
|
79
|
-
9.
|
|
80
|
-
10.
|
|
81
|
-
11.
|
|
82
|
-
12.
|
|
83
|
-
13.
|
|
84
|
-
14.
|
|
85
|
-
15.
|
|
86
|
-
16.
|
|
87
|
-
17.
|
|
88
|
-
18.
|
|
89
|
-
19.
|
|
90
|
-
20.
|
|
91
|
-
21.
|
|
92
|
-
22.
|
|
88
|
+
8. Confirm the request checkpoint and planning checkpoint, inspect the exact files, callers, and tests, then record the code checkpoint immediately before the first edit. Missing or pending checkpoints block mutation.
|
|
89
|
+
9. Before the first edit, evidence may change Light Path to Heavy Path or Heavy Path to Light Path. On every route change, update the plan artifact first, replace the incomplete repository goal task roadmap with `goal replan`, update the native UI plan to the same stable task order, and synchronize assignments, reviews, and required evidence. Do not mutate until all three agree.
|
|
90
|
+
10. After editing starts, only promote Light Path to Heavy Path. Stop further edits on a new Heavy Path signal, mark affected evidence stale, revise and synchronize the plan artifact, repository goal task roadmap, and native UI plan, run newly required Heavy Path review, and repeat the code checkpoint before resuming.
|
|
91
|
+
11. For Light Path, keep the main agent in the orchestrator role and delegate implementation edits to one bounded `worker` whenever subagent tools are available; keep the verification gate.
|
|
92
|
+
12. For Heavy Path, follow the full planning and review pipeline recorded in the plan. Run pre-implementation review before mutation and read-only review after evidence exists.
|
|
93
|
+
13. Delegate implementation to `worker` with exact files, ownership, constraints, and model-specific adjustment rules on both Light Path and Heavy Path whenever subagent tools are available. Tell every delegated agent and child subagent to read the project-root `MEMORY.md` before work, keep scope, preserve others' edits, and report status when the subagent tool provides a progress-reporting channel. Immediately relay received status events to the user. If no mid-run reporting channel exists, relay observable events such as assignment, waiting, and final completion. Require delegated subagents to provide a final report before leaving; after capturing final report and evidence, close or release the completed subagent, then review the final report and evidence before marking the work complete. Use `explorer` for parallel read-only discovery or verification when available and useful. Allow recursive delegation only for bounded sub-tasks when the current surface supports it. If subagent tools are unavailable, the main agent takes over implementation directly and records that takeover in evidence.
|
|
94
|
+
14. Before mutating external state, run the task dry-run or check command when one is recorded. If none exists, record the absence and continue with the smallest reversible command available.
|
|
95
|
+
15. Design the focused executable test contract before implementation. For behavior changes, run it and confirm the intended failure; for policy-only work, use the closest deterministic assertion or record why a failing test is unavailable.
|
|
96
|
+
16. Give the implementation worker only the contract, failing evidence, exact file scope, and constraints; require the minimum implementation rather than renewed broad discovery.
|
|
97
|
+
17. For Heavy Path, run the recorded automated test command and record explicit `Tests:` evidence before claiming completion.
|
|
98
|
+
18. `worker` must return a structured handoff for only its assigned goal/task with changed files, tool readiness result, dry-run or check result when applicable, automated test result for Heavy Path, module acceptance command and result, surface integration command or QA artifact, blocker, and cleanup notes. A worker must not select the next task.
|
|
99
|
+
19. Re-run both verification gates through `goal verify -- ...`. Treat tool exit codes as authoritative, keep successful output summarized, and expand context only for a failing test. Record each success as evidence bound to the current goal ID, task ID, plan, exact argv, and watched-workspace fingerprint.
|
|
100
|
+
20. Apply the bounded loop policy when a gate fails. After two failed passes, transition the task or goal to `blocked` with a concrete blocker instead of continuing automatically.
|
|
101
|
+
21. Mark a task complete only after every required evidence record passes. Let Cairn advance to the next pending task, then continue the goal without yielding a false completion.
|
|
102
|
+
22. After all tasks complete, run and record goal-level final review evidence and explicitly complete the goal. Successful completion or cancellation removes the user-home active state because completed evidence already lives in the plan document; paused and blocked state remains resumable. `active` is not a completion state.
|
|
103
|
+
23. Record evidence in the plan file and state before updating `PLAN.md`.
|
|
104
|
+
24. If the user asks a side question, status question, or narrow clarification while this task is still active, answer it briefly and then resume the previous active work unless the user explicitly asks to pause, stop, or switch tasks.
|
|
105
|
+
25. Write user-visible responses and generated or updated documentation, plans, and memory artifacts in the OS locale unless the user asks for another language.
|
|
93
106
|
|
|
94
107
|
## Builder Prompt Format
|
|
95
108
|
|
package/templates/PLAN.md
CHANGED
|
@@ -4,7 +4,9 @@ Short index of work plans. Link detailed plans under `docs/plan/`.
|
|
|
4
4
|
|
|
5
5
|
## Planning Rules
|
|
6
6
|
|
|
7
|
-
- For implementation or
|
|
7
|
+
- For non-trivial implementation or continuation of planned work, write or restore a plan with `triage-plan` active and synchronize it before exploration. Known-target Git/GitHub operations stay plan/goal-free unless they require code edits, conflict resolution, destructive recovery, release/deploy, or design.
|
|
8
|
+
- Record request, planning, and code checkpoints. When the route changes, synchronize the plan artifact, repository goal task roadmap, and native UI plan before editing; mark affected evidence stale after a late Heavy promotion.
|
|
9
|
+
- Keep models inherited and record requested/effective reasoning effort per task. Route changes also synchronize the reasoning effort profile, preserving completed profiles and recalculating incomplete profiles.
|
|
8
10
|
- Detect repository stack and required LSP/check tools before implementation.
|
|
9
11
|
- Install or bootstrap missing required tools before declaring them unavailable.
|
|
10
12
|
- Heavy Path completion requires explicit automated test evidence.
|
package/templates/work-plan.md
CHANGED
|
@@ -39,10 +39,27 @@ Describe the observable result.
|
|
|
39
39
|
- Role-specific adjustment:
|
|
40
40
|
- User-visible response and artifact locale: OS locale unless the user asks for another language.
|
|
41
41
|
|
|
42
|
+
## Reasoning Effort Profile
|
|
43
|
+
|
|
44
|
+
- Model: inherited from the host/user default; never override it.
|
|
45
|
+
- Light Path: planning=`medium`, implementation=`medium`, verification=`medium`.
|
|
46
|
+
- Heavy Path: planning/review=`high`, implementation=`high`, final verification/review=`xhigh`.
|
|
47
|
+
- Host boundary: pass a requested value only when dispatching a new task/worker and the host exposes a reasoning-effort option or host-native equivalent. Unsupported host/value means `Effective reasoning effort: inherited`; do not alter model/global config.
|
|
48
|
+
- Route-change gate: synchronize the plan artifact, repository goal task roadmap through `goal replan`, native UI plan, and reasoning effort profile before edits resume. Completed task profiles are preserved as audit history; incomplete task profiles are recalculated for the new path.
|
|
49
|
+
- Every module task records:
|
|
50
|
+
- Requested reasoning effort:
|
|
51
|
+
- Effective reasoning effort: `inherited` until a new dispatch confirms an accepted override.
|
|
52
|
+
|
|
42
53
|
## Complexity Triage
|
|
43
54
|
|
|
44
55
|
- Selected path: Light Path or Heavy Path.
|
|
45
56
|
- Selection rationale:
|
|
57
|
+
- Checkpoint ledger:
|
|
58
|
+
- Request checkpoint: provisional route, request/`MEMORY.md` evidence, uncertainty, and newly found Heavy Path signals.
|
|
59
|
+
- Planning checkpoint: post-exploration route, affected-surface/test evidence, and newly found Heavy Path signals.
|
|
60
|
+
- Code checkpoint: `pending` until exact files/callers/tests are inspected; record the final route immediately before the first edit.
|
|
61
|
+
- Route-change synchronization: before editing, evidence may change either route. Update the plan artifact, replace the incomplete repository goal task roadmap with `goal replan`, and update the native UI plan to the same stable task order, reviews, assignments, and required evidence before mutation.
|
|
62
|
+
- Late promotion: after editing begins, a new Heavy Path signal promotes Light Path to Heavy Path. Stop further edits, mark affected evidence stale, synchronize all three roadmaps, run newly required review, and repeat the code checkpoint before resuming.
|
|
46
63
|
- Heavy Path signals checked:
|
|
47
64
|
- New directory/module/layer:
|
|
48
65
|
- New domain model/service/abstraction:
|
|
@@ -97,6 +114,8 @@ Describe the observable result.
|
|
|
97
114
|
|
|
98
115
|
- Task ID: `triage-plan`
|
|
99
116
|
- Initial status: `active`
|
|
117
|
+
- Requested reasoning effort:
|
|
118
|
+
- Effective reasoning effort:
|
|
100
119
|
- Contract: execute the investigation scope and Heavy Path criteria declared by the initial plan, then update this file and the Codex UI plan to the decision-complete implementation revision.
|
|
101
120
|
- Required evidence records:
|
|
102
121
|
- `planArtifact`: command, exit code 0, timestamp, goal ID, task ID, and plan ID.
|
|
@@ -106,6 +125,8 @@ Describe the observable result.
|
|
|
106
125
|
|
|
107
126
|
- Task ID: `task-1`
|
|
108
127
|
- Initial status: `pending` or `active`
|
|
128
|
+
- Requested reasoning effort:
|
|
129
|
+
- Effective reasoning effort:
|
|
109
130
|
- Contract:
|
|
110
131
|
- Sub-tasks, if needed:
|
|
111
132
|
- Files:
|