immune-brain 3.5.0 → 3.6.0
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/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/package.json +1 -1
- package/plugins/immune-brain/.claude-plugin/plugin.json +1 -1
- package/plugins/immune-brain/.pi-extension/imm-canary-work.ts +3 -96
- package/plugins/immune-brain/.pi-extension/pi-canary-interaction.ts +20 -5
- package/plugins/immune-brain/.pi-extension/pi-canary-native-review.ts +2 -2
- package/plugins/immune-brain/dist/claude/mcp-server.mjs +95 -52
- package/plugins/immune-brain/dist/docs/reference/immune-brain-config.md +17 -8
- package/plugins/immune-brain/dist/imm-loop.md +134 -150
- package/plugins/immune-brain/dist/imm-planner.md +71 -77
- package/plugins/immune-brain/runtime/assurance/coordinator.ts +19 -5
- package/plugins/immune-brain/runtime/assurance/qa.ts +85 -0
- package/plugins/immune-brain/runtime/claude/kernel_ports.ts +1 -45
- package/plugins/immune-brain/runtime/kernel/intent.ts +7 -2
- package/plugins/immune-brain/runtime/plugin_version.ts +1 -1
|
@@ -6,162 +6,146 @@ description: Use to run an enrolled TaskIntent to completion through Kernel-gove
|
|
|
6
6
|
# Immune-Brain: Loop
|
|
7
7
|
|
|
8
8
|
This skill adheres to the **[BASELINE.md](BASELINE.md)**.
|
|
9
|
-
At every runtime role boundary, call the read-only `imm_loop_action` Tool. Use
|
|
10
|
-
`route` for active Steps, bounded repair, architecture exploration, advisory
|
|
11
|
-
review, Compounder, Kernel ownership, or scope expansion. Use `dispatch_role`
|
|
12
|
-
for `qa`, `code-review`, and `ui-review`, then invoke the returned foreground
|
|
13
|
-
Agent envelope exactly. Brainstorm and Planner use the same Tool for bounded
|
|
14
|
-
`arch-explorer` and explicit-lens `advisory-reviewer` dispatches. Loop may
|
|
15
|
-
dispatch `compounder` only when a closed Step supplies structured evidence for
|
|
16
|
-
a reusable Learning; routine work without that evidence returns `next: none`
|
|
17
|
-
and creates no Learning. Do not discover or load a Pi Skill for these roles. The Managed Path public entries remain `imm-brainstorm`, `imm-planner`, and `imm-loop`; standalone `imm-pr-fix`, `imm-doc-prune`, and `imm-agent-doc-maintain` are host-native and are never dispatched as the Loop role.
|
|
18
|
-
Dispatch authorization follows the [shared Subagent Dispatch
|
|
19
|
-
Protocol](docs/reference/subagent-dispatch-protocol.md#authorization-authority).
|
|
20
|
-
Same-boundary `follow_up` is not a Plan mutation; it repeats the current
|
|
21
|
-
execution, QA, and originating review gate. All internal Agent dispatch
|
|
22
|
-
envelopes use `run_in_background: false` and return a direct result to the Parent
|
|
23
|
-
before any workflow mutation.
|
|
24
|
-
|
|
25
|
-
## Workflow Profiles
|
|
26
|
-
|
|
27
|
-
- `direct` has no Plan or Ledger and never invokes this skill.
|
|
28
|
-
- `standard` keeps execution in the main context, closes a Plan Step when the runtime accepts passing evidence, and therefore does not dispatch the internal QA role per Step. It still dispatches every runtime-required final code/UI review gate. The last gate pass atomically performs internal terminal settlement when `compounder_requirement.required` is false.
|
|
29
|
-
- `strict` preserves the full internal loop: each Step reaches isolated QA before final review, internal Compounder handoff, and terminal settlement. A missing profile is strict.
|
|
30
|
-
- Reviewer `follow_up` targets always retain isolated QA. Standard Plans allow at
|
|
31
|
-
most two completed/open rounds; `review_budget_state.budget_stop` is a hard
|
|
32
|
-
stop. Never attempt a third Loop runtime action.
|
|
33
|
-
- `workflow_profile`, `compounder_requirement`, and `review_budget_state` from
|
|
34
|
-
the live Kernel / Loop projection are authoritative. Do not infer or override
|
|
35
|
-
them in the host.
|
|
36
|
-
|
|
37
|
-
## Core Responsibilities
|
|
38
|
-
|
|
39
|
-
- **Main-context completion loop**: Drive the enrolled Kernel task in the current Host conversation until completion or a safe stop.
|
|
40
|
-
- **Context-preserving execution**: Call `imm_loop_action` with `op: route`, then follow the returned `executor` context in the current Parent conversation. Implement only the active Step or pending same-boundary `follow_up`, then record structured execution evidence through the Loop runtime action. A bounded test failure uses the returned internal `test-fixer` dispatch with its explicit delegated test-file list; PR feedback or CI repair uses the returned internal `pr-fix` dispatch inside the current Plan boundary.
|
|
41
|
-
- **Independent authority isolation**: Use the host `Agent` subagent primitive for `awaiting_qa_decision` and for the exact runtime-reported review gate. Standard Plan Steps close from accepted passing evidence before an internal QA boundary exists; Strict Steps and all follow-ups retain isolated QA. The parent records accepted child decisions through the Loop runtime action.
|
|
42
|
-
- **Observable progress**: Update only at major phase changes: Step start, execution evidence recorded, QA/review result, or terminal stop. Always emit a terminal summary.
|
|
43
|
-
- **Kernel projection authority**: Re-read `imm_kernel_canary` `status` after every persisted action. Conversation memory never overrides the Kernel projection.
|
|
44
|
-
- **External tracker boundary**: The host may attach one opted-in GitHub Issue projection after terminal settlement. Only a fresh claimless `done`/`stopped` projection plus its exact terminal tombstone projects `completed`/`not planned`; Enrollment performs no GitHub projection. Report tracker failures separately, but never treat them as evidence, stop the Loop, repeat a Kernel mutation, or import Issue state.
|
|
45
|
-
- **Scope boundary**: Scope expansion always returns to `imm-planner`; Executor, test repair, and PR/CI repair stop with the concrete missing scope and verification reason instead of widening execution.
|
|
46
|
-
- **Action authority**: The loop always enters through `imm_loop_action`; its projected `next` authority is `executor`, `test-fixer`, `pr-fix`, `arch-explorer`, `advisory-reviewer`, `compounder`, `imm_kernel_canary`, `imm-planner`, or `none`.
|
|
47
|
-
|
|
48
|
-
## Kernel Loop
|
|
49
|
-
|
|
50
|
-
Repeat this sequence; do not silently stop while a valid action remains:
|
|
51
|
-
|
|
52
|
-
1. Call `imm_loop_action` with `op: route` (or `dispatch_role` at a QA/review boundary) and follow the projected `next` authority.
|
|
53
|
-
2. Emit one progress line: `[target][phase] result | next: action`.
|
|
54
|
-
3. Execute exactly one allowed action:
|
|
55
|
-
- Kernel ownership: call `imm_kernel_canary` for that owned task. Freeze the completed artifacts, then call `advance_assurance`; when it returns `review_ready`, invoke the foreground reviewer and pass its structured verdict to `submit_review`. When the projection calls for `request_authorization` or `approve_breaking_intent_revision`, invoke the exact Tool operation directly without asking the user for chat pre-confirmation; the native host interaction is the single authority decision. Invoke `repair_authority_state` directly for a proven stale claim; Kernel revalidation removes only the redundant claim without user interaction.
|
|
56
|
-
- Active Step / `rework_needed`: follow the returned `executor` context in the current conversation, implement only the active Step or pending same-boundary `follow_up`, verify, record structured execution evidence through the Loop runtime action, and continue. A bounded test-only repair may request internal `test-fixer` with `focus_delta.specific_changes`; PR review or CI repair may request internal `pr-fix` with the current `plan_id`, changed-file boundary, and verification. Both return child evidence to the Parent and cannot widen scope.
|
|
57
|
-
- `awaiting_qa_decision`: call `imm_loop_action` with `op: dispatch_role`, role `qa`, the current projection, Plan verification, recorded evidence, and current target identity. Invoke the returned foreground Agent envelope exactly. A `rework` or `replan` must carry validated `notes`.
|
|
58
|
-
- `review_required`: map the exact `pending_review_gate` (`imm-code-review` or `imm-ui-review`) to the internal `code-review` or `ui-review` role and call `imm_loop_action` with `op: dispatch_role`, passing `pending_review_gate`, `review_changed_files`, and `review_changed_files_signature`. Invoke the returned foreground Agent envelope exactly. Record a validated pass, or open a same-boundary follow-up through the Loop runtime action.
|
|
59
|
-
- `awaiting_user_successor_decision`: stop immediately with `recommended_authority: user`, no next skill, and no runtime action. This boundary must not dispatch Planner, transition, Compounder, or a new Pi session/subagent. Only a literal user may supply a concrete validated successor Plan through the native authority gate; the internal runtime token is `--approve-successor`, never a public Skill or user-facing entry.
|
|
60
|
-
4. After every accepted runtime write, discard the old snapshot and read a fresh Kernel / Loop projection. Emit a result line only when the write completes a major phase or a subagent round.
|
|
61
|
-
|
|
62
|
-
Use Pi native `Agent` subagents. Do not spawn Pi child processes or invoke a separate `imm-loop` CLI.
|
|
63
|
-
|
|
64
|
-
## Authority and Failure Guards
|
|
65
|
-
|
|
66
|
-
- Implementation requires a validated Plan and active Step or accepted pending `follow_up`.
|
|
67
|
-
- The parent may implement but must not issue its own QA or review pass.
|
|
68
|
-
- QA and reviewer children must not edit files, write Plans, mutate Kernel state, or close decisions directly.
|
|
69
|
-
- Missing `Agent` support, failed or malformed child output, stale child target, runtime write failure, invalid projection, missing credentials, unclear verification, repeated unchanged failure, or user cancellation stops fail-closed with an explicit reason and no decision write.
|
|
70
|
-
- A Managed native authority failure reports its stable reason and exactly one same-Host recovery action. Never recommend another Host, worktree, Direct Path, unmanaged implementation, or automatic retry as a fallback.
|
|
71
|
-
- `replan_needed` stops at `imm-planner`; do not widen scope or rewrite the active Plan. A replacement must use a new sequential Plan path after the current Plan reaches `completed`, or after a literal user explicitly marks it `cancelled` or `superseded`.
|
|
72
|
-
- Plans never suspend, resume, queue, or execute in parallel. Do not insert a repair Plan ahead of the current Plan.
|
|
73
|
-
- Same-boundary review `follow_up` repeats execution, independent QA, and the originating review gate.
|
|
74
|
-
- Runtime `review_required` is the single review-gate authority. Do not invent hidden gates.
|
|
75
|
-
- `imm-compounder` is an internal role and is never invoked as a public Skill. A `complete` projection carries an explicit internal Compounder handoff because the runtime determined it is required. A Standard Plan with optional Compounder is atomically finished by the last review gate and does not emit that handoff. Strict Plans preserve the successful order: current Steps and QA, required reviews, internal Compounder handoff, terminal settlement, then `awaiting_user_successor_decision` for a non-terminal Roadmap slice.
|
|
76
|
-
- Successor approval is non-delegable. QA, review, Planner, Compounder, and the loop cannot approve or activate a successor, and the loop must not turn a command template into an executable successor invocation.
|
|
77
|
-
|
|
78
|
-
## Stop Conditions
|
|
79
|
-
|
|
80
|
-
Stop only for:
|
|
81
|
-
|
|
82
|
-
- `complete` with an explicit internal Compounder handoff before terminal settlement
|
|
83
|
-
- `terminal_plan_complete` after a contracted terminal Plan or a legacy Plan without successor metadata has passed internal Compounder handoff and terminal settlement; stop with no next skill, authority, or action
|
|
84
|
-
- `awaiting_user_successor_decision` after finish, with literal user authority and no automatic action
|
|
85
|
-
- `replan_needed`
|
|
86
|
-
- blocker or required user input
|
|
87
|
-
- runtime, tool, subagent, or output-contract failure
|
|
88
|
-
- user cancellation (no decision write; Plan termination is a separate explicit user-confirmed runtime action)
|
|
89
|
-
- repeated unchanged failure
|
|
90
|
-
- explicit Step, rework, review, follow-up, or elapsed-time budget exhaustion
|
|
91
|
-
|
|
92
|
-
Session-local budgets are advisory. Persisted Step, QA, review, and follow-up state controls recovery. After interruption, re-enter only by reading a fresh projection: a completed runtime write is honored once; an interrupted pre-write action is not claimed; cancellation performs no decision write; repeated unchanged failure stops unless the next attempt names a strategy change; explicit budgets stop before another action.
|
|
93
|
-
|
|
94
|
-
## Observable Output Contract
|
|
95
|
-
|
|
96
|
-
Do not narrate projection reads or routine runtime writes. Emit compact progress only for Step start, completed execution evidence, QA/review decisions, failures that change the plan, and terminal stop. Every subagent round still emits exactly one dispatch line and exactly one collection/result line:
|
|
97
9
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
10
|
+
## Kernel Canary Routing and Authority
|
|
11
|
+
|
|
12
|
+
Only explicit `imm-loop` entry starts or resumes this loop. Ordinary host input
|
|
13
|
+
stays host-native; it never resumes a Managed owner implicitly. Read the current
|
|
14
|
+
Host's `imm_kernel_canary` `status` first and verify the exact active backend
|
|
15
|
+
claim, TaskIntent, and TaskRecord. Invalid or contradictory projections fail
|
|
16
|
+
closed. A candidate TaskIntent is not Enrollment authority.
|
|
17
|
+
|
|
18
|
+
TaskIntent defines the goal, acceptance, and `scope_hint`; TaskRecord and the
|
|
19
|
+
Kernel projection own lifecycle, artifact state, freshness, and next obligation.
|
|
20
|
+
Conversation memory, GitHub Issues, and `CONTEXT.md` never override them.
|
|
21
|
+
Historical prose Plans and State Ledgers are read-only history, not execution
|
|
22
|
+
instructions. Do not create Steps, workflow profiles, follow-up ledgers, or
|
|
23
|
+
successor Plans to drive a Kernel task.
|
|
24
|
+
|
|
25
|
+
At every internal role boundary call the read-only `imm_loop_action` Tool. Use
|
|
26
|
+
`route` for current-context Executor work, bounded repair, architecture
|
|
27
|
+
exploration, advisory review, Compounder, Kernel ownership, or scope expansion.
|
|
28
|
+
Use Kernel ownership for an enrolled task. This Tool projects authority; it does
|
|
29
|
+
not record execution evidence, mutate task state, or replace Kernel operations.
|
|
30
|
+
Follow the [Subagent Dispatch Protocol](docs/reference/subagent-dispatch-protocol.md#authorization-authority).
|
|
31
|
+
Never load an internal role as a public Skill or spawn another loop process.
|
|
32
|
+
The standalone `imm-pr-fix`, `imm-doc-prune`, and `imm-agent-doc-maintain` are host-native
|
|
33
|
+
maintenance entries, never dispatched as the Loop role. Internal `test-fixer`
|
|
34
|
+
and `pr-fix` repairs remain bounded by the enrolled TaskIntent.
|
|
35
|
+
|
|
36
|
+
## Execution Loop
|
|
37
|
+
|
|
38
|
+
Continue while the current projection has a valid action:
|
|
39
|
+
|
|
40
|
+
1. For active artifacts, implement only the enrolled acceptance within
|
|
41
|
+
`scope_hint` in the current conversation. Run focused checks. Executor checks
|
|
42
|
+
are diagnostic evidence, not a QA or Review approval.
|
|
43
|
+
2. Before Assurance, call `freeze_artifacts` while TaskRecord is `active:active`.
|
|
44
|
+
A bound active Spec and its archive path must both be inside `scope_hint`.
|
|
45
|
+
The Kernel owns byte-preserving archival and the frozen snapshot.
|
|
46
|
+
3. Call `advance_assurance` in the foreground and consume its direct terminal
|
|
47
|
+
result. Deterministic QA runs fixed acceptance descriptors atomically inside
|
|
48
|
+
the Host integration. Do not dispatch a separate per-Step QA Agent.
|
|
49
|
+
4. On `review_ready`, invoke the returned `agent_params` as one exact foreground
|
|
50
|
+
Agent call, then pass its structured verdict to `submit_review`. Do not
|
|
51
|
+
replace this snapshot-bound reviewer with a generic role dispatch. The Parent
|
|
52
|
+
cannot issue its own QA or Review pass.
|
|
53
|
+
5. Follow the returned Kernel obligation. Fresh QA suffices for routine work;
|
|
54
|
+
material and critical work additionally require fresh independent Review.
|
|
55
|
+
Normal completion does not require a second user confirmation.
|
|
56
|
+
6. For rework, follow the projected artifact state before editing. Resolve
|
|
57
|
+
findings only after fixing and verifying their cause. Changed snapshots
|
|
58
|
+
invalidate old evidence; freeze and run the newly required obligations.
|
|
59
|
+
7. Stop on terminal `done` or `stopped`, unresolved user decisions, explicit
|
|
60
|
+
cancellation, or a failure without a safe projected action.
|
|
61
|
+
|
|
62
|
+
Use the fresh projection returned by a successful operation when supplied. Read
|
|
63
|
+
`status` after interruption, ambiguous mutation results, absent projections, or
|
|
64
|
+
suspected external changes. Never repeat a mutation merely to obtain its result.
|
|
65
|
+
Kernel CAS and freshness checks remain mandatory; reducing Parent reads does
|
|
66
|
+
not bypass them. Do not poll or create detached jobs.
|
|
67
|
+
|
|
68
|
+
## Decisions and Recovery
|
|
69
|
+
|
|
70
|
+
- Scope expansion always returns to `imm-planner`. Collect all currently known missing
|
|
71
|
+
paths, caller/test/generated mirrors, and verification reasons in one request.
|
|
72
|
+
Do not edit outside scope while waiting or widen it piecemeal without new
|
|
73
|
+
evidence. Bounded test or PR repair stays inside the same TaskIntent.
|
|
74
|
+
- Invoke `approve_breaking_intent_revision` with the complete next intent
|
|
75
|
+
directly; the native Host gate is the single user decision. Do not overwrite
|
|
76
|
+
enrolled intent sidecars or ask for chat pre-confirmation.
|
|
77
|
+
- On `awaiting_user`, invoke `request_authorization` directly. It is reserved
|
|
78
|
+
for a concrete unresolved decision or explicit stop, not risk tier alone.
|
|
79
|
+
- Invoke `repair_authority_state` directly for a proven stale claim. Kernel
|
|
80
|
+
revalidation removes only the redundant claim without user interaction.
|
|
81
|
+
- A Managed native authority failure stays fail-closed. Report its stable reason
|
|
82
|
+
and exactly one same-Host recovery action. Never recommend another Host,
|
|
83
|
+
worktree, Direct Path, unmanaged implementation, or automatic retry.
|
|
84
|
+
- After interruption, read a fresh projection and run only the pending obligation.
|
|
85
|
+
A committed QA result is honored; an interrupted precommit QA run produces no
|
|
86
|
+
approval. Do not rerun fresh QA simply because Review was interrupted.
|
|
87
|
+
- Malformed or stale reviewer output is not a verdict. Keep the existing
|
|
88
|
+
reservation only if the Host reports it valid; use its exact recovery action.
|
|
89
|
+
Do not fabricate a pass or blindly redispatch Review.
|
|
90
|
+
- Missing tools, credentials, invalid projections, or repeated unchanged failures
|
|
91
|
+
stop with a concrete cause. Cancellation performs no decision write and is not
|
|
92
|
+
task termination. Explicit task stop uses its native authority gate.
|
|
93
|
+
|
|
94
|
+
## Review and Learning
|
|
95
|
+
|
|
96
|
+
Reviewers are read-only and bound to the frozen snapshot. They cannot edit files,
|
|
97
|
+
write planning artifacts, mutate Kernel state, or settle decisions. Report all
|
|
98
|
+
substantiated blockers in one round, tied to acceptance or a concrete regression;
|
|
99
|
+
separate optional advice from blockers. Suggestions alone do not justify rework.
|
|
100
|
+
Use the returned verdict schema exactly, including omission of unsupported fields.
|
|
101
|
+
|
|
102
|
+
`dispatch_role` for `qa`, `code-review`, or `ui-review` is used only when an
|
|
103
|
+
explicit runtime-supported role boundary requests it, followed by the returned
|
|
104
|
+
foreground Agent envelope exactly. It is not an extra gate on Kernel Assurance.
|
|
105
|
+
All internal Agent envelopes use `run_in_background: false`.
|
|
106
|
+
|
|
107
|
+
The internal Compounder is optional: only closed work with structured evidence
|
|
108
|
+
of a reusable Learning may route to it. Routine completion creates no Learning.
|
|
109
|
+
It cannot approve successors or delay terminal settlement. A projection with
|
|
110
|
+
`recommended_authority: user` must not dispatch successor work automatically.
|
|
111
|
+
Do not create, switch,
|
|
112
|
+
or delete Git worktrees; operate only in the Host launch directory.
|
|
113
|
+
|
|
114
|
+
The Host may attach an opted-in GitHub projection after settlement. Only a fresh claimless
|
|
115
|
+
`done`/`stopped` projection plus its exact terminal tombstone projects
|
|
116
|
+
`completed`/`not planned`; Enrollment performs no GitHub projection. Report a
|
|
117
|
+
tracker failure separately; never use it as evidence, a Loop blocker, or a reason to
|
|
118
|
+
repeat a Kernel mutation.
|
|
119
|
+
|
|
120
|
+
## Observable Output
|
|
121
|
+
|
|
122
|
+
Emit progress at execution start, QA/Review phase changes, failures, and terminal
|
|
123
|
+
stop. Every Agent round has one dispatch line and one result line; never claim a
|
|
124
|
+
successful collection on timeout, cancellation, malformed output, or stale identity.
|
|
125
|
+
Normal conversation and visible Tool calls are the observation surface. Do not
|
|
126
|
+
narrate routine projection reads or add Footer status content.
|
|
127
|
+
|
|
128
|
+
Every exit includes a concise summary:
|
|
107
129
|
|
|
108
130
|
```text
|
|
109
|
-
|
|
110
|
-
Completed
|
|
131
|
+
Task:
|
|
132
|
+
Completed work:
|
|
111
133
|
QA:
|
|
112
134
|
Review:
|
|
113
135
|
Stop reason:
|
|
114
136
|
Next action:
|
|
115
137
|
```
|
|
116
138
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
- If no validated Plan exists: stop and route to `imm-planner`.
|
|
132
|
-
- If an allowed Loop action exists: continue the loop without another user command.
|
|
133
|
-
- If work is fully closed but not finished: report the explicit internal Compounder handoff and wait for terminal settlement.
|
|
134
|
-
- If the projection is `awaiting_user_successor_decision`: report the candidate and preconditions, ask for the user's decision, and stop without dispatch.
|
|
135
|
-
|
|
136
|
-
## Output style
|
|
137
|
-
|
|
138
|
-
Default user-facing shape: checkpoint progress lines, then `Conclusion -> Evidence -> Next action` at the terminal boundary.
|
|
139
|
-
|
|
140
|
-
## Kernel Canary Routing
|
|
141
|
-
|
|
142
|
-
When the Kernel projection reports an active/draining backend claim, keep
|
|
143
|
-
`imm-loop` as the user-facing entry and call the current Host's Kernel integration
|
|
144
|
-
for that owned task. Enrollment and Review authorization use the current Host's
|
|
145
|
-
native gates. When the projection calls for `request_authorization` or
|
|
146
|
-
`approve_breaking_intent_revision`, invoke the exact Tool operation directly
|
|
147
|
-
without asking the user for chat pre-confirmation; the native Host interaction is
|
|
148
|
-
the single authority decision. Invoke
|
|
149
|
-
`repair_authority_state` directly for a proven stale claim; Kernel revalidation
|
|
150
|
-
removes only the redundant claim without user interaction. Do not invoke the
|
|
151
|
-
removed `imm-canary-work` Skill as
|
|
152
|
-
a separate entry point. Invalid or contradictory projections fail closed. After
|
|
153
|
-
implementation and focused verification, freeze the artifacts and call
|
|
154
|
-
`advance_assurance`. If it returns `review_ready`, invoke the foreground
|
|
155
|
-
reviewer and pass its structured verdict to `submit_review`;
|
|
156
|
-
`request_authorization` is reserved for an unresolved user decision or an
|
|
157
|
-
explicit stop. Critical work completes after fresh QA and Review without a
|
|
158
|
-
second user confirmation.
|
|
159
|
-
Every QA/Review operation stays foreground and returns its next projected
|
|
160
|
-
obligation directly to the Parent. The host performs any opted-in GitHub Issue
|
|
161
|
-
projection only after the corresponding authority mutation: only a fresh
|
|
162
|
-
claimless `done`/`stopped` projection with its exact terminal tombstone projects
|
|
163
|
-
terminal closure (`completed`/`not planned`); Enrollment performs no GitHub
|
|
164
|
-
projection. Treat the attached tracker result as non-authoritative observation.
|
|
165
|
-
Report its failure separately, but never use it as evidence, a stop condition,
|
|
166
|
-
or a reason to repeat a Kernel mutation. A terminal tombstone alone never
|
|
167
|
-
blocks unrelated v3 routing.
|
|
139
|
+
For `settlement_unknown`, call `advance_assurance` once to reconcile the Kernel
|
|
140
|
+
projection before resuming; never replay the uncertain write directly. The runtime
|
|
141
|
+
retries only explicit `EINTR`/`EAGAIN` failures of its initial projection read, once,
|
|
142
|
+
with cancellation checks. Semantic authority errors and mutation failures are not
|
|
143
|
+
retryable reads. For `review_preparation_failed`, repair the reported transport or
|
|
144
|
+
environment cause before advancing; committed QA remains valid. For
|
|
145
|
+
`verdict_invalid`, correct the existing payload once and resubmit without another
|
|
146
|
+
reviewer dispatch. If correction fails, report the schema failure and stop the
|
|
147
|
+
correction loop.
|
|
148
|
+
|
|
149
|
+
For failures, name the cause, stages already committed, the safe retry boundary,
|
|
150
|
+
and exactly one next action. Distinguish user approval from environment repair
|
|
151
|
+
and runtime failure. Do not ask the user to manually switch internal roles.
|
|
@@ -38,7 +38,7 @@ Learnings. It resolves repository facts, performs reference closure, and owns
|
|
|
38
38
|
ordinary technical choices:
|
|
39
39
|
component boundaries, internal interfaces, failure behavior, compatibility,
|
|
40
40
|
migration, recovery and rollback, Verification, execution slices, dependencies,
|
|
41
|
-
scope, and delivery risk. Persist that design in the candidate Spec
|
|
41
|
+
scope, and delivery risk. Persist that design in the candidate Spec and
|
|
42
42
|
TaskIntent rather than copying the question transcript.
|
|
43
43
|
|
|
44
44
|
Planner may ask only when concrete new evidence exposes an omission, repository
|
|
@@ -88,11 +88,10 @@ source. If its prose conflicts with those authority facts, report stale
|
|
|
88
88
|
documentation, preserve projection-based routing, and do not automatically
|
|
89
89
|
synchronize either representation.
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
TaskIntent whose `imm-kernel intent validate <path> --json` projection is
|
|
91
|
+
Historical prose Plans are read-only artifacts. Their validation never proves
|
|
92
|
+
Managed authority and is not a prerequisite for new TaskIntent planning. New
|
|
93
|
+
execution requires a Git-tracked TaskIntent whose
|
|
94
|
+
`imm-kernel intent validate <path> --json` projection is
|
|
96
95
|
`valid: true` and `enrollment_ready: true`, followed by current-Host native
|
|
97
96
|
Enrollment.
|
|
98
97
|
|
|
@@ -132,17 +131,21 @@ For a large proposal split across multiple TaskIntents, exactly one planning
|
|
|
132
131
|
carrier is chosen per Initiative: a Local Markdown file at
|
|
133
132
|
`docs/initiatives/<slug>.md` or one GitHub Parent Issue. This preference applies
|
|
134
133
|
only to Initiatives; ordinary TaskIntents remain tracked by Kernel TaskRecords.
|
|
135
|
-
Resolve the carrier in this order
|
|
134
|
+
Resolve the carrier in this order, reading each source directly rather than
|
|
135
|
+
assuming the current Host injected it into context:
|
|
136
136
|
|
|
137
137
|
1. a literal user instruction for the current request;
|
|
138
138
|
2. `Initiative carrier default: local` or `Initiative carrier default: github`
|
|
139
|
-
in the repository root
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
in the repository root agent instruction file, whichever this repository
|
|
140
|
+
tracks: `AGENTS.md` or `CLAUDE.md`;
|
|
141
|
+
3. the same directive in the Host's user-level agent instruction file; or
|
|
142
|
+
4. ask the user.
|
|
143
|
+
|
|
144
|
+
A repository directive overrides the user-level directive. There is no silent
|
|
145
|
+
carrier default: when no valid directive is found, ask and report which sources
|
|
146
|
+
were checked. Report an invalid value and ask instead of guessing. Never resolve
|
|
147
|
+
to `local` or `github` because a source was absent or unreadable. After resolving
|
|
148
|
+
it, display one non-blocking line with the selected carrier and its source. A configured `github` default is
|
|
146
149
|
standing opt-in for GitHub projection, but the literal user must still confirm
|
|
147
150
|
the named Initiative, its immutable slug, and the complete Parent/Child
|
|
148
151
|
decomposition before the first remote mutation. A prior bulk approval cannot
|
|
@@ -220,29 +223,20 @@ descriptors or add a mandatory user confirmation. Use the smallest `timeout_ms`
|
|
|
220
223
|
## Core Responsibilities
|
|
221
224
|
|
|
222
225
|
- **Decomposition**: Convert requirements into a concrete spec under `docs/specs/` and one or more TaskIntents. Treat Technical Design as one TaskIntent decomposition dimension alongside outcome, Verification, dependency, risk, rollback, compatibility, and authority.
|
|
223
|
-
- **Outcome Focus**: Each
|
|
224
|
-
- **Planning granularity**:
|
|
225
|
-
- **
|
|
226
|
-
- **
|
|
227
|
-
- **Risk-Triggered Exploration**: Before freezing a Managed Plan, resolve only the unknowns that could change Scope, design, or Verification — CI environment, third-party APIs, database behavior, cross-module interfaces — using targeted read-only probes. The internal `arch-explorer` and explicit-lens `advisory-reviewer` roles are the Loop bridge for these bounded probes; both return evidence and decision criteria without writing the Spec, Plan, or workflow state. Read-only and Plan-only work stays host-native without Enrollment; explicit Immune-Brain Skill entry starts Managed planning. Independently owned domains and unresolved material risk remain Managed concerns. Stop probing once Result, Scope, and Verification are concrete.
|
|
228
|
-
- **Supersede Observability**: Every new `superseded` termination must record the runtime flags `--reason-code` (`exploration_gap` | `scope_pivot` | `boundary_error` | `contract_change` | `execution_failure`), `--stage`, `--invalidated-assumption`, and `--avoidable yes|no`; `cancelled` terminations may record the same classification but do not require it. Legacy terminal records without observability remain readable. Planning-quality metrics count only `avoidable: yes` terminations; `scope_pivot` must use `--avoidable no` because it is an external requirement change, never planner failure; `execution_failure` normally routes to `rework`/`follow_up` instead of supersede.
|
|
226
|
+
- **Outcome Focus**: Each TaskIntent owns one independently verifiable outcome. Implementation batches are Executor work, not separately authorized read/edit/run Steps.
|
|
227
|
+
- **Planning granularity**: Keep a coherent outcome together when acceptance, risk, rollback, and authority can settle together. Use the TaskIntent decomposition rules below for independent outcomes. File count, tokens, compactions, elapsed time, and review rounds are evidence for judgment, not universal gates.
|
|
228
|
+
- **Historical artifacts**: v3 prose Plan mutation is retired. `imm-plan` is a read-only validator for archived Plans; create no new Roadmap, Phase, successor Plan, or State Ledger.
|
|
229
|
+
- **Risk-Triggered Exploration**: Before authoring a TaskIntent, resolve only unknowns that could change scope, design, or verification using targeted read-only probes. Internal `arch-explorer` and explicit-lens `advisory-reviewer` roles return evidence without writing the Spec, TaskIntent, or workflow state. Stop probing when outcome, scope, and verification are concrete. Do not use retired Plan termination flags to classify discovery failures.
|
|
229
230
|
- **Simplicity**: Apply the BASELINE Workflow Activation gate first. Non-mutating host-native work creates no Planner artifact. Explicit Immune-Brain Skill entry starts this Planner phase; ordinary host input does not invoke it through natural-language routing. Create one coherent outcome instead of expanding ceremony.
|
|
230
231
|
- **Design-Depth Classification**: Classify change design risk with the smallest sufficient tier: **Low risk** (copy, configuration, trivial rename, or contained local fix) may omit a separate Technical Design; **Medium risk** (non-trivial single-module behavior or internal contract) records affected components, decisions, invariants, failure behavior, and verification implications; **High risk** (cross-module/API/data-flow/state-machine, security, migration, concurrency, architecture ownership, cross-runtime/package-contract, or persisted-state work) records boundaries, interfaces or flow, alternatives, invariants, rollback/compatibility, and verification implications. Medium and High risk require Technical Design in the Spec. Do not classify a change as Low risk when it has a contract, ownership, security, persistence, compatibility, or multi-component concern. Every new or revised Spec records `**Design risk**: Low|Medium|High` with an adjacent rationale.
|
|
231
232
|
- **Design-view selection**: For Medium and High risk, select every materially relevant technical-design view from architecture layers, service/component interfaces, data flow, state transitions, and temporal sequence. Record a short `Design views` statement naming the selected views and why any omitted view cannot affect the design. Do not write empty architecture, interface, data-flow, state, or sequence sections. Low risk remains concise and may omit Technical Design. When a selected view is recorded, also record its required decision content: architecture layers need layer responsibilities, dependency direction, ownership, and prohibited coupling; service/component interfaces need inputs, outputs, errors, compatibility/versioning, and caller/callee ownership; data flow needs source, transformations, validation, destination, and failure handling; state transitions need states, legal transitions, trigger, invariant, terminal ownership, and recovery; temporal sequence needs ordered interactions, authority at each point, interruption behavior, and idempotency.
|
|
232
233
|
- **Technical Design Authority**: The Spec is the single Technical Design baseline. TaskIntent acceptance and scope reference the applicable design decisions or invariants without copying Technical Design prose. If discovery invalidates the baseline, stop execution and return to Planner to update the Spec and decide whether `replan` is required. TaskIntent and Initiative text do not duplicate Technical Design prose or become a prose Plan substitute.
|
|
233
234
|
- **TaskIntent decomposition**: Use the selected design boundaries as one retain/split criterion for TaskIntent slices. Keep work in one TaskIntent when the selected views describe one coherent executable slice with shared acceptance, risk treatment, rollback, and authority. Split a successor TaskIntent when a service boundary, state-machine owner, migration/compatibility boundary, independently promotable layer, or sequence dependency needs independent verification, rollback, authorization, or settlement. Do not split merely because the design names several layers, files, or services. Treat trust-boundary changes as the same kind of decomposition evidence: a TaskIntent should normally change one primary trust-boundary invariant, while merely traversing several boundaries or updating both sides of one end-to-end authority chain does not require a split. Split separate trust invariants when they can be independently verified, rolled back, authorized, migrated, or settled. Keep multiple trust-boundary changes together only when they form one atomic security outcome and splitting would create an unsafe or unusable intermediate state; record that reason in the Spec. This is Planner judgment, not a TaskIntent schema field or an Enrollment counting rule. This does not revive prose Plan, Roadmap, or Phase authority.
|
|
234
235
|
- **Mermaid Use**: Mermaid is required only when a medium/high-risk design contains structure, sequence, data flow, or state transition relationships that a diagram materially clarifies. Mermaid is not a universal gate; a diagram supplements adjacent prose and never becomes a second design authority. Every new or revised Spec records `**Diagram decision**: required|not_required` and a non-empty `**Diagram reason**:`. A `required` decision must have a Mermaid block; `not_required` explains why prose is sufficient.
|
|
235
|
-
- **Verification**: Every
|
|
236
|
-
- **Executable Scope**:
|
|
237
|
-
- **
|
|
238
|
-
- **
|
|
239
|
-
- **Prototype Step**: When a step exists to answer a design question rather than produce production code, annotate it with `Prototype: true`. A prototype step produces a throwaway artifact whose durable output is a recorded decision (ADR or docs/solutions/ entry). The executor skips test-first discipline on prototype steps; the compounder captures the answer before the prototype is deleted. This is an advisory annotation read from raw plan text; it is not parsed by `imm-plan.py`.
|
|
240
|
-
- **Execution Posture Detection**: When planning a step, detect whether a non-default execution posture applies. Write an `Execution note` field on the step when the signal is clear:
|
|
241
|
-
- Legal values: `test-first` | `characterization-first` (omit the field for default pragmatic execution)
|
|
242
|
-
- Trigger signals for `test-first`: user explicitly requests TDD; the step has clear input/output contract; new module with behavioral logic
|
|
243
|
-
- Trigger signals for `characterization-first`: modifying legacy code with no existing test coverage; refactoring fragile behavior
|
|
244
|
-
- Do not mark: pure spec/documentation writing, configuration wiring, styling, trivial renames
|
|
245
|
-
- Do not expand into literal RED/GREEN/REFACTOR substeps in the plan — the executor owns that choreography
|
|
236
|
+
- **Verification**: Every acceptance assertion has a concrete focused descriptor that can fail on the intended regression. Hypothetical evidence is not execution-ready.
|
|
237
|
+
- **Executable Scope**: `scope_hint` is the mutation envelope, not discovery context. Close references across callers, tests, generated mirrors, and state-machine owners before authoring. Include bound active and archive Spec paths needed for `freeze_artifacts`. Collect all known scope gaps in one revision request; ask again only when new evidence changes the boundary.
|
|
238
|
+
- **Devil's Advocate Preplan Audit**: Record a `Devil's Advocate Audit` in the Spec covering rollback resilience, verification vanity, and spec dilution detection. Explain recovery from partial implementation, why verification detects the regression, and how accepted requirements remain covered.
|
|
239
|
+
- **Execution posture**: Record `test-first` or `characterization-first` in the Spec when explicitly requested or justified by fragile untested behavior. The Executor owns the local choreography; do not create prototype or RED/GREEN/REFACTOR authority Steps. Throwaway probes must have a cleanup condition and a durable decision output.
|
|
246
240
|
|
|
247
241
|
## Settlement-Design Contract
|
|
248
242
|
|
|
@@ -297,7 +291,7 @@ implementation-ready contract and routes it to normal planning or execution.
|
|
|
297
291
|
|
|
298
292
|
## Planning Rules
|
|
299
293
|
|
|
300
|
-
- **Entry Contract**: Use when
|
|
294
|
+
- **Entry Contract**: Use when Spec/TaskIntent planning is needed. An already enrolled owner remains on its current Kernel authority and resumes only through explicit `imm-loop`; a validated candidate still needs native Enrollment.
|
|
301
295
|
- **Output Language Gate**: Before writing or revising any Spec or Plan, read the project output language policy from `AGENTS.md`, `IMMUNE.md`, or Immune-Brain plugin config. Default Spec and Plan prose to English unless the current user request, project instructions, or host/user preference contains an explicit document-language instruction. A reply-language instruction does not change document language. Keep schema fields, CLI commands, file paths, code identifiers, enum values, JSON keys, and canonical terms such as `Step`, `Plan`, `Spec`, `Verification`, `Discovery cache`, and `Devil's Advocate Audit` literal.
|
|
302
296
|
- **Clarification Supplement**: If an upstream `imm-brainstorm` manifest exists, verify that every `BR-Q-*` item is resolved and every confirmed framing decision is represented; must not repeat, reopen, or rewrite confirmed decisions. Ask only a focused omission, repository-conflict, or invalidated-assumption delta tied to concrete evidence. Resolve a local delta here; return to `imm-brainstorm` when it reopens multiple product branches or changes the overall goal or Scope. Finalization requires no unresolved supplement and no unconfirmed decision introduced by Planner.
|
|
303
297
|
- **Planning Bootstrap**: When no upstream `imm-brainstorm` manifest exists, preserve Direct Planner entry by resolving repository facts and deriving ordinary technical choices. An already-clear request takes the zero-question fast path to a non-blocking correction summary. Discovery of an unresolved user-owned goal, user, scope, behavior, compatibility preference, risk acceptance, or success criterion returns to `imm-brainstorm`; Planner does not convert product uncertainty into a silent assumption or duplicate Brainstorm's interview.
|
|
@@ -315,51 +309,52 @@ implementation-ready contract and routes it to normal planning or execution.
|
|
|
315
309
|
explain how the selected seam catches the intended regression. This is a
|
|
316
310
|
planning heuristic: it must not weaken acceptance-specific focused
|
|
317
311
|
verification descriptors or add a mandatory user confirmation.
|
|
318
|
-
- **Review Mapping**:
|
|
319
|
-
- **Brainstorm Manifest Mapping**:
|
|
320
|
-
- **
|
|
321
|
-
- **Session Lifecycle Ownership**: The user decides whether progression continues in the current session or a new session. Planner must not turn Plan boundaries, tokens, compactions, tool calls, elapsed time, or review rounds into automatic session creation, closure, or forced-stop policy. Persisted Spec, Plan, State Ledger, and handoff artifacts must support either user choice.
|
|
312
|
+
- **Review Mapping**: In-scope rework stays with the enrolled TaskIntent and explicit `imm-loop` entry. Cross-scope findings become a Planner decision delta with concrete missing paths and verification evidence; do not create a successor prose Plan.
|
|
313
|
+
- **Brainstorm Manifest Mapping**: Record every upstream `BR-*` item in a Spec `Brainstorm Trace`, mapped to TaskIntent acceptance, a captured decision, or an explicit reason for deferral or exclusion. Resolve every `BR-Q-*` item before handoff. Do not silently narrow confirmed framing.
|
|
314
|
+
- **Session Lifecycle Ownership**: The user chooses the current or a new session. Tokens, compactions, tool counts, elapsed time, and review rounds never trigger automatic session creation or termination. Recovery uses TaskRecord and the fresh Kernel projection.
|
|
322
315
|
- **Subagents**: Follow the Adaptive Cache-First Route in `docs/reference/subagent-dispatch-protocol.md`: classify the task, use cache-first discovery evidence, and add subagent participation only when the Cost-Based Subagent Gate says the slice is multi-domain, high-risk, explicitly requested, or has concrete `parallel_probes`. Plan conditional reviewers such as `security-reviewer` only if their trigger surfaces are explicit; do not manufacture them.
|
|
323
|
-
- **
|
|
324
|
-
- **CONTEXT.md Vocabulary**:
|
|
325
|
-
- **Discovery Protocol**:
|
|
326
|
-
- **Planning Quality Gate**: For elevated-risk
|
|
327
|
-
- **
|
|
328
|
-
- **Parallel Probes**: When decomposing a step, identify whether the step involves 3+ non-overlapping file areas where readonly investigation can run in parallel before the executor changes code. If so, define an optional `parallel_probes` annotation on the step describing each probe's `scope` (files/directories to investigate), `output` (expected evidence format), and `readonly: true` constraint. Plan parsing and runtime sync preserve `parallel_probes` on the normalized Step and State Ledger active Step. Probes are dispatched by `imm-work` before entering executor; the executor receives probe results as input context. Do not mark probes on small steps or steps where sub-tasks have causal dependencies. Probe failure falls back to sequential inline investigation by the executor with a recorded fallback reason.
|
|
316
|
+
- **Enrolled Intent**: Planner never overwrites an enrolled TaskIntent. Scope or acceptance changes use Kernel revision authority; breaking revisions invoke the native gate directly with the complete next intent. Preserve the prior on-disk sidecars until Kernel applies the revision.
|
|
317
|
+
- **CONTEXT.md Vocabulary**: Read `CONTEXT.md` at the repo root. Use canonical terms in Spec, acceptance, and scope descriptions. `CONTEXT.md` is vocabulary and architecture navigation, not execution state.
|
|
318
|
+
- **Discovery Protocol**: Read `CONTEXT.md` `## Architecture Map` before broad searching and relevant `docs/solutions/` evidence. Record concrete file pointers and reasons in the Spec. Do not read or write a legacy Step discovery cache.
|
|
319
|
+
- **Planning Quality Gate**: For elevated-risk work, verify contract surfaces, compatibility, interruption recovery, rollback, verification strength, and Brainstorm traceability in the Spec. Do not invoke retired Plan mutation or State Ledger synchronization.
|
|
320
|
+
- **Parallel Probes**: Optional read-only probes must have bounded non-overlapping scopes, expected evidence, and no file or authority writes. They are advisory discovery, not persisted Step annotations. Probe failure falls back to inline investigation with a recorded reason.
|
|
329
321
|
|
|
330
322
|
## Research Dispatch
|
|
331
323
|
|
|
332
324
|
Follow [`docs/reference/subagent-dispatch-protocol.md`](docs/reference/subagent-dispatch-protocol.md) for the full dispatch lifecycle. This section defines planner-specific optional research dispatch.
|
|
333
325
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
Agreement becomes evidence. Disagreement becomes decision criteria. strong-model blockers become explicit risks or verification requirements in the planner-owned output. Small plans do not fan out by default; use solo planning unless the task has elevated planning risk or an explicit ensemble request.
|
|
343
|
-
|
|
344
|
-
**Trigger condition:** Only dispatch when the task spans multiple domains (`multi_domain >= 2`) or the user explicitly requests parallel research during planning. Do not dispatch for single-domain tasks or small-scope plans.
|
|
345
|
-
|
|
346
|
-
**Retrieval budget:** Stop dispatching as soon as existing evidence is sufficient to decompose steps with concrete verification paths. Do not dispatch additional agents to improve phrasing, add examples, or fill in non-essential details. Dispatch again only when a required interface contract, file dependency, or constraint is still missing and would block step decomposition.
|
|
347
|
-
|
|
348
|
-
**Dispatch behavior:** Use Pi native `Explore` subagents (`subagent_type: "Explore"`). Parallel eligibility is capability-based rather than a closed Skill list: every child delegation prompt must enforce read-only advisory behavior with no file edits, Plan writes, workflow-state mutation, or QA closure. Eligible examples include Brainstorm and Planner research children, Domain Mappers and architecture explorers, advisory reviewers, and provider-native read-only explorers; executor, QA, Compounder, owning Planner, and test-fixer children always run sequentially. Each research subagent receives a bounded investigation scope (specific module, directory, or interface surface) and returns a structured summary with `constraints`, `risks`, `unknowns`, `file_pointers`, and `verification_implications`. The parent planner merges summaries into the Research section of the plan before step decomposition. Research subagents do not write specs, plans, or `.imm/` state.
|
|
326
|
+
Use `imm_loop_action` for bounded `arch-explorer` and explicit-lens
|
|
327
|
+
`advisory-reviewer` routing. Invoke the returned foreground Agent envelope
|
|
328
|
+
exactly. The Parent owns Spec/TaskIntent synthesis, Brainstorm traceability,
|
|
329
|
+
acceptance, and scope; children return evidence only. On Pi the `arch-explorer` envelope
|
|
330
|
+
uses `subagent_type: "Explore"`; invoke the returned envelope rather than
|
|
331
|
+
constructing another Agent call. Do not invoke retired Planner runtime helpers
|
|
332
|
+
or write child-owned planning artifacts.
|
|
349
333
|
|
|
350
|
-
|
|
334
|
+
An optional planner ensemble is advisory-only; the Parent owns the final Spec and TaskIntent.
|
|
335
|
+
Agreement becomes evidence, not authority. Disagreement becomes decision criteria,
|
|
336
|
+
not a new confirmation gate. Do not treat strong-model blockers as authority
|
|
337
|
+
without concrete evidence for the requested outcome.
|
|
351
338
|
|
|
352
|
-
|
|
339
|
+
Stop discovery once concrete interfaces, paths, constraints, and verification
|
|
340
|
+
are known. Additional reviewers are not required to improve wording. If an
|
|
341
|
+
optional advisory dispatch fails, continue inline and record the reason.
|
|
353
342
|
|
|
354
343
|
## Boundary
|
|
355
344
|
|
|
356
|
-
- **Allowed**: Write
|
|
357
|
-
- **Blocked**: Implementation edits,
|
|
358
|
-
- **Workflow guard**:
|
|
345
|
+
- **Allowed**: Write candidate Specs and TaskIntents, Initiative planning carriers, and necessary domain vocabulary.
|
|
346
|
+
- **Blocked**: Implementation edits, direct Kernel-store writes, enrolled intent overwrites, and QA/Review decisions.
|
|
347
|
+
- **Workflow guard**: Execution continues through native Enrollment and explicit `imm-loop`. Planner owns design and decomposition, not execution authority.
|
|
359
348
|
|
|
360
349
|
## Output artifact
|
|
361
350
|
|
|
362
|
-
|
|
351
|
+
Spec under `docs/specs/` plus canonical candidate
|
|
352
|
+
`docs/plans/<task-id>.intent.json`. The Spec records outcome, discovery evidence,
|
|
353
|
+
decisions, assumptions, Technical Design when required, output language,
|
|
354
|
+
`Devil's Advocate Audit`, and acceptance/test mapping. Include a complete
|
|
355
|
+
`Brainstorm Trace` when consuming a Brainstorm manifest. TaskIntent is authored
|
|
356
|
+
and validated through `imm-kernel`; do not write a prose iteration Plan or sync
|
|
357
|
+
a State Ledger. Keep historical Plan validation strictly read-only.
|
|
363
358
|
|
|
364
359
|
## Output style
|
|
365
360
|
|
|
@@ -369,33 +364,32 @@ Iteration plan under `docs/plans/` and spec under `docs/specs/`. Includes: `Summ
|
|
|
369
364
|
|
|
370
365
|
| Excuse | Rebuttal |
|
|
371
366
|
| -------- | ---------- |
|
|
372
|
-
| Skip
|
|
373
|
-
| Split one outcome into read/edit/run micro-steps |
|
|
374
|
-
| Append repair
|
|
367
|
+
| Skip TaskIntent validation | Author, stage, and validate the canonical candidate before native Enrollment. |
|
|
368
|
+
| Split one outcome into read/edit/run micro-steps | One TaskIntent owns one closable outcome; Executor owns implementation batches. |
|
|
369
|
+
| Append repair outside scope | Return the complete known scope delta for Kernel revision; do not widen execution. |
|
|
375
370
|
| Drop a brainstorm-confirmed item as "out of scope" without saying so | Closed-world handoff: every `BR-*` ID must be covered, decisioned, deferred, scoped out with reason, or resolved as an assumption. |
|
|
376
371
|
| Start planning while brainstorm questions are open | **Clarification Barrier**: Planning is blocked until all `BR-Q-*` items are answered; do not speculate on missing product info. |
|
|
377
372
|
| Skip adversarial self-review because the plan is small | **Devil's Advocate** audit still checks rollback resilience, verification vanity, and spec dilution before the plan is treated as execution-ready. |
|
|
378
373
|
|
|
379
374
|
## Red Flags
|
|
380
375
|
|
|
381
|
-
-
|
|
382
|
-
-
|
|
383
|
-
- A
|
|
384
|
-
- A
|
|
385
|
-
- New
|
|
386
|
-
-
|
|
376
|
+
- Acceptance verification names only hypothetical evidence with no runnable descriptor.
|
|
377
|
+
- New work depends on a prose Plan validator, Step activation, or State Ledger.
|
|
378
|
+
- A Brainstorm manifest lacks a complete Spec `Brainstorm Trace`.
|
|
379
|
+
- A Spec lacks a `Devil's Advocate Audit` covering rollback resilience, verification vanity, and spec dilution detection.
|
|
380
|
+
- New Spec prose ignores the document-language policy.
|
|
381
|
+
- Candidate artifacts escape the approved planning scope.
|
|
387
382
|
|
|
388
383
|
## Verification
|
|
389
384
|
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
- For brainstorm-origin Plans with a manifest, `imm-plan <plan-path> --json` reports `origin_coverage` totals with no `unmapped_items` and no reason-required trace rows without reasons.
|
|
385
|
+
- Validate every candidate through `imm-kernel intent validate <path> --json` after authoring and staging. Require `valid: true` and `enrollment_ready: true` before Enrollment.
|
|
386
|
+
- Verify Spec design metadata, document language, reference closure, concrete descriptor paths, and complete Brainstorm traceability before handoff.
|
|
387
|
+
- Enrollment validates descriptor structure only. Deterministic QA owns descriptor execution after implementation; planning does not run the acceptance suite.
|
|
394
388
|
- Managed execution handoff is Git-tracked TaskIntent author/validate plus current-Host native Enrollment. Do not sync a v3 State Ledger or invoke a missing dispatcher.
|
|
395
389
|
|
|
396
390
|
## Next Action
|
|
397
391
|
|
|
398
|
-
- Gate: Reference closure and
|
|
392
|
+
- Gate: Reference closure and clarification are complete; every upstream `BR-*` item is represented; no unresolved user decision remains; Planner-introduced decision deltas are confirmed; the candidate is Git-tracked and validates with `valid: true` and `enrollment_ready: true`; each acceptance has concrete focused verification. Plan-only requests stop here.
|
|
399
393
|
- If gates pass: for Kernel-managed work, invoke the current Host's native Enrollment Tool directly without chat pre-confirmation. Its single literal-user gate binds the TaskIntent revision, content hash, and preparation digest, validates Enrollment preconditions without executing acceptance descriptors, and enrolls the task to continue through `imm-loop`.
|
|
400
394
|
- If the native gate fails: preserve candidate artifacts and report the stable reason plus exactly one same-Host recovery action. Do not suggest another Host, worktree, Direct Path, unmanaged implementation, or automatic retry.
|
|
401
395
|
- If gates are not met: state which validation failures, unresolved verification paths, or material decision deltas remain; do not name a next skill.
|