@mmerterden/multi-agent-pipeline 23.7.0 → 24.1.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 (162) hide show
  1. package/CHANGELOG.md +60 -1
  2. package/README.md +59 -24
  3. package/README.tr.md +43 -8
  4. package/SECURITY.md +3 -3
  5. package/docs/architecture.md +41 -4
  6. package/docs/ecosystem.md +15 -13
  7. package/docs/facts.json +5 -4
  8. package/docs/features.md +67 -15
  9. package/install/_codex-agents.mjs +13 -8
  10. package/install/_common.mjs +24 -0
  11. package/install/_dev-only-files.mjs +5 -0
  12. package/install/_mcp-register.mjs +6 -2
  13. package/install/_rewrite-tree.mjs +197 -0
  14. package/install/codex.mjs +96 -180
  15. package/install/copilot.mjs +24 -54
  16. package/install/index.mjs +29 -11
  17. package/install/templates/codex-instructions.md +21 -5
  18. package/install/templates/copilot-instructions.md +21 -14
  19. package/manifest.json +2083 -0
  20. package/package.json +8 -2
  21. package/pipeline/commands/multi-agent/SKILL.md +5 -4
  22. package/pipeline/commands/multi-agent/analysis/SKILL.md +5 -1
  23. package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +31 -3
  24. package/pipeline/commands/multi-agent/autopilot-status/SKILL.md +5 -1
  25. package/pipeline/commands/multi-agent/channels/SKILL.md +16 -8
  26. package/pipeline/commands/multi-agent/log/SKILL.md +2 -0
  27. package/pipeline/commands/multi-agent/stack/SKILL.md +1 -1
  28. package/pipeline/contract/CHANGELOG.md +15 -0
  29. package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
  30. package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
  31. package/pipeline/contract/fixtures/runs-awaiting-question.json +6 -1
  32. package/pipeline/contract/fixtures/runs-empty.json +1 -1
  33. package/pipeline/contract/fixtures/runs-failed.json +21 -1
  34. package/pipeline/contract/fixtures/runs-old-schema.json +18 -3
  35. package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +31 -1
  36. package/pipeline/contract/fixtures/runs-pr-opened.json +31 -1
  37. package/pipeline/contract/fixtures/runs-running.json +16 -1
  38. package/pipeline/contract/manifest.json +14 -14
  39. package/pipeline/contract/types/index.d.ts +20 -1
  40. package/pipeline/lib/_jira-auth.sh +50 -78
  41. package/pipeline/lib/_service-account.sh +191 -0
  42. package/pipeline/lib/credential-inventory.sh +49 -37
  43. package/pipeline/lib/credential-store.sh +48 -3
  44. package/pipeline/lib/fetch-confluence.sh +76 -92
  45. package/pipeline/lib/fetch-crashlytics.sh +30 -59
  46. package/pipeline/lib/fetch-figma-annotations.sh +9 -9
  47. package/pipeline/lib/fetch-fortify.sh +77 -81
  48. package/pipeline/lib/fetch-graylog.sh +38 -77
  49. package/pipeline/lib/figma-mcp-refresh.sh +23 -4
  50. package/pipeline/lib/figma-screenshot.sh +7 -8
  51. package/pipeline/lib/figma-token.sh +39 -46
  52. package/pipeline/lib/host.mjs +138 -0
  53. package/pipeline/lib/host.sh +48 -0
  54. package/pipeline/lib/issue-fetcher.sh +25 -41
  55. package/pipeline/lib/jira-publish.sh +23 -21
  56. package/pipeline/lib/local-model.mjs +93 -0
  57. package/pipeline/lib/md2confluence-v3.py +37 -30
  58. package/pipeline/lib/model-dispatch.sh +41 -4
  59. package/pipeline/lib/model-resolve.mjs +58 -0
  60. package/pipeline/lib/post-pr-review.sh +38 -53
  61. package/pipeline/lib/reviewer-families.mjs +70 -0
  62. package/pipeline/lib/service-account.mjs +2131 -0
  63. package/pipeline/lib/service-account.sh +35 -0
  64. package/pipeline/lib/usage-token.mjs +64 -24
  65. package/pipeline/lib/usage-vocab.mjs +1 -1
  66. package/pipeline/lib/user-facing.mjs +11 -3
  67. package/pipeline/lib/vercel-deploy.sh +17 -26
  68. package/pipeline/multi-agent-refs/_entry-picker.md +62 -0
  69. package/pipeline/multi-agent-refs/analysis/intake.md +2 -0
  70. package/pipeline/multi-agent-refs/analysis/render.md +12 -1
  71. package/pipeline/multi-agent-refs/analysis/reusable-refs.md +1 -0
  72. package/pipeline/multi-agent-refs/analysis/unattended.md +135 -0
  73. package/pipeline/multi-agent-refs/autopilot-on/details.md +16 -0
  74. package/pipeline/multi-agent-refs/channels/generator.md +10 -2
  75. package/pipeline/multi-agent-refs/channels/menu.md +3 -1
  76. package/pipeline/multi-agent-refs/channels/preview.md +3 -1
  77. package/pipeline/multi-agent-refs/channels/reference.md +16 -2
  78. package/pipeline/multi-agent-refs/channels/report-file.md +188 -0
  79. package/pipeline/multi-agent-refs/cross-cli-contract.md +35 -27
  80. package/pipeline/multi-agent-refs/features/doctor.md +37 -11
  81. package/pipeline/multi-agent-refs/features/free-models.md +3 -3
  82. package/pipeline/multi-agent-refs/features/local-model.md +87 -0
  83. package/pipeline/multi-agent-refs/features/model-fallback.md +25 -10
  84. package/pipeline/multi-agent-refs/features/product-context.md +6 -5
  85. package/pipeline/multi-agent-refs/features/service-accounts.md +233 -0
  86. package/pipeline/multi-agent-refs/features/unattended-security.md +10 -1
  87. package/pipeline/multi-agent-refs/help/en.md +36 -1
  88. package/pipeline/multi-agent-refs/help/tr.md +34 -1
  89. package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +2 -1
  90. package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +2 -1
  91. package/pipeline/multi-agent-refs/phases/modes.md +20 -1
  92. package/pipeline/multi-agent-refs/phases/phase-0-init.md +1 -0
  93. package/pipeline/multi-agent-refs/phases/phase-4-commit.md +1 -0
  94. package/pipeline/multi-agent-refs/phases/phase-5-report.md +13 -11
  95. package/pipeline/multi-agent-refs/phases.md +4 -3
  96. package/pipeline/multi-agent-refs/review/panel.md +30 -18
  97. package/pipeline/multi-agent-refs/setup/discovery.md +17 -5
  98. package/pipeline/multi-agent-refs/setup/token-save-flow.md +21 -2
  99. package/pipeline/multi-agent-refs/sync/overview.md +11 -5
  100. package/pipeline/multi-agent-refs/tracker-contract.md +64 -20
  101. package/pipeline/office/index.html +77 -4
  102. package/pipeline/schemas/activity.schema.json +63 -4
  103. package/pipeline/schemas/autopilot-config.schema.json +29 -4
  104. package/pipeline/schemas/hosts.json +512 -0
  105. package/pipeline/schemas/hosts.schema.json +310 -0
  106. package/pipeline/schemas/launch.json +22 -2
  107. package/pipeline/schemas/launch.schema.json +2 -1
  108. package/pipeline/schemas/now-lines.json +103 -0
  109. package/pipeline/schemas/now-lines.schema.json +42 -0
  110. package/pipeline/schemas/phases.json +19 -1
  111. package/pipeline/schemas/phases.schema.json +8 -0
  112. package/pipeline/schemas/prefs.schema.json +331 -4
  113. package/pipeline/schemas/runs-index.schema.json +22 -1
  114. package/pipeline/scripts/_autopilot-config.mjs +67 -4
  115. package/pipeline/scripts/_autopilot-item.mjs +67 -0
  116. package/pipeline/scripts/_autopilot-outcomes.mjs +6 -0
  117. package/pipeline/scripts/_contract-core.mjs +1 -1
  118. package/pipeline/scripts/_cost.mjs +75 -3
  119. package/pipeline/scripts/activity-snapshot.mjs +27 -1
  120. package/pipeline/scripts/analysis-sources.mjs +22 -5
  121. package/pipeline/scripts/analysis-unattended.mjs +360 -0
  122. package/pipeline/scripts/anonymize-findings.mjs +3 -7
  123. package/pipeline/scripts/autopilot-arming.mjs +19 -10
  124. package/pipeline/scripts/autopilot-intake.mjs +124 -27
  125. package/pipeline/scripts/autopilot-menubar.swift +7 -0
  126. package/pipeline/scripts/autopilot-runner.mjs +77 -48
  127. package/pipeline/scripts/autopilot-status.sh +32 -9
  128. package/pipeline/scripts/bulk-read.sh +37 -5
  129. package/pipeline/scripts/confluence-readback.mjs +15 -7
  130. package/pipeline/scripts/cost-table.json +65 -25
  131. package/pipeline/scripts/doctor.mjs +119 -32
  132. package/pipeline/scripts/entry-mode.mjs +101 -0
  133. package/pipeline/scripts/estimate.mjs +30 -16
  134. package/pipeline/scripts/feedback-send.mjs +11 -8
  135. package/pipeline/scripts/gen-facts.mjs +7 -9
  136. package/pipeline/scripts/jira-attach.sh +23 -28
  137. package/pipeline/scripts/jira-search.sh +5 -21
  138. package/pipeline/scripts/launch-request.mjs +15 -9
  139. package/pipeline/scripts/migrate-prefs.mjs +56 -0
  140. package/pipeline/scripts/phase-tracker.sh +226 -50
  141. package/pipeline/scripts/priority-review.mjs +14 -7
  142. package/pipeline/scripts/product-context.mjs +26 -7
  143. package/pipeline/scripts/prune-logs.sh +4 -2
  144. package/pipeline/scripts/render-work-summary.sh +51 -1
  145. package/pipeline/scripts/report-file.mjs +285 -0
  146. package/pipeline/scripts/rework-escalation.mjs +19 -4
  147. package/pipeline/scripts/runs-index.mjs +2 -1
  148. package/pipeline/scripts/service-read.mjs +19 -17
  149. package/pipeline/scripts/skill-siblings.mjs +17 -1
  150. package/pipeline/scripts/status-overview.mjs +20 -10
  151. package/pipeline/scripts/uninstall.mjs +145 -57
  152. package/pipeline/scripts/usage-register.mjs +34 -11
  153. package/pipeline/scripts/usage-report.mjs +31 -26
  154. package/pipeline/scripts/validate-triage.mjs +11 -1
  155. package/pipeline/scripts/work-items.mjs +25 -28
  156. package/pipeline/scripts/write-store-config.mjs +37 -11
  157. package/pipeline/skills/.skill-manifest.json +4 -4
  158. package/pipeline/skills/.skills-index.json +1 -1
  159. package/pipeline/skills/shared/core/multi-agent/SKILL.md +11 -3
  160. package/pipeline/skills/shared/core/multi-agent-analysis/SKILL.md +2 -0
  161. package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +11 -8
  162. package/pipeline/lib/credential-resolve.mjs +0 -75
@@ -75,6 +75,8 @@ The generic "zero-interaction" contract covers Phases 0-4 only. Phase 5 channels
75
75
  - **30-minute timeout** - if user does not respond, session ends cleanly:
76
76
  - External delivery aborted (no silent apply - prevents accidental Jira comments / Confluence pages).
77
77
  - Internal capture (`agent-log.md`, telemetry, knowledge base) STILL runs.
78
+ - The report file is written from prefs content (`--file-only`) as part of that
79
+ capture: a timeout is the person not answering, not the work being worthless.
78
80
  - State persisted as `{phase: 5, waitingFor: "user-channels-choice", channelsTimeout: true}`.
79
81
  - Resume: `/multi-agent:resume <task-id>` re-opens menu with same inputs.
80
82
  - Post-hoc `/multi-agent:channels <task>` never times out - user invoked it explicitly.
@@ -98,7 +100,24 @@ Phase 0: Intake -> Phase 1: Evidence -> Phase 2: Synthesis -> Phase 3: Review ->
98
100
  | 4 Publish | Local file / Confluence / Jira. Locked 6 still forbids `git add` and `git commit` |
99
101
  | 5 Report | Channels, same as every mode |
100
102
 
101
- **No `autopilot` variant.** Worktree isolation buys nothing when no code is written, and the intake, the Pass B convention preview and the open-question resolution are interactive by nature; a zero-interaction analysis would be a document nobody agreed to.
103
+ ### The unattended form (`analysis-autopilot`)
104
+
105
+ `/multi-agent:analysis <tracker-ref> autopilot` is its own declared mode
106
+ (`phases.json` `modes.analysis-autopilot`: the same six slots, the same step
107
+ names, `autopilot: true`, `commits: false`). It is the shape an unattended queue
108
+ launches for a tracker item carrying the repo's analysis label, and it ends at
109
+ `doc-delivered` rather than at a pull request. Still no worktree: isolation buys
110
+ nothing when no code is written, and Locked 6 forbids `git add` and `git commit`
111
+ in every analysis mode.
112
+
113
+ Every intake question is **derived from evidence or parked**, never defaulted and
114
+ never asked: what each one answers and from which evidence is
115
+ [`analysis/unattended.md`]($HOME/.claude/multi-agent-refs/analysis/unattended.md),
116
+ and a question that evidence cannot settle parks the run with the reason rather
117
+ than guessing a document nobody agreed to. The Phase 3.3 bucket rule is
118
+ unchanged (searches still run; a gap the user alone could close is stamped and
119
+ recorded in Section 20), and Phase 3.5 resolves to the local file only - an
120
+ unattended run publishes nothing outside the machine.
102
121
 
103
122
  **Where the document lands.** Drafts go to `/tmp/analysis-<slug>-<ts>/` first, then the Phase 4 picker decides: Local writes `<repo>/analysis/<feature>-<platform>.md` uncommitted, Confluence posts the page, Jira updates the description. In the full pipeline the same engine writes into the worktree instead and `prefs.global.analysisPhase.commitDoc` decides whether it rides along with the commit.
104
123
 
@@ -744,3 +744,4 @@ It asserts five things:
744
744
  A failure is a halt, not a warning: fix the state, re-run the gate, and leave the phase
745
745
  `in_progress` until it passes. Never close Phase 0 on the grounds that its steps ran -
746
746
  the gate checks the output, which is what Phase 2 consumes.
747
+
@@ -314,3 +314,4 @@ LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4
314
314
  ```
315
315
 
316
316
  Best-effort. See `$HOME/.claude/multi-agent-refs/progress-contract.md#token-telemetry-forwarding`.
317
+
@@ -7,13 +7,10 @@ Progress per `$HOME/.claude/multi-agent-refs/progress-contract.md`: channels dis
7
7
 
8
8
  ## Sub-step Tracking (required)
9
9
 
10
- Phase 5 has **3 ordered sub-steps** (external delivery lives under channels). Register all of them in the tracker at Phase 5 entry.
10
+ Phase 5 has **3 ordered sub-steps** (external delivery lives under channels), registered by `add` from `schemas/phases.json`.
11
11
 
12
12
  ```bash
13
13
  bash ~/.claude/scripts/phase-tracker.sh update 5 in_progress
14
- bash ~/.claude/scripts/phase-tracker.sh sub 5 1 Channels-Dispatch pending
15
- bash ~/.claude/scripts/phase-tracker.sh sub 5 2 Log+Telemetry pending
16
- bash ~/.claude/scripts/phase-tracker.sh sub 5 3 Knowledge+Memory pending
17
14
  ```
18
15
 
19
16
  On entry: `phase-tracker.sh sub 5 <N> "<name>" in_progress`. On exit: `completed` / `failed` / `skipped` / `timeout`.
@@ -37,11 +34,16 @@ Phase 5 builds a state bundle and invokes `/multi-agent:channels` (Claude Code)
37
34
  > **Local-only short-circuit**: when `state.offlineOnly == true` (all repos
38
35
  > are local - see Phase 0), Step 1 is **skipped entirely**. No channels menu,
39
36
  > no Jira/Wiki/Confluence/PR adapters, no autopilot pause. The tracker
40
- > records `step1.status = "skipped-offline"` and the run jumps straight to
41
- > the internal capture sub-steps (agent-log finalization, telemetry,
42
- > knowledge/memory write). The only report is the run's `agent-log.md` on disk.
37
+ > records `step1.status = "file-only"`, channels runs once with `--file-only`,
38
+ > and the internal capture sub-steps continue. Reports: `agent-log.md` and
39
+ > `task-report.md` on disk (`channels/report-file.md`).
43
40
 
44
- > **Unattended** (`MULTI_AGENT_UNATTENDED=1`): Step 1 is skipped, `deferred-to-runner` (`features/unattended-security.md`).
41
+ > **Unattended** (`MULTI_AGENT_UNATTENDED=1`): external delivery is
42
+ > `deferred-to-runner` (`features/unattended-security.md`); channels still runs
43
+ > with `--file-only`, so the report lands under `LOGS_ROOT`.
44
+
45
+ > **If the access check stops channels** (`ACCESS_RC` 3), Phase 5 records
46
+ > `report file not written` and continues its internal capture; it never halts.
45
47
 
46
48
  ### State bundle passed to channels
47
49
 
@@ -286,7 +288,7 @@ Print the closing report to the terminal. Two blocks, in this order - what the
286
288
 
287
289
  ```bash
288
290
  bash $HOME/.claude/scripts/phase-tracker.sh report
289
- bash $HOME/.claude/scripts/render-work-summary.sh "$TASK_ID" --worktree "$WORKTREE_PATH"
291
+ bash $HOME/.claude/scripts/render-work-summary.sh "$TASK_ID" --format terminal --worktree "$WORKTREE_PATH"
290
292
  ```
291
293
 
292
294
  `report` prices the run phase by phase; `render-work-summary.sh` says what changed on disk. Both land in tool output, which the host collapses, so **reprint them in your reply** followed by this line:
@@ -301,7 +303,7 @@ Full report: $HOME/.claude/logs/multi-agent/{project}/{task-id}/agent-log.md
301
303
 
302
304
  Plan row: `plan-attachment.mjs line --state "$STATE_FILE"`, omitted when it prints nothing.
303
305
 
304
- Tracker: `phase-tracker.sh sub 5 2 "Log+Telemetry" completed`.
306
+ Tracker: `phase-tracker.sh sub 5 2 "Log + telemetry" completed`.
305
307
 
306
308
  ## Step 3 - Knowledge Capture (incremental learning)
307
309
 
@@ -347,7 +349,7 @@ bash $HOME/.claude/scripts/memory-save.sh "$PROJECT_ROOT" --from-json memory-syn
347
349
  - **user**: only if the user disclosed new context about their role, expertise, or team layout
348
350
  - **Otherwise return `[]`** - blank is the correct default. Do not save derivable facts (code structure, git history, command outputs).
349
351
 
350
- Tracker: `phase-tracker.sh sub 5 3 "Knowledge+Memory" completed`.
352
+ Tracker: `phase-tracker.sh sub 5 3 "Knowledge + memory" completed`.
351
353
 
352
354
  Log: "Phase 5: Knowledge captured ({N} entries to {files})"
353
355
 
@@ -121,14 +121,15 @@ After every LLM call (counts are additive; skipping this is why runs end with du
121
121
  $HOME/.claude/scripts/phase-tracker.sh tokens <N> <in> <out> [cached]
122
122
  ```
123
123
 
124
- For sub-phase progress (e.g. Phase 1's parallel Explore agents, Phase 3's reviewer dispatch + triage + validator gate, Phase 4's commit + push + PR sub-steps):
124
+ Sub-steps are registered by `add`, from the `steps` list each phase declares in `schemas/phases.json` - a phase arrives with `<N>.1`, `<N>.2`, `<N>.3` already on it. Phases move their own:
125
125
 
126
126
  ```bash
127
- $HOME/.claude/scripts/phase-tracker.sh sub <N> 1 "<sub name>" pending # register
128
127
  $HOME/.claude/scripts/phase-tracker.sh sub <N> 1 "<sub name>" in_progress # advance
129
128
  $HOME/.claude/scripts/phase-tracker.sh sub <N> 1 "<sub name>" completed # done
130
129
  ```
131
130
 
131
+ The same call registers a step that is not in the contract (Phase 4's integration build, Phase 5's issue comment). Dev declares no steps: its sub-steps are Phase 1's plan tasks, attached by `phase-tracker.sh plan 2`. Each `sub` prints a `-- NEXT (required) --` block with this host's mirror call, as `update` does.
132
+
132
133
  State persists at `$HOME/.claude/logs/multi-agent/<task_id>/tracker-state.json` - atomic writes mean concurrent worktrees don't corrupt each other.
133
134
 
134
135
  ### Optional banner (single-event flair)
@@ -145,7 +146,7 @@ Banner status enum on `end`: `done` | `failed` | `skipped`. Anything else exits
145
146
 
146
147
  ### TaskCreate registration (Claude Code - required)
147
148
 
148
- In Claude Code the agent MUST register one TaskCreate tile per phase at Phase 0 startup, with each subject copied verbatim from `phase-tracker.sh tiles` (`Phase 1 Plan`, `Phase 3 Review`; never a renamed or merged phase such as `Analysis + Plan`) (one per phase the current COMMAND runs - `/multi-agent` and the autopilot entries = 0..5, `:analysis` = 0/1/3/4/5). Capture the returned `taskId`, persist it via `phase-tracker.sh meta <N> tasklist_id "<taskId>"` so `:resume` can rebuild the widget.
149
+ In Claude Code the agent MUST register one TaskCreate tile per ROW that `phase-tracker.sh tiles` prints at Phase 0 startup, with each subject copied verbatim (`Phase 1 Plan`, ` 1.2 Exploration`; never a renamed or merged phase such as `Analysis + Plan`). The rows are the phases the current COMMAND runs (`/multi-agent` and the autopilot entries = 0..5, `:analysis` = 0/1/3/4/5) and, indented under each, that phase's declared sub-steps. Capture the `taskId` of every phase row, persist it via `phase-tracker.sh meta <N> tasklist_id "<taskId>"` so `:resume` can rebuild the widget.
149
150
 
150
151
  Per phase boundary:
151
152
 
@@ -4,33 +4,45 @@
4
4
 
5
5
  ## Reviewers
6
6
 
7
- Every host runs three reviewers; only the second slot differs, because GPT-5.4 exists on Copilot and Codex but not on Claude Code, where Opus fills it.
8
-
9
- **Claude Code (3 in parallel while the fable rung is on, 2 while it is off):**
10
- - Agent 1: `claude-fable-5-2` → security + architecture (only when `REVIEW_RUNG` is `fable`)
11
- - Agent 2: `claude-opus-5-5` → edge cases, alternate perspective
12
- - Agent 3: `claude-sonnet-5-5` → general quality
13
-
14
- **Copilot CLI (3 in parallel):**
15
- - Agent 1: `claude-opus-4.7` → security + architecture (Fable is not offered on Copilot CLI)
16
- - Agent 2: `gpt-5.4` → edge cases, alternate perspective
17
- - Agent 3: `claude-sonnet-4.6` → general quality
18
-
19
- **Codex CLI (3 in parallel, single vendor):**
20
- - Agent 1: `gpt-5.6` @ `xhigh` → security + architecture
21
- - Agent 2: `gpt-5.4` @ `high` → edge cases, alternate perspective
22
- - Agent 3: `gpt-5.6` @ `medium` → general quality
7
+ The panel below is generated from the host registry (`schemas/hosts.json`); only
8
+ the second slot differs between hosts, because GPT-5.4 is reachable on two of
9
+ them and not on Claude Code, where Opus fills it.
10
+
11
+ <!-- hosts:panel -->
12
+ **Claude Code** (3 in parallel, one vendor):
13
+ - Agent 1: the `fable` rung -> security + architecture
14
+ - Agent 2: the `opus` rung -> edge cases, alternate perspective
15
+ - Agent 3: the `sonnet` rung -> general quality
16
+ - Triage: the `fable` rung
17
+
18
+ **Copilot CLI** (3 in parallel, two vendors):
19
+ - Agent 1: `claude-opus-4.7` -> security + architecture
20
+ - Agent 2: `gpt-5.4` -> edge cases, alternate perspective
21
+ - Agent 3: `claude-sonnet-4.6` -> general quality
22
+ - Triage: `claude-opus-4.7`
23
+
24
+ **Codex CLI** (3 in parallel, one vendor):
25
+ - Agent 1: `gpt-5.6` @ `xhigh` -> security + architecture
26
+ - Agent 2: `gpt-5.4` @ `high` -> edge cases, alternate perspective
27
+ - Agent 3: `gpt-5.6` @ `medium` -> general quality
28
+ - Triage: `gpt-5.6` @ `max`
29
+
30
+ **Local model** (1 in parallel, one vendor):
31
+ - Agent 1: `local` -> security + architecture
32
+ - Triage: `local`
33
+ <!-- /hosts -->
23
34
 
24
35
  When `REVIEW_RUNG` is anything but `fable`, Agent 1 is dropped on Claude Code and the panel is Agent 2 + Agent 3.
25
36
 
26
37
  ## Store compliance
27
38
 
28
39
  | Platform | Trigger files | Catalog |
29
- |---|---|---|
40
+ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
30
41
  | iOS | `**/Info.plist`, `**/PrivacyInfo.xcprivacy`, `**/*.entitlements`, `**/*App.swift`, `**/AppDelegate*.swift`, `**/SceneDelegate*.swift`, `**/project.pbxproj` | `$HOME/.claude/skills/apple-archive-compliance/SKILL.md` - 18 rules + ITMS refs |
31
42
  | Android | `**/AndroidManifest.xml`, `**/build.gradle(.kts)`, `**/proguard-rules.pro`, `**/network_security_config.xml` | `$HOME/.claude/skills/google-play-compliance/SKILL.md` - 21 rules + Play policy refs |
32
43
 
33
44
  Each finding gets the `ruleID` from the catalog plus the platform policy ref:
45
+
34
46
  - iOS: `(apple-archive-compliance / info-plist - Guideline 5.1.1)`
35
47
  - Android: `(google-play-compliance / dangerous-permissions - Policy - Permissions)`
36
48
 
@@ -66,7 +78,7 @@ default: option 1
66
78
  `post-pr-review.sh` reads `agent-state.review.{input, findings, iterationNumber, headCommitSha}`, decides APPROVE vs NEEDS_WORK from the decision rule, posts one inline comment per accepted blocking + important finding (in `outputLanguage`), then sets the review state via the provider's API:
67
79
 
68
80
  | Provider | Inline comment | State |
69
- |---|---|---|
81
+ | ------------------ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
70
82
  | `github` | `gh api -X POST /repos/{o}/{r}/pulls/{n}/comments` (path + line + commit_id) | `gh pr review --approve` / `--request-changes` |
71
83
  | `bitbucket-server` | `POST /pull-requests/{n}/comments` with `anchor: { path, line, lineType:"ADDED", fileType:"TO" }` | `PUT /pull-requests/{n}/participants/{user}` body `{"status":"APPROVED"}` or `{"status":"NEEDS_WORK"}` |
72
84
 
@@ -2,12 +2,24 @@
2
2
 
3
3
  Instead of checking only hardcoded key names, discover ALL user keys and intelligently map them to services. Uses `credential-store.sh list`:
4
4
 
5
- **1a. Discover all keys:**
5
+ **1a. Discover all keys - two passes:**
6
+
6
7
  ```bash
7
- DISCOVERED=$(~/.claude/lib/credential-store.sh list 2>/dev/null | grep -i "^${USER}" | sort -u)
8
- echo "$DISCOVERED"
8
+ DISCOVERED_ALL=$(~/.claude/lib/credential-store.sh list 2>/dev/null | sort -u)
9
+ DISCOVERED=$(printf '%s\n' "$DISCOVERED_ALL" | grep -i "^${USER}")
9
10
  ```
10
11
 
12
+ `DISCOVERED` is the conventional set: the standard key names are
13
+ `{USER}_{Service}_{Type}`, so an item whose name starts with the username is
14
+ almost certainly one of ours and is offered first. `DISCOVERED_ALL` is every
15
+ item the store lists, and it is what Steps 3 and 4 actually search. A token
16
+ saved before this pipeline existed - `work_jira_pat`, `JiraPAT_2024` - does
17
+ not start with the username, and narrowing the search to the prefixed set is how
18
+ setup comes to ask a person for a credential they already have on the machine.
19
+
20
+ Neither list is ever printed in full: the keyword match decides what a person is
21
+ shown, and an item name is not a value but it is still theirs.
22
+
11
23
  **1b. Search keywords (per service):**
12
24
 
13
25
  Standard key names - the ones to use when creating a NEW key - live in `$HOME/.claude/multi-agent-refs/keychain.md` "Standard key names"; read the name for a service from there. Existing keys under other names are perfectly valid, which is what these keywords are for.
@@ -45,7 +57,7 @@ For each service in the table above, follow this order:
45
57
 
46
58
  1. **Check standard key** -> `~/.claude/lib/credential-store.sh get "<standard_key>" 2>/dev/null`
47
59
  - Found (non-empty stdout, exit 0) -> auto-map, done
48
- 3. **Search discovered keys** -> filter `$DISCOVERED` by the service's search keywords (case-insensitive)
60
+ 3. **Search discovered keys** -> filter `$DISCOVERED_ALL` by the service's search keywords (case-insensitive). When several match, a `$DISCOVERED` entry is listed above the rest: a conventionally named item is the likelier one, but it is not the only candidate.
49
61
  - Exactly 1 match -> show: `"Found '${matched_key}' for ${service} - use this? (enter=yes / n=skip)"` -> if yes, map it
50
62
  - Multiple matches -> show numbered list, user picks:
51
63
  ```
@@ -75,7 +87,7 @@ For each service in the table above, follow this order:
75
87
  - Cap at 10 candidates, sorted by relevance (shortest edit distance to service keywords)
76
88
  - If 0 candidates even after broad search -> MISSING (truly not in keychain)
77
89
 
78
- **Important:** Steps 3-4 search the FULL `$DISCOVERED` list (both passes from 1a), not just user-prefixed entries. This catches tokens saved under any naming convention.
90
+ **Important:** Steps 3 and 4 search `$DISCOVERED_ALL`, not `$DISCOVERED`. Searching only the user-prefixed set is what makes setup ask for a credential the machine already holds under a name it did not recognise.
79
91
 
80
92
  **1d. Check preferences for existing mapping:**
81
93
 
@@ -115,7 +115,14 @@ For GitHub (special case):
115
115
 
116
116
  Update `prefs.global.keychainMapping.{service}` with the key name.
117
117
  Update `identity.servicePatMap.{service}` with the key name.
118
- Update `serviceStatus.{service} = { ok: true, checkedAt: <now> }`.
118
+
119
+ **Do not write `serviceStatus.{service}` here.** Saving a token is not evidence
120
+ that it works, and `ok: true` is read as evidence: `autopilot-arming.mjs`
121
+ refuses to arm on a recorded failure and treats an absent record as "not probed
122
+ yet", so a `true` written at save time is the one value that cannot be told
123
+ apart from a successful probe. A hosted service also has no host yet at this
124
+ point, so there is nothing to probe against. The probe belongs after Step 3.5,
125
+ where it is described.
119
126
 
120
127
  **→ Next: if `{service}` is `jira` / `confluence` / `bitbucket` / `fortify` / `graylog` AND the corresponding
121
128
  `prefs.global.hosts.{service}` is unset, run Step 3.5 (Host Prompt) inline before
@@ -145,7 +152,19 @@ Service host - needed to build API URLs for this token.
145
152
  {Service} host (e.g. jira.example.com): ___
146
153
  ```
147
154
 
148
- Save to `prefs.global.hosts.{service}`. For Fortify, also ask `Fortify project version ids (optional, comma-separated - e.g. 1234,5678)` → `prefs.global.fortify.versionIds`. A ticket naming only an instance id carries no version, so the lookup silently no-ops without these; URL-referenced findings resolve either way.
155
+ Save to `prefs.global.hosts.{service}`.
156
+
157
+ **Then probe once, and record what it says.** With the token saved and the host
158
+ known, run `bash "$HOME/.claude/lib/credential-inventory.sh" --key {service}`
159
+ and write `serviceStatus.{service} = { ok: <probe result>, checkedAt: <now> }`,
160
+ with `error` on a failure. A probe that cannot run at all - no host for a hosted
161
+ service, no network - writes nothing, because "I did not check" and "I checked
162
+ and it worked" are different answers and only one of them is true. A failure is
163
+ reported in one line and does not undo the save: the token is stored, the person
164
+ is told it did not answer, and the Expired-token decision in
165
+ `$HOME/.claude/multi-agent-refs/keychain.md` is what they run next.
166
+
167
+ For Fortify, also ask `Fortify project version ids (optional, comma-separated - e.g. 1234,5678)` → `prefs.global.fortify.versionIds`. A ticket naming only an instance id carries no version, so the lookup silently no-ops without these; URL-referenced findings resolve either way.
149
168
 
150
169
  For Jira, **discover the project keys instead of asking the user to recall them.** The token is already saved and the host is already known, so ask Jira which projects this person actually works in - a corporate instance has thousands of projects, and a typed key is a typo waiting to route branches and new issues at the wrong board:
151
170
 
@@ -7,14 +7,20 @@ publishes.
7
7
  ## Targets
8
8
 
9
9
  | # | Target | Path | Direction |
10
- |---|-------|-----|-----|
10
+ | --- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
11
11
  | 1 | Claude Code (source of truth) | `~/.claude/commands/multi-agent/` + `~/.claude/multi-agent-refs/` + `~/.claude/agents/` + `~/.claude/scripts/` + `~/.claude/lib/` | source |
12
- | 2 | Copilot CLI | `~/.copilot/copilot-instructions.md` + `~/.copilot/skills/` | <- from Claude |
12
+ | 2 | Copilot CLI | `~/.copilot/copilot-instructions.md` + `~/.copilot/skills/` + `~/.copilot/multi-agent-refs/` | <- from Claude (path-rewritten) |
13
13
  | 2b | Codex CLI | `~/.codex/AGENTS.md` + `~/.codex/skills/multi-agent/` + `~/.codex/multi-agent-refs/` + `~/.codex/agents/*.toml` | <- from Claude (path-rewritten) |
14
+ | 2c | Local model | `~/.codex-local/AGENTS.md` + `~/.codex-local/skills/multi-agent/` + `~/.codex-local/multi-agent-refs/` + `~/.codex-local/agents/*.toml` | <- from Claude (path-rewritten), only when the tree exists |
14
15
  | 3 | multi-agent-pipeline repo | `~/multi-agent-pipeline/pipeline/` | <- from Claude (genericized) |
15
16
  | 4 | Website | `{owner}/{website-host}` | <- version + features |
16
17
  | 5 | multi-agent MCP server | resolved from `prefs.global.devToolkit` or the `mcpServers` registration | own repo: gate, commit, publish |
17
18
 
19
+ A host tree that is not there is not created by a sync: installing a host is
20
+ `/multi-agent:setup`'s decision and the user's, and a sync that created one
21
+ would enrol a machine in a host nobody asked for. Target 2c is therefore
22
+ skipped, not failed, when `~/.codex-local` is absent.
23
+
18
24
  ## Sync rules (Claude <-> Copilot)
19
25
 
20
26
  1. **Read first** - understand every target's current state before making any change
@@ -34,7 +40,7 @@ publishes.
34
40
  ## Keychain Token Access
35
41
 
36
42
  | Operation | Token Source |
37
- |-------|---------------|
43
+ | --------------------------------- | ------------------------------------------------------------------------------------------------- |
38
44
  | `gh` CLI (personal) | `{owner}` gh auth (Keychain) |
39
45
  | `gh` CLI (work) | `{user}_<work-label>` gh auth (Keychain) - see `prefs.global.accounts[]` |
40
46
  | npm publish | `NODE_AUTH_TOKEN` - `GITHUB_TOKEN` in CI, Keychain PAT locally |
@@ -47,14 +53,14 @@ gh auth switch --user {owner} # for personal repos
47
53
  ## Website files (Step 4)
48
54
 
49
55
  | File | What to sync |
50
- |-------|--------------|
56
+ | ---------------------- | -------------------------------------------------------- |
51
57
  | `src/lib/i18n.tsx` | Phase count, model count, feature descriptions (EN + TR) |
52
58
  | `src/data/projects.ts` | Version number, tagline, description, feature list |
53
59
 
54
60
  ## Sub-command paths
55
61
 
56
62
  | Claude Code | Copilot CLI |
57
- |-------------|-------------|
63
+ | ----------------------------------------------- | ---------------------------------------------- |
58
64
  | `~/.claude/commands/multi-agent/{cmd}/SKILL.md` | `~/.copilot/skills/multi-agent-{cmd}/SKILL.md` |
59
65
 
60
66
  **Claude -> Copilot**: add SKILL.md frontmatter (`name`, `description`, `user-invocable: true`, `argument-hint`)
@@ -118,7 +118,7 @@ For each `TaskCreate` line `phase-tracker.sh tiles` prints, IN THAT ORDER:
118
118
  bash phase-tracker.sh meta 0 tasklist_id "<taskId>"
119
119
  ```
120
120
 
121
- **The subject is the tracker's line, verbatim.** `phase-tracker.sh tiles` prints each subject from the phase names the command registered (`0:Init 1:Plan 2:Dev 3:Review 4:Commit 5:Report` for a full run). Copy it as printed: no task-id prefix, no renamed, merged or annotated phase (`Analysis + Plan`, `Review + Verify`). What a phase does inside goes in `activeForm` or a sub-step tile, never in the phase name. A tile that disagrees with the tracker is a second, wrong progress record.
121
+ **The subject is the tracker's line, verbatim.** `phase-tracker.sh tiles` prints each subject from the phase names the command registered (`0:Init 1:Plan 2:Dev 3:Review 4:Commit 5:Report` for a full run) and, indented under each, that phase's sub-steps. Copy every row as printed, two leading spaces included: no task-id prefix, no renamed, merged or annotated phase (`Analysis + Plan`, `Review + Verify`). What a phase does inside goes in `activeForm` or a sub-step tile, never in the phase name. A tile that disagrees with the tracker is a second, wrong progress record.
122
122
 
123
123
  The `tasklist_id` meta field is persisted so that `:resume` can rebuild the TaskList from the state file in a fresh session. On Claude Code the `task-mirror.sh` PostToolUse hook records it from every phase tile's TaskCreate result, replacing an id an earlier session left (so a resume's new ids land too), and tells the model when a tile is created after a higher-numbered phase's tile in the same session. The explicit `meta` call stays in the pattern: it is what the other hosts have, and on Claude Code it writes the same value.
124
124
 
@@ -249,23 +249,49 @@ bash $HOME/.claude/scripts/phase-tracker.sh render
249
249
 
250
250
  ### Active phase - "what is it doing right now"
251
251
 
252
- **Claude Code** - `TaskUpdate({activeForm: ...})` updates the spinner header:
253
- ```text
254
- TaskUpdate({taskId: <dev_task>, activeForm: "Editing TopBarView.swift"})
255
- TaskUpdate({taskId: <dev_task>, activeForm: "Running xcodebuild test"})
256
- ```
257
-
258
- **Other CLIs** - the dedicated `now` action (quiet: writes `meta.Now`, never renders; the card picks it up at the next boundary render/update):
252
+ **Every host** - the `now` action, always, first. It is quiet: it writes
253
+ `meta.Now` and renders nothing, and the card picks it up at the next boundary.
259
254
  ```bash
260
255
  bash $HOME/.claude/scripts/phase-tracker.sh now 3 "editing TopBarView.swift"
261
256
  ```
262
257
 
263
- The `Now` value shows up in the bordered card as `Now: editing TopBarView.swift` (truncated to 60 chars by the script).
258
+ Writing it to the tracker is what makes the line outlive the moment. The
259
+ tracker is what the card renders, what the subject is composed from, what the
260
+ office reads and what the run's own report can look back at; a line that went
261
+ only to the host's spinner is gone the instant it is replaced, and nothing
262
+ afterwards can say what a phase was doing.
263
+
264
+ The lines themselves are not invented per run: `$HOME/.claude/schemas/now-lines.json`
265
+ carries a canonical set per phase, keyed by phase id, and naming the moments that
266
+ phase says something. Read the set for the phase that is running and write the
267
+ line that fits; skip the call when the text would repeat the last value. The call
268
+ is here and not in each phase document because six copies of it is six times the
269
+ context and six places to drift.
270
+
271
+ | Phase | Call |
272
+ |---|---|
273
+ | 0 Init | `bash "$HOME/.claude/scripts/phase-tracker.sh" now 0 "<line>"` |
274
+ | 1 Plan | `bash "$HOME/.claude/scripts/phase-tracker.sh" now 1 "<line>"` |
275
+ | 2 Dev | `bash "$HOME/.claude/scripts/phase-tracker.sh" now 2 "<line>"` |
276
+ | 3 Review | `bash "$HOME/.claude/scripts/phase-tracker.sh" now 3 "<line>"` |
277
+ | 4 Commit | `bash "$HOME/.claude/scripts/phase-tracker.sh" now 4 "<line>"` |
278
+ | 5 Report | `bash "$HOME/.claude/scripts/phase-tracker.sh" now 5 "<line>"` |
279
+
280
+ **Claude Code, additionally** - mirror the same text into the tile so the
281
+ spinner header carries it too:
282
+ ```text
283
+ TaskUpdate({taskId: <dev_task>, activeForm: "editing TopBarView.swift"})
284
+ ```
285
+
286
+ The `Now` value shows up in the bordered card as `Now: editing TopBarView.swift`
287
+ (truncated to 60 chars by the script) and at the end of that phase's subject.
288
+ When nothing has been set, the name of the in-progress sub-step fills the same
289
+ place, so the question "what is it doing" always has an answer.
264
290
 
265
291
  **Progress-line mirror (required).** Every `normal`-tier progress line from the progress contract's canonical "When to emit" set is ALSO mirrored to the active phase, so the tracker always answers "what is it doing right now":
266
292
 
267
- - Claude Code: `TaskUpdate({activeForm: "<line text, arrow prefix stripped>"})`
268
- - Other CLIs: `phase-tracker.sh now <N> "<line text, arrow prefix stripped>"`
293
+ - Every host: `phase-tracker.sh now <N> "<line text, arrow prefix stripped>"`
294
+ - Claude Code, additionally: `TaskUpdate({activeForm: "<the same text>"})`
269
295
 
270
296
  Throttling rules: mirror only canonical-set lines (`verbose`-tier internals are not mirrored); at most one mirror per emitted line; skip the mirror when the text is identical to the last mirrored value; the mirror itself never triggers a render. Text is truncated to 60 chars.
271
297
 
@@ -352,14 +378,31 @@ bash $HOME/.claude/scripts/phase-tracker.sh meta <N> "<key>" "<value>"
352
378
 
353
379
  Meta keys are overwritten - values update as the pipeline progresses.
354
380
 
355
- ### 7. Sub-phase (optional, e.g. Phase 1 explorers)
381
+ ### 7. Sub-steps - declared by the contract, moved by the phase
356
382
 
357
- There is no nested TaskList for sub-phases - sub-progress is reflected in `activeForm` plus a `sub` record in the state file.
383
+ Each phase declares its sub-steps in `schemas/phases.json` (`steps`), and
384
+ `phase-tracker.sh add` registers them, so a phase reaches the widget with
385
+ `<N>.1`, `<N>.2`, `<N>.3` already under it. A step registered from the contract
386
+ is a property of the phase set and reaches the widget whether or not the phase
387
+ later announces it; one a phase has to announce before it exists reaches the
388
+ widget only when that call is made.
389
+
390
+ There is no nested task list on any host. A sub-step is a row of its own,
391
+ indented two spaces inside the subject, and its number rides in that string
392
+ (` 3.2 Review panel`) because the widget renders one string per row and no
393
+ field beside it.
394
+
395
+ The phase moves its own steps as it reaches them, and registers one the contract
396
+ does not declare the same way:
358
397
 
359
398
  ```bash
360
399
  bash $HOME/.claude/scripts/phase-tracker.sh sub <N> <sub_id> "<sub name>" in_progress
361
400
  ```
362
401
 
402
+ Every `sub` prints a `-- NEXT (required) --` block with this host's mirror call,
403
+ exactly as `update` does. `activeForm` stays what it was - the live
404
+ current-action line inside the step, not a substitute for the row:
405
+
363
406
  ```text
364
407
  TaskUpdate({taskId: <phase_task>, activeForm: "Running explorer: repo-map"})
365
408
  ```
@@ -379,17 +422,18 @@ starts and finishes it.
379
422
 
380
423
  **A rebuild, not an append.** Creation order is the only ordering the native
381
424
  widget has - there is no parent field and no insert - so steps arriving at
382
- Phase 2 cannot be appended without landing after Phase 5. `tiles` detects that
383
- sub-steps exist and asks for the list to be deleted and recreated. That is one
384
- rebuild at one boundary, and it is the same thing Resume already does below for
385
- a different reason.
425
+ Phase 2 cannot be appended without landing after Phase 5. `plan` therefore ends
426
+ in `tiles --rebuild`, which asks for the list to be deleted and recreated. That
427
+ is one rebuild at one boundary, and it is the same thing Resume already does
428
+ below for a different reason. Every other phase's steps are registered by `add`
429
+ before any tile exists, so they go out with the first batch and cost no rebuild.
386
430
 
387
431
  **Per host, with what each one actually has:**
388
432
 
389
433
  | Host | How the plan arrives | Dependencies |
390
434
  |---|---|---|
391
435
  | Claude Code | `TaskCreate` per row, the steps indented inside the subject string | `TaskUpdate(..., addBlockedBy: [...])`, a second pass because a tile cannot be blocked by one that does not exist yet |
392
- | Codex | `update_plan` re-read from `subjects`, which now includes the steps | No dependency concept. The `(bekliyor: t1)` suffix inside the step text is where that survives |
436
+ | Codex | `update_plan` re-read from `tiles`, whose payload carries the steps as plan steps of their own | No dependency concept. The `(waiting on: t1)` suffix inside the step text is where that survives |
393
437
  | Copilot CLI | The card, which has drawn sub-phases with tree glyphs since they existed | Same suffix, on the card row |
394
438
 
395
439
  The dependency lines name tiles by their subject, never by the plan's own `t1` /
@@ -429,8 +473,8 @@ of it is harmless: the second write sets the same values.
429
473
 
430
474
  When `/multi-agent:resume <task_id>` is called:
431
475
  1. The state file is loaded and the phase list is read.
432
- 2. `TaskCreate` is called again for every phase (new task IDs are issued for the new session).
433
- 3. Each phase's status is re-applied via `TaskUpdate` based on the state file.
476
+ 2. `TaskCreate` is called again for every row `phase-tracker.sh tiles` prints, sub-steps included (new task IDs are issued for the new session).
477
+ 3. Each row's status is re-applied via `TaskUpdate` based on the state file.
434
478
  4. The active phase is determined and the agent picks up where it left off.
435
479
 
436
480
  The `tasklist_id` meta from the previous session is replaced with the new IDs during resume.