@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
package/docs/ecosystem.md CHANGED
@@ -4,7 +4,7 @@ This pipeline is not one repo. It's three, each owned separately, each versioned
4
4
  separately, wired together at install time and at run time:
5
5
 
6
6
  | Repo | What it owns | Ships as |
7
- |---|---|---|
7
+ | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
8
8
  | **`multi-agent-pipeline`** (this repo) | Orchestration: the <!-- fact:phaseCount -->6<!-- /fact -->-phase flow, the <!-- fact:commandCount -->81<!-- /fact --> slash commands, quality gates, review/triage, cross-CLI parity | npm package (`@mmerterden/multi-agent-pipeline`), installs itself onto Claude Code / Copilot CLI / Codex CLI |
9
9
  | **`multi-agent-plugins`** | Stack knowledge: per-platform component/lifecycle skills (iOS, Android, Frontend, Backend) + shared knowledge | Claude Code marketplace, 6 independently-versioned plugins |
10
10
  | **`multi-agent-mcp`** | The pipeline's hands on devices and browsers: <!-- fact:toolCount -->267<!-- /fact --> MCP tools across <!-- fact:toolFamilyCount -->25<!-- /fact --> families (simulator/emulator control, end-to-end locators and assertions, memory, crash diagnostics, accessibility audit, store compliance and listing lint, web automation and scraping, Figma-vs-mock design audit with contrast checks, code intelligence, a code graph, a learnings ledger, wallet passes, an agent-DSL batch runner, a full-text context index with text-to-image rendering, provider-backed and community research, opt-in social reading, verified hand-off of simple text tasks to free models, video key frames and transcripts, offline security scoring with evidence checks, SARIF export and MCP config launch-selector audits, read-only access to related repositories at their latest branch, travel document fixtures, a voice channel, App Store Connect and Play Console APIs, virtual iPhones, offline facts about builds you own) | npm package, registered as a standard stdio MCP server on every host |
@@ -91,10 +91,10 @@ graph TD
91
91
  style DTK2 fill:#dff,stroke:#333,stroke-dasharray: 5 5
92
92
  ```
93
93
 
94
- **Why `multi-agent-mcp` is drawn differently.** The other five targets are *derived*
94
+ **Why `multi-agent-mcp` is drawn differently.** The other five targets are _derived_
95
95
  from the Claude Code source - sync writes their content. `multi-agent-mcp` is not:
96
96
  it's a separate codebase developed on its own schedule. Sync's Step 3d only
97
- *detects* whether it moved (dirty tree, unpushed commits, untagged version), runs
97
+ _detects_ whether it moved (dirty tree, unpushed commits, untagged version), runs
98
98
  **its own** gate suite, and ships it - commit, tag, staged publish (section 6). If the pipeline
99
99
  needs a tool that toolkit doesn't have yet, that's a two-repo change: add the tool
100
100
  in `multi-agent-mcp`, ship it, then bump the minimum version pin back in
@@ -104,7 +104,7 @@ in `multi-agent-mcp`, ship it, then bump the minimum version pin back in
104
104
  only rebuilds each plugin's `knowledge/` folder from `pipeline/skills/shared/external/`.
105
105
  The plugins' lifecycle skills - `create-component`, `evolve-component`,
106
106
  `figma-utility`, `code-connect`, `branch-and-pr`, `fix-bug`, and the rest - are
107
- hand-authored *inside* `multi-agent-plugins` and are never touched by sync.
107
+ hand-authored _inside_ `multi-agent-plugins` and are never touched by sync.
108
108
 
109
109
  ---
110
110
 
@@ -154,18 +154,19 @@ running in a consumer's session.
154
154
 
155
155
  ---
156
156
 
157
- ## 3. Per-host delivery: the same three repos, three different shapes
157
+ ## 3. Per-host delivery: the same three repos, four different shapes
158
158
 
159
159
  The three repos land differently on each host, because each host's skill-loading
160
160
  behavior is different (see `pipeline/multi-agent-refs/cross-cli-contract.md` for the
161
161
  measurements behind this table):
162
162
 
163
- | | Claude Code | Copilot CLI | Codex CLI |
164
- |---|---|---|---|
165
- | **Pipeline commands** | <!-- fact:commandCount -->81<!-- /fact --> slash-command skills, native | <!-- fact:commandCount -->81<!-- /fact --> sub-command skills, `multi-agent-{cmd}` naming, copied in | 1 router skill (`multi-agent`) + <!-- fact:commandCount -->81<!-- /fact --> command specs as reference files - Codex silently truncates its skills block past a few dozen entries, so sub-commands are not peer skills here |
166
- | **Stack plugins** | Marketplace plugin, loaded natively, resolved by `.claude/settings.json` enabled-list | Enabled plugin's authored skills copied flat into `~/.copilot/skills/`; `knowledge/` **not** re-copied (already delivered via `shared/external`) | Copied as reference files under `~/.codex/multi-agent-refs/skills/`, plugin-prefixed on name clash (e.g. `architecture` → `ai-ios-toolkit-architecture`) |
167
- | **Component dispatch (Phase 3)** | Marketplace plugin's `create-component`/`create-screen` skill via the Skill tool | No plugin loader - the enabled stack plugin's authored skills (incl. `create-component`) are copied flat into `~/.copilot/skills/` at install time (the old frozen `figma-*` copies are pruned, they were never a fallback) | Not part of the enforced parity axis; classification + state-shape must match, skill *inventory* does not |
168
- | **multi-agent-mcp** | `claude mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` | `copilot mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` | `codex mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` (skipped with a warning if `codex` isn't on `PATH`) |
163
+ | | Claude Code | Copilot CLI | Codex CLI | Local model |
164
+ | ---- | ---- | ---- | ---- | ---- |
165
+ | **Pipeline commands** | <!-- fact:commandCount -->81<!-- /fact --> slash-command skills, native | <!-- fact:commandCount -->81<!-- /fact --> sub-command skills, `multi-agent-{cmd}` naming, copied in | 1 router skill (`multi-agent`) + <!-- fact:commandCount -->81<!-- /fact --> command specs as reference files - Codex silently truncates its skills block past a few dozen entries, so sub-commands are not peer skills here | 1 router skill + <!-- fact:commandCount -->81<!-- /fact --> command specs as reference files, the Codex shape in `~/.codex-local/` |
166
+ | **Pipeline refs** (phase specs, contracts, standalone command specs) | `~/.claude/multi-agent-refs/` | `~/.copilot/multi-agent-refs/`, with every ref path retargeted into it, so a Copilot-only machine resolves them on its own; the per-sub-command specs are not copied there, because each already ships as its own skill and the rewrite points at those | `~/.codex/multi-agent-refs/`, including the per-sub-command specs, which the router reads by path | `~/.codex-local/multi-agent-refs/`, the same tree as Codex CLI with the root rewritten |
167
+ | **Stack plugins** | Marketplace plugin, loaded natively, resolved by `.claude/settings.json` enabled-list | Enabled plugin's authored skills copied flat into `~/.copilot/skills/`; `knowledge/` **not** re-copied (already delivered via `shared/external`) | Copied as reference files under `~/.codex/multi-agent-refs/skills/`, plugin-prefixed on name clash (e.g. `architecture` → `ai-ios-toolkit-architecture`) | Copied as reference files under `~/.codex-local/multi-agent-refs/skills/`, as on Codex CLI |
168
+ | **Component dispatch (Phase 3)** | Marketplace plugin's `create-component`/`create-screen` skill via the Skill tool | No plugin loader - the enabled stack plugin's authored skills (incl. `create-component`) are copied flat into `~/.copilot/skills/` at install time (the old frozen `figma-*` copies are pruned, they were never a fallback) | Not part of the enforced parity axis; classification + state-shape must match, skill _inventory_ does not | Same as Codex CLI: classification and state shape match, skill inventory does not |
169
+ | **multi-agent-mcp** | `claude mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` | `copilot mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` | `codex mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` (skipped with a warning if `codex` isn't on `PATH`) | Registered against this host's own home, so the engine's Codex install is left alone |
169
170
 
170
171
  `smoke-cross-cli-behavior.sh` and `smoke-codex-install.sh` gate the axes that **do**
171
172
  have to match (phase labels, placeholder vocabulary, output schemas, command↔skill
@@ -240,6 +241,7 @@ Detail: [`unattended-security.md`](../pipeline/multi-agent-refs/features/unatten
240
241
  ### multi-agent-mcp's tools, by category
241
242
 
242
243
  <!-- fact:toolCount -->267<!-- /fact --> tools in <!-- fact:toolFamilyCount -->25<!-- /fact --> families, counted from the server's own `tools/list` response
244
+
243
245
  at toolkit <!-- fact:toolkitVersion -->4.5.0<!-- /fact --> rather than from a README. Three families are defined in
244
246
  modules the main file only spreads in, so a count taken from the source reads
245
247
  low; the response is the only place the whole surface appears at once. A
@@ -267,7 +269,7 @@ it are in [`toolkit-tools.md`](../pipeline/multi-agent-refs/toolkit-tools.md), w
267
269
  `lint-mcp-refs.mjs` holds to the live list.
268
270
 
269
271
  | Family | Primary pipeline consumers |
270
- |---|---|
272
+ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
271
273
  | `ios` | Simulator control, UI tree, crash sweep (`ios_list_crashes`), leaks, accessibility audits, archive and App Store audits, `ios_testflight_validate`, `ios_xcodebuild` / `ios_xcresult`, `ios_visual_diff`: `/multi-agent:test`, `test-dark-mode`, `test-accessibility`, `test-dynamic-type`, `test-screenshots`, `manual-test`, `sim-test`, `design-check`, `store-ready`, `testflight-validation` |
272
274
  | `web` | frontend-stack UI testing (via `test`) and the `e2e-testing` skill: snapshot `ref` targeting and `web_find`, console/network capture, request mocking, offline, clock, dialogs, uploads, traces, ARIA assertions; `web_scrape` for Phase 1 `generic-doc` links; sitemap-aware `web_map` and `web_crawl` with `llms.txt` |
273
275
  | `android` | Emulator control, UI tree, crash sweep, `android_meminfo`, accessibility and APK audits, launch time: the same test commands as `ios` on Android |
@@ -312,7 +314,7 @@ it are in [`toolkit-tools.md`](../pipeline/multi-agent-refs/toolkit-tools.md), w
312
314
  `npm publish`) without a pipeline release, as long as pinned tools keep their
313
315
  contract.
314
316
  - **Neither boundary is symmetric.** The pipeline depends on both other repos being
315
- present *for specific task types* (component work, UI testing) but functions
317
+ present _for specific task types_ (component work, UI testing) but functions
316
318
  without either - a non-component bugfix task never touches the plugin marketplace,
317
319
  and a task with no UI-testing step never opens the MCP connection.
318
320
 
package/docs/facts.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "Generated by pipeline/scripts/gen-facts.mjs. Do not hand-edit: the site reads this, and a number edited here instead of at its source is the drift this file removes.",
3
- "generatedAt": "2026-11-13",
4
- "version": "23.7.0",
3
+ "generatedAt": "2026-11-17",
4
+ "version": "24.1.0",
5
5
  "phaseSchema": 2,
6
6
  "phases": [
7
7
  {
@@ -33,7 +33,8 @@
33
33
  "modes": {
34
34
  "full": [0, 1, 2, 3, 4, 5],
35
35
  "autopilot": [0, 1, 2, 3, 4, 5],
36
- "analysis": [0, 1, 2, 3, 4, 5]
36
+ "analysis": [0, 1, 2, 3, 4, 5],
37
+ "analysis-autopilot": [0, 1, 2, 3, 4, 5]
37
38
  },
38
39
  "reworkCap": 3,
39
40
  "reworkDefault": 2,
@@ -41,7 +42,7 @@
41
42
  "skillCount": 174,
42
43
  "skillCountAll": 258,
43
44
  "agentCount": 11,
44
- "hosts": ["Claude Code", "Codex CLI", "Copilot CLI"],
45
+ "hosts": ["Claude Code", "Codex CLI", "Copilot CLI", "Local model"],
45
46
  "toolCount": 267,
46
47
  "toolCategories": {
47
48
  "ios": 42,
package/docs/features.md CHANGED
@@ -5,6 +5,7 @@ Comprehensive list of every feature the pipeline ships. The top-level `README.md
5
5
  ## Contents
6
6
 
7
7
  - [Core Pipeline](#core-pipeline)
8
+ - [Hosts](#hosts)
8
9
  - [PR & Review Flow](#pr--review-flow)
9
10
  - [Review Quality](#review-quality)
10
11
  - [Autopilot (unattended)](#autopilot-unattended)
@@ -30,7 +31,8 @@ Phase 2: Dev TDD cycle: test → code → build (Sonnet), then the Verify
30
31
  Phase 3: Review Parallel AI review + Fable triage against Dev's logs, then the
31
32
  optional user test + on-demand device audits
32
33
  (Claude Code: Fable + Opus + Sonnet, or Opus + Sonnet with the
33
- fable rung off · Copilot CLI: GPT-5.4 + Opus + Sonnet)
34
+ fable rung off · Copilot CLI: GPT-5.4 + Opus + Sonnet
35
+ · Codex CLI: gpt-5.6 and gpt-5.4, separated by effort)
34
36
  Phase 4: Commit Git commit, push, PR with default reviewers + draft/ready prompt
35
37
  Phase 5: Report External: Jira comment · Wiki + Figma screenshots · Confluence
36
38
  Internal: agent-log.md + Quality & Metrics + knowledge + memory
@@ -41,13 +43,29 @@ Each phase reads its own spec file under `pipeline/multi-agent-refs/phases/phase
41
43
  ### Modifier Flag
42
44
 
43
45
  | Flag | Effect |
44
- | ----------- | ----------------------------------------------------------------------------------- |
46
+ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45
47
  | `autopilot` | Skip all confirmation prompts; still fails safe on review blockers + build retries. Also resolves the workspace to a worktree without asking, and turns on the verification gates described under [Autopilot (unattended)](#autopilot-unattended). |
46
48
 
47
49
  The workspace is not a flag. **Where the branch lives** is asked at Phase 0 Step 5b - worktree (`.worktrees/{id}/`, your checkout untouched) or local (the project root, which drops the user-test offer because that gate checks the change out of a worktree and there is none). There is no `:local` command and no `--local` switch: an answer given in the run is visible in the run, where a flag is visible only in how the run was typed. Every autopilot entry resolves it to a worktree and never asks, because an unattended run commits and pushes from wherever it stands and doing that in the user's own checkout is what worktrees exist to prevent. `state.workspaceSource` records who decided - `localMode: false` alone is both "the user chose a worktree" and "nothing asked".
48
50
 
49
51
  There is one pipeline: every mode runs its whole phase set, and no answer during the run adds or removes a phase.
50
52
 
53
+ ### Bare Invocation Asks
54
+
55
+ `/multi-agent` and `/multi-agent:analysis` are argument-shaped - a tracker key, a URL, `repo#N`, free text, a sub-command - and typed with nothing after them they ask for the parameter instead of printing the guide. `scripts/entry-mode.mjs` decides, and prints one word: `typed` (arguments were given, route them exactly as before), `picker` (ask), `usage` (a modifier with no task, such as `autopilot` or `--loop 3` on its own, where asking would silently drop the modifier and send the run interactive) or `refuse-unattended` (nothing was given and nobody is there to answer, so the run stops in one line rather than waiting out a timeout having produced nothing). The decision is a script rather than prose because the four answers have to come out the same on every host. `multi-agent-refs/_entry-picker.md` is the one page both hosts read for what to do with each answer: `/multi-agent` offers tracker items, unassigned issues, a one-line description or the guide, and `/multi-agent:analysis` offers a new analysis or checking, refreshing or conforming a named document. The picker replaces no step - account, maturity and dev-context still run after it - and autopilot and every typed form are unchanged.
56
+
57
+ ### Phase Sub-Steps on the Progress Widget
58
+
59
+ Each phase declares its own sub-steps in `schemas/phases.json` (`steps`), and `phase-tracker.sh add` registers them with the host's progress widget, so a run reaches its first boundary already showing `0.1 Intake`, `0.2 Workspace` and `0.3 Task contract` under Phase 0, and the same three-row shape under Plan (Context, Exploration, Task breakdown), Review (Gates, Review panel, Triage), Commit (Commit, Push, Pull request) and Report (Channels dispatch, Log + telemetry, Knowledge + memory). Dev declares none: its sub-steps are Phase 1's plan tasks, which the approved plan attaches. The number rides inside the row text, because the widget renders one string per row and carries no field beside it.
60
+
61
+ ### What a Working Phase Says
62
+
63
+ A phase that is working carries, in one line, which model is spending, how long it has been going, its tokens, roughly what they cost, which step of how many, and what it is doing right now: `Phase 3 Review - fable - 26s - 14.4k tok - ~$0.22 - step 1/3 - review in progress: 3 reviewers`. The action comes from `schemas/now-lines.json`, a canonical set of lines per phase, rather than from whatever a model chose to type; a phase that moved without writing one falls back to the name of its own step in progress. The call itself is one table in `multi-agent-refs/tracker-contract.md`, not a block repeated in six loadable documents, and `scripts/lint-now-lines.mjs` holds the set and that table to each other.
64
+
65
+ The subject is composed rather than remembered, and it has a ceiling of 96 characters because a task subject travels through surfaces that are not a terminal. When it will not fit, the segments are given up in a fixed order - the cost first, since it returns when the phase completes; then the action, down to a floor below which shortening it says nothing; then the tokens; then the model - and the phase, its elapsed time and its step counter are never dropped. The card carries the same facts with a model column, for the hosts that have no widget, and the office page shows them per phase from the same record.
66
+
67
+ At the end of a run `scripts/render-work-summary.sh --format terminal` prints a plain summary: what changed, what was checked, what was delivered and what is left for you. It renders from the same collection as the markdown block a channel carries, so the two cannot disagree.
68
+
51
69
  ### Outside a Pipeline Run
52
70
 
53
71
  The install is not only useful while `/multi-agent` is running. `rules/outside-the-pipeline.md` loads with every session and announces three things a plain conversation would otherwise not know it had:
@@ -77,7 +95,7 @@ Measured on 230 held-out bug fixes from eight repositories, the screen layer did
77
95
  ### Stack Auto-Detection
78
96
 
79
97
  | Platform | Detection | Guide Loaded |
80
- | -------------- | -------------------------------------------- | ------------------------ |
98
+ | -------------- | -------------------------------------------- | ----------------------- |
81
99
  | iOS/Swift | `.xcodeproj`, `Package.swift` | `refs/swiftui-guide.md` |
82
100
  | Android/Kotlin | `build.gradle[.kts]` | `refs/android-guide.md` |
83
101
  | Backend | `requirements.txt`, `package.json`, `go.mod` | `refs/backend-guide.md` |
@@ -146,7 +164,7 @@ Phase 0 Step 9 classifies every task before Phase 1 starts. Deterministic priori
146
164
  Result persisted to `agent-state.taskType`:
147
165
 
148
166
  | Type | Downstream effects |
149
- | ----------- | ----------------------------------------------------------------------------- |
167
+ | ----------- | ------------------------------------------------------------------------------------------------- |
150
168
  | `component` | Phase 2 dispatches to the marketplace component plugin (create-component) with SubPhase reporting |
151
169
  | `bugfix` | Phase 3 emphasizes test coverage + regression; Phase 4 uses `fix(...)` prefix |
152
170
  | `feature` | Standard TDD flow; Phase 4 uses `feat(...)` prefix |
@@ -157,6 +175,29 @@ Result persisted to `agent-state.taskType`:
157
175
 
158
176
  When a specialized skill takes over a main pipeline phase, progress is reported as SubPhases (e.g. `SubPhase 3.0: Init`, `SubPhase 3.1: Gather`). The top-level pipeline stays fixed at <!-- fact:phaseCount -->6<!-- /fact --> phases (0-5) - specialized work slots into its parent phase without inflating the count.
159
177
 
178
+ ## Hosts
179
+
180
+ ### Host Registry
181
+
182
+ Every host is one record in `pipeline/schemas/hosts.json`, checked against `hosts.schema.json`, and that record is the only place a host differs. It carries the install flag and root, the subtrees installed under it, where the sub-command specs live and what prefixes them, the path rewrites from the authored tree to that host's shape, the model rung table and how a rung binds, the review panel and triage slot, the dispatch mechanism and its model and effort arguments, how many children may run at once, the price ceiling the cost ledger uses, the headless argv, the session-usage format and whether the network is required. `lib/host.mjs` and `lib/host.sh` are the readers; `lib/model-resolve.mjs` resolves a rung through it, `lib/reviewer-families.mjs` takes the panel from it, and `scripts/gen-host-tables.mjs` renders the dispatch and panel tables into `multi-agent-refs/review/panel.md` and `multi-agent-refs/features/model-fallback.md`, with a `--check` mode that fails when a rendered table and the registry disagree.
183
+
184
+ | Host | Install | Rungs | Panel | Children at once | Network |
185
+ | ---- | ------- | ----- | ----- | ---------------- | ------- |
186
+ | Claude Code | `--claude`, `~/.claude` | fable, opus, sonnet, haiku | three, one vendor | no stated ceiling | required |
187
+ | Copilot CLI | `--copilot`, `~/.copilot` | opus, sonnet, haiku | three, two vendors | no stated ceiling | required |
188
+ | Codex CLI | `--codex`, `~/.codex` | four, each a model and a reasoning effort | three, one vendor | 3 | required |
189
+ | Local model | `--local`, `~/.codex-local` | all four collapse to the one served model | one, triage on the same model | 1 | optional |
190
+
191
+ ### Local Model Host
192
+
193
+ `install --local` is the Codex engine pointed at a model served from this machine, installed into a tree of its own (`~/.codex-local`) so it cannot retune an existing Codex install - the engine keeps its model binding in agent files under its own home, and two installs sharing one home means the second silently retunes the first.
194
+
195
+ It is not "any OpenAI-compatible server": the engine speaks the OpenAI **Responses** API and no other, so a server has to answer `POST /v1/responses`. Ollama serves that from v0.13.3 and the engine asks for v0.13.4 or newer. Whether another local server qualifies is a question about which endpoint it serves; LM Studio and generic servers have not been measured.
196
+
197
+ The registry is packaged data, so the two values that are the user's live in preferences and are validated by `lib/local-model.mjs` before either reaches a config file or an agent file: `global.localModel.baseUrl` (loopback unless `allowRemote` is set, because the base URL is where every prompt in a run goes and a typo that resolves is a silent exfiltration path), `global.localModel.model` (a narrow character set, because the value is written into a TOML file) and `global.localModel.contextWindow` (required, not guessed - a window set too small truncates the diff and the run then reports on a file it never saw). Until a model is recorded, agents are written with no model at all and children inherit the session's. `/multi-agent:doctor` carries a `local-model` check that reads the same validator, and with `--probe` asks the server whether it answers; the probe is behind the flag because a doctor run that wakes a model loader every time would be its own problem.
198
+
199
+ What the profile claims is that the pipeline runs, not that it runs as well: one reviewer instead of three is less disagreement to triage, and a smaller model reads a diff less carefully. Autopilot is not offered. Price is zero per token and the ledger still counts tokens, so a run stays comparable with one that cost money. The engine still attempts a request to its vendor's telemetry host, so "offline" here means the model is local, not that the process makes no outbound request. `scripts/smoke-local-host.sh` covers the registry shape, the preference refusals, a live install that keeps to its own tree and the agent binding with and without a configured model; no model is started there, and no end-to-end run against a real local model has been recorded. Detail: [`local-model.md`](../pipeline/multi-agent-refs/features/local-model.md).
200
+
160
201
  ## PR & Review Flow
161
202
 
162
203
  ### Default Reviewers
@@ -225,21 +266,21 @@ stamp fails the dispatch gate. Autopilot runs both phases; only the asking degra
225
266
  ### CLI-Aware Parallel Review + Fable Triage (Phase 3 Steps 2-3)
226
267
 
227
268
  | Reviewer | Model | Focus | Where it runs |
228
- | ---------- | ------------------- | --------------------------------- | -------------------- |
229
- | Reviewer 1 | `claude-fable-5-2` (Claude Code) / `claude-opus-4.7` (Copilot CLI) | Deep security + architecture | Both CLIs |
230
- | Reviewer 2 | `claude-opus-5-5` (Claude Code) / `gpt-5.4` (Copilot CLI) | Edge cases, different perspective | Both CLIs |
231
- | Reviewer 3 | `claude-sonnet-5-5` (Claude Code) / `claude-sonnet-4.6` (Copilot CLI) | Quality + correctness + naming | Both CLIs |
269
+ | ---------- | --------------------------------------------------------------------------------------------------------- | --------------------------------- | ------------- |
270
+ | Reviewer 1 | `claude-fable-5-2` (Claude Code) / `claude-opus-4.7` (Copilot CLI) / `gpt-5.6` at `xhigh` (Codex CLI) | Deep security + architecture | Every host |
271
+ | Reviewer 2 | `claude-opus-5-5` (Claude Code) / `gpt-5.4` (Copilot CLI) / `gpt-5.4` at `high` (Codex CLI) | Edge cases, different perspective | Every host |
272
+ | Reviewer 3 | `claude-sonnet-5-5` (Claude Code) / `claude-sonnet-4.6` (Copilot CLI) / `gpt-5.6` at `medium` (Codex CLI) | Quality + correctness + naming | Every host |
232
273
 
233
- The reviewer set is **CLI-aware**: Claude Code dispatches 3 reviewers in parallel (Fable + Opus + Sonnet - Opus fills the slot GPT-5.4 takes elsewhere); Copilot CLI dispatches all 3. Each returns structured JSON for deterministic aggregation. Cross-model diversity catches blind spots that any single model family would miss.
274
+ The reviewer set is **host-aware**, and the panel above comes from the host registry (`pipeline/schemas/hosts.json`), which `gen-host-tables.mjs` renders into `multi-agent-refs/review/panel.md`. All three hosts dispatch 3 reviewers in parallel; only the second slot changes vendor, because GPT-5.4 is reachable on Copilot CLI and Codex CLI and not on Claude Code, where Opus fills it. Each returns structured JSON for deterministic aggregation. Cross-model diversity catches blind spots that any single model family would miss, which is what Copilot CLI's two-vendor panel buys and the two single-vendor panels do not.
234
275
 
235
- **Fable Triage** (Phase 3 Step 3, Opus on Copilot CLI): Evaluates merged raw findings against task scope. Classifies each as `accepted` (fix now), `deferred` (out of scope, log for later), or `rejected` (false positive / noise). Only triage-accepted blocking items loop back to Phase 3.
276
+ **Fable Triage** (Phase 3 Step 3, Opus on Copilot CLI, `gpt-5.6` at `max` on Codex CLI): Evaluates merged raw findings against task scope. Classifies each as `accepted` (fix now), `deferred` (out of scope, log for later), or `rejected` (false positive / noise). Only triage-accepted blocking items loop back to Phase 3.
236
277
 
237
278
  ### Runtime Triage Validator
238
279
 
239
280
  After triage returns, output is validated by `validate-triage.mjs`:
240
281
 
241
282
  | Exit | Meaning |
242
- | ----- | ------------------------------------------------------------ |
283
+ | ----- | ---------------------------------------------------------------------------------- |
243
284
  | **0** | Valid and clean - act on triage output |
244
285
  | **1** | Invalid structure - retry once, then fallback |
245
286
  | **2** | Over-rejection guard tripped - pause for human; act on `result.corrected` when set |
@@ -287,6 +328,10 @@ Phase 2 treats the issue-tracker status update as a required step with a post-mu
287
328
 
288
329
  Continuous mode (`/multi-agent:autopilot-on`) runs the pipeline with nobody watching. The runner is a launchd tick: it takes the head of the queue, runs the whole pipeline on it in a worktree with `MULTI_AGENT_UNATTENDED=1` set on the child, and ends at a draft pull request that a person reviews and merges. Every behaviour in this section keys on that variable or on autopilot mode; an attended run is unchanged. Contract, entry point by entry point: [`unattended-contract.md`](../pipeline/multi-agent-refs/unattended-contract.md).
289
330
 
331
+ ### Analysis Has Its Own Queue
332
+
333
+ `/multi-agent:analysis` runs unattended on tracker labels of its own, separate from the development queue, so a repository can take analysis work without taking development work and the reverse. The labels are per repository - `analysisGithubLabel` and `analysisJiraLabel`, both defaulting to `agent-analysis` - and a configuration that gives an analysis label the same value as the development label is refused with both fields named, because one item would otherwise be picked up by both queues. On the Jira side the analysis search is by label, so a repository with a custom development JQL still picks analysis work up. An analysis item runs the analysis command against the item itself and ends at the document: the terminal outcome is `doc-delivered`, and an analysis item never opens a pull request.
334
+
290
335
  ### Research Before Asking
291
336
 
292
337
  A run that parks on a maturity blocker or on open analysis questions gets a research pass before it waits for a person. `/multi-agent:research <id> --autonomous` reads the tracker thread, issue links, similar closed items, linked documents and the repository; `research-gate.mjs` decides what closed. `inference` alone never closes a gap, `evidence` must be quoted from a fetched source, `repo` must resolve at `file:line` or in a commit, and acceptance criteria and business rules only ever yield candidates. The maturity check or the open-questions gate then re-runs on the result: `proceed` resumes the run, anything else parks it with the gaps left. `maxAskRounds` bounds the rounds per item. Detail: [`research.md`](../pipeline/multi-agent-refs/features/research.md).
@@ -298,7 +343,7 @@ The session commits and stops. Phase 4 writes a PR request through `pr-request.m
298
343
  ### Operations Around a Run
299
344
 
300
345
  | Operation | Default | What it does |
301
- |---|---|---|
346
+ | ---------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
302
347
  | Awake agent | on | `com.multi-agent.autopilot-awake` runs `caffeinate -s -i` from `autopilot-on` to `autopilot-off`; `awake.display` adds `-d` |
303
348
  | Sleep lock | on | `caffeinate -s -w <runner pid>` from the launch to the end of the tick |
304
349
  | Credential probe | on | `autopilot-arming.mjs probe` before the schedule is offered, `check --probe` on every tick; `credential-store.sh probe` answers `readable`, `missing` or `locked` without reading a value |
@@ -330,7 +375,7 @@ Detail: [`unattended-security.md`](../pipeline/multi-agent-refs/features/unatten
330
375
  While the quality gates are active (`MULTI_AGENT_UNATTENDED=1`, or `state.autopilot` for a terminal autopilot run), each gate appends its verdict to `state.gates[]` through `gate-ledger.mjs`, and under the variable the commit hook refuses a commit unless every required gate passed or was not applicable for HEAD.
331
376
 
332
377
  | Gate | What it checks |
333
- |---|---|
378
+ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
334
379
  | `symbol-existence` | every localization key and endpoint the added lines reference exists in the repository's truth sources |
335
380
  | `open-questions` | open analysis questions are answered, assumed or park the run |
336
381
  | `verify-citations` | a triage citation quotes the line it cites (at least 8 non-space characters, or the whole line) |
@@ -510,9 +555,16 @@ Audits are **on-demand** - triggered by user, never automatic.
510
555
  - Phase 5: post analysis + test scenarios as Jira comment (Turkish by default, configurable).
511
556
  - Phase 5 (optional): create Confluence page under chosen parent, cached per project.
512
557
 
513
- ### Keychain
558
+ ### Service Accounts
559
+
560
+ A credential is one entry under `prefs.global.serviceAccounts`: the service, the scope that says where it may be sent, and `secrets`, a slot-to-item-**name** map. No value is ever written to preferences, and literal keychain item names never reach a synced file. The scope depends on what kind of service it is - a hosted service (jira, confluence, bitbucket, fortify, graylog, jenkins) carries its own host, a vendor service (github, npm) uses the vendor's hosts unless the account names another instance, a vendor-fixed service (figma, firebase, google_play, appstore_connect) has a fixed list the account cannot widen, a local credential (figma_mcp, vercel, claude_oauth, supabase) is handed to a local tool and is never sent by the pipeline, and an endpoint service takes its host from another preference.
561
+
562
+ `pipeline/lib/service-account.mjs` is the only module that decides a destination, and two rules shape it:
563
+
564
+ - **A secret is never produced without a destination that was checked against the account holding it.** A request naming no host is refused rather than answered from the default account, and a host no account covers is refused rather than matched to the nearest one.
565
+ - **A file with no `serviceAccounts` resolves identically**, because the same entries are derived in memory from the flat keys. A missing array is the old shape read the new way, not a refusal. `keychainMapping`, `hosts` and `credentialHosts` stay as the projection of each service's default account, so the toolkit server and people's own scripts keep reading the same answers.
514
566
 
515
- Token registry maps logical names (`jira`, `bitbucket`, `github`, `confluence`) to Keychain item names. Tokens never land in a config file, never synced to the repo.
567
+ The host is matched exactly: a subdomain of a configured host, a name that merely ends in one, and userinfo in the URL are refused, and `http` is accepted only at loopback, where there is no network to carry the request. A credential supplied through an environment variable is answered as its own `env:<service>` account, but bound differently because nobody said which host it belongs to: it reaches a host a configured account already covers, the vendor's own hosts, whatever its own `*_HOST` variable names, and loopback, and nothing else; it never wins a destination a configured account also covers and never becomes the default. Shell callers source `pipeline/lib/_service-account.sh`, which hands curl a config carrying the URL and the credential together and refuses redirects, with the config written to a directory removed when the shell exits - so the credential reaches neither argv, an environment variable, nor a log, and a redirect cannot carry the header. The authentication scheme is a fact about the service rather than a choice at the call site. Refusals are a closed set with their own exit codes (`destination-required`, `insecure-url`, `host-mismatch`, `no-account-for-target`, `needs-pairing`, `ambiguous` and the rest), each carrying one sentence and a remedy naming the single next step. `lint-credential-reads.mjs` is a per-file ratchet that keeps the resolver the only reader: a file may carry fewer direct credential reads than its baseline, never more. Detail: [`service-accounts.md`](../pipeline/multi-agent-refs/features/service-accounts.md).
516
568
 
517
569
  ## Schemas & Validation
518
570
 
@@ -107,10 +107,10 @@ export function tomlString(s) {
107
107
  * @param {string} raw - persona file content
108
108
  * @returns {string} TOML
109
109
  */
110
- export function renderCodexAgent(name, raw) {
110
+ export function renderCodexAgent(name, raw, tierMap = CODEX_TIER_MAP) {
111
111
  const { front, body } = parsePersona(raw);
112
112
  const tier = front.preferredModel || front.model || DEFAULT_TIER;
113
- const mapped = CODEX_TIER_MAP[tier] || CODEX_TIER_MAP[DEFAULT_TIER];
113
+ const mapped = tierMap[tier] || tierMap[DEFAULT_TIER] || {};
114
114
 
115
115
  const lines = [
116
116
  GENERATED_MARKER,
@@ -118,11 +118,16 @@ export function renderCodexAgent(name, raw) {
118
118
  "",
119
119
  `name = ${tomlString(name)}`,
120
120
  `description = ${tomlString(front.description || name)}`,
121
- `model = ${tomlString(mapped.model)}`,
122
- `model_reasoning_effort = ${tomlString(mapped.reasoning_effort)}`,
123
- `developer_instructions = ${tomlString(body)}`,
124
- "",
125
121
  ];
122
+ // A host whose model the user has not chosen yet writes no model and no
123
+ // effort: the child then inherits the session's, which is the only answer
124
+ // that cannot be wrong. Writing a placeholder would bind every agent to a
125
+ // model that does not exist.
126
+ if (mapped.model) lines.push(`model = ${tomlString(mapped.model)}`);
127
+ if (mapped.reasoning_effort) {
128
+ lines.push(`model_reasoning_effort = ${tomlString(mapped.reasoning_effort)}`);
129
+ }
130
+ lines.push(`developer_instructions = ${tomlString(body)}`, "");
126
131
  return lines.join("\n");
127
132
  }
128
133
 
@@ -137,7 +142,7 @@ export function renderCodexAgent(name, raw) {
137
142
  * @param {string} dest - `$CODEX_HOME/agents`
138
143
  * @returns {number} how many agent files were written
139
144
  */
140
- export function installCodexAgents(agentsSrc, dest) {
145
+ export function installCodexAgents(agentsSrc, dest, { tierMap = CODEX_TIER_MAP } = {}) {
141
146
  if (!existsSync(agentsSrc)) return 0;
142
147
  const personas = readdirSync(agentsSrc).filter((f) => f.endsWith(".md"));
143
148
  if (personas.length === 0) return 0;
@@ -155,7 +160,7 @@ export function installCodexAgents(agentsSrc, dest) {
155
160
  let written = 0;
156
161
  for (const file of personas) {
157
162
  const name = file.replace(/\.md$/, "");
158
- const toml = renderCodexAgent(name, readFileSync(join(agentsSrc, file), "utf-8"));
163
+ const toml = renderCodexAgent(name, readFileSync(join(agentsSrc, file), "utf-8"), tierMap);
159
164
  const target = join(dest, `${name}.toml`);
160
165
  if (isDryRun()) {
161
166
  console.log(` [dry-run] would write ${target}`);
@@ -28,6 +28,8 @@ import { createHash } from "crypto";
28
28
  import { dirname, join, relative, sep } from "path";
29
29
  import { fileURLToPath } from "url";
30
30
 
31
+ import { prefsFileIn } from "../pipeline/lib/prefs-value.mjs";
32
+
31
33
  let dryRun = false;
32
34
 
33
35
  /**
@@ -969,3 +971,25 @@ export function dirsIdentical(a, b) {
969
971
  }
970
972
  return true;
971
973
  }
974
+
975
+ /**
976
+ * Seed the shared preferences file if no install has written one yet.
977
+ *
978
+ * Preferences live under the state root, not under any one host's tree, so
979
+ * whichever host is installed first writes them and the rest find them in
980
+ * place. A host that skips this step leaves a machine where it is the only
981
+ * installed CLI with no preferences at all: identity, language, model rung and
982
+ * keychain mapping all fall back to built-in defaults, silently.
983
+ *
984
+ * @param {string} home
985
+ * @param {string} pipelineSrc
986
+ */
987
+ export function ensureSharedPreferences(home, pipelineSrc) {
988
+ const prefsPath = prefsFileIn(home);
989
+ if (existsSync(prefsPath)) return;
990
+ const template = join(pipelineSrc, "preferences-template.json");
991
+ if (!existsSync(template)) return;
992
+ ensureDir(join(home, ".claude"));
993
+ copyFile(template, prefsPath);
994
+ console.log(` -> seeded shared preferences at ${prefsPath}`);
995
+ }
@@ -76,6 +76,11 @@ const DEV_ONLY_TOOLING = Object.freeze([
76
76
  "gen-free-llm-skill.mjs", // reads the sibling toolkit checkout; an install has none
77
77
  "gen-toolkit-path-params.mjs", // reads the sibling toolkit checkout; an install has none
78
78
  "gen-access-check.mjs", // rewrites the repo's own command files; an install has no pipeline/commands source
79
+ "gen-host-tables.mjs", // regenerates tables inside the repo's own refs; an install has no source to rewrite
80
+ "lint-host-literals.mjs", // ratchets the repo's own source tree against a committed baseline
81
+ "lint-credential-reads.mjs", // the same, over the repo's own credential readers
82
+ "lint-temp-guards.mjs", // scans the repo's own shell scripts; an install ships no smokes to scan
83
+ "lint-now-lines.mjs", // holds the repo's own phase docs to the shipped line set
79
84
  "gen-fact-marks.mjs", // renders the counts in the repo's own docs; an install has no docs/
80
85
  "gen-office-command-matrix.mjs", // reads office-src, which an install does not carry
81
86
  "gen-ref-toc.mjs", // regenerates the repo's own reference tree; an install has no pipeline/
@@ -260,8 +260,12 @@ export function removeLegacyRegistration(host, label, { cli: cliOverride } = {})
260
260
  return "removed";
261
261
  }
262
262
 
263
- function registerCurrent(host, label, { cli: cliOverride } = {}) {
263
+ function registerCurrent(host, label, { cli: cliOverride, codexHome } = {}) {
264
264
  const cli = cliOverride || resolveCli(host);
265
+ // A second install of the same engine keeps its config in its own home, so
266
+ // the registration has to be written there rather than into the engine's
267
+ // default tree, where it would overwrite the first install's entry.
268
+ const env = codexHome ? { ...process.env, CODEX_HOME: codexHome } : process.env;
265
269
  const { scopeArgs, getArgs } = hostConfig(host);
266
270
  const npxArgs = ["-y", ...scopeRegistryFlag(), MCP_SERVER_SPEC];
267
271
  const desired = ["npx", ...npxArgs];
@@ -283,7 +287,7 @@ function registerCurrent(host, label, { cli: cliOverride } = {}) {
283
287
 
284
288
  // Bounded: an installer must never hang on a child process. These are local
285
289
  // config reads and writes and return in milliseconds.
286
- const run = (args) => execFileSync(cli, args, { stdio: "pipe", timeout: 20_000 });
290
+ const run = (args) => execFileSync(cli, args, { stdio: "pipe", timeout: 20_000, env });
287
291
  const add = (spec) => {
288
292
  try {
289
293
  const stdout = run(["mcp", "add", ...scopeArgs, MCP_SERVER_NAME, "--", ...spec]);