immune-brain 4.6.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.
Files changed (64) hide show
  1. package/README.md +154 -37
  2. package/README.zh-CN.md +160 -40
  3. package/package.json +1 -1
  4. package/plugins/immune-brain/.claude-plugin/plugin.json +1 -1
  5. package/plugins/immune-brain/.pi-extension/imm-canary-enroll.ts +42 -44
  6. package/plugins/immune-brain/.pi-extension/imm-canary-work.ts +142 -474
  7. package/plugins/immune-brain/.pi-extension/imm-unattended-batch.ts +54 -84
  8. package/plugins/immune-brain/.pi-extension/pi-canary-assurance-progression.ts +7 -2
  9. package/plugins/immune-brain/.pi-extension/tsconfig.json +2 -2
  10. package/plugins/immune-brain/agents/immune-brain-advisory-reviewer.md +23 -0
  11. package/plugins/immune-brain/agents/immune-brain-qa.md +42 -0
  12. package/plugins/immune-brain/agents/immune-brain-reviewer.md +90 -1
  13. package/plugins/immune-brain/agents/immune-brain-ui-review.md +21 -0
  14. package/plugins/immune-brain/dist/BASELINE.md +4 -4
  15. package/plugins/immune-brain/dist/claude/mcp-server.mjs +7369 -7016
  16. package/plugins/immune-brain/dist/docs/reference/planning-quality-gate.md +3 -3
  17. package/plugins/immune-brain/dist/docs/reference/subagent-dispatch-protocol.md +30 -1
  18. package/plugins/immune-brain/dist/imm-brainstorm.md +1 -1
  19. package/plugins/immune-brain/dist/imm-doc-prune.md +2 -2
  20. package/plugins/immune-brain/dist/{imm-agent-doc-maintain.md → imm-doc-slim.md} +9 -9
  21. package/plugins/immune-brain/dist/imm-planner.md +23 -8
  22. package/plugins/immune-brain/dist/imm-pr-fix.md +1 -1
  23. package/plugins/immune-brain/dist/{imm-review-retro.md → imm-retro.md} +26 -13
  24. package/plugins/immune-brain/dist/{imm-loop.md → imm-run.md} +33 -7
  25. package/plugins/immune-brain/dist/registry.yaml +9 -9
  26. package/plugins/immune-brain/dist/role-prompts/code-review.md +7 -0
  27. package/plugins/immune-brain/dist/role-prompts/executor.md +35 -2
  28. package/plugins/immune-brain/runtime/assurance/coordinator.ts +83 -67
  29. package/plugins/immune-brain/runtime/assurance/host_port.ts +20 -0
  30. package/plugins/immune-brain/runtime/assurance/qa.ts +2 -2
  31. package/plugins/immune-brain/runtime/assurance/verdict_authority.ts +347 -0
  32. package/plugins/immune-brain/runtime/claude/kernel_ports.ts +62 -369
  33. package/plugins/immune-brain/runtime/claude/mcp_server.ts +2 -0
  34. package/plugins/immune-brain/runtime/claude/review_host.ts +48 -16
  35. package/plugins/immune-brain/runtime/claude/role_agents.ts +83 -0
  36. package/plugins/immune-brain/runtime/commands/kernel.ts +3 -6
  37. package/plugins/immune-brain/runtime/kernel/application.ts +6 -3
  38. package/plugins/immune-brain/runtime/kernel/assurance_projection.ts +15 -8
  39. package/plugins/immune-brain/runtime/kernel/canary_application.ts +5 -3
  40. package/plugins/immune-brain/runtime/kernel/enrollment.ts +149 -5
  41. package/plugins/immune-brain/runtime/kernel/index.ts +3 -1
  42. package/plugins/immune-brain/runtime/kernel/storage.ts +170 -11
  43. package/plugins/immune-brain/runtime/kernel/storage_paths.ts +13 -0
  44. package/plugins/immune-brain/runtime/loop_contract.ts +22 -22
  45. package/plugins/immune-brain/runtime/plugin_version.ts +1 -1
  46. package/plugins/immune-brain/runtime/prompts/code-review.md +7 -0
  47. package/plugins/immune-brain/runtime/prompts/executor.md +35 -2
  48. package/plugins/immune-brain/runtime/role_prompt_bridge.ts +27 -0
  49. package/plugins/immune-brain/runtime/unattended/batch_git.ts +57 -27
  50. package/plugins/immune-brain/runtime/unattended/batch_kernel_port.ts +106 -0
  51. package/plugins/immune-brain/runtime/unattended/batch_preflight.ts +12 -14
  52. package/plugins/immune-brain/runtime/unattended/batch_reconfirmation.ts +34 -29
  53. package/plugins/immune-brain/runtime/unattended/batch_runner.ts +26 -90
  54. package/plugins/immune-brain/runtime/workspace_scope.ts +34 -0
  55. package/plugins/immune-brain/skills/BASELINE.md +4 -4
  56. package/plugins/immune-brain/skills/imm-doc-prune/SKILL.md +1 -1
  57. package/plugins/immune-brain/skills/{imm-agent-doc-maintain → imm-doc-slim}/SKILL.md +9 -9
  58. package/plugins/immune-brain/skills/imm-planner/SKILL.md +4 -2
  59. package/plugins/immune-brain/skills/imm-pr-fix/SKILL.md +1 -1
  60. package/plugins/immune-brain/skills/{imm-review-retro → imm-retro}/SKILL.md +7 -7
  61. package/plugins/immune-brain/skills/{imm-review-retro → imm-retro}/scripts/review_retro.ts +46 -21
  62. package/plugins/immune-brain/skills/{imm-loop → imm-run}/SKILL.md +7 -7
  63. package/plugins/immune-brain/skills/registry.yaml +9 -9
  64. package/plugins/immune-brain/.pi-extension/runtime-stub.ts +0 -581
@@ -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-loop` run should continue.
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-loop` 和 runtime 内部 roles 引用本协议,不内联另一套宿主分支。
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-loop`. `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.
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-loop` internal-role dispatch.
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-loop`. Read-only inventory and manifest
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-agent-doc-maintain
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: Agent Doc Maintain
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-loop` internal-role dispatch.
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-loop`. Read-only inventory and manifest
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-agent-doc-maintain` or
27
- `/imm-agent-doc-maintain`. Ordinary "is this AGENTS.md too long?" questions stay
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-agent-doc-maintain audit`: read-only. Produce the manifest and stop.
31
- - `imm-agent-doc-maintain`: produce the manifest, then wait for exact manifest
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-loop`. A candidate overlapping its `scope_hint` is
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-loop` entry; explicit Planner entry owns planning and the later
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-loop` for foreground Kernel Tool
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;
@@ -409,7 +409,7 @@ it, and structural Enrollment readiness is not proof that a descriptor executed.
409
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.
410
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.
411
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.
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.
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.
413
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.
414
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.
415
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.
@@ -484,7 +484,7 @@ preparation does not apply the revision or authorize expanded execution.
484
484
 
485
485
  ## Planning Rules
486
486
 
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-loop`; a validated candidate still needs native Enrollment.
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.
488
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.
489
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.
490
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.
@@ -502,7 +502,16 @@ preparation does not apply the revision or authorize expanded execution.
502
502
  explain how the selected seam catches the intended regression. This is a
503
503
  planning heuristic: it must not weaken acceptance-specific focused
504
504
  verification descriptors or add a mandatory user confirmation.
505
- - **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.
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.
506
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.
507
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.
508
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.
@@ -535,7 +544,12 @@ Use the invoking Host's read-only role-boundary route for bounded
535
544
  exactly. The Parent owns Spec/TaskIntent synthesis, Brainstorm traceability,
536
545
  acceptance, and scope; children return evidence only. On Pi the `arch-explorer` envelope
537
546
  uses `subagent_type: "Explore"`; invoke the returned envelope rather than
538
- constructing another Agent call. Do not invoke retired Planner runtime helpers
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
539
553
  or write child-owned planning artifacts.
540
554
 
541
555
  An optional planner ensemble is advisory-only; the Parent owns the final Spec and TaskIntent.
@@ -551,7 +565,7 @@ optional advisory dispatch fails, continue inline and record the reason.
551
565
 
552
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.
553
567
  - **Blocked**: Implementation edits, direct Kernel-store writes, enrolled intent overwrites, and QA/Review decisions.
554
- - **Workflow guard**: Execution continues through native Enrollment and explicit `imm-loop`. Planner owns design and decomposition, not execution authority.
568
+ - **Workflow guard**: Execution continues through native Enrollment and explicit `imm-run`. Planner owns design and decomposition, not execution authority.
555
569
 
556
570
  ## Output artifact
557
571
 
@@ -588,6 +602,7 @@ a State Ledger. Keep historical Plan validation strictly read-only.
588
602
  - A required check matches zero tests or is skipped and the run is reported as passing.
589
603
  - New work depends on a prose Plan validator, Step activation, or State Ledger.
590
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.
591
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.
592
607
  - A Medium/High risk Spec lacks a `Devil's Advocate Audit` covering rollback resilience, verification vanity, and spec dilution detection.
593
608
  - New Spec prose ignores the document-language policy.
@@ -603,6 +618,6 @@ a State Ledger. Keep historical Plan validation strictly read-only.
603
618
  ## Next Action
604
619
 
605
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.
606
- - 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`.
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`.
607
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.
608
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-loop`; stop and direct the user there when
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-review-retro
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: Review Retro
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-loop` internal-role dispatch. It reviews no diff — a diff
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-loop`. This Skill does
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-review-retro` or `/imm-review-retro`.
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
- - Attribution = the model behind the most recent `edit`, `write`, or
47
- `multiedit` in that session. If none, the row is `no-edit (review-only)`.
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` / `pass%` parse `[SCORE: …]` and `[VERDICT: …]` tags from the
54
- matching Review `toolResult`. Untagged reviews show `-`.
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 `record_finding` calls, deduped per session. Summaries that
60
- match `recorded cleanly`, `receipt recorded`, `round recorded`, or
61
- `no finding(s)` are `bookkeep` / `noisy`, excluded from `block`/`advis`.
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-loop
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-loop` entry starts or resumes this loop. Ordinary host input
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-loop` entry does not
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-agent-doc-maintain` are host-native
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. Executor checks are diagnostic evidence, not a QA or Review approval.
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-loop` behavior is byte-identical to per-task Enrollment, and no batch state,
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>`),
@@ -236,11 +247,26 @@ write planning artifacts, mutate Kernel state, or settle decisions. Report all
236
247
  substantiated blockers in one round, tied to acceptance or a concrete regression;
237
248
  separate optional advice from blockers. Suggestions alone do not justify rework.
238
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.
239
256
 
240
257
  `dispatch_role` for `qa`, `code-review`, or `ui-review` is used only when an
241
258
  explicit runtime-supported role boundary requests it, followed by the returned
242
259
  foreground Agent envelope exactly. It is not an extra gate on Kernel Assurance.
243
- All internal Agent envelopes use `run_in_background: false`.
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`.
244
270
 
245
271
  Role dispatches follow the user's interaction language: include
246
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-loop]
21
+ next_actions: [imm-run]
22
22
  boundary: Owns plan creation and revision; no executor edits.
23
- - name: imm-loop
24
- path: skills/imm-loop/SKILL.md
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-agent-doc-maintain
51
- path: skills/imm-agent-doc-maintain/SKILL.md
50
+ - name: imm-doc-slim
51
+ path: skills/imm-doc-slim/SKILL.md
52
52
  role: execute
53
- title: Agent Doc Maintain
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-review-retro
60
- path: skills/imm-review-retro/SKILL.md
59
+ - name: imm-retro
60
+ path: skills/imm-retro/SKILL.md
61
61
  role: execute
62
- title: Review Retro
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.
@@ -12,8 +12,9 @@ scoped implementation, staging and focused diagnostics. Enrollment itself does
12
12
  not start QA; the Parent owns the subsequent Kernel Assurance and foreground
13
13
  Review handoff under the same still-valid batch authorization.
14
14
 
15
- Before handoff, run the permitted diagnostic checks and return commands and
16
- outcomes to the Parent as structured diagnostic evidence. The read-only Loop
15
+ Before handoff, run the permitted diagnostic checks, complete the Delivery
16
+ Evidence check below and return its table to the Parent as structured diagnostic
17
+ evidence. The read-only Loop
17
18
  runtime action only constructs the dispatch envelope; it does not store
18
19
  evidence or change task state. Preserve failed and blocked attempts. Do not
19
20
  perform QA,
@@ -21,6 +22,38 @@ review, plan mutation, successor approval, Compounder work, or authority
21
22
  writes. If the requested change needs scope expansion, stop and return an
22
23
  `imm-planner` route with the concrete missing scope and verification reason.
23
24
 
25
+ ## Delivery Evidence
26
+
27
+ Reuse the TaskIntent and any bound Spec's agreed seams and controls. Before the
28
+ first Assurance attempt, return one compact row per acceptance; update affected
29
+ rows after repair. This is handoff evidence, not a new artifact or approval gate.
30
+
31
+ | Acceptance / invariant | Entry and consumers | Positive / negative / boundary controls | Command, outcome and input | Finding coverage |
32
+ |---|---|---|---|---|
33
+
34
+ For changed shared behavior, trace the real entry through its state owner,
35
+ write, serialization, reload and downstream consumer as applicable. Include
36
+ both affected hosts and recovery/replay branches. An async, return-type or
37
+ exception-contract change requires checking every affected caller's await,
38
+ cancellation and error propagation.
39
+
40
+ Use the real producer for the success control where available. Derive rejection
41
+ controls from a successful state, change only the target condition, and assert
42
+ the intended rejection reason and required side effects. A control must fail
43
+ when its target protection is removed. For byte-preservation claims compare the
44
+ relevant raw files, index and refs; for observed behavior link each required
45
+ criterion to its concrete observation.
46
+
47
+ Name whether each check consumed worktree or delivery bytes. Before Assurance,
48
+ verify task-owned changes are staged within scope, generated mirrors match,
49
+ and applicable type/build checks pass. On QA failure, reproduce the reported
50
+ failure under its delivery conditions before another attempt. For rework, name
51
+ the violated invariant, all known trigger classes and their controls in Finding
52
+ coverage; account for affected callers sharing that invariant within scope.
53
+ Record missing evidence as blocked and repair it before handoff. The Loop owns
54
+ verdict submission, finding disposition and the second-rework generalize-or-refute
55
+ rule.
56
+
24
57
  ## Code Quality Guard
25
58
 
26
59
  Before handoff, check the implementation for real implementation rather than