@bridge_gpt/mcp-server 0.2.68 → 0.2.70

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 (166) hide show
  1. package/README.md +226 -320
  2. package/build/agent-launchers/claude-executor-adapter.js +17 -4
  3. package/build/agents.generated.js +4 -4
  4. package/build/artifact-diff.js +110 -0
  5. package/build/bin-entrypoint.js +36 -0
  6. package/build/bridge-permissions.js +650 -98
  7. package/build/check-update-cli.js +74 -0
  8. package/build/claude-review-workflow-drift.js +3 -3
  9. package/build/claude-settings.js +84 -2
  10. package/build/cli-help.js +7 -1
  11. package/build/codex-bridge-profile.js +1 -1
  12. package/build/codex-home.js +9 -1
  13. package/build/codex-launcher-pin.js +598 -0
  14. package/build/commands.generated.js +8 -8
  15. package/build/conductor/bridge-api-client.js +598 -19
  16. package/build/conductor/bring-up-facts.js +9 -9
  17. package/build/conductor/doctor.js +466 -18
  18. package/build/conductor/epic-child-continuation.js +54 -3
  19. package/build/conductor/epic-implementer-cli.js +132 -34
  20. package/build/conductor/epic-runtime.js +2 -2
  21. package/build/conductor/epic-state.js +1 -1
  22. package/build/conductor/hook-runtime-qualification.js +1 -1
  23. package/build/conductor/install-doctor.js +4 -2
  24. package/build/conductor/launch-need-probes.js +337 -0
  25. package/build/conductor/local-merge.js +241 -56
  26. package/build/conductor/merge-credential.js +172 -0
  27. package/build/conductor/merge-execution-eligibility.js +1 -1
  28. package/build/conductor/merged-child-check.js +95 -0
  29. package/build/conductor/plan-trim.js +30 -0
  30. package/build/conductor/pr-ci-producer.js +1 -1
  31. package/build/conductor/readiness-cli.js +11 -6
  32. package/build/conductor/readiness-prerequisites.js +41 -0
  33. package/build/conductor/readiness-sections.js +345 -55
  34. package/build/conductor/readiness.js +99 -87
  35. package/build/conductor/recovery-cli.js +606 -21
  36. package/build/conductor/recovery-operations.js +306 -7
  37. package/build/conductor/repair-contract.js +47 -2
  38. package/build/conductor/repository-workflow-remedy.js +8 -6
  39. package/build/conductor/stored-merge-credential.js +76 -0
  40. package/build/conductor/stored-merge-token-probe.js +28 -0
  41. package/build/conductor/temporary-plan.js +50 -0
  42. package/build/conductor/wait-run-cli.js +759 -0
  43. package/build/conductor/worker-database-doctor-inspector.js +49 -0
  44. package/build/conductor-bin.js +2 -2
  45. package/build/conductor-claude-hook-bin.js +2 -2
  46. package/build/conductor-claude-hook-removed-stub-bin.js +2 -5
  47. package/build/conductor-removed-stub-bin.js +2 -5
  48. package/build/connect-github-api.js +33 -14
  49. package/build/credential-store.js +356 -13
  50. package/build/docs.generated.js +27 -14
  51. package/build/doctor.js +203 -38
  52. package/build/drive-epic-help.js +212 -0
  53. package/build/drive-epic.js +1840 -373
  54. package/build/epic-ci-workflow-drift.js +77 -0
  55. package/build/epic-ci-workflow-install.js +183 -0
  56. package/build/epic-ci-workflow.js +157 -0
  57. package/build/epic-contract-context.js +326 -0
  58. package/build/epic-implementer-bin.js +131 -120
  59. package/build/epic-implementer-claude-hook-bin.js +2 -2
  60. package/build/escalation-reachability.js +134 -0
  61. package/build/executor/cleanup-report.js +99 -0
  62. package/build/executor/cli.js +12 -1
  63. package/build/executor/completion-contract.js +68 -11
  64. package/build/executor/completion-supervision.js +99 -0
  65. package/build/executor/delivery-outcome.js +179 -0
  66. package/build/executor/deps.js +3 -0
  67. package/build/executor/env.js +71 -0
  68. package/build/executor/failure-reason-codes.js +126 -0
  69. package/build/executor/heartbeat.js +38 -0
  70. package/build/executor/http-client.js +115 -4
  71. package/build/executor/integration-job.js +298 -5
  72. package/build/executor/job-errors.js +36 -6
  73. package/build/executor/job-runner.js +720 -36
  74. package/build/executor/likely-tests.js +36 -2
  75. package/build/executor/merge-job.js +145 -2
  76. package/build/executor/observation.js +73 -4
  77. package/build/executor/permissions.js +193 -97
  78. package/build/executor/preflight.js +14 -3
  79. package/build/executor/process-containment.js +28 -2
  80. package/build/executor/prompt-spec.js +50 -5
  81. package/build/executor/rebase-finalization.js +38 -3
  82. package/build/executor/reconcile-overlap-job.js +35 -7
  83. package/build/executor/required-work-ledger.js +236 -81
  84. package/build/executor/resume-pre-spawn.js +38 -1
  85. package/build/executor/runner.js +91 -3
  86. package/build/executor/test-clock.js +8 -0
  87. package/build/executor/types.js +37 -2
  88. package/build/executor/worker-cli-launcher.js +259 -0
  89. package/build/executor/worker-command.js +41 -4
  90. package/build/executor/worker-database-target.js +91 -0
  91. package/build/executor/worker-database.js +908 -0
  92. package/build/executor/worker-finalization.js +106 -0
  93. package/build/executor/worker-guard-hook.js +203 -0
  94. package/build/executor/worker-resources.js +47 -0
  95. package/build/executor/worker-verification-guidance.js +15 -2
  96. package/build/executor/worktree.js +303 -15
  97. package/build/executor-launch.js +11 -1
  98. package/build/generated-assets-doctor.js +9 -1
  99. package/build/generated-assets-health.js +13 -4
  100. package/build/generated-assets-legacy.js +39 -0
  101. package/build/generated-assets-paths.js +12 -1
  102. package/build/generated-assets-repair.js +4 -1
  103. package/build/generated-assets-test-support.js +12 -0
  104. package/build/github-remote.js +33 -0
  105. package/build/github-sign-in.js +62 -0
  106. package/build/index.js +1214 -465
  107. package/build/init.js +39 -1
  108. package/build/install-bridge-conductor-gate.js +78 -0
  109. package/build/install-bridge-conductor-setup.js +413 -0
  110. package/build/install-bridge-conductor.js +1226 -267
  111. package/build/install-bridge.js +629 -350
  112. package/build/launcher-config-inspection.js +184 -19
  113. package/build/mcp-host-targets.js +4 -0
  114. package/build/mcp-identity.js +7 -0
  115. package/build/mcp-install-state.js +8 -2
  116. package/build/merge-pull-request.js +6 -0
  117. package/build/merge-workflow-install.js +763 -345
  118. package/build/phase-result-artifacts.js +75 -20
  119. package/build/pipeline-orchestrator.js +247 -4
  120. package/build/pipelines.generated.js +35 -35
  121. package/build/plan-discovery.js +15 -2
  122. package/build/plan-execution-ledger.js +306 -17
  123. package/build/plan-phase-routing.js +48 -13
  124. package/build/plane/cli.js +105 -51
  125. package/build/plane/defaults.js +3 -0
  126. package/build/plane/plane-freshness.js +294 -0
  127. package/build/plane/schema-compatibility.js +137 -0
  128. package/build/plane/shutdown-deps.js +38 -0
  129. package/build/plane/shutdown.js +83 -8
  130. package/build/plane/terminal-run-cleanup.js +303 -0
  131. package/build/printed-remedy-commands.js +26 -4
  132. package/build/readiness-check.js +6 -2
  133. package/build/readiness-prerequisites.generated.js +532 -0
  134. package/build/readme.generated.js +1 -1
  135. package/build/session-upgrade-notice.js +86 -0
  136. package/build/setup-epic.js +400 -30
  137. package/build/shared-resources.generated.js +5 -0
  138. package/build/start-tickets.js +43 -15
  139. package/build/test-command-detection.js +247 -0
  140. package/build/test-command-validation.js +73 -0
  141. package/build/testing-config-client.js +150 -0
  142. package/build/ticket-delivery-artifacts.js +258 -0
  143. package/build/ticket-delivery-enrollment.js +306 -0
  144. package/build/ticket-delivery.js +205 -0
  145. package/build/ticket-review-summary.js +14 -0
  146. package/build/tool-call-advisory.js +162 -0
  147. package/build/tool-surface-gating.js +28 -89
  148. package/build/update-check.js +97 -16
  149. package/build/update-status.js +61 -71
  150. package/build/upgrade-advice.js +15 -11
  151. package/build/upgrade-cli.js +360 -20
  152. package/build/v2-readiness-requirements.js +552 -0
  153. package/build/version.generated.js +3 -3
  154. package/build/worker-guard-hook-bin.js +2 -2
  155. package/build/worktree-core.js +22 -7
  156. package/docs/BRIDGE-DIRECTORY-README.md +48 -0
  157. package/docs/EPIC-IMPLEMENTER-INSTALL.md +12 -867
  158. package/docs/EPIC-IMPLEMENTER.md +104 -63
  159. package/docs/epic-implementer/getting-started.md +131 -0
  160. package/docs/epic-implementer/self-hosting.md +133 -0
  161. package/package.json +3 -3
  162. package/pipelines/idea-to-ticket.json +1 -1
  163. package/pipelines/implement-ticket.json +8 -8
  164. package/pipelines/review-ticket.json +2 -2
  165. package/design-assets/favicon/favicon-32x32.png +0 -0
  166. package/design-assets/just-logo-rough-draft.png +0 -0
@@ -1,867 +1,12 @@
1
- # Epic Implementer install guide (for agents)
2
-
3
- This guide is for a coding agent (Claude Code, Cursor, or similar) working in a
4
- customer repository. Your human said "set up the Epic Implementer" and does not
5
- know how. Follow the steps below in order. Each step says why it matters, the
6
- exact command, how to check it worked, what to do if it fails, and whether you
7
- must ask the human first.
8
-
9
- Bridge copies this file into every installed project at
10
- `docs/install/epic-implementer-install.md`. The same text ships in the npm
11
- package as `docs/EPIC-IMPLEMENTER-INSTALL.md`. For the full reference, read
12
- `docs/EPIC-IMPLEMENTER.md` inside the `@bridge_gpt/mcp-server` package.
13
-
14
- In this guide, `<launcher>` means `npx -y @bridge_gpt/mcp-server`. Always keep
15
- the `-y`. Without it, `npx` stops to ask whether to install the package.
16
-
17
- ---
18
-
19
- ## 0. Rules for you, the agent
20
-
21
- 1. **Read first, write later.** Run every read-only check in a step before any
22
- step that writes.
23
- 2. **Ask before any write or push.** Ask the human before you install a GitHub
24
- App, open a pull request, create a secret, change an admin setting, or push a
25
- branch. Say what will change and why.
26
- 3. **Replace every placeholder before you run a printed remedy.** The tools now
27
- print complete commands, with the `npx -y @bridge_gpt/mcp-server` prefix and
28
- every required flag. Some carry a placeholder that only a real value can fill:
29
- `<@org/team|@user>` (the one reviewer of the workflow file; Bridge cannot infer
30
- it) and `<check-name>` (the exact name of a CI check this repository requires;
31
- repeat `--required-check` for more than one). Older tool versions printed
32
- shorthand; the table in [§12](#12-troubleshooting-and-known-wrong-remedies)
33
- maps it to the full command.
34
- 4. **Stop at human-only access.** Some steps need a browser, a GitHub admin, or
35
- the Bridge admin panel. Stop, say exactly what the human must do, and wait.
36
- 5. **Interactive commands go to the human.** `install`, `connect-github`, and
37
- both `install conductor` forms ask questions on a terminal. A shell you run
38
- has no terminal (no TTY), so the answer is always "no":
39
- - `install conductor` prints `Aborted` and **exits `0`**. The exit code does
40
- not tell you it failed.
41
- - `install conductor --merge-workflow` prints `consent_declined` and exits `1`.
42
-
43
- Ask the human to run these commands in their own terminal, from the
44
- repository root. Then read what they paste back.
45
- 6. **Never write a secret into the repository.** No token, API key, or merge
46
- credential goes into a tracked file, a command argument you print, or a
47
- commit.
48
- 7. **Keep notes.** Record which step you finished. Step 5 asks the human to
49
- restart the MCP client, which may end this session.
50
-
51
- ## 1. What you are setting up
52
-
53
- The Epic Implementer drives a multi-ticket epic from an approved plan to merged
54
- pull requests. It cuts an `epic/<EPIC-KEY>` branch, hands each child ticket to
55
- an agent on this machine, waits for CI and code review on each child PR, and
56
- merges each child PR into the epic branch. A person merges the final
57
- integration PR into the default branch.
58
-
59
- By default a run with two or more tickets is **unattended**: it merges child
60
- PRs on its own. `--attended` is the opt-out: the run then has no permission to
61
- merge by itself.
62
-
63
- Both kinds of run still need CI and code review to actually run on child PRs
64
- into `epic/<EPIC-KEY>`, or every ticket waits forever. Unattended runs also need
65
- the server to confirm the setup (steps 6 to 9). Attended runs skip that
66
- confirmation, but have their own launch path ([§11c](#11c-attended-runs)).
67
-
68
- ## 2. Preflight checklist (read-only)
69
-
70
- **Why:** the executor that runs the jobs lives on this machine. It refuses to
71
- start without certain tools, and several later steps need `gh` and push rights.
72
-
73
- **Ask first?** No. Everything here only reads.
74
-
75
- | Check | Command | Pass when |
76
- |---|---|---|
77
- | Node.js 18 or newer | `node --version` | `v18` or later. The optional git hooks want an even LTS line, `v20` or later. |
78
- | Operating system | `uname -s` | `Darwin` or `Linux`. The executor does not run on Windows. |
79
- | git | `git --version` | Prints a version. |
80
- | GitHub CLI, logged in | `gh auth status` | Logged in to github.com. |
81
- | Claude Code CLI | `claude --version` | Prints a version. The human must also be logged in to `claude`. |
82
- | Worktrunk | `wt --version` | Prints a version. The executor refuses to start without it. |
83
- | Push rights | `gh repo view --json viewerPermission -q .viewerPermission` | `WRITE`, `MAINTAIN`, or `ADMIN`. Setup pushes an `epic/<EPIC-KEY>` branch with the human's own git. |
84
- | No retired variables | The command below | Prints nothing. |
85
-
86
- Retired-variable check (prints names only, never values):
87
-
88
- ```bash
89
- env | grep -E '^(BAPI_CONDUCTOR_|CONDUCTOR_(NODE_PATH|DEAD_MAN_ONLY|DEADMAN_CHANNEL_TYPE|DEADMAN_DESTINATION_REF)=)' | cut -d= -f1
90
- ```
91
-
92
- These are old Epic Implementer variable names. If any is set, every
93
- `<launcher>` command exits `1` and lists each old name with its new one. Show
94
- the names to the human and ask them to rename or remove them in their shell
95
- profile, then open a fresh shell.
96
-
97
- If a tool is missing, stop and tell the human which one. Do not install tools
98
- yourself without asking.
99
-
100
- Then run the three Bridge diagnostics. All three only read:
101
-
102
- ```bash
103
- npx -y @bridge_gpt/mcp-server doctor
104
- npx -y @bridge_gpt/mcp-server epic-implementer doctor
105
- npx -y @bridge_gpt/mcp-server epic-implementer readiness --json
106
- ```
107
-
108
- - `doctor` checks the base install: repository identity, credentials, server
109
- connection, and whether the repository is indexed.
110
- - `epic-implementer doctor` checks this machine: the local ledger, git hooks,
111
- and the merge credential. It briefly starts a headless `claude` probe to check
112
- that permission denials are enforced.
113
- - `epic-implementer readiness --json` combines all of these with the server's
114
- view. It is the one report you will re-run after every step. It always exits
115
- `0`, even when things fail, so read the JSON.
116
-
117
- **How to read `readiness --json`:** look at the `checks` array. Each entry has an
118
- `id` (for example `server.github-credentials`), a `status`, a `label`, and
119
- sometimes a `detail` and a `remediation`.
120
-
121
- - `pass` — fine.
122
- - `warn` — works but degraded. Note it.
123
- - `fail` — not met, **or could not be checked**. Read the `detail` to tell which.
124
- - `skip` — does not apply here.
125
-
126
- Rows whose `id` starts with `plane.` only matter when the human runs their own
127
- Bridge API server. Against the hosted service you can ignore them. The
128
- `server.executor-readiness` row may fail before the first run. That is fine:
129
- `drive-epic` starts an executor for each run by itself.
130
-
131
- Map each failing row to a step below. Do not run the `remediation` text as a
132
- command; see rule 3.
133
-
134
- ## 3. Base install (only if Bridge is not installed yet)
135
-
136
- **Why:** every Epic Implementer command needs the repository's Bridge identity
137
- and API key.
138
-
139
- **Check first:** if `.bridge/config` exists and `doctor` reports the credential
140
- and server connection as fine, skip this step.
141
-
142
- **Ask first?** Yes. It is interactive and writes files.
143
-
144
- Ask the human to run this in their own terminal, from the repository root:
145
-
146
- ```bash
147
- npx -y @bridge_gpt/mcp-server install
148
- ```
149
-
150
- It asks for an email (new account) or a key or invite (existing account). It
151
- writes `.bridge/config`, the editor's MCP config, and the slash commands. It
152
- stores the API key outside the repository.
153
-
154
- **How credentials are found.** Every command looks for the API key in this
155
- order: the `BAPI_API_KEY` environment variable, then the file
156
- `~/.config/bridge/credentials.json` under the key `bapi:<repo_name>`. A key
157
- that lives only in the editor's MCP config is **not** visible to a shell you
158
- start, so rely on the credentials file.
159
-
160
- **The `repo_name` rule.** `repo_name` must match byte for byte everywhere:
161
- `.bridge/config`, the `BAPI_REPO_NAME` in the MCP config, the `bapi:<repo_name>`
162
- key, and any `--repo` flag. Never derive it from the folder or GitHub name. A
163
- hyphen where Bridge has an underscore gives a **403** that looks like a
164
- permissions problem. Read it:
165
-
166
- ```bash
167
- grep '^repo_name' .bridge/config
168
- ```
169
-
170
- **Check it worked:** re-run `npx -y @bridge_gpt/mcp-server doctor`. The identity,
171
- credential, and connectivity rows should pass.
172
-
173
- **If it fails:** a 403 almost always means a `repo_name` mismatch. A 401 means
174
- the key was rejected or rotated. Ask the human for a fresh key.
175
-
176
- ## 4. Connect GitHub
177
-
178
- **Why:** the server watches CI and review through the Bridge GitHub App. Without
179
- App credentials, `drive-epic` refuses to start any run (`github_credentials`).
180
-
181
- **Check first:** in `readiness --json`, find `server.github-credentials`. If it
182
- passes, skip to the permission check below.
183
-
184
- **Ask first?** Yes. It opens a browser and installs a GitHub App.
185
-
186
- Ask the human to run, in their own terminal:
187
-
188
- ```bash
189
- npx -y @bridge_gpt/mcp-server connect-github --repo <repo_name>
190
- ```
191
-
192
- It opens the GitHub App install page. The human installs the App there, comes
193
- back to the terminal, and confirms the repository. No GitHub token is ever
194
- typed. If someone else administers the GitHub organization, use
195
- `connect-github --handoff --repo <repo_name>` instead. It prints a link to send
196
- to that admin. After they finish, run `connect-github --resume --repo <repo_name>`.
197
-
198
- **Permission check.** Find `server.github-actions-permission` in
199
- `readiness --json`. It should read `actions: write`. Without it, the Epic
200
- Implementer cannot re-run a flaky workflow (the rerun fails with a 403). This is
201
- a warning, not a blocker. If it shows a lower level, ask the human to check the
202
- Bridge GitHub App's installation in their GitHub settings and accept any
203
- pending permission request. If `detail` says the permission could not be
204
- checked, re-run readiness after credentials resolve.
205
-
206
- **Check it worked:** `server.github-credentials` passes.
207
-
208
- ## 5. Bootstrap the repository: `install conductor`
209
-
210
- **Why:** this writes the repository's default Epic Implementer settings on the
211
- server: the required CI check each ticket must pass, merge approval, and the
212
- review policy. `drive-epic` refuses a repository without them
213
- (`supervisor_setup`, `supervisor_config`). With extra flags it also writes the
214
- `claude-review` workflow when you opt in to AI review, and it adds the Epic Implementer MCP
215
- tools to your editor config.
216
-
217
- The subcommand is still named `install conductor` (the Epic Implementer's old
218
- name). `install-bridge conductor` is the same command.
219
-
220
- **Ask first?** Yes. It asks several yes/no questions and writes to the server
221
- and to local files. It needs a real terminal.
222
-
223
- ### 5a. Choose the required check
224
-
225
- The installer needs a **confirmed repository gate**: provider checks, local
226
- commands the executor runs, both, or none. Without gate flags it uses a gate
227
- already stored (an older `--required-check` setup counts), or it proposes one
228
- from the working tree and the provider's real check history and asks the human
229
- to confirm it. You may explain the proposal; you never confirm, clear, or write
230
- a gate. Read `docs/install/install-bridge-conductor-gate.md` first.
231
-
232
- `--required-check` is the common scripted form: it stores a confirmed provider
233
- gate. It must be the exact name of a CI check run that GitHub reports on child
234
- PRs into `epic/<EPIC-KEY>`. A name that never reports leaves every ticket
235
- waiting forever.
236
-
237
- - **Unattended runs (the default):** the name must be a job `name:` written
238
- literally in `.github/workflows/epic-implementer-ci.yml` or
239
- `.github/workflows/claude-review.yml` on the default branch. At approval the
240
- server checks each required check against those two files. Any other name,
241
- including a real check from another workflow, is refused as
242
- `admission_evidence_unverifiable`. Use **`epic-implementer-ci / gate`**, the
243
- gate job in the step 6 template.
244
- - **Attended runs only:** any real check name works, as long as that check runs
245
- on pull requests into `epic/**`. List the names on a recent pull request:
246
-
247
- ```bash
248
- gh pr view <pr-number> --json statusCheckRollup \
249
- | jq -r '.statusCheckRollup[] | .name // .context'
250
- ```
251
-
252
- **Never use `claude-review` as a required check.** It is the review signal, not
253
- a test run. The review gate reads it separately.
254
-
255
- ### 5b. Choose the review workflow values
256
-
257
- `.github/workflows/claude-review.yml` produces the review verdict the review
258
- gate waits for **when you choose AI review** (`verdict_protocol`). For unattended
259
- runs it must also emit two markers (`run-id:` and `Reviewed-SHA:`). This command
260
- writes a correct file when you choose AI review and pass **all three** of these
261
- flags. If one is missing, phase 3 prints a `skipped — …` line and writes nothing.
262
- Without AI review you can skip this section.
263
-
264
- | Flag | Value |
265
- |---|---|
266
- | `--allowed-bot` | The GitHub App bot whose PRs get reviewed. Child PRs are opened by the Bridge GitHub App. For hosted Bridge, use `bridge-gpt-ai-tools-for-sfcc[bot]`. A self-hosted Bridge uses its own App's `<app-slug>[bot]`. |
267
- | `--secret-name` | The **name** (not the value) of a GitHub Actions secret that holds a Claude Code OAuth token, for example `CLAUDE_CODE_OAUTH_TOKEN`. Upper-case letters, digits, and underscores only. |
268
- | `--branches` | The pull-request base branches to review: the default branch plus `epic/**`, for example `main,epic/**`. Child PRs target `epic/<EPIC-KEY>`, so without `epic/**` they are never reviewed. |
269
-
270
- Installation no longer defaults to `verdict_protocol`. If you omit
271
- `--review-policy`, the command assumes `repository_policy`: it scaffolds **no**
272
- Claude-review workflow and stores **no** repository review default. A new
273
- feature-branch run then gets `repository_policy` from the server at its first
274
- approval, when neither the run nor the repository sets a policy.
275
-
276
- AI review is an explicit opt-in. Pass `--review-policy verdict_protocol` to
277
- scaffold the workflow and store `verdict_protocol` as the repository choice.
278
- Passing any value explicitly stores it as the repository default. A run that was
279
- already approved without a stored policy is not changed: it still resolves to
280
- `verdict_protocol` and still needs the workflow.
281
-
282
- If the repository already has a `claude-review.yml`, the command asks before
283
- overwriting it. An older or hand-written file may lack the markers. Readiness
284
- tells you which marker is missing.
285
-
286
- ### 5c. Run it
287
-
288
- Find the default branch:
289
-
290
- ```bash
291
- gh repo view --json defaultBranchRef -q .defaultBranchRef.name
292
- ```
293
-
294
- First ask the human to preview with `--dry-run`. The preview still asks one
295
- question (whether to use the shown Bridge API URL) because it reads from the
296
- server. It writes nothing:
297
-
298
- ```bash
299
- npx -y @bridge_gpt/mcp-server install conductor \
300
- --required-check "epic-implementer-ci / gate" \
301
- --allowed-bot "bridge-gpt-ai-tools-for-sfcc[bot]" \
302
- --secret-name CLAUDE_CODE_OAUTH_TOKEN \
303
- --branches "main,epic/**" \
304
- --dry-run
305
- ```
306
-
307
- Replace `main` with the real default branch and adjust the other values. Then
308
- ask the human to run the same command **without** `--dry-run`, in their own
309
- terminal, from the repository root. It runs eight phases:
310
-
311
- 1. A read-only doctor. It stops before any write if something fatal is missing.
312
- 2. A preview of the server settings, then "Write the safe project-default
313
- supervisor posture now?". If the change would remove an existing
314
- requirement, it asks a second, separate question.
315
- 3. The `claude-review` workflow (only with `--review-policy verdict_protocol` and the
316
- three flags from 5b).
317
- 4. **Tool visibility:** adds `epic_implementer` to `BRIDGE_MCP_PROFILE` in the
318
- Bridge entry of `.mcp.json`, `.vscode/mcp.json`, and `.cursor/mcp.json`. It
319
- only edits files that already have a Bridge entry. It never creates a file
320
- and never touches Codex or Copilot config.
321
- 5. Local observability: the optional local git hooks. Safe to decline.
322
- 6. A plan check, only with `--epic-key` and `--plan-file`. Skip it for now.
323
- 7. An executor service, only with `--executor-id`. Skip it: `drive-epic` starts
324
- one for each run.
325
- 8. A capability report and a final doctor.
326
-
327
- The last line is `complete` or `complete-with-manual-steps`. Before the first
328
- run, `complete-with-manual-steps` is normal, because no executor has been seen
329
- yet. Read the "Manual actions" list it prints.
330
-
331
- **After it finishes:**
332
-
333
- - The workflow file (phase 3) was only written locally. It lands in step 6.
334
- - **Restart the MCP client** (the editor or `claude` session). The server reads
335
- its tool groups at startup, so `get_epic_snapshot` and `explain_run` appear
336
- only after a restart. Save your notes first. After the restart, confirm those
337
- two tools are listed. If they are not, check that the Bridge entry's
338
- `BRIDGE_MCP_PROFILE` contains `epic_implementer`, for example
339
- `core,epic_implementer`.
340
-
341
- **Check it worked:** in `readiness --json`, `server.supervisor-setup`,
342
- `server.supervisor-config`, and `server.supervisor-required-checks` pass.
343
-
344
- **If it fails:** if the output says `Aborted` right after the URL question, it
345
- had no terminal or the human answered no. Ask them to run it again in their own
346
- terminal. If phase 1 lists a fatal row, fix that row first (usually step 3 or 4).
347
-
348
- ## 6. The two workflows, on the default branch
349
-
350
- **Why:** child PRs need CI and review that really run. For unattended runs, the
351
- server also reads two files from the **default branch**, at fixed paths, before
352
- it creates or approves a run. If either is wrong, it refuses with
353
- `repository_readiness_unconfirmed`. **No install command fixes this.** The files
354
- must be merged into the default branch.
355
-
356
- | File | Requirement |
357
- |---|---|
358
- | `.github/workflows/claude-review.yml` | Must emit the `run-id:` and `Reviewed-SHA:` markers. Written by step 5 with the three flags from 5b. |
359
- | `.github/workflows/epic-implementer-ci.yml` | Must exist and parse as a workflow. Nothing in the package writes it. Use the template below. |
360
-
361
- A different file name does not count, even if it runs the same tests.
362
-
363
- **Ask first?** Yes. You will create a branch and open a pull request.
364
-
365
- ### 6a. The `epic-implementer-ci.yml` template
366
-
367
- This is a minimal, generic starting point. It runs the repository's tests on the
368
- Epic Implementer's pull requests and reports one check,
369
- `epic-implementer-ci / gate`. That name is the required check from step 5.
370
- `gh pr view --json statusCheckRollup` shows it as `epic-implementer-ci / gate`.
371
- The GitHub web page may show it as `epic-implementer-ci / epic-implementer-ci / gate`
372
- (workflow name, then job name). The required check is still
373
- `epic-implementer-ci / gate`.
374
-
375
- The Epic Implementer names each child branch `feature/<TICKET-KEY>` and the
376
- epic branch `epic/<EPIC-KEY>`. Child PRs go from `feature/…` into `epic/…`. The
377
- final integration PR goes from `epic/…` into the default branch. The template
378
- tests every same-repository PR from a `feature/` or `epic/` branch. To test only
379
- the Epic Implementer's tickets, you may narrow `feature/` to
380
- `feature/<PREFIX>-`, where `<PREFIX>` is the ticket prefix of the **child**
381
- tickets. Get that wrong and every child PR counts as out of scope, so the gate
382
- passes **without running any tests**.
383
-
384
- ```yaml
385
- name: epic-implementer-ci
386
-
387
- on:
388
- pull_request:
389
- # The default branch (change main if yours differs) and the epic branches
390
- # that child pull requests target.
391
- branches: [main, "epic/**"]
392
-
393
- permissions:
394
- contents: read
395
-
396
- # A new push cancels the run for the older head of the same pull request.
397
- concurrency:
398
- group: epic-implementer-ci-${{ github.event.pull_request.number }}
399
- cancel-in-progress: true
400
-
401
- jobs:
402
- tests:
403
- name: tests
404
- # Same-repository feature/ and epic/ branches only.
405
- if: >-
406
- ${{ github.event.pull_request.head.repo.full_name == github.repository &&
407
- (startsWith(github.event.pull_request.head.ref, 'feature/') ||
408
- startsWith(github.event.pull_request.head.ref, 'epic/')) }}
409
- runs-on: ubuntu-latest
410
- steps:
411
- - uses: actions/checkout@v4
412
- with:
413
- # Test the exact head commit of the pull request.
414
- ref: ${{ github.event.pull_request.head.sha }}
415
- persist-credentials: false
416
- # Add the repository's real setup steps here (language runtime,
417
- # dependency install), then its real test command.
418
- - name: Run tests
419
- run: |
420
- echo "Replace this step with the repository's test command."
421
- exit 1
422
-
423
- gate:
424
- # This name IS the check-run name the done gate waits for. Keep it literal.
425
- name: epic-implementer-ci / gate
426
- needs: [tests]
427
- if: ${{ always() }}
428
- runs-on: ubuntu-latest
429
- steps:
430
- - name: Aggregate the result
431
- env:
432
- # Keep this identical to the tests job's condition.
433
- IN_SCOPE: ${{ github.event.pull_request.head.repo.full_name == github.repository && (startsWith(github.event.pull_request.head.ref, 'feature/') || startsWith(github.event.pull_request.head.ref, 'epic/')) }}
434
- TESTS_RESULT: ${{ needs.tests.result }}
435
- run: |
436
- if [ "$IN_SCOPE" != "true" ]; then
437
- echo "Out-of-scope pull request: the gate passes without running tests."
438
- exit 0
439
- fi
440
- if [ "$TESTS_RESULT" = "success" ]; then
441
- echo "Tests passed."
442
- exit 0
443
- fi
444
- echo "Tests concluded '$TESTS_RESULT', so the gate fails."
445
- exit 1
446
- ```
447
-
448
- Fill in the `tests` job with the repository's real test command. Find it in the
449
- existing CI workflows, `package.json` scripts, a `Makefile`, or the README. Ask
450
- the human if it is unclear. Do not leave the placeholder step: it fails on
451
- purpose.
452
-
453
- **Things to keep**, in this file and in `claude-review.yml`:
454
-
455
- - `if: ${{ always() }}` on the gate. Without it, a failed or skipped test job
456
- would leave the gate check missing instead of red.
457
- - The gate is green only when the tests job concluded `success`. A skipped or
458
- cancelled test job is never treated as a pass.
459
- - `persist-credentials: false` and the checkout of the pull request's head SHA.
460
- - **Static job names.** For unattended runs the server must read every job's
461
- check name straight from both files. If either file has any of the following,
462
- the server cannot read the names, and approval refuses every required check:
463
- - a `strategy.matrix` on any job;
464
- - a job-level `uses:` (a reusable workflow call). A `uses:` inside a step is
465
- fine;
466
- - a `${{ … }}` expression in any job id or job `name:`.
467
-
468
- Put matrix or reusable-workflow jobs in a different workflow file if you need
469
- them.
470
-
471
- ### 6b. The `migration-guard` job (only for Alembic repositories)
472
-
473
- Check whether the repository has `alembic.ini` at its **root** on the default
474
- branch:
475
-
476
- ```bash
477
- git fetch origin
478
- git ls-tree --name-only origin/<default-branch> alembic.ini
479
- ```
480
-
481
- If that prints nothing, skip this part. If it prints `alembic.ini`, the server
482
- also requires a job whose id is exactly `migration-guard`, with a step that runs
483
- exactly `python scripts/check_alembic_migration_graph.py`. The repository must
484
- contain that script. It should fail when the Alembic revision graph has more
485
- than one head, a duplicate revision id, a missing parent, or a cycle. Add the
486
- job to `needs:` in the gate and fail the gate unless it concluded `success`. If
487
- the human does not want this, they can run attended instead.
488
-
489
- ### 6c. Land both files
490
-
491
- 1. Ask the human before you branch and push.
492
- 2. Create a branch, for example `chore/epic-implementer-workflows`.
493
- 3. Commit `.github/workflows/epic-implementer-ci.yml` and the
494
- `.github/workflows/claude-review.yml` that step 5 wrote.
495
- 4. Open a pull request into the default branch with `gh pr create`.
496
- 5. Ask the human to review and merge it. Do not merge it yourself.
497
-
498
- **Secret the human must add** (repository Settings, then Secrets and variables,
499
- then Actions): a secret with the exact name you passed to `--secret-name`,
500
- holding a Claude Code OAuth token. The human can create one with
501
- `claude setup-token`. Never ask them to paste the token to you.
502
-
503
- **Check it worked:** after the merge, re-run `readiness --json`.
504
- `server.review-workflow`, `server.conductor-ci-workflow`, and
505
- `server.repository-workflow-readiness` should pass.
506
-
507
- **If it fails:** readiness names the missing item, for example "does not emit
508
- the Reviewed-SHA: marker". A detail saying Bridge "could not read" a file means
509
- the read failed, not that the file is wrong. Re-run readiness. If it keeps
510
- failing, contact Bridge support.
511
-
512
- ## 7. Index the repository, after the workflows merge
513
-
514
- **Why:** `setup-epic` cuts `epic/<EPIC-KEY>` at the exact commit the code index
515
- was built from, not at the tip of the default branch. If that commit is older
516
- than the merge from step 6, the epic branch has no workflows. Then child PRs into
517
- it get no CI and no review, and every ticket waits forever. Each child ticket's
518
- plan also uses the index to find code.
519
-
520
- **Ask first?** No. Indexing runs on the server and changes nothing in the
521
- repository. It can take a while on a large repository.
522
-
523
- After the step 6 pull request has merged, run the `/parse-repository` slash
524
- command, even if the repository was indexed before. Then poll the
525
- `parse_repository` MCP tool with `action: "status"` until it reports completed.
526
- `doctor` also shows the indexing state.
527
-
528
- You will confirm the cut commit in [§11a](#11a-plan-the-epic), once a plan
529
- exists.
530
-
531
- **If it fails:** report the status message to the human. Do not start a real
532
- run until indexing has completed after the merge.
533
-
534
- ## 8. Unattended prerequisites
535
-
536
- **Why:** an unattended run merges on its own, so three things are checked
537
- before a run is created. `--attended` skips them. `setup-epic` (which `/plan-epic`
538
- runs) and the `drive-epic` preview name each one differently.
539
-
540
- **Repository consent**
541
- - `setup-epic` refusal: `target_not_allowed`. `drive-epic` preview:
542
- `unattended_consent`. Readiness row: `server.unattended-consent`.
543
- - It is **on by default**. The repository owner switches "Allow unattended Epic
544
- Implementer runs" on the repository's Setup page in the Bridge admin panel.
545
- Only a human can change it. If it is already on, contact Bridge support.
546
-
547
- **An escalation channel** (where alerts go when the run needs a person)
548
- - `setup-epic` refusal: `webhook_unverified`. `drive-epic` preview:
549
- `unattended_notify_default`. Readiness row: `server.unattended-notify-default`.
550
- - The simplest channel is the email address on the Bridge account. It needs no
551
- extra step when the account has one.
552
- - A webhook also works, but only through a `--policy-file` that sets
553
- `notify.webhook_url`. `/plan-epic` and `/drive-epic-run` never pass a policy
554
- file, so the webhook route needs the shell `drive-epic` ([§11c](#11c-attended-runs)
555
- shows the command form). `notify.local_sink` does not count.
556
-
557
- ```json
558
- { "notify": { "webhook_url": "https://example.com/your-webhook" } }
559
- ```
560
-
561
- A policy file is the **complete** run policy, so keep it minimal. The server
562
- tests the webhook when the run activates, so it must be reachable from the
563
- internet.
564
-
565
- **The two workflows**
566
- - `setup-epic` refusal: `repository_readiness_unconfirmed`. `drive-epic`
567
- preview: `repository_readiness`. Readiness row:
568
- `server.repository-workflow-readiness`.
569
- - Finish step 6. The message names the missing file, marker, or job.
570
-
571
- **Readiness could not be read**
572
- - `setup-epic` refusal: `readiness_unreadable`.
573
- - The server did not report these facts. Retry. If it persists, contact Bridge
574
- support.
575
-
576
- **Ask first?** Yes for anything that changes an account or admin setting. Only
577
- the human can change these.
578
-
579
- ## 9. Merge credential and merge modes
580
-
581
- **Why:** in an unattended run, the executor on this machine merges each child PR
582
- into the epic branch with `gh pr merge`. In the default local mode it uses
583
- **only** the token in `BAPI_LOCAL_MERGE_TOKEN`. (A run in machine-user mode uses
584
- only `BAPI_MACHINE_MERGE_TOKEN` instead.) It never falls back to the human's `gh`
585
- login, `GH_TOKEN`, or `GITHUB_TOKEN`. Without the token, merges are refused. The
586
- diagnostics show this only as a warning (`conductor.merge-credential`), so it is
587
- easy to miss.
588
-
589
- **Ask first?** Yes. This concerns the human's GitHub credential.
590
-
591
- The executor inherits its environment from the process that runs `drive-epic`.
592
- So the variable must be set in the shell that launches `drive-epic`. If you use
593
- `/drive-epic-run`, that is **your own session's** environment, so the human must
594
- set it before starting the editor or `claude`.
595
-
596
- The simplest source is the human's own GitHub CLI token:
597
-
598
- ```bash
599
- export BAPI_LOCAL_MERGE_TOKEN="$(gh auth token)"
600
- ```
601
-
602
- To make it last, suggest the human add that exact line (the command, not the
603
- token value) to their shell profile, for example `~/.zshrc`, then open a new
604
- terminal and restart the editor. Never write the token value into any file, and
605
- never add it to the repository.
606
-
607
- If an executor is already running for a run, it will not see a newly exported
608
- value. It must be restarted from a shell that has it.
609
-
610
- **Check it worked:** `npx -y @bridge_gpt/mcp-server epic-implementer doctor`
611
- no longer warns about the merge credential. Run it from the same shell.
612
-
613
- ### Optional: GitHub Actions merge mode
614
-
615
- Use this only if the human wants merges done by a GitHub Actions workflow
616
- instead of this machine. It applies only to a run whose policy file declares
617
- `"merge_execution_mode": "github_actions"`. Otherwise skip it.
618
-
619
- Ask the human to run, in their own terminal (it asks before writing):
620
-
621
- ```bash
622
- npx -y @bridge_gpt/mcp-server install conductor --merge-workflow --codeowner <@org/team|@user>
623
- ```
624
-
625
- `--codeowner` is required: the one GitHub user or team who must review changes
626
- to the merge workflow. Add `--dry-run` first to preview. The command writes
627
- `.github/workflows/epic-implementer-merge.yml` and two helper files, pushes a
628
- branch with the human's own git, and opens a pull request with their own `gh`.
629
- It never merges it.
630
-
631
- After the human merges that pull request, three manual steps remain. The human
632
- does all three:
633
-
634
- 1. Create a repository Actions secret named `BAPI_API_KEY` holding the
635
- repository's Bridge API key.
636
- 2. Merge the rule from `.bridge/merge-workflow/CODEOWNERS.fragment` into the
637
- active CODEOWNERS file. The fragment does nothing on its own.
638
- 3. Add a default-branch rule that requires a pull request and code-owner review.
639
- Until it exists, the workflow file is not protected.
640
-
641
- ## 10. Verify
642
-
643
- **Before a plan exists**, use readiness only:
644
-
645
- ```bash
646
- npx -y @bridge_gpt/mcp-server epic-implementer readiness --json
647
- ```
648
-
649
- The `drive-epic` preview is not useful yet. Without a plan it only says
650
- `decision: stop`, with no reason, or a generic "not ready" refusal.
651
-
652
- **Done means:**
653
-
654
- - These rows pass: `server.supervisor-setup`, `server.supervisor-config`,
655
- `server.supervisor-required-checks`, and `server.github-credentials`.
656
- - For unattended runs, these pass too: `server.unattended-consent`,
657
- `server.unattended-notify-default`, and `server.repository-workflow-readiness`.
658
- If a `server.admission-required-checks` row is present, it passes too.
659
- - `server.worker-present` and `server.single-transition-authority` pass. These
660
- are the server's own health. If they fail, contact Bridge support.
661
- - `conductor.merge-credential` passes in the shell that will launch runs.
662
- - The `get_epic_snapshot` and `explain_run` tools are available.
663
- - Every other `fail` is explained, and the human accepted it.
664
-
665
- **After `/plan-epic` has written a plan**, preview the launch:
666
-
667
- ```bash
668
- npx -y @bridge_gpt/mcp-server drive-epic <EPIC> --plan-file <path to epic-plan.dag.json> --dry-run --json
669
- ```
670
-
671
- It changes nothing. Its `decision` is `create`, `attach`, `refuse`, or `stop`. A
672
- `refuse` carries `refusal.reason_id` and `refusal.remedy`. Map the `reason_id`:
673
-
674
- - `supervisor_setup`, `supervisor_config` — step 5.
675
- - `github_credentials` — step 4.
676
- - `unattended_consent`, `unattended_notify_default`, `repository_readiness` — step 8.
677
- - `remote-reconciler-not-live` — the Bridge server side. Contact Bridge support.
678
- - Anything else — read its `remedy`, then check the table in step 12 before you
679
- run anything.
680
-
681
- Report to the human what passed, what failed, and what they still need to do.
682
-
683
- ## 11. First run
684
-
685
- ### 11a. Plan the epic
686
-
687
- `/plan-epic` needs an **existing epic ticket**. Run `/plan-epic <EPIC>` with its
688
- key, for example `SHOP-100`. Free text instead of a key gives no epic key, and
689
- no run can be created from it.
690
-
691
- It explores the code, splits the epic into child tickets, and asks the human to
692
- approve the split. It writes its files to `<docs_dir>/epic-plans/<slug>/`, where
693
- `<docs_dir>` is the docs folder the `ping` MCP tool reports (often `docs/tmp`).
694
- The plan file is `epic-plan.dag.json`.
695
-
696
- **Before the plan is approved, check every `ticket_key` in
697
- `epic-plan.dag.json`.** Each one must be a real ticket key. A placeholder such as
698
- `TBD-1` must not reach approval. If you see one, stop and create or link the
699
- real tickets first.
700
-
701
- **The last step of `/plan-epic` creates and approves an unattended run** (it
702
- runs `setup-epic` without `--attended`). For an attended run, see §11c before
703
- you reach that step.
704
-
705
- Before that step runs `setup-epic` for real, run its dry run and check the cut
706
- commit (plain output, not `--json`):
707
-
708
- ```bash
709
- npx -y @bridge_gpt/mcp-server setup-epic --epic-key <EPIC> \
710
- --plan-file <path to epic-plan.dag.json> --dry-run
711
- git fetch origin
712
- git ls-tree --name-only <sha from the "Cut:" line> .github/workflows/
713
- ```
714
-
715
- The listing must include `claude-review.yml` and `epic-implementer-ci.yml`. If
716
- it does not, the index is older than the step 6 merge. Go back to step 7 and
717
- re-index first.
718
-
719
- **If `setup-epic` fails, what happened depends on where it failed:**
720
-
721
- - **`setup-epic REFUSED (<reason>)`** — a check before creation failed.
722
- `target_not_allowed`, `webhook_unverified`, `repository_readiness_unconfirmed`,
723
- and `readiness_unreadable` are all this kind. **Nothing was created.** Fix the
724
- named item (step 8) and run it again.
725
- - **`The plan was NOT approved: …`** — the server refused at approval. By then
726
- the run **was** created, the epic branch **was** cut, and the plan **was**
727
- stored. The run waits in `planning`. The message always talks about unattended
728
- consent, whatever the real cause. Ignore that wording and read the `Detail:`
729
- line for `predicate` and `reason_code`:
730
- - `admission_evidence_unverifiable` or `admission_evidence_denied` with
731
- predicate `required_checks` — the required check is not a static job name in
732
- the two workflow files (step 5a, and "Things to keep" in 6a).
733
- - predicate `repository_readiness` — step 6.
734
- - predicate `webhook` or `notify_webhook` — step 8, escalation channel.
735
- - predicate `target_allowed` or `unattended_consent` — step 8, consent.
736
- - any other predicate — report the `predicate` and `reason_code` to the human.
737
-
738
- Fix the cause, then run the same `setup-epic` command again. It reuses the
739
- existing run instead of creating a second one.
740
-
741
- ### 11b. Drive an unattended run
742
-
743
- In Claude Code or Cursor:
744
-
745
- ```text
746
- /drive-epic-run <EPIC> <path to epic-plan.dag.json>
747
- ```
748
-
749
- It previews the launch, asks the human once, creates the run (or attaches to the
750
- one `/plan-epic` created), starts an executor, and watches the run to the end. It
751
- accepts no flags, so it cannot pass `--attended` or `--policy-file`. When it
752
- creates a run, the run must be unattended.
753
-
754
- From a shell, the same launch is:
755
-
756
- ```bash
757
- npx -y @bridge_gpt/mcp-server drive-epic <EPIC> --plan-file <path to epic-plan.dag.json>
758
- ```
759
-
760
- Add `--policy-file <policy.json>` for a webhook (step 8). Run it from the
761
- repository root, in a shell that has `BAPI_LOCAL_MERGE_TOKEN`. Always pass
762
- `--plan-file`. Without it, `drive-epic` searches only `docs/tmp/epic-plans/` (or
763
- `BAPI_DOCS_DIR`), which may not be where `/plan-epic` wrote. `drive-epic` starts
764
- a run-scoped executor in the background. Its log is
765
- `.bridge/executors/<run>.log`. The executor exits by itself when the run is done
766
- or abandoned.
767
-
768
- ### 11c. Attended runs
769
-
770
- An attended run never merges by itself. It still needs a required check that
771
- really runs on child PRs into `epic/<EPIC-KEY>` (step 5a, attended branch), and a
772
- review verdict on those PRs (step 5b, `--branches` including `epic/**`).
773
-
774
- 1. Plan with `/plan-epic <EPIC>`, but **do not let its last step run
775
- `setup-epic`**. That step would create an unattended run whenever the
776
- unattended prerequisites hold. Tell the human, and skip that step with their
777
- agreement. If it has already run and refused with `setup-epic REFUSED`,
778
- nothing was created and you can continue.
779
- 2. Check every `ticket_key` in `epic-plan.dag.json`, as in §11a.
780
- 3. Launch from a shell, from the repository root:
781
-
782
- ```bash
783
- npx -y @bridge_gpt/mcp-server drive-epic <EPIC> \
784
- --plan-file <path to epic-plan.dag.json> --attended
785
- ```
786
-
787
- `/drive-epic-run` cannot create an attended run.
788
-
789
- ### 11d. Monitor
790
-
791
- - MCP tools: `get_epic_snapshot` (the full run state) and `explain_run` (why a
792
- run or ticket is stuck). Both need the `epic_implementer` profile from step 5.
793
- - Notifications: `npx -y @bridge_gpt/mcp-server notifications --repo <repo_name> --run <EPIC> --follow`.
794
- - Quick health: `npx -y @bridge_gpt/mcp-server epic-implementer epic-status --epic-key <EPIC>`.
795
-
796
- ### 11e. Stop and recover
797
-
798
- Always diagnose with the `explain_run` MCP tool first. Then apply one verb. Ask
799
- the human before any of them. Each runs as:
800
-
801
- ```bash
802
- npx -y @bridge_gpt/mcp-server epic-implementer <verb> --epic-run-id <EPIC>
803
- ```
804
-
805
- `--epic-run-id` takes the run id, or the epic key when the epic has exactly one
806
- active run.
807
-
808
- The two you will use most:
809
-
810
- | Verb | Use it to |
811
- |---|---|
812
- | `unpark --ticket-key <key>` | Send a parked (`needs_human`) ticket back into its gates once the cause is fixed. |
813
- | `stop-run` | Stop the run now: no new work, queued work cancelled. The record stays. |
814
-
815
- Advanced verbs. Use them only when `explain_run` points at them:
816
-
817
- | Verb | Use it to |
818
- |---|---|
819
- | `abandon-run` | End the run for good. **Terminal and irreversible.** |
820
- | `resume-run [--clear-quarantine]` | Resume a paused run. |
821
- | `adopt-current-head-and-unpark --ticket-key <key>` | Recover a ticket parked because someone pushed to its PR. |
822
- | `continue-child --ticket-key <key>` | Let a parked child carry on without resetting its attempt. |
823
- | `continuation-receipt --ticket-key <key>` | Check whether a `continue-child` request took effect (read-only). |
824
- | `resume-ci --ticket-key <key>` | Resume a child parked on a CI stop once CI is green. |
825
- | `dispatch-remediation --ticket-key <key> --context-file <path>` | Queue a repair job with your notes. |
826
- | `merge-child --pr <number>` | Merge the run's child PR through the shared merge service. |
827
- | `scope-reparse --scope-id <scope>` | Re-index the run's own index scope. |
828
- | `scope-catch-up --scope-id <scope>` | Replay merges the run's scope missed. |
829
- | `patch-policy --patch-file <path>` | Change part of the run's policy. |
830
-
831
- In Claude Code or Cursor, `/drive-epic-run` applies these for you within limits,
832
- and asks when it must.
833
-
834
- ## 12. Troubleshooting and known-wrong remedies
835
-
836
- Current tools print complete commands. Replace any placeholder in them with a
837
- real value before you run them. Older tool versions printed the shorthand in the
838
- left-hand column below, which does not work as typed. Use the right-hand column
839
- instead.
840
-
841
- | Printed remedy | Problem | Run this instead |
842
- |---|---|---|
843
- | `install-bridge connect-github` | `install` accepts no such argument, and there is no `npx` prefix. | `npx -y @bridge_gpt/mcp-server connect-github --repo <repo_name>` (step 4) |
844
- | `install-bridge conductor` or `install conductor` with no flags | Missing the `npx` prefix and the required `--required-check`. | The full command in step 5c |
845
- | `install-bridge conductor --merge-workflow` (older tools) | Missing the `npx` prefix and the required `--codeowner`. | `npx -y @bridge_gpt/mcp-server install conductor --merge-workflow --codeowner <@org/team\|@user>`; replace the placeholder with the one reviewer (step 9) |
846
- | `npx @bridge_gpt/mcp-server install` | Missing `-y`, so `npx` stops to ask. | `npx -y @bridge_gpt/mcp-server install` (step 3) |
847
- | Any remedy for `repository_readiness_unconfirmed` that names an install command | No install command creates the workflows. | Step 6, then step 7 |
848
- | `The plan was NOT approved: this repository is no longer authorized for unattended runs` | Printed for every approval refusal, whatever the cause. | Read `Detail:` (§11a) |
849
- | `install conductor --executor-id <id> --repo-wide` for executor readiness | Not needed to launch. | Nothing. `drive-epic` starts an executor per run. |
850
-
851
- Other common problems:
852
-
853
- | Symptom | Cause | Fix |
854
- |---|---|---|
855
- | Every `<launcher>` command exits `1` with a list of variable names | Old Epic Implementer variable names are set. | Step 2, retired-variable check. |
856
- | `install conductor` prints `Aborted` and exits `0` | No terminal, or the human answered no. | Rule 5: the human runs it in their own terminal. |
857
- | `--merge-workflow` prints `consent_declined` | No terminal, or the human answered no. | Rule 5. |
858
- | 403 on any command | `repo_name` does not match byte for byte. | Step 3. |
859
- | `get_epic_snapshot` is not available | The MCP client was not restarted, or the profile lacks `epic_implementer`. | Step 5, "After it finishes". |
860
- | Child PRs get no CI or no review at all | The epic branch was cut before the workflows merged, or `--branches` / the CI trigger lacks `epic/**`. | Steps 5b, 6a, and 7. |
861
- | Tickets wait forever at CI | The required check name does not match a check that runs on child PRs. | Step 5a. Compare with `gh pr view <n> --json statusCheckRollup`. |
862
- | Tickets pass CI but no tests ran | A narrowed `feature/<PREFIX>-` does not match the child branches. | Step 6a. |
863
- | Approval refused: `admission_evidence_unverifiable` on `required_checks` | The required check is not a static job name in the two workflow files. | Steps 5a and 6a. |
864
- | Child PRs are never merged | `BAPI_LOCAL_MERGE_TOKEN` was not set for the executor. | Step 9. |
865
- | `merge_execution_ineligible` | The policy declares `github_actions` merge mode, but the merge workflow is missing or not ready. | Step 9, optional part. Or remove that line from the policy. |
866
- | `drive-epic` cannot find the plan | It searched `docs/tmp/epic-plans/` only. | Pass `--plan-file`. |
867
- | The reconciler or worker rows fail | The Bridge server side is not healthy. | Nothing to fix locally. Contact Bridge support. |
1
+ # Epic Implementer install guide
2
+
3
+ This file is now a short pointer. The one first-run guide is
4
+ [epic-implementer/getting-started.md](./epic-implementer/getting-started.md).
5
+ `npx -y @bridge_gpt/mcp-server install` writes that guide into your project at
6
+ `docs/install/epic-implementer-install.md`. Run it again at any time to refresh
7
+ the file.
8
+
9
+ The first run has four steps: install, set up (`npx -y @bridge_gpt/mcp-server
10
+ install conductor`), define the epic (`/define-tickets`), and launch it
11
+ (`/drive-epic-run <EPIC>`). For every option and command, read
12
+ [EPIC-IMPLEMENTER.md](./EPIC-IMPLEMENTER.md).