immune-brain 4.5.0 → 5.0.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 +157 -39
- package/README.zh-CN.md +160 -40
- package/package.json +1 -1
- package/plugins/immune-brain/.claude-plugin/plugin.json +1 -1
- package/plugins/immune-brain/.pi-extension/imm-canary-enroll.ts +42 -45
- package/plugins/immune-brain/.pi-extension/imm-canary-work.ts +189 -476
- package/plugins/immune-brain/.pi-extension/imm-unattended-batch.ts +77 -102
- package/plugins/immune-brain/.pi-extension/pi-canary-assurance-progression.ts +7 -2
- package/plugins/immune-brain/.pi-extension/tsconfig.json +2 -2
- package/plugins/immune-brain/agents/immune-brain-advisory-reviewer.md +23 -0
- package/plugins/immune-brain/agents/immune-brain-qa.md +42 -0
- package/plugins/immune-brain/agents/immune-brain-reviewer.md +90 -1
- package/plugins/immune-brain/agents/immune-brain-ui-review.md +21 -0
- package/plugins/immune-brain/dist/BASELINE.md +4 -4
- package/plugins/immune-brain/dist/claude/mcp-server.mjs +9924 -9654
- package/plugins/immune-brain/dist/docs/reference/planning-quality-gate.md +3 -3
- package/plugins/immune-brain/dist/docs/reference/subagent-dispatch-protocol.md +30 -1
- package/plugins/immune-brain/dist/imm-brainstorm.md +1 -1
- package/plugins/immune-brain/dist/imm-doc-prune.md +2 -2
- package/plugins/immune-brain/dist/{imm-agent-doc-maintain.md → imm-doc-slim.md} +9 -9
- package/plugins/immune-brain/dist/imm-planner.md +60 -20
- package/plugins/immune-brain/dist/imm-pr-fix.md +1 -1
- package/plugins/immune-brain/dist/{imm-review-retro.md → imm-retro.md} +26 -13
- package/plugins/immune-brain/dist/{imm-loop.md → imm-run.md} +44 -11
- package/plugins/immune-brain/dist/registry.yaml +9 -9
- package/plugins/immune-brain/dist/role-prompts/code-review.md +7 -0
- package/plugins/immune-brain/dist/role-prompts/executor.md +35 -2
- package/plugins/immune-brain/runtime/assurance/coordinator.ts +138 -69
- package/plugins/immune-brain/runtime/assurance/host_port.ts +20 -0
- package/plugins/immune-brain/runtime/assurance/qa.ts +2 -2
- package/plugins/immune-brain/runtime/assurance/review_evidence.ts +4 -0
- package/plugins/immune-brain/runtime/assurance/verdict_authority.ts +347 -0
- package/plugins/immune-brain/runtime/claude/interaction.ts +1 -2
- package/plugins/immune-brain/runtime/claude/kernel_ports.ts +135 -396
- package/plugins/immune-brain/runtime/claude/mcp_server.ts +5 -4
- package/plugins/immune-brain/runtime/claude/review_host.ts +63 -16
- package/plugins/immune-brain/runtime/claude/role_agents.ts +83 -0
- package/plugins/immune-brain/runtime/commands/kernel.ts +3 -6
- package/plugins/immune-brain/runtime/github_issue_tracker.ts +738 -677
- package/plugins/immune-brain/runtime/kernel/application.ts +7 -7
- package/plugins/immune-brain/runtime/kernel/assurance_projection.ts +15 -8
- package/plugins/immune-brain/runtime/kernel/authority_port.ts +5 -14
- package/plugins/immune-brain/runtime/kernel/batch_authority.ts +30 -49
- package/plugins/immune-brain/runtime/kernel/canary_application.ts +6 -5
- package/plugins/immune-brain/runtime/kernel/canary_eligibility.ts +0 -1
- package/plugins/immune-brain/runtime/kernel/capability_registry.ts +7 -9
- package/plugins/immune-brain/runtime/kernel/enrollment.ts +170 -17
- package/plugins/immune-brain/runtime/kernel/enrollment_authority.ts +5 -11
- package/plugins/immune-brain/runtime/kernel/index.ts +3 -1
- package/plugins/immune-brain/runtime/kernel/storage.ts +170 -11
- package/plugins/immune-brain/runtime/kernel/storage_paths.ts +13 -0
- package/plugins/immune-brain/runtime/kernel/types.ts +2 -1
- package/plugins/immune-brain/runtime/kernel/validation.ts +3 -1
- package/plugins/immune-brain/runtime/loop_contract.ts +22 -22
- package/plugins/immune-brain/runtime/plugin_version.ts +1 -1
- package/plugins/immune-brain/runtime/prompts/code-review.md +7 -0
- package/plugins/immune-brain/runtime/prompts/executor.md +35 -2
- package/plugins/immune-brain/runtime/role_prompt_bridge.ts +27 -0
- package/plugins/immune-brain/runtime/unattended/batch_git.ts +66 -28
- package/plugins/immune-brain/runtime/unattended/batch_kernel_port.ts +106 -0
- package/plugins/immune-brain/runtime/unattended/batch_plan.ts +3 -9
- package/plugins/immune-brain/runtime/unattended/batch_preflight.ts +132 -45
- package/plugins/immune-brain/runtime/unattended/batch_reasons.ts +0 -6
- package/plugins/immune-brain/runtime/unattended/batch_reconfirmation.ts +40 -36
- package/plugins/immune-brain/runtime/unattended/batch_runner.ts +98 -209
- package/plugins/immune-brain/runtime/unattended/batch_state.ts +36 -14
- package/plugins/immune-brain/runtime/unattended/types.ts +0 -2
- package/plugins/immune-brain/runtime/workspace_scope.ts +78 -8
- package/plugins/immune-brain/skills/BASELINE.md +4 -4
- package/plugins/immune-brain/skills/imm-doc-prune/SKILL.md +1 -1
- package/plugins/immune-brain/skills/{imm-agent-doc-maintain → imm-doc-slim}/SKILL.md +9 -9
- package/plugins/immune-brain/skills/imm-planner/SKILL.md +4 -2
- package/plugins/immune-brain/skills/imm-pr-fix/SKILL.md +1 -1
- package/plugins/immune-brain/skills/{imm-review-retro → imm-retro}/SKILL.md +7 -7
- package/plugins/immune-brain/skills/{imm-review-retro → imm-retro}/scripts/review_retro.ts +46 -21
- package/plugins/immune-brain/skills/{imm-loop → imm-run}/SKILL.md +7 -7
- package/plugins/immune-brain/skills/registry.yaml +9 -9
- package/plugins/immune-brain/.pi-extension/runtime-stub.ts +0 -584
- package/plugins/immune-brain/runtime/unattended/confirmation_deadline.ts +0 -33
|
@@ -16,16 +16,16 @@ Apply the gate when the task touches one or more of these surfaces:
|
|
|
16
16
|
|
|
17
17
|
- **contract surface**: name the files, skills, runtime modules, generated outputs, or docs whose behavior is part of the promised result.
|
|
18
18
|
- **compatibility**: state whether existing plans, state files, Pi runtime contracts, or users need migration or backwards-compatible behavior.
|
|
19
|
-
- **interruption recovery**: describe what should remain true if execution stops midway and how the next `imm-
|
|
19
|
+
- **interruption recovery**: describe what should remain true if execution stops midway and how the next `imm-run` run should continue.
|
|
20
20
|
- **rollback path**: name the smallest coherent set of files or state entries to revert if the step fails.
|
|
21
21
|
- **verification strength**: prefer parser, contract-test, unit-test, or executable command evidence over simple file-existence checks.
|
|
22
22
|
- **design-depth classification**: for a change with a Technical Design concern, record why it is Low, Medium, or High risk. Every new or revised Spec records `**Design risk**: Low|Medium|High` with an adjacent rationale. Medium/High risk requires a Technical Design baseline in the Spec; Low risk may remain concise only when it has no contract, ownership, security, persistence, compatibility, or multi-component concern.
|
|
23
23
|
- **Technical Design baseline**: keep the Spec as the single design authority and make each Plan Step reference the applicable decision or invariant instead of duplicating design prose.
|
|
24
24
|
- **design-view selection**: for Medium/High risk, select every materially relevant technical-design view from architecture layers, service/component interfaces, data flow, state transitions, and temporal sequence. Record selected views and why omitted views cannot affect the design. Low risk remains concise.
|
|
25
|
-
- **TaskIntent decomposition**: use Technical Design boundaries as one retain/split criterion with outcome, Verification, dependency, risk, rollback, compatibility, and authority. Split a successor TaskIntent only when a service, state-machine owner, migration, independently promotable layer, or sequence dependency needs independent verification, rollback, authorization, or settlement. A TaskIntent should normally change one primary trust-boundary invariant, but traversing several boundaries or updating both sides of one authority chain does not itself require a split. Split independently verifiable, reversible, authorizable, migratable, or settleable trust invariants. Keep multiple trust-boundary changes together only for one atomic security outcome whose split would create an unsafe or unusable intermediate state, and record that rationale in the Spec. Treat this as Planner judgment rather than a schema field or Enrollment counting rule. Do not split merely because the design names several layers, files, or services, and do not revive prose Plan authority.
|
|
25
|
+
- **TaskIntent decomposition**: use Technical Design boundaries as one retain/split criterion with outcome, Verification, dependency, risk, rollback, compatibility, and authority. Split a successor TaskIntent only when a service, state-machine owner, migration, independently promotable layer, or sequence dependency needs independent verification, rollback, authorization, or settlement. A TaskIntent should normally change one primary trust-boundary invariant, but traversing several boundaries or updating both sides of one authority chain does not itself require a split. Split independently verifiable, reversible, authorizable, migratable, or settleable trust invariants. Keep multiple trust-boundary changes together only for one atomic security outcome whose split would create an unsafe or unusable intermediate state, and record that rationale in the Spec. Treat this as Planner judgment rather than a schema field or Enrollment counting rule. Do not split merely because the design names several layers, files, or services, and do not revive prose Plan authority. For a multi-TaskIntent Initiative only, require each Slice to state what is observable and verifiable when that Slice alone has landed, and no acceptance may require another unfinished Slice's work to pass; a Slice with no such statement is a horizontal layer slice and is re-cut. Record the exception for a wide mechanical refactor whose blast radius prevents any green vertical slice, with the rationale and a final integrate-and-verify Slice that the batches block.
|
|
26
26
|
- **Mermaid intent**: use Mermaid only when it clarifies structure, sequence, data flow, or state transitions; it is not a universal gate or a second source of truth. Medium/High risk Specs record `**Diagram decision**: required|not_required` and a non-empty `**Diagram reason**:`. A `required` decision must include Mermaid; `not_required` explains why prose is sufficient. Low-risk Specs omit the empty ceremony and record neither field.
|
|
27
27
|
- **Design Conformance**: before final closure, require Spec-to-implementation evidence. A local implementation mismatch routes to `rework`; a structural or intended design change routes to `replan` through Planner. QA cannot silently approve a design change.
|
|
28
|
-
- **Brainstorm traceability**: ensure every `BR-*` item listed in `Brainstorm manifest` is mapped in `Brainstorm Trace`.
|
|
28
|
+
- **Brainstorm traceability**: ensure every `BR-*` item listed in `Brainstorm manifest` is mapped in `Brainstorm Trace`. Every Spec decision and every acceptance names exactly one source — an upstream `BR-*` ID, repository evidence, or a delegated technical choice — with or without an upstream manifest, and a user-owned decision that names no source is a defect the Planner removes or returns for clarification.
|
|
29
29
|
- **roadmap information preservation**: for large or multi-phase work, distinguish the Roadmap from the current executable slice, preserve deferred phase goals, open questions, promotion criteria, and candidate next Plans.
|
|
30
30
|
- **executable-slice discipline**: the Plan promises only the current executable slice — one coherent set of Steps sharing acceptance, review, rollback, and authority boundaries. Future-phase logic, speculative architecture, and unvalidated assumptions belong in the Roadmap or as explicitly Deferred items, never as active Steps. Do not enforce a fixed Step count: multiple Steps inside one shared boundary are fine, and a single Step that smuggles in unvalidated future architecture is still over-planning.
|
|
31
31
|
- **Plan boundary cohesion**: treat Plan granularity separately from Step and Roadmap Phase granularity. Confirm the current Plan contains one coherent executable slice and explain why its outcome, authority, risk, verification, review, and rollback boundaries belong together. Promote an independent boundary into a sequential Plan instead of hiding it inside a large Step. One Phase may therefore span multiple Plans.
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
# Pi Subagent Dispatch Protocol
|
|
2
2
|
|
|
3
|
-
本文档定义 Immune-Brain workflow role 在 Pi 中调度 advisory child 的唯一可执行协议。公共 `imm-brainstorm`、`imm-planner`、`imm-
|
|
3
|
+
本文档定义 Immune-Brain workflow role 在 Pi 中调度 advisory child 的唯一可执行协议。公共 `imm-brainstorm`、`imm-planner`、`imm-run` 和 runtime 内部 roles 引用本协议,不内联另一套宿主分支。Claude Host 的 read-only role 派发见 [Claude Host Read-Only Agent Dispatch](#claude-host-read-only-agent-dispatch);Pi 的调度规则不因该节改变。
|
|
4
|
+
|
|
5
|
+
## Claude Host Read-Only Agent Dispatch
|
|
6
|
+
|
|
7
|
+
On the Claude Host a read-only internal role is dispatched through the `Agent`
|
|
8
|
+
tool by its plugin agent type, not by prompt text alone:
|
|
9
|
+
|
|
10
|
+
| Internal role | Claude agent type | Tool allowlist |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| `qa` | `immune-brain:immune-brain-qa` | `Read, Grep, Glob` |
|
|
13
|
+
| `ui-review` | `immune-brain:immune-brain-ui-review` | `Read, Grep, Glob` |
|
|
14
|
+
| `advisory-reviewer` | `immune-brain:immune-brain-advisory-reviewer` | `Read, Grep, Glob` |
|
|
15
|
+
| `arch-explorer` | the Host's `Explore` agent | whatever the Host grants |
|
|
16
|
+
|
|
17
|
+
Each shipped definition is generated from the matching `runtime/prompts/` source
|
|
18
|
+
by the plugin build, so its body states the same role contract a Pi child
|
|
19
|
+
receives. The agent definition, not prompt text, bounds the role's tools: a
|
|
20
|
+
write, shell or dispatch tool absent from the allowlist is unavailable to the
|
|
21
|
+
child whatever its prompt asks for. `arch-explorer` ships no definition because
|
|
22
|
+
architecture exploration uses the Host's own read-only research agent, and a
|
|
23
|
+
second definition would fork a boundary the Host owns.
|
|
24
|
+
|
|
25
|
+
`code-review` is not in this table: the authoritative Review authority ships
|
|
26
|
+
`immune-brain:immune-brain-reviewer`, whose allowlist adds `Bash` because it must
|
|
27
|
+
run read-only Git commands against the immutable revision.
|
|
28
|
+
|
|
29
|
+
On Pi the agent configuration belongs to the Pi user, and the read-only boundary
|
|
30
|
+
remains prompt text plus the `tool_policy` the delegation packet declares; Pi's
|
|
31
|
+
`Agent` has no `readonly` parameter. The Pi invocation and scheduling rules below
|
|
32
|
+
are unchanged.
|
|
4
33
|
|
|
5
34
|
## Eligibility
|
|
6
35
|
|
|
@@ -158,7 +158,7 @@ Agreement becomes framing evidence. Disagreement becomes decision criteria or an
|
|
|
158
158
|
|
|
159
159
|
- **Allowed**: Clarify framing, inspect read-only context, ask narrowing questions, perform inline gap analysis.
|
|
160
160
|
- **Blocked**: Implementation edits, test changes, plan writes, and runtime state updates. Do not edit implementation files, tests, specs, plans, or `.imm/memory/`.
|
|
161
|
-
- **Workflow guard**: implementation continuations must go through `imm-planner` or `imm-
|
|
161
|
+
- **Workflow guard**: implementation continuations must go through `imm-planner` or `imm-run`. `imm-brainstorm` frames the problem; it is not the default post-framing stage once the task is already stable enough to route forward. The `adversarial` mode remains available as an opt-in high-pressure gate for high-risk scenarios but is not a default route target.
|
|
162
162
|
|
|
163
163
|
## Output artifact
|
|
164
164
|
|
|
@@ -9,14 +9,14 @@ Prune stale current documentation from one Git repository through explicit
|
|
|
9
9
|
invocation, comprehensive inventory, evidence-based candidate narrowing,
|
|
10
10
|
one exact user-approved manifest, and bounded current-only mutation. This is
|
|
11
11
|
a standalone host-native maintenance entry, not a Managed Path continuation
|
|
12
|
-
and not an `imm-
|
|
12
|
+
and not an `imm-run` internal-role dispatch.
|
|
13
13
|
|
|
14
14
|
## Authority Boundary
|
|
15
15
|
|
|
16
16
|
This Skill prunes documentation
|
|
17
17
|
without creating or mutating
|
|
18
18
|
TaskIntent, TaskRecord, Kernel, Spec, or Plan authority. An already active
|
|
19
|
-
Managed task remains owned by `imm-
|
|
19
|
+
Managed task remains owned by `imm-run`. Read-only inventory and manifest
|
|
20
20
|
production remain available. Classify each candidate overlapping the active
|
|
21
21
|
TaskIntent `scope_hint` as `BLOCKED_ACTIVE_SCOPE` and continue auditing
|
|
22
22
|
unaffected candidates. If the routing owner or scope cannot be read reliably,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: imm-
|
|
2
|
+
name: imm-doc-slim
|
|
3
3
|
description: Use when the user explicitly requests Immune-Brain minimization of tracked AGENTS.md, CLAUDE.md, or GEMINI.md.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Immune-Brain:
|
|
6
|
+
# Immune-Brain: Doc Slim
|
|
7
7
|
|
|
8
8
|
Minimize tracked agent instruction files in one Git repository to the smallest
|
|
9
9
|
set of persistent rules that are non-obvious, repeatable, stable, and costly to
|
|
10
10
|
violate. This is a standalone host-native maintenance entry, not a Managed Path
|
|
11
|
-
continuation and not an `imm-
|
|
11
|
+
continuation and not an `imm-run` internal-role dispatch.
|
|
12
12
|
|
|
13
13
|
## Authority Boundary
|
|
14
14
|
|
|
15
15
|
This Skill maintains agent instruction files without creating or mutating
|
|
16
16
|
TaskIntent, TaskRecord, Kernel, Spec, or Plan authority. An already active
|
|
17
|
-
Managed task remains owned by `imm-
|
|
17
|
+
Managed task remains owned by `imm-run`. Read-only inventory and manifest
|
|
18
18
|
production remain available. Classify each candidate overlapping the active
|
|
19
19
|
TaskIntent `scope_hint` as `BLOCKED_ACTIVE_SCOPE` and continue auditing
|
|
20
20
|
unaffected candidates. If the routing owner or scope cannot be read reliably,
|
|
@@ -23,12 +23,12 @@ deletion of evidence-proven content remains that Skill's separate job.
|
|
|
23
23
|
|
|
24
24
|
## Invocation
|
|
25
25
|
|
|
26
|
-
Requires explicit invocation: `imm-
|
|
27
|
-
`/imm-
|
|
26
|
+
Requires explicit invocation: `imm-doc-slim` or
|
|
27
|
+
`/imm-doc-slim`. Ordinary "is this AGENTS.md too long?" questions stay
|
|
28
28
|
host-native and do not enter this Skill.
|
|
29
29
|
|
|
30
|
-
- `imm-
|
|
31
|
-
- `imm-
|
|
30
|
+
- `imm-doc-slim audit`: read-only. Produce the manifest and stop.
|
|
31
|
+
- `imm-doc-slim`: produce the manifest, then wait for exact manifest
|
|
32
32
|
approval before any mutation.
|
|
33
33
|
|
|
34
34
|
No automatic invocation. No daemon, no telemetry, no automatic learning, no
|
|
@@ -52,7 +52,7 @@ commit.
|
|
|
52
52
|
|
|
53
53
|
2. **Resolve Managed ownership.** Read the existing routing projection without
|
|
54
54
|
creating authority. An already active Managed task remains owned by
|
|
55
|
-
`imm-
|
|
55
|
+
`imm-run`. A candidate overlapping its `scope_hint` is
|
|
56
56
|
`BLOCKED_ACTIVE_SCOPE`; continue auditing unaffected candidates. If the
|
|
57
57
|
routing owner or scope cannot be read reliably, fail closed for mutation.
|
|
58
58
|
|
|
@@ -12,7 +12,7 @@ This skill adheres to the **[BASELINE.md](BASELINE.md)**.
|
|
|
12
12
|
`imm-planner` is entered explicitly by the user for a clear repository mutation.
|
|
13
13
|
Ordinary host input does not invoke this Skill through natural-language routing.
|
|
14
14
|
An active Assurance projection remains authoritative and is resumed only through
|
|
15
|
-
an explicit `imm-
|
|
15
|
+
an explicit `imm-run` entry; explicit Planner entry owns planning and the later
|
|
16
16
|
native Enrollment gate.
|
|
17
17
|
|
|
18
18
|
Plan-only output remains non-authoritative. Planner creates or validates a
|
|
@@ -91,7 +91,7 @@ resolved wrapper and use the resolved `imm-kernel` wrapper for every Kernel
|
|
|
91
91
|
command below. Do not assume either bare command is available on shell `PATH`.
|
|
92
92
|
Then route deterministically:
|
|
93
93
|
|
|
94
|
-
- an active Kernel claim remains with `imm-
|
|
94
|
+
- an active Kernel claim remains with `imm-run` for foreground Kernel Tool
|
|
95
95
|
coordination, except a Loop-requested revision follows Enrolled Intent Revision
|
|
96
96
|
below to prepare a non-authoritative proposal for that same owner;
|
|
97
97
|
- an active or otherwise nonterminal v3 Plan remains on its existing v3 route;
|
|
@@ -273,8 +273,21 @@ goal prose and never truncates a title. The tracker rereads every canonical
|
|
|
273
273
|
TaskIntent for identity, risk, and acceptance IDs; projection fields and public
|
|
274
274
|
summaries never widen TaskIntent scope or authority. It validates the complete dependency graph before
|
|
275
275
|
remote writes, creates the Parent once, creates all Children, attaches every
|
|
276
|
-
Child as a native Sub-issue, creates native `blocked_by` relations, and
|
|
277
|
-
|
|
276
|
+
Child as a native Sub-issue, creates native `blocked_by` relations, and takes
|
|
277
|
+
every Issue number from its own create response. The write flow is direct: one
|
|
278
|
+
start-of-run read of the repository identity, the Issue listing, and the label
|
|
279
|
+
listing, then one create per absent Issue in dependency order, one attach per
|
|
280
|
+
Child, and one relation write per edge. No repository listing, attachment,
|
|
281
|
+
dependency or ownership confirmation follows a write; one Issue-scoped read
|
|
282
|
+
follows each create to resolve the database id the relation endpoints need,
|
|
283
|
+
because `gh issue create` returns only the Issue URL. No cumulative deadline
|
|
284
|
+
exists either; each call keeps its own per-call timeout and
|
|
285
|
+
the caller's cancellation. Deduplication is start-only: a rerun of the same
|
|
286
|
+
approved batch adopts whatever the start listing already carries and writes only
|
|
287
|
+
the missing relations, so it never creates a duplicate Issue and never repeats a
|
|
288
|
+
completed write. Concurrent edits made during a run are not detected in that
|
|
289
|
+
run; they surface as drift at the start of the next run. Every Child carries
|
|
290
|
+
`ready-for-agent`, blocked Children
|
|
278
291
|
additionally carry `blocked`, and the Parent carries neither; the tracker never
|
|
279
292
|
creates labels, so a repository missing a required label fails the batch closed
|
|
280
293
|
before any remote write. The Child Agent Brief includes a direct Parent Issue link.
|
|
@@ -298,27 +311,39 @@ complete-decomposition decision; or `tracker_projection_failed` with the returne
|
|
|
298
311
|
failure and exact retry action. A candidate Initiative or partial Issue set
|
|
299
312
|
recorded only in the Spec or final summary is neither user confirmation nor a
|
|
300
313
|
completed carrier outcome. Report `retryable_failure`, `permanent_failure`, or
|
|
301
|
-
`ambiguous_remote_state` and the exact batch retry action.
|
|
314
|
+
`ambiguous_remote_state` and the exact batch retry action. A failure after the
|
|
315
|
+
request may have landed is reported as uncertain with its confirmed steps, its
|
|
316
|
+
pending steps, and one recovery action: rerun the same approved batch, whose
|
|
317
|
+
start listing adopts whatever landed. This does not invalidate
|
|
302
318
|
already-authored planning files, but it blocks `tracker_associated` and every
|
|
303
319
|
Enrollment or execution handoff for that Initiative until the same complete
|
|
304
|
-
batch succeeds. Do not infer opt-in from tracker output or Issue state,
|
|
305
|
-
import Issue state, create a TaskIntent from an Issue, or store Issue identity in
|
|
320
|
+
batch succeeds. Do not infer opt-in from tracker output or Issue state, import Issue state, create a TaskIntent from an Issue, or store Issue identity in
|
|
306
321
|
TaskIntent or TaskRecord. Existing Issue markers grant permission only for
|
|
307
322
|
idempotent retry of that same approved Initiative; they never grant execution
|
|
308
323
|
authority.
|
|
309
324
|
|
|
325
|
+
The Planner never closes the Parent. The terminal projection of a Child does: when
|
|
326
|
+
`mark-terminal` closes a Child as completed and every Slice Child of that Initiative
|
|
327
|
+
is closed as completed, the tracker closes the Parent as completed; an open, stopped
|
|
328
|
+
or parked Child keeps it open.
|
|
329
|
+
|
|
310
330
|
For amending an already-published Initiative, the same
|
|
311
331
|
`imm-tracker publish-initiative --stdin --json` operation accepts an optional
|
|
312
332
|
`amendment` input after the literal user approves the changed pending frontier.
|
|
313
333
|
Provide the complete approved pending Tasks plus the complete read-only
|
|
314
334
|
historical Child list, each binding the observed `issue_number`, title, body,
|
|
315
|
-
and state at approval. The
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
335
|
+
and state at approval. The amendment uses the same direct write flow: one start
|
|
336
|
+
listing (plus Issue-scoped Sub-issue and `blocked_by` reads) verifies every bound
|
|
337
|
+
Issue against its baseline, then the Parent is edited at most once, each approved
|
|
338
|
+
pending brief is edited at most once, newly added pending Children are created as
|
|
339
|
+
in ordinary publication, and each pending Child's `blocked_by` set is converged
|
|
340
|
+
to the approved set. Historical Children are never written and keep their
|
|
341
|
+
byte-exact content, native Sub-issue links and dependency relations. No read
|
|
342
|
+
follows a write and no closing recheck runs, so baseline drift that appears after
|
|
343
|
+
the start listing is not detected in that run; it surfaces at the start of the
|
|
344
|
+
next run. Omitted membership, baseline drift present at start, and a stopped
|
|
345
|
+
historical prerequisite fail closed before any write with an exact retry action;
|
|
346
|
+
the strict no-amendment default is unchanged.
|
|
322
347
|
|
|
323
348
|
### Verification Descriptor Discipline
|
|
324
349
|
|
|
@@ -384,7 +409,7 @@ it, and structural Enrollment readiness is not proof that a descriptor executed.
|
|
|
384
409
|
- **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.
|
|
385
410
|
- **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.
|
|
386
411
|
- **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.
|
|
387
|
-
- **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.
|
|
412
|
+
- **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. For a multi-TaskIntent Initiative only, each Slice also states what is observable and verifiable when that Slice alone has landed, and no acceptance may require another unfinished Slice's work to pass; the Initiative review table's existing `result` column carries that statement. A Slice with no such result is a horizontal layer slice and is re-cut. Exception: a wide mechanical refactor whose blast radius prevents any green vertical slice may be batched, with the rationale recorded and the batches blocking one final integrate-and-verify Slice.
|
|
388
413
|
- **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. Medium/High risk Specs record `**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. Low-risk Specs omit the empty ceremony and record neither field.
|
|
389
414
|
- **Verification**: Every acceptance assertion has a concrete focused descriptor that can fail on the intended regression, and every named invariant has positive, negative, and bound controls at an observable seam. Hypothetical evidence is not execution-ready; a check that matches zero tests, is skipped, or lacks its prerequisite is a failure rather than a pass.
|
|
390
415
|
- **Executable Scope**: `scope_hint` is the mutation envelope, not discovery context. Close references across callers, tests, generated mirrors, and state-machine owners before authoring. Simple tasks are TaskIntent-only. A complex task binds at most one active Spec by content identity; do not add archive paths for freeze, and do not relocate artifacts. Collect all known scope gaps in one revision request; ask again only when new evidence changes the boundary.
|
|
@@ -459,7 +484,7 @@ preparation does not apply the revision or authorize expanded execution.
|
|
|
459
484
|
|
|
460
485
|
## Planning Rules
|
|
461
486
|
|
|
462
|
-
- **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-
|
|
487
|
+
- **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-run`; a validated candidate still needs native Enrollment.
|
|
463
488
|
- **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.
|
|
464
489
|
- **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.
|
|
465
490
|
- **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.
|
|
@@ -477,7 +502,16 @@ preparation does not apply the revision or authorize expanded execution.
|
|
|
477
502
|
explain how the selected seam catches the intended regression. This is a
|
|
478
503
|
planning heuristic: it must not weaken acceptance-specific focused
|
|
479
504
|
verification descriptors or add a mandatory user confirmation.
|
|
480
|
-
|
|
505
|
+
**Agreed seam recording.** Record, for each acceptance, the agreed seam: the
|
|
506
|
+
existing or new test file and the observable boundary it exercises. Complex
|
|
507
|
+
work records it in the Spec's verification and acceptance mapping; simple work
|
|
508
|
+
names it in the acceptance assertion. Because the seam is part of the
|
|
509
|
+
candidate, present it in the native Enrollment gate, and the Initiative review
|
|
510
|
+
table when one exists, without any added confirmation. Tests the Executor adds
|
|
511
|
+
exercise the agreed seams, and replacing a seam is an acceptance change and
|
|
512
|
+
follows Enrolled Intent Revision.
|
|
513
|
+
- **Review Mapping**: In-scope rework stays with the enrolled TaskIntent and explicit `imm-run` entry. Cross-scope findings become a Planner decision delta with concrete missing paths and verification evidence; do not create a successor prose Plan.
|
|
514
|
+
- **Decision Provenance**: Every Spec decision and every acceptance names exactly one source: an upstream `BR-*` ID, repository evidence with a concrete path, or a delegated technical choice as defined by Clarification supplement. The rule applies with or without an upstream Brainstorm manifest, and the source does not have to be a `BR-DEC` item: Direct Planner entry and delegated technical choices stay legitimate sources. A user-owned decision — goal, user, scope, observable behavior, compatibility preference, risk acceptance, or success criterion — that names no source is a defect the Planner removes or returns for clarification under the existing Clarification supplement routes. Simple TaskIntent-only work satisfies the rule when each acceptance traces to the request text and adds no table.
|
|
481
515
|
- **Brainstorm Manifest Mapping**: Record every upstream `BR-*` item in a Spec `Brainstorm Trace` when the work is complex, otherwise on the TaskIntent, mapped to 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.
|
|
482
516
|
- **Handoff Completeness Check**: Before reporting a candidate as handoff-ready, confirm every upstream item and required phase is mapped exactly once, that required phases are delivered rather than excused by a reason, and that no confirmed outcome was conserved as a smaller deliverable. Reject a narrowed deliverable as a completeness failure; ask again only for a new material delta, never to reconfirm an unchanged clear request or an already-confirmed decision.
|
|
483
517
|
- **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.
|
|
@@ -510,7 +544,12 @@ Use the invoking Host's read-only role-boundary route for bounded
|
|
|
510
544
|
exactly. The Parent owns Spec/TaskIntent synthesis, Brainstorm traceability,
|
|
511
545
|
acceptance, and scope; children return evidence only. On Pi the `arch-explorer` envelope
|
|
512
546
|
uses `subagent_type: "Explore"`; invoke the returned envelope rather than
|
|
513
|
-
constructing another Agent call.
|
|
547
|
+
constructing another Agent call. On the Claude Host a read-only role is dispatched
|
|
548
|
+
through the `Agent` tool by its plugin agent type —
|
|
549
|
+
`immune-brain:immune-brain-advisory-reviewer` — and architecture exploration uses
|
|
550
|
+
the Host's own `Explore` agent; the agent definition, not prompt text, bounds
|
|
551
|
+
that role's tools. On Pi the agent configuration belongs to the Pi user and the
|
|
552
|
+
read-only boundary remains prompt text. Do not invoke retired Planner runtime helpers
|
|
514
553
|
or write child-owned planning artifacts.
|
|
515
554
|
|
|
516
555
|
An optional planner ensemble is advisory-only; the Parent owns the final Spec and TaskIntent.
|
|
@@ -526,7 +565,7 @@ optional advisory dispatch fails, continue inline and record the reason.
|
|
|
526
565
|
|
|
527
566
|
- **Allowed**: Write a TaskIntent. Add a Spec only for complex work. Activate an absent routing policy under Kernel TaskIntent Routing. Initiative planning carriers and necessary domain vocabulary.
|
|
528
567
|
- **Blocked**: Implementation edits, direct Kernel-store writes, enrolled intent overwrites, and QA/Review decisions.
|
|
529
|
-
- **Workflow guard**: Execution continues through native Enrollment and explicit `imm-
|
|
568
|
+
- **Workflow guard**: Execution continues through native Enrollment and explicit `imm-run`. Planner owns design and decomposition, not execution authority.
|
|
530
569
|
|
|
531
570
|
## Output artifact
|
|
532
571
|
|
|
@@ -563,6 +602,7 @@ a State Ledger. Keep historical Plan validation strictly read-only.
|
|
|
563
602
|
- A required check matches zero tests or is skipped and the run is reported as passing.
|
|
564
603
|
- New work depends on a prose Plan validator, Step activation, or State Ledger.
|
|
565
604
|
- A Brainstorm manifest lacks complete `BR-*` coverage on the Spec (complex) or TaskIntent (simple).
|
|
605
|
+
- A user-owned Spec decision or acceptance names no source, or names one nobody made.
|
|
566
606
|
- The handoff completeness check passed while a required phase or upstream item is unmapped, or while the plan delivers only part of the confirmed outcome.
|
|
567
607
|
- A Medium/High risk Spec lacks a `Devil's Advocate Audit` covering rollback resilience, verification vanity, and spec dilution detection.
|
|
568
608
|
- New Spec prose ignores the document-language policy.
|
|
@@ -578,6 +618,6 @@ a State Ledger. Keep historical Plan validation strictly read-only.
|
|
|
578
618
|
## Next Action
|
|
579
619
|
|
|
580
620
|
- 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.
|
|
581
|
-
- 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-
|
|
621
|
+
- 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-run`.
|
|
582
622
|
- 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.
|
|
583
623
|
- If gates are not met: state which validation failures, unresolved verification paths, or material decision deltas remain; do not name a next skill.
|
|
@@ -9,7 +9,7 @@ description: Use when the user explicitly requests Immune-Brain repair of GitHub
|
|
|
9
9
|
|
|
10
10
|
Repair blockers on one GitHub pull request without creating or mutating
|
|
11
11
|
TaskIntent, TaskRecord, Kernel, Spec, or Plan authority. An already active
|
|
12
|
-
Managed task remains owned by `imm-
|
|
12
|
+
Managed task remains owned by `imm-run`; stop and direct the user there when
|
|
13
13
|
the target PR is part of that task.
|
|
14
14
|
|
|
15
15
|
## Workflow
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: imm-
|
|
2
|
+
name: imm-retro
|
|
3
3
|
description: Use when the user explicitly requests Immune-Brain ranking of models by cross-model review load or a project usage retro.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Immune-Brain:
|
|
6
|
+
# Immune-Brain: Retro
|
|
7
7
|
|
|
8
8
|
Rank models by how much code review their own edits triggered, and report
|
|
9
9
|
basic project usage over a look-back window the user supplies in days. This
|
|
10
10
|
is a standalone host-native analysis entry, not a Managed Path continuation
|
|
11
|
-
and not an `imm-
|
|
11
|
+
and not an `imm-run` internal-role dispatch. It reviews no diff — a diff
|
|
12
12
|
review is `code-review`.
|
|
13
13
|
|
|
14
14
|
## Boundary
|
|
@@ -20,12 +20,12 @@ Blocked: code, test, Spec, Plan, or `.imm/` edits; session-log writes;
|
|
|
20
20
|
Kernel, TaskIntent, or TaskRecord mutation; Compounder or scheduled runs;
|
|
21
21
|
`.imm/audit/` lifecycle statistics.
|
|
22
22
|
|
|
23
|
-
An already active Managed task remains owned by `imm-
|
|
23
|
+
An already active Managed task remains owned by `imm-run`. This Skill does
|
|
24
24
|
not create or resume Managed authority.
|
|
25
25
|
|
|
26
26
|
## Invocation
|
|
27
27
|
|
|
28
|
-
Requires explicit invocation: `imm-
|
|
28
|
+
Requires explicit invocation: `imm-retro` or `/imm-retro`.
|
|
29
29
|
Ordinary questions such as "which model is worse" stay host-native and do
|
|
30
30
|
not enter this Skill.
|
|
31
31
|
|
|
@@ -42,23 +42,36 @@ No daemon, no cron, no CI, no automatic commit.
|
|
|
42
42
|
These rules keep numbers comparable across runs. Read the analyzer header
|
|
43
43
|
aloud in the report so the 口径 stays visible.
|
|
44
44
|
|
|
45
|
-
- `review` = an `Agent` tool call with `subagent_type` equal to `Review
|
|
46
|
-
-
|
|
47
|
-
|
|
45
|
+
- `review` = an `Agent` tool call with `subagent_type` equal to `Review`,
|
|
46
|
+
compared case-insensitively.
|
|
47
|
+
- Attribution = the model behind the most recent `edit`, `write`,
|
|
48
|
+
`multiedit`, or `apply_patch` in that session. If none, the row is
|
|
49
|
+
`no-edit (review-only)`. Edits made through `bash` or `codemode` are not
|
|
50
|
+
attributed.
|
|
48
51
|
- `uniq` counts distinct (session, description+prompt prefix) pairs. A wide
|
|
49
52
|
gap versus `reviews` is the same review re-run on the same code.
|
|
50
53
|
- `rev/100ed` is `100 * reviews / devEdits`. Rank on both absolute `reviews`
|
|
51
54
|
and this intensity. A model can lead one axis and sit mid-pack on the
|
|
52
55
|
other.
|
|
53
|
-
- `avgSc`
|
|
54
|
-
|
|
56
|
+
- `avgSc` parses the `[SCORE: …]` tag from the matching Review `toolResult`.
|
|
57
|
+
The `assurance_verdict` contract carries no score, so untagged reviews show
|
|
58
|
+
`-` and are left out of the average.
|
|
59
|
+
- `pass%` is PASS over judged reviews. A review is judged by the `decision`
|
|
60
|
+
of the `assurance_kernel/assurance_verdict` contract in its `toolResult`
|
|
61
|
+
(`pass` counts as PASS); without a contract, by the `[VERDICT: …]` tag. A
|
|
62
|
+
review with neither is unjudged and left out of the denominator.
|
|
63
|
+
- The quality table (`PASS` / `REVISE` / `REJECT` / `highRisk`) covers tagged
|
|
64
|
+
reviews only, so its `PASS` count can differ from `pass%`.
|
|
55
65
|
- `registr` counts the Kernel `submit_review` registration in the session log.
|
|
56
66
|
It is the registration of the same review and is never added into `reviews`.
|
|
57
67
|
- `rounds/task` is registrations per distinct `(cwd, task_id)`. High values
|
|
58
68
|
can be canary/QA harness re-registration, not human-visible rework.
|
|
59
|
-
- Findings are `
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
- Findings are the `verdict.findings` entries of `submit_review` calls plus
|
|
70
|
+
legacy `record_finding` calls, deduped per session by summary, so a finding
|
|
71
|
+
re-submitted across rounds counts once. The Review `toolResult` copy of the
|
|
72
|
+
same verdict is not counted. Summaries that match `recorded cleanly`,
|
|
73
|
+
`receipt recorded`, `round recorded`, or `no finding(s)` are `bookkeep` /
|
|
74
|
+
`noisy`, excluded from `block`/`advis`.
|
|
62
75
|
|
|
63
76
|
Usage counters on the same pass: sessions with activity, assistant turns,
|
|
64
77
|
edit counts, a tool-call name histogram, and the project × author table.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: imm-
|
|
2
|
+
name: imm-run
|
|
3
3
|
description: Use when the user explicitly requests execution or resumption of an Immune-Brain task.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ This skill adheres to the **[BASELINE.md](BASELINE.md)**.
|
|
|
9
9
|
|
|
10
10
|
## Kernel Canary Routing and Authority
|
|
11
11
|
|
|
12
|
-
Only explicit `imm-
|
|
12
|
+
Only explicit `imm-run` entry starts or resumes this loop. Ordinary host input
|
|
13
13
|
stays host-native; it never resumes a Managed owner implicitly. Read the current
|
|
14
14
|
Host's `status` projection first and verify the exact active backend claim,
|
|
15
15
|
TaskIntent, and TaskRecord. Invalid or contradictory projections fail closed. A
|
|
@@ -25,7 +25,7 @@ assume either way. For a GitHub-carried Initiative, `tracker_projection_failed`
|
|
|
25
25
|
`awaiting_user_initiative_confirmation` blocks that Enrollment until the same
|
|
26
26
|
complete carrier batch succeeds; report the stable carrier reason and its exact
|
|
27
27
|
retry action instead of enrolling. A carrier command the Host refused, cancelled,
|
|
28
|
-
or never ran is not a completed batch, and a later `imm-
|
|
28
|
+
or never ran is not a completed batch, and a later `imm-run` entry does not
|
|
29
29
|
clear it. This pre-Enrollment gate is distinct from the post-settlement tracker
|
|
30
30
|
projection below, which never blocks the Loop.
|
|
31
31
|
|
|
@@ -42,9 +42,18 @@ architecture exploration, advisory review, Compounder, Kernel ownership, or
|
|
|
42
42
|
scope expansion. Use Kernel ownership for an enrolled task. This route projects
|
|
43
43
|
authority; it does not record execution evidence, mutate task state, or replace
|
|
44
44
|
Kernel operations.
|
|
45
|
+
|
|
46
|
+
On the Claude Host a read-only internal role is dispatched through the `Agent`
|
|
47
|
+
tool by its plugin agent type — `immune-brain:immune-brain-qa`,
|
|
48
|
+
`immune-brain:immune-brain-ui-review`,
|
|
49
|
+
`immune-brain:immune-brain-advisory-reviewer` — and architecture exploration uses
|
|
50
|
+
the Host's own `Explore` agent. The agent definition, not prompt text, bounds
|
|
51
|
+
that role's tools. On Pi the agent configuration belongs to the Pi user and the
|
|
52
|
+
read-only boundary remains prompt text; the Pi dispatch rules are unchanged.
|
|
53
|
+
|
|
45
54
|
Before a child dispatch, read the [Subagent Dispatch Protocol](docs/reference/subagent-dispatch-protocol.md#authorization-authority).
|
|
46
55
|
Never load an internal role as a public Skill or spawn another loop process.
|
|
47
|
-
The standalone `imm-pr-fix`, `imm-doc-prune`, and `imm-
|
|
56
|
+
The standalone `imm-pr-fix`, `imm-doc-prune`, and `imm-doc-slim` are host-native
|
|
48
57
|
maintenance entries, never dispatched as the Loop role. Internal `test-fixer`
|
|
49
58
|
and `pr-fix` repairs remain bounded by the enrolled TaskIntent.
|
|
50
59
|
|
|
@@ -60,7 +69,9 @@ Continue while the current projection has a valid action:
|
|
|
60
69
|
to the user. If a file mixes pre-existing user changes with task changes and
|
|
61
70
|
the task-owned hunks cannot be isolated reliably, stop with that ownership
|
|
62
71
|
conflict instead of staging the whole file. Staging grants no commit or push
|
|
63
|
-
authority.
|
|
72
|
+
authority. Complete the [Executor Delivery Evidence](role-prompts/executor.md#delivery-evidence)
|
|
73
|
+
table before the first Assurance attempt and update affected rows after repair.
|
|
74
|
+
Executor checks are diagnostic evidence, not a QA or Review approval.
|
|
64
75
|
2. Call `advance_assurance` in the foreground and consume its direct terminal
|
|
65
76
|
result. The Kernel freezes the artifacts itself before QA: it binds Git
|
|
66
77
|
content identity in place without relocating source paths. A simple task has
|
|
@@ -104,7 +115,7 @@ not bypass them. Do not poll or create detached jobs.
|
|
|
104
115
|
|
|
105
116
|
The only unattended batch entry is the privileged Host tool `start_unattended_batch`
|
|
106
117
|
with its `initiative_slug` parameter. That parameter is the opt-in: absent the call,
|
|
107
|
-
`imm-
|
|
118
|
+
`imm-run` behavior is byte-identical to per-task Enrollment, and no batch state,
|
|
108
119
|
branch, or Batch Authorization exists. The Standalone Hosts expose the same tool
|
|
109
120
|
name and the same single parameter; it is never a batch of tasks the Host chose.
|
|
110
121
|
When an Initiative is referenced by its tracker Issue (e.g. `github #<number>`),
|
|
@@ -130,11 +141,18 @@ The runtime owns no model invocation and adds no persisted execution lifecycle.
|
|
|
130
141
|
After diagnostics pass, the Parent advances Kernel QA and dispatches any reserved
|
|
131
142
|
foreground Review once using the exact returned `agent_params`, then submits its
|
|
132
143
|
structured verdict. An open Review reservation stays with that Host invocation;
|
|
133
|
-
batch re-entry waits for it rather than redispatching.
|
|
134
|
-
|
|
135
|
-
|
|
144
|
+
batch re-entry waits for it rather than redispatching. When a batch child's
|
|
145
|
+
foreground terminal mutation reaches Kernel `done`, the same tool call stages
|
|
146
|
+
only that child's generated terminal audit evidence and re-enters the batch under
|
|
147
|
+
the still-valid authorization, opening no gate. The driver reconciles settlement,
|
|
136
148
|
adopts or creates the one scope-bound commit, then enrolls the next ready child
|
|
137
|
-
|
|
149
|
+
or settles the batch as `completed`; the result carries the batch report as
|
|
150
|
+
`batch`. A reserved Review, a parked child and a stopped child end where they do
|
|
151
|
+
today and are never committed automatically. If the re-entry fails, the Kernel
|
|
152
|
+
result is unchanged and `batch` carries one recovery action: call
|
|
153
|
+
`start_unattended_batch` with the same slug, which is also how to continue by
|
|
154
|
+
hand. A commit that fast-forwards the batch branch outside the runner is adopted,
|
|
155
|
+
not attributed to a child; any other HEAD movement still fails closed. Ordinary Executor handoff and below-limit
|
|
138
156
|
QA repair do not park the batch; genuine budget/authority stops remain fail-closed.
|
|
139
157
|
|
|
140
158
|
Batch execution never pushes a ref, opens or updates a pull request, resolves a
|
|
@@ -229,11 +247,26 @@ write planning artifacts, mutate Kernel state, or settle decisions. Report all
|
|
|
229
247
|
substantiated blockers in one round, tied to acceptance or a concrete regression;
|
|
230
248
|
separate optional advice from blockers. Suggestions alone do not justify rework.
|
|
231
249
|
Use the returned verdict schema exactly, including omission of unsupported fields.
|
|
250
|
+
A Review pass verdict's approval must carry `inspected_paths`: an array of
|
|
251
|
+
unique repository-relative path strings listing every path of the reviewed
|
|
252
|
+
change set, deleted paths included; an empty change set is listed as an empty
|
|
253
|
+
array. A path may be listed only after its diff was read. A pass that omits any
|
|
254
|
+
changed path, lists a path outside the change set, or duplicates a path is
|
|
255
|
+
rejected as a correctable invalid verdict.
|
|
232
256
|
|
|
233
257
|
`dispatch_role` for `qa`, `code-review`, or `ui-review` is used only when an
|
|
234
258
|
explicit runtime-supported role boundary requests it, followed by the returned
|
|
235
259
|
foreground Agent envelope exactly. It is not an extra gate on Kernel Assurance.
|
|
236
|
-
|
|
260
|
+
Pass the returned Agent envelope through unchanged. On the Claude Host an Agent
|
|
261
|
+
call always returns an asynchronous launch receipt, which is normal and never a
|
|
262
|
+
configuration fault; the Parent waits for the reviewer to finish before
|
|
263
|
+
`submit_review`. A dispatched reviewer is never continued or re-prompted,
|
|
264
|
+
including through SendMessage. The reserved prompt is dispatched verbatim. Any
|
|
265
|
+
edit to it forfeits the reservation: the Host binds a reviewer start only to a
|
|
266
|
+
byte-identical prompt, so appending context, truncating or rewriting the body
|
|
267
|
+
leaves the reservation unobserved and `submit_review` blocked. Dispatch the same
|
|
268
|
+
envelope unchanged. A blocked `submit_review` is recovered only through its
|
|
269
|
+
returned `recovery_action`.
|
|
237
270
|
|
|
238
271
|
Role dispatches follow the user's interaction language: include
|
|
239
272
|
`"interaction_language"` in the `dispatch_role` or routed role context with
|
|
@@ -18,10 +18,10 @@ skills:
|
|
|
18
18
|
role_class: authority
|
|
19
19
|
canonical: true
|
|
20
20
|
output_artifacts: [validated_plan]
|
|
21
|
-
next_actions: [imm-
|
|
21
|
+
next_actions: [imm-run]
|
|
22
22
|
boundary: Owns plan creation and revision; no executor edits.
|
|
23
|
-
- name: imm-
|
|
24
|
-
path: skills/imm-
|
|
23
|
+
- name: imm-run
|
|
24
|
+
path: skills/imm-run/SKILL.md
|
|
25
25
|
role: coordinate
|
|
26
26
|
title: Run
|
|
27
27
|
role_class: coordinator
|
|
@@ -47,19 +47,19 @@ skills:
|
|
|
47
47
|
output_artifacts: [prune_report]
|
|
48
48
|
next_actions: []
|
|
49
49
|
boundary: Prune stale current documentation after explicit manifest approval; no Managed authority mutation or authority-artifact deletion.
|
|
50
|
-
- name: imm-
|
|
51
|
-
path: skills/imm-
|
|
50
|
+
- name: imm-doc-slim
|
|
51
|
+
path: skills/imm-doc-slim/SKILL.md
|
|
52
52
|
role: execute
|
|
53
|
-
title:
|
|
53
|
+
title: Doc Slim
|
|
54
54
|
role_class: repair
|
|
55
55
|
canonical: true
|
|
56
56
|
output_artifacts: [maintain_report]
|
|
57
57
|
next_actions: []
|
|
58
58
|
boundary: Minimize tracked agent-instruction context after explicit manifest approval; no Managed authority mutation, contract installation, or reference-document creation.
|
|
59
|
-
- name: imm-
|
|
60
|
-
path: skills/imm-
|
|
59
|
+
- name: imm-retro
|
|
60
|
+
path: skills/imm-retro/SKILL.md
|
|
61
61
|
role: execute
|
|
62
|
-
title:
|
|
62
|
+
title: Retro
|
|
63
63
|
role_class: discovery
|
|
64
64
|
canonical: true
|
|
65
65
|
output_artifacts: [retro_report]
|
|
@@ -46,6 +46,13 @@ covers the whole lifecycle including cleanup, ranking tolerates missing
|
|
|
46
46
|
embeddings, the budget covers the complete serialized request, and each success,
|
|
47
47
|
failure, and timeout outcome carries its own duration evidence.
|
|
48
48
|
|
|
49
|
+
When an acceptance assertion, or the Spec it references, names an agreed seam,
|
|
50
|
+
check that the delivered tests exercise that acceptance at that seam. A missing
|
|
51
|
+
seam, or a seam silently replaced by a different one, is a finding carrying
|
|
52
|
+
`violated.kind` of `acceptance` with `ref` the acceptance id. When no seam is
|
|
53
|
+
named, its absence is not a finding: candidates written before this rule carries
|
|
54
|
+
no defect for lacking one.
|
|
55
|
+
|
|
49
56
|
A required check that is skipped, that matches zero tests, or whose prerequisite
|
|
50
57
|
is absent does not prove the acceptance; do not accept it as evidence. Full
|
|
51
58
|
suite coverage reported at a coarse pass count is not per-invariant evidence.
|