@cleocode/skills 2026.10.21 → 2026.10.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/skills",
3
- "version": "2026.10.21",
3
+ "version": "2026.10.22",
4
4
  "description": "CLEO skill definitions - bundled with CLEO monorepo",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -2,14 +2,14 @@
2
2
  name: ct-cleo
3
3
  description: CLEO task management protocol - session, task, and workflow guidance. Use when managing tasks, sessions, or multi-agent workflows with the CLEO CLI protocol.
4
4
  metadata:
5
- version: 2.24.16
5
+ version: 2.24.21
6
6
  tier: core
7
7
  install: harness
8
8
  covers:
9
9
  - packages/cleo/src/cli/commands/session.ts
10
10
  - packages/cleo/src/cli/commands/focus.ts
11
11
  - packages/cleo/src/cli/commands/sticky.ts
12
- lastReviewed: 2026-10-17
12
+ lastReviewed: 2026-10-24
13
13
  stability: stable
14
14
  ---
15
15
 
@@ -234,7 +234,7 @@ This internal budget contract does not add a `--token-budget` flag to add/update
234
234
  |------|------------------|
235
235
  | `references/session-protocol.md` | start, resume or end sessions; pick skills |
236
236
  | `references/orchestrator-constraints.md` | spawn subagents from an orchestrator |
237
- | `references/loom-lifecycle.md` | move an epic through the LOOM stages |
237
+ | `references/planning-loop.md` | plan an epic, run its waves, verify its tasks |
238
238
  | `references/anti-patterns.md` | check a plan against known mistakes |
239
239
  | `references/memory.md` | recall or record BRAIN memory (progressive disclosure) |
240
240
  | `references/sticky-notes.md` | capture a thought before it is a task: `cleo sticky jot "..."`, then `cleo sticky convert <id> --to-task` |
@@ -7,7 +7,8 @@
7
7
  *
8
8
  * Checks:
9
9
  * - Contains `cleo memory observe` (not bare `cleo observe`)
10
- * - Contains `cleo orchestrate start` in Session Start section
10
+ * - Sends agents to no RCASD/IVTR verb (`cleo orchestrate start`,
11
+ * `cleo lifecycle complete`, `cleo orchestrate ivtr`) (T13942)
11
12
  * - Contains "Memory Protocol (JIT)" H2 section
12
13
  * - Contains "Escalation" H2 section
13
14
  * - At least 6 distinct `cleo <verb>` command patterns
@@ -139,8 +140,10 @@ describe('CLEO-INJECTION.md — command correctness', () => {
139
140
  expect(bareObserveInstructions).toHaveLength(0);
140
141
  });
141
142
 
142
- it('contains "cleo orchestrate start" in documentation', () => {
143
- expect(injectionContent).toMatch(/cleo orchestrate start/);
143
+ it('sends agents to no RCASD or IVTR verb (T13942)', () => {
144
+ expect(injectionContent).not.toMatch(/cleo orchestrate start/);
145
+ expect(injectionContent).not.toMatch(/cleo lifecycle complete/);
146
+ expect(injectionContent).not.toMatch(/cleo orchestrate ivtr/);
144
147
  });
145
148
 
146
149
  it('contains "cleo session status" command', () => {
@@ -18,7 +18,6 @@
18
18
  ### CLI Spawn Operations
19
19
 
20
20
  ```bash
21
- cleo orchestrate start T001
22
21
  cleo orchestrate analyze T001
23
22
  cleo orchestrate ready T001
24
23
  cleo orchestrate next T001
@@ -0,0 +1,55 @@
1
+ # Planning Loop: plan, execute, verify
2
+
3
+ How CLEO work flows (T13958). RCASD stage records and the IVTR loop are retired
4
+ from agent instructions (epic T13932). `pipeline_stage` is a label on tasks; it
5
+ gates work only where a project turns on the stage gate (below).
6
+
7
+ ## 1. Plan
8
+
9
+ - One plan document per epic, in the CleoDocs store:
10
+ `cleo docs add <epicId> ./<slug>-plan.md --type plan --slug <slug>-plan`.
11
+ Sections: findings, decision, spec (acceptance criteria), decomposition.
12
+ - Decisions go to BRAIN:
13
+ `cleo memory decision-store --decision "..." --rationale "..." --linked-task <epicId>`.
14
+ Owner decisions go through the ask tool first.
15
+ - Tasks: `cleo add --type task --parent <epicId> --acceptance "A|B"`, with
16
+ dependencies via `--depends`.
17
+ - **Stage gate** (`lifecycle.stageGate`, off by default, T13970): when a project sets it
18
+ to `strict`, a child cannot complete (exit 80) while its parent epic sits in a planning
19
+ stage (research to decomposition), and the epic cannot advance once children sit at its
20
+ stage; `advisory` only warns. An epic inherits its saga's stage, or starts at research
21
+ when it has no parent. With the gate on, run `cleo update <epicId> --pipeline-stage
22
+ implementation` once the plan is written and BEFORE adding children; if children
23
+ already sit at its stage, report the epic to the lead or owner. The setting is their
24
+ choice: never change `lifecycle.stageGate` yourself. Evidence strictness stays on
25
+ `lifecycle.mode` either way.
26
+
27
+ ## 2. Execute
28
+
29
+ - `cleo orchestrate waves <epicId>` for wave numbers, `cleo orchestrate ready <epicId>`
30
+ for what may run now, `cleo orchestrate spawn <taskId> --lead-mbx <you>` for each
31
+ worker prompt.
32
+ - Agents coordinate over AgentMBX; task state and evidence stay in CLEO.
33
+ - Autonomous runs go through CLEO Goal (ADR-097).
34
+
35
+ ## 3. Verify
36
+
37
+ - `cleo done <id> --plan`, record each gate with `cleo verify <id> --gate <gate>
38
+ --evidence "<atoms>"`, then `cleo complete <id>`.
39
+ - Each PR head gets an independent review before merge.
40
+
41
+ ## Spawn protocols are labels
42
+
43
+ Spawn protocols (research, consensus, specification, decomposition,
44
+ implementation, validation, testing, release, contribution) choose the spawn
45
+ prompt's stage guidance. They are not gates.
46
+
47
+ ## When `cleo complete` refuses
48
+
49
+ - Exit 80 with unproven evidence gates (the common case in strict mode): run
50
+ `cleo done <id> --plan`, record what it names, then complete.
51
+ - Exit 80 naming a planning-stage parent epic: the project turned on
52
+ `lifecycle.stageGate`; advance the epic before children exist (above), otherwise
53
+ report it to the lead or owner, who decide on the setting.
54
+ - Exit 83 (`E_IVTR_INCOMPLETE`): the task carries `ivtr_state` from the retired
55
+ IVTR loop, which no command clears; report it to the lead or owner.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ct-codebase-mapper
3
- version: 2.2.1
3
+ version: 2.3.5
4
4
  description: Orient in an unfamiliar or large codebase with CLEO's code-intelligence graph (cleo nexus) and project map (cleo map). Use before planning or editing unfamiliar code, for brownfield onboarding, to find what a change would break, or to map a project's structure, communities and execution flows. Triggers on "map the codebase", "understand this project", "what calls X", "what would break", "brownfield analysis", "project structure".
5
5
  protocol: null
6
6
  dependencies: []
@@ -17,13 +17,13 @@ triggers:
17
17
  - project structure
18
18
  - blast radius
19
19
  metadata:
20
- version: 2.2.1
20
+ version: 2.3.5
21
21
  tier: on-demand
22
22
  install: harness
23
23
  covers:
24
24
  - packages/cleo/src/cli/commands/nexus.ts
25
25
  - packages/cleo/src/cli/commands/map.ts
26
- lastReviewed: 2026-10-11
26
+ lastReviewed: 2026-10-24
27
27
  stability: stable
28
28
  ---
29
29
 
@@ -44,12 +44,26 @@ Two instruments, used together:
44
44
  cleo nexus status
45
45
  ```
46
46
 
47
- Read `nodeCount`, `lastIndexedAt` and `staleFileCount` against `fileCount`.
48
- Queries auto-refresh up to 25 stale files; beyond that they warn
49
- `W_NEXUS_INDEX_STALE`. Refresh with `cleo nexus analyze` (incremental; `--full`
47
+ Read `nodeCount`, `lastIndexedAt` and `staleFileCount` against `fileCount`,
48
+ and `freshness.commitsBehind` (commits on `freshness.baseRef` the index has
49
+ not seen) with `freshness.ageDays`.
50
+ Queries refresh a stale index inline when the last run's cost, scaled to the
51
+ repository and the stale set, fits `nexus.autoRefresh.budgetMs`; otherwise they
52
+ warn `W_NEXUS_INDEX_STALE`. `freshness.changedFilesSinceIndex` is a quick
53
+ git-diff count of tracked files changed since the indexed revision. Refresh with `cleo nexus analyze` (incremental; `--full`
50
54
  rebuilds). An empty or stale index gives confident-looking but incomplete
51
55
  answers — say which you relied on.
52
56
 
57
+ `registry` counts the registered projects by recorded health. When
58
+ `registry.unreachable` is above zero, `registry.cleanCommand` is the dry run
59
+ (`cleo nexus projects clean --orphans --dry-run`) that shows which rows are
60
+ really gone; report it, and leave removal to the owner. `registry.otherHost`
61
+ counts rows whose project lives on another machine sharing the store (a live
62
+ location on another device); `projects clean` never removes those and lists
63
+ them under `otherHost`. A legacy row with no location record is judged only by
64
+ its path root, so a same-username path from another machine stays removable:
65
+ read the dry run before removing.
66
+
53
67
  `assessment.referenceCount` is how many static references the graph could not
54
68
  resolve, so known callers are incomplete. Inspect them a page at a time:
55
69
 
@@ -77,6 +91,8 @@ cleo map --focus concerns # one area: stack | architecture | structure |
77
91
  # conventions | testing | integrations | concerns
78
92
  cleo map --store # same survey, findings stored to BRAIN
79
93
  # (tagged source: 'codebase-map')
94
+ cleo map --brief # one line per folder of exported names (nexus graph,
95
+ # else git-tracked walk), --budget N chars (default 2000)
80
96
  ```
81
97
 
82
98
  ## 3. Find the structure
@@ -102,11 +118,29 @@ caller, so an empty footprint alone never establishes that a change is safe.
102
118
  When a symbol name is ambiguous, pass the qualified candidate the command
103
119
  returns and confirm against the source.
104
120
 
105
- On a stale index, `impact` and `context` refresh it inline only when the last
106
- analysis recorded a cost that bounds the run; otherwise they answer from the
107
- stale index and say so. `--no-refresh` (or `CLEO_NEXUS_AUTO_REFRESH=false`)
121
+ On a stale index, `impact` and `context` refresh it inline when the size-scaled
122
+ cost estimate fits the budget: one refresh at a time per project, a larger one
123
+ only when `cleo run` admits it, and none for 30 minutes after one fails or is
124
+ aborted (`freshness.refreshCooldownUntil`; the next `cleo nexus analyze` ends
125
+ the pause). An aborted refresh keeps its parse work for the next run. Otherwise
126
+ they answer from the stale index and say so. `--no-refresh` (or `CLEO_NEXUS_AUTO_REFRESH=false`)
108
127
  always answers from the index as it stands.
109
128
 
129
+ Every graph answer carries `data.freshness` (`indexedRevision`, `baseRef`,
130
+ `commitsBehind` to the base branch, `commitsBehindHead`, `ageDays`). When the
131
+ index is more than `nexus.freshness.maxCommitsBehind` (default 50) commits
132
+ behind the checked-out HEAD, or the symbol is missing from an index that is
133
+ stale for this checkout, the query fails with
134
+ `E_NEXUS_INDEX_STALE` (exit 111) and `error.fix` names the reindex command. Run
135
+ it, then repeat the query. `--allow-stale` (`impact`, `context`) or
136
+ `CLEO_NEXUS_ALLOW_STALE=1` accepts the stale answer; say that you did.
137
+
138
+ `cleo nexus reindex-on-merge --enable` opts a project into a background
139
+ reindex after each merge into the base branch (the CLEO `post-merge` hook; it
140
+ waits for idle `cleo run` admission and gives up after 300s). `cleo nexus
141
+ status` shows the last real outcome as `reindexOnMerge` (ran, deferred or
142
+ failed, with the reason); skips are not recorded.
143
+
110
144
  ## 5. Across projects: where each one lives, and its state
111
145
 
112
146
  ```bash
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ct-dev-workflow
3
3
  description: Development workflow orchestration for task-driven development with atomic commits, conventional commit messages, and systematic release processes. Enforces task traceability, branch discipline, smart test scope selection, and GitHub Actions integration. Use when committing code, creating releases, managing branches, or following contribution protocols. Triggers on commit operations, release preparation, or workflow compliance needs.
4
- version: 3.1.25
4
+ version: 3.1.31
5
5
  protocol: contribution
6
6
  dependencies: []
7
7
  sharedResources:
@@ -14,7 +14,7 @@ compatibility:
14
14
  - gemini-cli
15
15
  license: MIT
16
16
  metadata:
17
- version: 3.1.25
17
+ version: 3.1.31
18
18
  tier: core
19
19
  install: harness
20
20
  covers:
@@ -26,7 +26,7 @@ metadata:
26
26
  - packages/core/src/hooks.ts
27
27
  - packages/core/templates/git-hooks/**
28
28
  - packages/contracts/src/git-hooks.ts
29
- lastReviewed: 2026-10-16
29
+ lastReviewed: 2026-10-24
30
30
  stability: stable
31
31
  ---
32
32
 
@@ -106,6 +106,10 @@ subject `initial: cleo init` (the empty commit `cleo init` makes so HEAD resolve
106
106
  only on a parentless first commit (T13582); a later commit with that subject, or any
107
107
  longer or different subject, still needs a task ID. A template change adds the
108
108
  previously shipped hash to `legacy-hashes.json` so installed copies refresh.
109
+
110
+ `cleo init` and `cleo upgrade` no longer seed the CleoOS hub (Pi extensions, CANT
111
+ workflows, justfile) into the global CLEO home (T13994, ADR-098); only the deprecated
112
+ `cleo admin scaffold-hub` still does.
109
113
  It probes CLEO_PROJECT_HOOK_V1 before invoking the implemented CLI adapter;
110
114
  missing or incompatible runners warn and allow. `cleo hook run --probe -- execution`
111
115
  answers EXEC or INERT (older builds answer V1; stable builds before 2026.10.17 are
@@ -115,6 +119,15 @@ checkout whose activation is on (T13774). Verify nested checkout paths, linked
115
119
  worktrees, custom hook paths, historical release bodies and corrupt receipts
116
120
  with focused Git fixtures before changing this delivery path.
117
121
 
122
+ The fourth managed hook, `post-merge` (T14010), never blocks. In shell, before
123
+ starting anything, it requires the `cleo.nexusReindexOnMerge` git marker and
124
+ HEAD on the base branch; otherwise it starts no process. When both hold it
125
+ starts `cleo nexus reindex-on-merge` detached. That command runs one at a time
126
+ per project (`.cleo/nexus-reindex.lock`) at the lowest admission priority: it
127
+ never joins the `cleo run` queue, tries only when nothing is waiting, and
128
+ records `deferred` after `nexus.reindexOnMerge.timeoutSeconds` (300). Turn it
129
+ on or off with `cleo nexus reindex-on-merge --enable` / `--disable`.
130
+
118
131
  ---
119
132
 
120
133
 
@@ -191,7 +204,7 @@ fix/T456-token-validation # Bug fix
191
204
 
192
205
  ## Gate System (Simplified)
193
206
 
194
- Not all gates apply to all changes. Follow the decision matrix.
207
+ Not all gates apply to all changes. Follow the decision matrix. Required gates also follow the task's evidence kind (`verification.requiredGatesByKind`): research and documentation tasks owe the required gates without `testsPassed`/`qaPassed` until their work touches any non-document path, which restores the full code gates.
195
208
 
196
209
  ### G0: Pre-Flight Check
197
210
 
@@ -518,6 +531,11 @@ cleo complete T1550
518
531
  Provider delivery receives canonical SDK file reads and Git discovery through a contracts port.
519
532
  Adapters do not acquire a runtime dependency on core for these utilities.
520
533
 
534
+ CLEO's own harness hooks are separate from project hooks: `cleo hook heavy-command`
535
+ (PreToolUse), `cleo hook stop` (Stop; it runs ask-enforce) and, for Claude Code, `cleo hook session-end`
536
+ (SessionEnd) and `cleo hook subagent-start` (SubagentStart, the ct-lean rules for Agent-tool subagents) are installed together by
537
+ `cleo init`/`cleo upgrade` or `cleo doctor heavy-command-hook --fix`, and fail open.
538
+
521
539
  Project business rules live in tracked `.cleo/hooks.json`; generated provider entries
522
540
  are delivery outputs. hooks-v1 was promoted in v2026.10.17 and is released in source
523
541
  (T13776), so every build activates and runs project hooks. The release gate
@@ -542,18 +560,22 @@ provider records use bounded regular-file reads; FIFOs are rejected. Unsupported
542
560
  provider bindings remain unsupported in delivery summaries, including mixed bindings.
543
561
 
544
562
  The Stop event has ONE CLEO entry per provider, `cleo hook stop --provider claude-code|codex`
545
- (T13796), in order goal tick → ask-enforce → session end. The goal runtime goes first, only when
563
+ (T13796), in order goal tick → ask-enforce. Stop fires at every turn end, so it NEVER ends the CLEO
564
+ session (T13913): ending there deleted the terminal binding every turn. Claude Code's `SessionEnd`
565
+ hook (`cleo hook session-end`, always installed) runs `cleo session end --quiet` detached, waited for
566
+ at most 20 s; Codex has no session-end event, so its sessions end explicitly. The goal runtime goes first, only when
546
567
  `.opencode/goals/` exists (`CLEO_GOAL_TICK_COMMAND`, default `ocg tick`, Stop JSON on stdin,
547
568
  JSON-only stdout, at most 60 s, its process group SIGKILLed at the deadline): a block is
548
- re-serialised as exactly `{decision, reason}` (reason capped) and skips the rest. Next, an ask-enforce block (T13420) wins and keeps
549
- the session open, because the agent still owes the owner an ask. Otherwise Claude Code's runs
550
- `cleo session end --quiet` as before; Codex's never ends the session (its Stop fires every turn
551
- and never did). Every step fails open to the session end (missing, failing or timed-out tick;
569
+ re-serialised as exactly `{decision, reason}` (reason capped) and skips the rest. Otherwise
570
+ ask-enforce (T13420) answers. Every step fails open (missing, failing or timed-out tick;
552
571
  ask-enforce error); `CLEO_GOAL_TICK=off` skips the tick; `CLEO_ASK_ENFORCE=off` or heavy-command
553
572
  mode `off` (`CLEO_HEAVY_COMMAND_HOOK` / `resources.heavyCommandHook`, read at run time) skips the
554
573
  ask check, as they removed its separate hook before.
555
574
  Sync folds the separate ask-enforce and old session-end Stop entries into it in place; Codex's
556
- rides the heavy-command mode, Claude Code's always stays.
575
+ rides the heavy-command mode, Claude Code's always stays. `cleo doctor heavy-command-hook`
576
+ reports the hook `outdated` when the Stop, SessionEnd or SubagentStart entry is missing or was
577
+ written by another build (a binary updated without a re-sync, T13960); `--fix` re-syncs them.
578
+ `cleo self-update` re-syncs only the project it runs in.
557
579
 
558
580
  Init, upgrade and inspection share the commit-msg, pre-commit and pre-push installer.
559
581
  Git determines effective hooksPath and the common directory, including linked worktrees.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ct-documentor
3
3
  description: Documentation coordinator with CLEO style guide compliance. Routes every canonical-doc write (spec, adr, research, handoff, note, llm-readme) through the docs SSoT via `cleo docs add` / `cleo docs publish` / `cleo docs fetch` — never raw filesystem writes. Carries the CLEO writing and review guides as references and coordinates ct-spec-writer and ct-adr-recorder. Use when creating or updating documentation files, consolidating scattered documentation, or validating documentation against style standards. Triggers on documentation tasks, doc update requests, or style guide compliance checks.
4
- version: 3.25.4
4
+ version: 3.26.0
5
5
  protocol: null
6
6
  dependencies:
7
7
  - ct-spec-writer
@@ -16,13 +16,13 @@ compatibility:
16
16
  - gemini-cli
17
17
  license: MIT
18
18
  metadata:
19
- version: 3.25.4
19
+ version: 3.26.0
20
20
  tier: core
21
21
  install: harness
22
22
  covers:
23
23
  - packages/cleo/src/cli/commands/docs.ts
24
24
  - packages/contracts/src/docs-taxonomy.ts
25
- lastReviewed: 2026-10-16
25
+ lastReviewed: 2026-10-23
26
26
  stability: stable
27
27
  ---
28
28
 
@@ -577,48 +577,31 @@ three invariants: stuck-saga closure (AC1), sibling-saga isolation
577
577
  another stuck docs-canon Saga so the recovery pattern stays under
578
578
  test.
579
579
 
580
- ### Docs->memory auto-emit (T9976 · regression-tested by T10375)
581
-
582
- Every successful `cleo docs add` fires a fire-and-forget memory observation
583
- into `brain_observations`. The CLI never blocks on this write — a BRAIN
584
- failure cannot fail `docs add` — but the observation is the bridge that
585
- makes `cleo memory find '<slug>'` surface attached docs.
586
-
587
- **Title shape**: `"Doc attached: <slug>"` (or `"Doc attached: <attachmentId>"`
588
- when no slug is provided). This is what the FTS index matches on, so the
589
- slug is also a memory-discovery key — not just a docs-lookup key.
590
-
591
- **Narrative payload** (the {@link DocAttachmentObservationPayload} contract):
592
-
593
- ```jsonc
594
- {
595
- "kind": "doc-attachment", // discriminator
596
- "attachmentId": "<id>", // assigned by the docs store
597
- "ownerId": "<T#### | SG-#### | …>",
598
- "slug": "<kebab-slug>", // omitted only when --slug not passed
599
- "type": "<docKind>", // omitted only when --type not passed
600
- "addedAt": "<ISO 8601 timestamp>"
601
- }
602
- ```
603
-
604
- The payload is consumed by `cleo memory verify <observationId>` for
605
- round-trip checks against the docs store — see AC3 of the original T9976
606
- suite at `packages/cleo/src/dispatch/domains/__tests__/docs-memory-observation.test.ts`.
607
-
608
- **Retroactive sweeps**: when migrating manual `Write`-based docs back into
609
- the SSoT (the T10371 + T10373 pattern), the auto-emit fires uniformly for
610
- the kebab-case slugs the sweep uses (`t<num>-<kebab>`, `adr-<num>-<kebab>`).
611
- Regression coverage lives at
612
- `packages/cleo/src/dispatch/domains/__tests__/docs-memory-observation-retroactive.test.ts`
613
- (T10375). Add a new case to that table whenever you discover a slug shape
614
- not yet under test.
615
-
616
- **Anti-pattern**: do NOT write a `cleo memory observe` manually after a
617
- `cleo docs add` — the auto-emit already happened, and the duplicate
618
- observation pollutes the FTS index. No CLI command back-fills that
619
- observation for attachments that pre-date the auto-emit feature: the
620
- `memory backfill-docs` verb planned in T9976 AC4 never shipped. Leave such
621
- attachments as they are rather than hand-writing a duplicate observation.
580
+ ### Docs->BRAIN link (T13985 · owner decision D11180)
581
+
582
+ Every successful `cleo docs add` links the document to its owner in the BRAIN
583
+ graph as `llmtxt:<sha256> --documents--> <ownerType>:<ownerId>` (for example
584
+ `task:T1234`). The `llmtxt:<sha256>` node carries the slug (or file name) as
585
+ its label. The link is canonical, so it is written even when
586
+ `brain.autoCapture` is off; the owner's `embeds` edge is automatic capture and
587
+ follows that setting. The write runs in the docs projection after the
588
+ attachment is stored, so a BRAIN failure never fails `docs add`.
589
+
590
+ There is no "Doc attached" observation any more (T9976's auto-emit was retired
591
+ by D11180): find a document through `cleo docs` (`list`, `find`, `fetch`), not
592
+ `cleo memory find`. Legacy "Doc attached" rows still in a store are kept out
593
+ of recall, and `cleo memory verify <observationId>` still round-trips one
594
+ against the docs store.
595
+
596
+ The internal `memory.backfill-docs` operation writes the missing `documents`
597
+ edges for attachments that predate the link (idempotent). Regression coverage:
598
+ `packages/cleo/src/dispatch/domains/__tests__/docs-memory-observation.test.ts`
599
+ and `docs-memory-observation-retroactive.test.ts` (slug shapes from the
600
+ T10371 + T10373 sweep).
601
+
602
+ **Anti-pattern**: do NOT write a `cleo memory observe` after a
603
+ `cleo docs add` to "register" the document: the documents edge already links
604
+ it, and an observation only adds noise to recall.
622
605
 
623
606
  #### System-managed exemptions (T10368)
624
607
 
@@ -1,20 +1,20 @@
1
1
  ---
2
2
  name: ct-lead
3
- description: "Phase Lead orchestration playbook for spawning and supervising a parallel worker swarm in one wave. Use when spawned by ct-orchestrator with role=orchestrator to fan out N leaf workers via delegate_task, drain the epic-{TID}.wave-{n} conduit topic plus pipeline_manifest, await rollupWaveStatus convergence, and return ONE rolled-up contract string to the parent Orchestrator. Triggers: 'phase lead', 'wave lead', 'supervise wave', 'fan out workers', 'aggregate worker results', 'rollup wave', any task with role=orchestrator that is itself a child of another orchestrator. Implements ADR-070 hierarchical orchestration."
3
+ description: "Phase Lead orchestration playbook for spawning and supervising a parallel worker swarm in one wave. Use when spawned by ct-orchestrator with role=orchestrator to fan out N leaf workers via delegate_task, read worker completion messages on AgentMBX plus pipeline_manifest, await rollupWaveStatus convergence, and return ONE rolled-up contract string to the parent Orchestrator. Triggers: 'phase lead', 'wave lead', 'supervise wave', 'fan out workers', 'aggregate worker results', 'rollup wave', any task with role=orchestrator that is itself a child of another orchestrator. Implements ADR-070 hierarchical orchestration."
4
4
  metadata:
5
- version: 1.0.8
5
+ version: 1.1.3
6
6
  tier: core
7
7
  install: harness
8
8
  covers:
9
9
  - packages/core/src/orchestration/lead-rollup.ts
10
10
  - packages/core/src/orchestration/waves.ts
11
- lastReviewed: 2026-09-30
11
+ lastReviewed: 2026-10-23
12
12
  stability: stable
13
13
  ---
14
14
 
15
15
  # Phase Lead Protocol (ct-lead)
16
16
 
17
- > **The Mantra**: *Aggregate, don't expose. Subscribe before spawn. Convergence over polling. Roll up in one contract.*
17
+ > **The Mantra**: *Aggregate, don't expose. Name your mailbox before spawn. Convergence over polling. Roll up in one contract.*
18
18
 
19
19
  You are a **Phase Lead** — a middle-tier orchestrator spawned by the top-level
20
20
  Orchestrator to supervise exactly ONE wave of leaf workers. Your job is to
@@ -35,10 +35,10 @@ exactly ONE aggregated summary.
35
35
 
36
36
  | ID | Rule | Practical Meaning |
37
37
  |----|------|-------------------|
38
- | LEAD-005 | Subscribe BEFORE spawn | Subscribe to `epic-<TID>.wave-<n>` conduit topic before issuing any `delegate_task` — late subscribers miss early completion events |
38
+ | LEAD-005 | Name your mailbox BEFORE spawn | Spawn each worker with `cleo orchestrate spawn <taskId> --lead-mbx <you>` so its prompt names your AgentMBX mailbox. Mailboxes keep messages, so a fast worker is never missed |
39
39
  | LEAD-006 | Parallel fanout | All workers in a wave fan out via a SINGLE `delegate_task` batch (`tasks: [...]`) — never sequential per-worker calls |
40
40
  | LEAD-007 | Bounded by `maxConcurrent` (default 10) | Wave width MUST NOT exceed it; split into multiple waves if larger. No config key or runtime check enforces this yet (`delegation.max_concurrent_children` is not read by CLEO) — the Lead enforces it |
41
- | LEAD-008 | Convergence over polling | Wait on conduit signals + `rollupWaveStatus`; do not poll task status in a busy loop |
41
+ | LEAD-008 | Convergence over polling | Wait on AgentMBX completion messages + `rollupWaveStatus`; do not poll task status in a busy loop |
42
42
  | LEAD-009 | Roll up via `rollupWaveStatus` | Always call `rollupWaveStatus(epicId, waveId)` before returning — never hand-aggregate manifest rows |
43
43
  | LEAD-010 | One summary upstream | Return ONE contract string to parent Orchestrator; detail lives in pipeline_manifest under your wave's roll-up entry |
44
44
  | LEAD-011 | Honest reporting | Distinguish `complete` / `partial` / `blocked` in the return contract — partial completions MUST list unresolved worker tasks in the manifest entry |
@@ -52,18 +52,25 @@ The parent Orchestrator spawns you with a resolved prompt containing:
52
52
  | `epicId` | Parent epic (e.g., `T9080`) |
53
53
  | `waveId` | Wave index within the epic (e.g., `wave-2`) |
54
54
  | `workerTasks[]` | Pre-resolved leaf task IDs in this wave (deps already satisfied) |
55
- | `conduitTopic` | `epic-<epicId>.wave-<waveId>` — your subscription topic |
55
+ | `mailbox` | Your AgentMBX name — workers send their completion message there |
56
56
  | `maxConcurrent` | Wave width cap passed by the parent (default 10) |
57
57
  | `subagentTimeoutSeconds` | Default 600 — wall-clock budget per worker |
58
58
 
59
59
  ## Workflow
60
60
 
61
- ### 1. Pre-flight (subscribe before spawn)
61
+ ### 1. Pre-flight (name your mailbox before spawn)
62
62
 
63
- ```bash
64
- # Subscribe FIRST — race-free (LEAD-005)
65
- cleo conduit subscribe --topic "epic-${EPIC}.wave-${WAVE}"
63
+ Run `mbx_whoami` for your AgentMBX name; if it shows no identity, claim one
64
+ with `mbx_identity` before any other mbx tool. Then build each worker's prompt
65
+ with `cleo orchestrate spawn <taskId> --lead-mbx <you>` (LEAD-005): the
66
+ prompt's Agent Coordination section names your mailbox. `cleo orchestrate
67
+ fanout` does not carry the name yet (T13966); when you use it, put your
68
+ mailbox in the task notes, where workers are told to look. Claude Code
69
+ Agent-tool subagents share their parent's identity, so they return results
70
+ directly instead of mailing them. Agent messages travel over AgentMBX, not
71
+ CONDUIT (D11172).
66
72
 
73
+ ```bash
67
74
  # Verify the wave is well-formed: ready tasks and the computed wave plan
68
75
  cleo orchestrate ready "${EPIC}"
69
76
  cleo orchestrate waves "${EPIC}"
@@ -85,20 +92,20 @@ delegate_task({
85
92
  { taskId: "T9102", role: "leaf", subagent_type: "cleo-subagent", model: "sonnet" },
86
93
  /* ... up to maxConcurrent ... */
87
94
  ],
88
- conduitTopic: "epic-T9080.wave-2",
89
95
  timeoutSeconds: 600
90
96
  })
91
97
  ```
92
98
 
93
- ### 3. Convergence (drain conduit + manifest)
99
+ ### 3. Convergence (AgentMBX messages + manifest)
100
+
101
+ Read worker completion messages with `mbx_inbox` / `mbx_read` (or
102
+ `agentmbx inbox --as <you>` inside the provider session that holds the MCP
103
+ lease) between waits, bounded by the wave budget; ack
104
+ each one you acted on. Messages give timing; the manifest gives content.
94
105
 
95
106
  ```bash
96
107
  # WAVE = the wave number `cleo orchestrate waves` prints now (1-based);
97
- # topic and roll-up use the same number.
98
-
99
- # Read worker terminal signals on the wave topic. There is no blocking
100
- # await: poll with --since between checks, bounded by the wave budget.
101
- cleo conduit listen --topic "epic-${EPIC}.wave-${WAVE}" --since "${SPAWNED_AT}"
108
+ # roll-up uses the same number.
102
109
 
103
110
  # Roll up authoritative status from pipeline_manifest
104
111
  cleo orchestrate roll-up "${EPIC}" --wave "${WAVE}" --json \
@@ -106,9 +113,8 @@ cleo orchestrate roll-up "${EPIC}" --wave "${WAVE}" --json \
106
113
  ```
107
114
 
108
115
  > **Wave contract (T12682).** One wave number `n` names everything: it is
109
- > the 1-based number `cleo orchestrate waves <epic>` prints, spawned workers
110
- > publish on `epic-<epicId>.wave-<n>`, and `cleo orchestrate roll-up <epic>
111
- > --wave <n>` takes the same `n` (`--wave 0` is refused with
116
+ > the 1-based number `cleo orchestrate waves <epic>` prints, and `cleo
117
+ > orchestrate roll-up <epic> --wave <n>` takes the same `n` (`--wave 0` is refused with
112
118
  > `E_CLEO_VALIDATION`, pointing at `cleo orchestrate waves`).
113
119
  >
114
120
  > **What a wave number guarantees (T12683).** A task's wave is its
@@ -121,8 +127,8 @@ cleo orchestrate roll-up "${EPIC}" --wave "${WAVE}" --json \
121
127
  > finished waves without renumbering the rest.
122
128
  > - **Not stable** when a dependency edge is added or removed anywhere
123
129
  > upstream, including in another epic: downstream waves shift. If you
124
- > subscribed ahead to `epic-<epicId>.wave-<n>`, re-read `cleo orchestrate
125
- > waves` after any dependency change.
130
+ > noted a wave number ahead of time, re-read `cleo orchestrate waves`
131
+ > after any dependency change.
126
132
  > - **Numbers can skip, and an epic's first wave can be above 1** (a task
127
133
  > whose external prerequisite sits at depth 3 is in wave 4). Always take
128
134
  > `n` from `cleo orchestrate waves`; never assume the first wave is 1.
@@ -140,6 +146,8 @@ cleo orchestrate roll-up "${EPIC}" --wave "${WAVE}" --json \
140
146
 
141
147
  `rollupWaveStatus` (T9082, `packages/core/src/orchestration/lead-rollup.ts`)
142
148
  returns `{ wave, total, complete, partial, blocked, failed, workers: [...] }`.
149
+ Its `conduitMessages` option is deprecated (T13981): pass nothing and let the
150
+ roll-up read the manifest; AgentMBX messages only tell you when to roll up.
143
151
 
144
152
  A stored manifest row with malformed metadata no longer fails the roll-up
145
153
  (T12686): it is skipped, every other worker is still reported, and a
@@ -179,11 +187,11 @@ cleo manifest append \
179
187
 
180
188
  ## Pitfalls
181
189
 
182
- - **Late subscribe**: subscribing AFTER `delegate_task` race-loses early completers — always subscribe first (LEAD-005).
190
+ - **Unnamed mailbox**: a worker that does not know your AgentMBX name cannot report to you — pass `--lead-mbx` on every spawn (LEAD-005).
183
191
  - **Sequential fanout**: spawning workers one-by-one defeats parallelism and breaks the wave model — use ONE batch (LEAD-006).
184
192
  - **Recursive Leads**: do NOT spawn a Lead from within a Lead — escalate to parent Orchestrator with a `blocked` contract instead (LEAD-003).
185
193
  - **Forwarding raw outputs**: never paste worker manifest entries upstream — parent's context budget assumes ONE rollup string per wave (LEAD-004).
186
- - **Polling task status**: do not `while true; sleep` on `cleo show` — read the wave topic with `cleo conduit listen --topic … --since …` and aggregate with `cleo orchestrate roll-up` (LEAD-008).
194
+ - **Polling task status**: do not `while true; sleep` on `cleo show` — read your AgentMBX inbox and aggregate with `cleo orchestrate roll-up` (LEAD-008).
187
195
  - **Unbounded retries**: cap local retry at 1 per worker — repeated failure escalates to parent.
188
196
 
189
197
  ## Cross-references
@@ -198,4 +206,4 @@ cleo manifest append \
198
206
  | Topic | File |
199
207
  |-------|------|
200
208
  | Worker fanout examples (3 / 5 / 10) | `references/spawn-pattern.md` |
201
- | Conduit + manifest drain semantics, retry policy, escalation | `references/aggregation-protocol.md` |
209
+ | AgentMBX + manifest drain semantics, retry policy, escalation | `references/aggregation-protocol.md` |