@mmerterden/multi-agent-pipeline 23.6.0 → 24.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 (167) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/README.md +61 -27
  3. package/README.tr.md +46 -12
  4. package/SECURITY.md +3 -3
  5. package/docs/architecture.md +47 -8
  6. package/docs/ecosystem.md +20 -18
  7. package/docs/engineering.md +1 -1
  8. package/docs/facts.json +8 -6
  9. package/docs/features.md +59 -15
  10. package/install/_codex-agents.mjs +13 -8
  11. package/install/_common.mjs +24 -0
  12. package/install/_dev-only-files.mjs +4 -0
  13. package/install/_mcp-register.mjs +6 -2
  14. package/install/_rewrite-tree.mjs +197 -0
  15. package/install/codex.mjs +96 -180
  16. package/install/copilot.mjs +24 -54
  17. package/install/index.mjs +29 -11
  18. package/install/templates/codex-instructions.md +21 -5
  19. package/install/templates/copilot-instructions.md +21 -14
  20. package/manifest.json +2082 -0
  21. package/package.json +6 -2
  22. package/pipeline/commands/multi-agent/SKILL.md +7 -5
  23. package/pipeline/commands/multi-agent/analysis/SKILL.md +4 -0
  24. package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +31 -3
  25. package/pipeline/commands/multi-agent/autopilot-status/SKILL.md +5 -1
  26. package/pipeline/commands/multi-agent/channels/SKILL.md +16 -8
  27. package/pipeline/commands/multi-agent/log/SKILL.md +2 -0
  28. package/pipeline/commands/multi-agent/resume/SKILL.md +2 -0
  29. package/pipeline/commands/multi-agent/review-rounds/SKILL.md +94 -0
  30. package/pipeline/commands/multi-agent/stack/SKILL.md +1 -1
  31. package/pipeline/commands/multi-agent/sync/SKILL.md +3 -3
  32. package/pipeline/contract/manifest.json +1 -1
  33. package/pipeline/contract/types/index.d.ts +1 -0
  34. package/pipeline/lib/_jira-auth.sh +50 -78
  35. package/pipeline/lib/_service-account.sh +191 -0
  36. package/pipeline/lib/credential-inventory.sh +49 -37
  37. package/pipeline/lib/credential-store.sh +48 -3
  38. package/pipeline/lib/fetch-confluence.sh +76 -92
  39. package/pipeline/lib/fetch-crashlytics.sh +30 -59
  40. package/pipeline/lib/fetch-figma-annotations.sh +9 -9
  41. package/pipeline/lib/fetch-fortify.sh +77 -81
  42. package/pipeline/lib/fetch-graylog.sh +38 -77
  43. package/pipeline/lib/figma-mcp-refresh.sh +23 -4
  44. package/pipeline/lib/figma-screenshot.sh +7 -8
  45. package/pipeline/lib/figma-token.sh +39 -46
  46. package/pipeline/lib/host.mjs +138 -0
  47. package/pipeline/lib/host.sh +48 -0
  48. package/pipeline/lib/issue-fetcher.sh +25 -41
  49. package/pipeline/lib/jira-publish.sh +23 -21
  50. package/pipeline/lib/local-model.mjs +93 -0
  51. package/pipeline/lib/md2confluence-v3.py +37 -30
  52. package/pipeline/lib/model-dispatch.sh +41 -4
  53. package/pipeline/lib/model-resolve.mjs +58 -0
  54. package/pipeline/lib/post-pr-review.sh +38 -53
  55. package/pipeline/lib/reviewer-families.mjs +70 -0
  56. package/pipeline/lib/service-account.mjs +2131 -0
  57. package/pipeline/lib/service-account.sh +35 -0
  58. package/pipeline/lib/usage-names.generated.mjs +3 -0
  59. package/pipeline/lib/usage-token.mjs +64 -24
  60. package/pipeline/lib/usage-vocab.mjs +1 -1
  61. package/pipeline/lib/user-facing.mjs +11 -3
  62. package/pipeline/lib/vercel-deploy.sh +17 -26
  63. package/pipeline/multi-agent-refs/_entry-picker.md +62 -0
  64. package/pipeline/multi-agent-refs/_input-parser.md +1 -1
  65. package/pipeline/multi-agent-refs/analysis/intake.md +2 -0
  66. package/pipeline/multi-agent-refs/analysis/reusable-refs.md +1 -0
  67. package/pipeline/multi-agent-refs/analysis/unattended.md +135 -0
  68. package/pipeline/multi-agent-refs/autopilot-on/details.md +16 -0
  69. package/pipeline/multi-agent-refs/channels/generator.md +10 -2
  70. package/pipeline/multi-agent-refs/channels/menu.md +3 -1
  71. package/pipeline/multi-agent-refs/channels/preview.md +3 -1
  72. package/pipeline/multi-agent-refs/channels/reference.md +16 -2
  73. package/pipeline/multi-agent-refs/channels/report-file.md +188 -0
  74. package/pipeline/multi-agent-refs/component-dispatch.md +2 -2
  75. package/pipeline/multi-agent-refs/cross-cli-contract.md +38 -30
  76. package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +4 -4
  77. package/pipeline/multi-agent-refs/features/doctor.md +37 -11
  78. package/pipeline/multi-agent-refs/features/free-models.md +3 -3
  79. package/pipeline/multi-agent-refs/features/local-model.md +87 -0
  80. package/pipeline/multi-agent-refs/features/model-fallback.md +25 -10
  81. package/pipeline/multi-agent-refs/features/product-context.md +6 -5
  82. package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
  83. package/pipeline/multi-agent-refs/features/review-rounds.md +40 -0
  84. package/pipeline/multi-agent-refs/features/rework-escalation.md +5 -4
  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 +31 -2
  88. package/pipeline/multi-agent-refs/help/tr.md +31 -2
  89. package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +3 -2
  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/operations.md +1 -1
  93. package/pipeline/multi-agent-refs/phases/phase-0-init.md +1 -1
  94. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +4 -4
  95. package/pipeline/multi-agent-refs/phases/phase-3-review.md +7 -3
  96. package/pipeline/multi-agent-refs/phases/phase-5-report.md +12 -10
  97. package/pipeline/multi-agent-refs/phases.md +4 -3
  98. package/pipeline/multi-agent-refs/resume/details.md +2 -0
  99. package/pipeline/multi-agent-refs/review/panel.md +30 -18
  100. package/pipeline/multi-agent-refs/setup/discovery.md +17 -5
  101. package/pipeline/multi-agent-refs/setup/token-save-flow.md +21 -2
  102. package/pipeline/multi-agent-refs/sync/overview.md +11 -5
  103. package/pipeline/multi-agent-refs/tracker-contract.md +28 -10
  104. package/pipeline/office/index.html +4 -4
  105. package/pipeline/schemas/agent-state.schema.json +19 -1
  106. package/pipeline/schemas/autopilot-config.schema.json +29 -4
  107. package/pipeline/schemas/hosts.json +512 -0
  108. package/pipeline/schemas/hosts.schema.json +310 -0
  109. package/pipeline/schemas/launch.json +22 -2
  110. package/pipeline/schemas/launch.schema.json +2 -1
  111. package/pipeline/schemas/phases.json +21 -3
  112. package/pipeline/schemas/phases.schema.json +8 -0
  113. package/pipeline/schemas/prefs.schema.json +346 -7
  114. package/pipeline/schemas/token-budget.json +2 -2
  115. package/pipeline/scripts/.doctor-mut.47076.mjs +2253 -0
  116. package/pipeline/scripts/_autopilot-config.mjs +67 -4
  117. package/pipeline/scripts/_autopilot-item.mjs +67 -0
  118. package/pipeline/scripts/_autopilot-outcomes.mjs +6 -0
  119. package/pipeline/scripts/_cost.mjs +75 -3
  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 +16 -13
  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 +146 -38
  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/report-file.mjs +285 -0
  145. package/pipeline/scripts/review-rounds.mjs +592 -0
  146. package/pipeline/scripts/rework-escalation.mjs +26 -7
  147. package/pipeline/scripts/service-read.mjs +19 -17
  148. package/pipeline/scripts/skill-siblings.mjs +17 -1
  149. package/pipeline/scripts/status-overview.mjs +20 -10
  150. package/pipeline/scripts/uninstall.mjs +145 -57
  151. package/pipeline/scripts/usage-register.mjs +34 -11
  152. package/pipeline/scripts/usage-report.mjs +31 -26
  153. package/pipeline/scripts/validate-state.mjs +19 -11
  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 +11 -7
  158. package/pipeline/skills/.skills-index.json +13 -2
  159. package/pipeline/skills/shared/README.md +4 -3
  160. package/pipeline/skills/shared/core/multi-agent/SKILL.md +14 -6
  161. package/pipeline/skills/shared/core/multi-agent-analysis/SKILL.md +2 -0
  162. package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +11 -8
  163. package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +1 -1
  164. package/pipeline/skills/shared/core/multi-agent-review-rounds/SKILL.md +92 -0
  165. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
  166. package/pipeline/skills/skills-index.md +2 -1
  167. package/pipeline/lib/credential-resolve.mjs +0 -75
@@ -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
 
@@ -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
 
@@ -105,6 +105,8 @@ A run that stopped mid-phase to ask a human has `currentPhase` pointing at the p
105
105
  | `question` | The step `state.pendingQuestion.stepId` names, after the answer is recorded ("Answering a parked question") |
106
106
  | absent or `null` | `currentPhase + 1` (same pipeline as the main multi-agent command) |
107
107
 
108
+ A decided rework that was not finished is not a wait for a person, so it has no `waitingFor`: `state.phases["2"].reworkForIteration` equal to the number of `reviewIterations` means `review-rounds.mjs next` recorded a rework for the latest review and no later review exists. Resume re-enters the Phase 2 rework on that review's triage and never runs Phase 3 Step 4 again (a repeated Step 4 answers `rework` without counting it twice).
109
+
108
110
  A `waitingFor` that outlives the question it asked sends every later resume back to the step the user already answered, which is why it is cleared in the same write that records the answer.
109
111
 
110
112
  ## Untracked context
@@ -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
 
@@ -352,14 +352,31 @@ bash $HOME/.claude/scripts/phase-tracker.sh meta <N> "<key>" "<value>"
352
352
 
353
353
  Meta keys are overwritten - values update as the pipeline progresses.
354
354
 
355
- ### 7. Sub-phase (optional, e.g. Phase 1 explorers)
355
+ ### 7. Sub-steps - declared by the contract, moved by the phase
356
356
 
357
- There is no nested TaskList for sub-phases - sub-progress is reflected in `activeForm` plus a `sub` record in the state file.
357
+ Each phase declares its sub-steps in `schemas/phases.json` (`steps`), and
358
+ `phase-tracker.sh add` registers them, so a phase reaches the widget with
359
+ `<N>.1`, `<N>.2`, `<N>.3` already under it. A step registered from the contract
360
+ is a property of the phase set and reaches the widget whether or not the phase
361
+ later announces it; one a phase has to announce before it exists reaches the
362
+ widget only when that call is made.
363
+
364
+ There is no nested task list on any host. A sub-step is a row of its own,
365
+ indented two spaces inside the subject, and its number rides in that string
366
+ (` 3.2 Review panel`) because the widget renders one string per row and no
367
+ field beside it.
368
+
369
+ The phase moves its own steps as it reaches them, and registers one the contract
370
+ does not declare the same way:
358
371
 
359
372
  ```bash
360
373
  bash $HOME/.claude/scripts/phase-tracker.sh sub <N> <sub_id> "<sub name>" in_progress
361
374
  ```
362
375
 
376
+ Every `sub` prints a `-- NEXT (required) --` block with this host's mirror call,
377
+ exactly as `update` does. `activeForm` stays what it was - the live
378
+ current-action line inside the step, not a substitute for the row:
379
+
363
380
  ```text
364
381
  TaskUpdate({taskId: <phase_task>, activeForm: "Running explorer: repo-map"})
365
382
  ```
@@ -379,17 +396,18 @@ starts and finishes it.
379
396
 
380
397
  **A rebuild, not an append.** Creation order is the only ordering the native
381
398
  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.
399
+ Phase 2 cannot be appended without landing after Phase 5. `plan` therefore ends
400
+ in `tiles --rebuild`, which asks for the list to be deleted and recreated. That
401
+ is one rebuild at one boundary, and it is the same thing Resume already does
402
+ below for a different reason. Every other phase's steps are registered by `add`
403
+ before any tile exists, so they go out with the first batch and cost no rebuild.
386
404
 
387
405
  **Per host, with what each one actually has:**
388
406
 
389
407
  | Host | How the plan arrives | Dependencies |
390
408
  |---|---|---|
391
409
  | 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 |
410
+ | 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
411
  | Copilot CLI | The card, which has drawn sub-phases with tree glyphs since they existed | Same suffix, on the card row |
394
412
 
395
413
  The dependency lines name tiles by their subject, never by the plan's own `t1` /
@@ -429,8 +447,8 @@ of it is harmless: the second write sets the same values.
429
447
 
430
448
  When `/multi-agent:resume <task_id>` is called:
431
449
  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.
450
+ 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).
451
+ 3. Each row's status is re-applied via `TaskUpdate` based on the state file.
434
452
  4. The active phase is determined and the agent picks up where it left off.
435
453
 
436
454
  The `tasklist_id` meta from the previous session is replaced with the new IDs during resume.