@bridge_gpt/mcp-server 0.2.71 → 0.2.73

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 (198) hide show
  1. package/README.md +55 -17
  2. package/build/agent-launchers/claude-executor-adapter.js +22 -3
  3. package/build/agent-notes.js +171 -95
  4. package/build/agents.generated.js +7 -7
  5. package/build/bridge-permissions.js +31 -0
  6. package/build/bridge-worktree-inspection.js +237 -0
  7. package/build/check-evidence.js +6 -0
  8. package/build/ci-system-detection.js +50 -0
  9. package/build/ci-trigger-adapters.js +631 -0
  10. package/build/ci-trigger-install.js +106 -0
  11. package/build/claude-review-workflow.js +1 -1
  12. package/build/cli-help.js +6 -0
  13. package/build/codex-auto-recovery.js +126 -0
  14. package/build/codex-launcher-pin.js +33 -2
  15. package/build/codex-skill-adapter.js +5 -1
  16. package/build/command-host.js +33 -0
  17. package/build/commands.generated.js +7 -6
  18. package/build/conductor/bridge-api-client.js +1352 -50
  19. package/build/conductor/bring-up-facts.js +18 -5
  20. package/build/conductor/command-drift-production.js +42 -17
  21. package/build/conductor/command-drift.js +47 -0
  22. package/build/conductor/declare-blocked.js +554 -0
  23. package/build/conductor/doctor.js +187 -28
  24. package/build/conductor/driver-commands.js +141 -0
  25. package/build/conductor/driver-guard.js +277 -0
  26. package/build/conductor/driver-lapse.js +321 -0
  27. package/build/conductor/driver-register.js +176 -0
  28. package/build/conductor/driver-release.js +174 -0
  29. package/build/conductor/driver-session-state.js +315 -0
  30. package/build/conductor/epic-branch-ci-inspection.js +222 -29
  31. package/build/conductor/epic-implementer-cli.js +213 -13
  32. package/build/conductor/epic-server-database.js +162 -0
  33. package/build/conductor/epic-server-guidance.js +278 -0
  34. package/build/conductor/epic-server-journal.js +239 -0
  35. package/build/conductor/epic-server-processes.js +324 -0
  36. package/build/conductor/epic-server-recipe.js +397 -0
  37. package/build/conductor/epic-server-runtime.js +1207 -0
  38. package/build/conductor/epic-server-sfcc.js +107 -0
  39. package/build/conductor/epic-server-state.js +427 -0
  40. package/build/conductor/epic-server.js +594 -0
  41. package/build/conductor/gate-discovery.js +281 -10
  42. package/build/conductor/gate-settings-review.js +525 -5
  43. package/build/conductor/git-hooks-uninstall.js +112 -0
  44. package/build/conductor/git-hooks.js +81 -15
  45. package/build/conductor/guided-repair.js +10 -1
  46. package/build/conductor/install-doctor.js +2 -4
  47. package/build/conductor/launch-need-probes.js +6 -53
  48. package/build/conductor/launch-plan.js +318 -121
  49. package/build/conductor/local-merge.js +12 -1
  50. package/build/conductor/merge-execution-contract.js +1 -1
  51. package/build/conductor/merged-child-check.js +2 -1
  52. package/build/conductor/prerequisite-inputs.js +1213 -0
  53. package/build/conductor/readiness-assessment.js +93 -0
  54. package/build/conductor/readiness-cli.js +30 -9
  55. package/build/conductor/readiness-prerequisites.js +77 -5
  56. package/build/conductor/readiness-sections.js +146 -126
  57. package/build/conductor/readiness.js +21 -3
  58. package/build/conductor/recovery-cli.js +236 -15
  59. package/build/conductor/recovery-operations.js +34 -4
  60. package/build/conductor/repair-contract.js +33 -0
  61. package/build/conductor/tools.js +36 -4
  62. package/build/conductor/wait-run-attention.js +115 -0
  63. package/build/conductor/wait-run-cli.js +300 -21
  64. package/build/conductor/worker-database-doctor-inspector.js +34 -2
  65. package/build/conductor/worker-setup-tally.js +27 -0
  66. package/build/credential-store.js +96 -21
  67. package/build/dependency-install-declarations.js +212 -0
  68. package/build/docs.generated.js +4 -4
  69. package/build/doctor.js +91 -8
  70. package/build/drive-epic-help.js +23 -4
  71. package/build/drive-epic.js +1841 -340
  72. package/build/engine-paths.js +20 -0
  73. package/build/epic-branch-ci-summary.js +140 -0
  74. package/build/epic-capability-statement.js +107 -0
  75. package/build/epic-ci-workflow-drift.js +30 -15
  76. package/build/epic-ci-workflow-install.js +110 -42
  77. package/build/epic-ci-workflow-v2.js +274 -0
  78. package/build/epic-ci-workflow.js +38 -12
  79. package/build/epic-implementer-bin.js +2184 -52
  80. package/build/epic-launch-context.js +607 -0
  81. package/build/epic-launch-profile.js +1 -1
  82. package/build/epic-server-record.js +273 -0
  83. package/build/epic-shared/bridge-client.js +11 -3
  84. package/build/escalation-reachability.js +43 -0
  85. package/build/executor/ci-fix-test-runs.js +334 -0
  86. package/build/executor/cli.js +2 -0
  87. package/build/executor/completion-contract.js +24 -1
  88. package/build/executor/credentials.js +1 -1
  89. package/build/executor/delivery-observations.js +113 -0
  90. package/build/executor/delivery-outcome.js +30 -0
  91. package/build/executor/dependency-refresh-runner.js +132 -0
  92. package/build/executor/dependency-refresh.js +530 -0
  93. package/build/executor/deps.js +4 -0
  94. package/build/executor/env.js +119 -17
  95. package/build/executor/epic-server-context.js +141 -0
  96. package/build/executor/gate-qualification-job.js +127 -26
  97. package/build/executor/harness-coverage.js +19 -0
  98. package/build/executor/http-client.js +87 -6
  99. package/build/executor/index.js +2 -1
  100. package/build/executor/install-preflight.js +1 -1
  101. package/build/executor/job-runner.js +659 -87
  102. package/build/executor/likely-tests.js +94 -97
  103. package/build/executor/observation.js +8 -0
  104. package/build/executor/pre-pr-checks.js +363 -0
  105. package/build/executor/prompt-spec.js +127 -5
  106. package/build/executor/reconcile-overlap-job.js +5 -3
  107. package/build/executor/required-verification.js +28 -0
  108. package/build/executor/required-work-diagnostics.js +32 -0
  109. package/build/executor/required-work-ledger.js +955 -39
  110. package/build/executor/results.js +100 -0
  111. package/build/executor/service-discovery.js +42 -0
  112. package/build/executor/service-lifecycle.js +109 -2
  113. package/build/executor/service-uninstall.js +205 -0
  114. package/build/executor/service-unit.js +5 -3
  115. package/build/executor/terminal-mutation.js +8 -0
  116. package/build/executor/test-clock.js +3 -0
  117. package/build/executor/verification-hints.js +179 -0
  118. package/build/executor/worker-command.js +126 -5
  119. package/build/executor/worker-database-config.js +281 -0
  120. package/build/executor/worker-database-target.js +16 -12
  121. package/build/executor/worker-database.js +575 -116
  122. package/build/executor/worker-finalization.js +71 -10
  123. package/build/executor/worker-guard-hook.js +10 -2
  124. package/build/executor/worker-resources.js +25 -3
  125. package/build/executor/worker-verification-guidance.js +55 -5
  126. package/build/executor/worktree-inspection.js +42 -0
  127. package/build/executor/worktree.js +20 -1
  128. package/build/executor-launch.js +54 -2
  129. package/build/generated-assets-catalog.js +2 -2
  130. package/build/github-sign-in.js +1 -1
  131. package/build/index.js +1111 -381
  132. package/build/init.js +29 -14
  133. package/build/install-bridge-conductor-answers.js +465 -0
  134. package/build/install-bridge-conductor-apply.js +259 -0
  135. package/build/install-bridge-conductor-assessment.js +895 -0
  136. package/build/install-bridge-conductor-compact.js +161 -0
  137. package/build/install-bridge-conductor-contracts.js +63 -0
  138. package/build/install-bridge-conductor-gate.js +1383 -188
  139. package/build/install-bridge-conductor-setup.js +637 -92
  140. package/build/install-bridge-conductor.js +3163 -740
  141. package/build/install-bridge.js +601 -128
  142. package/build/install-maintenance.js +127 -0
  143. package/build/install-reexec.js +1 -1
  144. package/build/launcher-config-inspection.js +162 -1
  145. package/build/local-cleanup.js +59 -0
  146. package/build/mcp-grant-candidates.js +767 -0
  147. package/build/mcp-grant-doctor.js +63 -0
  148. package/build/mcp-grant.js +288 -0
  149. package/build/mcp-host-targets.js +8 -0
  150. package/build/mcp-identity.js +23 -0
  151. package/build/mcp-install-state.js +68 -2
  152. package/build/mcp-invoke.js +126 -13
  153. package/build/mcp-presets.js +107 -0
  154. package/build/mcp-provisioning.js +134 -2
  155. package/build/mcp-registration-doctor.js +31 -2
  156. package/build/mcp-server-invocation.js +6 -1
  157. package/build/merge-workflow-install.js +236 -111
  158. package/build/package-script-semantics.js +10 -0
  159. package/build/pipeline-utils.js +1 -1
  160. package/build/pipelines.generated.js +6 -6
  161. package/build/plan-discovery.js +97 -4
  162. package/build/plan-execution-ledger.js +248 -9
  163. package/build/plan-generation-io.js +262 -0
  164. package/build/plan-generation.js +424 -0
  165. package/build/plane/build-freshness.js +6 -1
  166. package/build/plane/cli.js +75 -9
  167. package/build/plane/plane-freshness.js +23 -7
  168. package/build/plane/preflight.js +50 -10
  169. package/build/plane/shutdown.js +19 -0
  170. package/build/plane/terminal-run-cleanup.js +23 -5
  171. package/build/plane/terminal-run-status.js +4 -0
  172. package/build/printed-remedy-commands.js +229 -15
  173. package/build/readiness-check.js +1 -1
  174. package/build/readiness-prerequisites.generated.js +311 -4
  175. package/build/readme.generated.js +1 -1
  176. package/build/repository-state-paths.js +38 -0
  177. package/build/repository-toolchains.js +50 -8
  178. package/build/run-unit-tests-launcher.js +8 -1
  179. package/build/setup-change-policy.js +32 -0
  180. package/build/setup-epic.js +1192 -198
  181. package/build/setup-progress.js +44 -0
  182. package/build/setup-question.js +180 -0
  183. package/build/start-tickets.js +4 -0
  184. package/build/test-command-detection.js +32 -88
  185. package/build/test-support/notes-fs.js +40 -0
  186. package/build/third-party-mcp-targets.js +30 -0
  187. package/build/ticket-delivery-enrollment.js +30 -8
  188. package/build/ticket-delivery-run-scope.js +128 -0
  189. package/build/upgrade-cli.js +85 -2
  190. package/build/v2-readiness-requirements.js +28 -1
  191. package/build/version.generated.js +3 -3
  192. package/build/worker-guard-hook-bin.js +2 -2
  193. package/build/worktrees.js +105 -0
  194. package/docs/EPIC-IMPLEMENTER-INSTALL.md +9 -1
  195. package/docs/EPIC-IMPLEMENTER.md +5 -0
  196. package/docs/epic-implementer/getting-started.md +42 -15
  197. package/docs/epic-implementer/self-hosting.md +14 -1
  198. package/package.json +2 -2
@@ -11,7 +11,6 @@
11
11
  * mirrored contract (`conductor/merge-execution-contract.ts`).
12
12
  */
13
13
  import { MCP_PACKAGE_NAME } from "./mcp-identity.js";
14
- import { EPIC_IMPLEMENTER_CI_CHECK_NAME } from "./epic-ci-workflow.js";
15
14
  /** The non-interactive launcher every printed command starts with. */
16
15
  const LAUNCHER = `npx -y ${MCP_PACKAGE_NAME}`;
17
16
  /** The top-level subcommand tokens `index.ts` dispatches that remedies name. */
@@ -33,11 +32,11 @@ export const CONSUMER_GUIDE_PATH = "docs/install/epic-implementer-install.md";
33
32
  */
34
33
  export const CONSUMER_GUIDE_POINTER = `${CONSUMER_GUIDE_PATH} (write or refresh it with ${PRINTED_INSTALL_COMMAND})`;
35
34
  /**
36
- * Conductor bootstrap with an explicit provider check. Since BAPI-1391 a
37
- * confirmed gate (provider, local, mixed, or none) replaces the old "at least
38
- * one --required-check" rule; a provider check is still the common scripted form.
35
+ * Conductor setup. The plain command is the whole remedy (BAPI-1603): setup plans
36
+ * the repository gate from what it finds, learns and proves the test command, and
37
+ * adds no required check on its own, so no remedy needs to name one.
39
38
  */
40
- export const PRINTED_CONDUCTOR_INSTALL_COMMAND = `${LAUNCHER} install conductor --required-check "${EPIC_IMPLEMENTER_CI_CHECK_NAME}"`;
39
+ export const PRINTED_CONDUCTOR_INSTALL_COMMAND = `${LAUNCHER} install epic-implementer`;
41
40
  /** Conductor bootstrap that also provisions a repository-wide executor service. */
42
41
  export const PRINTED_CONDUCTOR_EXECUTOR_INSTALL_COMMAND = `${PRINTED_CONDUCTOR_INSTALL_COMMAND} --executor-id <id> --repo-wide`;
43
42
  /** Read-only readiness diagnostics. */
@@ -45,14 +44,15 @@ export const PRINTED_DOCTOR_COMMAND = `${LAUNCHER} doctor`;
45
44
  /** Sessionless GitHub App connection. `--repo` is optional for this command. */
46
45
  export const PRINTED_CONNECT_GITHUB_COMMAND = `${LAUNCHER} connect-github`;
47
46
  /**
48
- * BAPI-1536 — save or replace the repository's stored test command. The flag is
49
- * the consent for that one write; the placeholder is never filled in here.
47
+ * BAPI-1536 — replace the repository's test command. Since BAPI-1603 the flag is
48
+ * the owner's command offered for proof, not a direct write: Bridge runs it once
49
+ * and the server stores it only if it passes. The placeholder is never filled in here.
50
50
  */
51
- export const PRINTED_TEST_COMMAND_INSTALL_COMMAND = `${LAUNCHER} install conductor --test-command "<command>"`;
51
+ export const PRINTED_TEST_COMMAND_INSTALL_COMMAND = `${LAUNCHER} install epic-implementer --test-command "<command>"`;
52
52
  /** Explains the `<command>` placeholder; print it beside the test-command remedy. */
53
53
  export const PRINTED_TEST_COMMAND_INSTRUCTION = "Replace <command> with the one command that runs your tests.";
54
- /** Explains the `<check-name>` placeholder; print it beside a conductor command. */
55
- export const PRINTED_CHECK_NAME_INSTRUCTION = "Run setup to create the workflow and store the required check.";
54
+ /** One plain sentence on what setup does; print it beside a conductor command. */
55
+ export const PRINTED_CHECK_NAME_INSTRUCTION = "Run setup to plan the repository gate and store the safe defaults.";
56
56
  /** Explains the `<id>` placeholder of the executor command. */
57
57
  export const PRINTED_EXECUTOR_ID_INSTRUCTION = "Replace <id> with a name for the executor service.";
58
58
  /**
@@ -60,22 +60,236 @@ export const PRINTED_EXECUTOR_ID_INSTRUCTION = "Replace <id> with a name for the
60
60
  * qualification job and drain it with a short-lived repository-wide executor.
61
61
  * The remedy for `local_command_unqualified`.
62
62
  */
63
- export const PRINTED_QUALIFY_GATE_COMMAND = `${LAUNCHER} install-bridge conductor --qualify-gate`;
63
+ export const PRINTED_QUALIFY_GATE_COMMAND = `${LAUNCHER} install epic-implementer --qualify-gate`;
64
64
  /** A persistent repository-wide executor service, which also drains qualification jobs. */
65
- export const PRINTED_REPO_WIDE_EXECUTOR_COMMAND = `${LAUNCHER} install conductor --executor-id <id> --repo-wide`;
65
+ export const PRINTED_REPO_WIDE_EXECUTOR_COMMAND = `${LAUNCHER} install epic-implementer --executor-id <id> --repo-wide`;
66
66
  /** The lifecycle-free executor service-unit generator. */
67
67
  export const PRINTED_EXECUTOR_INSTALL_SERVICE_COMMAND = `${LAUNCHER} executor install-service`;
68
+ /**
69
+ * BAPI-1602 — workflow remedies name the step that CHANGES the failed state, never
70
+ * the command that just printed them. The old text told the reader to run
71
+ * `install epic-implementer --required-check ...`, and that command printed the
72
+ * same text again. Each piece is a short sentence; the combined remedy is built
73
+ * from the same pieces so wording cannot drift between the three cases.
74
+ */
75
+ const REVIEW_WORKFLOW_STEP = `Add .github/workflows/claude-review.yml, or run ${LAUNCHER} install epic-implementer.`;
76
+ const MANAGED_WORKFLOW_STEP = "Merge the setup pull request.";
77
+ const REINDEX_STEP = "Then re-index the repository.";
68
78
  /** Fixed public actions; generated into Python from this source at build time. */
69
79
  export const READINESS_PREREQUISITE_FIXES = {
70
80
  retry: "Retry the readiness check.",
71
- setup: `Run ${PRINTED_CONDUCTOR_INSTALL_COMMAND}, then retry readiness.`,
81
+ setup: "Merge the setup pull request, then retry readiness.",
72
82
  no_index: "Re-index the repository, then retry readiness.",
73
83
  pending_index: "Wait for indexing to finish, then retry readiness.",
74
- missing_workflow: `Run ${PRINTED_CONDUCTOR_INSTALL_COMMAND}, merge the workflow changes, then re-index the repository.`,
75
- explicit_command: `Run ${PRINTED_TEST_COMMAND_INSTALL_COMMAND}. ${PRINTED_TEST_COMMAND_INSTRUCTION}`,
84
+ missing_workflow: `${MANAGED_WORKFLOW_STEP} ${REINDEX_STEP}`,
85
+ missing_review_workflow: `${REVIEW_WORKFLOW_STEP} ${REINDEX_STEP}`,
86
+ missing_review_and_managed_workflows: `${REVIEW_WORKFLOW_STEP} ${MANAGED_WORKFLOW_STEP} ${REINDEX_STEP}`,
87
+ webhook_failed_email_available: "The webhook did not respond. Escalations will go to the account email.",
76
88
  escalation: "Declare a notify webhook, or verify the account email with live email delivery.",
77
89
  self_host: "Check the self-host installation guide, then retry readiness.",
78
90
  consent: "Turn on Allow unattended Epic Implementer runs on the repository Setup page, or use --attended.",
79
91
  github: `Run ${PRINTED_CONNECT_GITHUB_COMMAND}, then retry readiness.`,
92
+ // BAPI-1635 — client-side remedies for known states. None of these is ever sent
93
+ // on the wire: the server maps them to the empty fix (see
94
+ // PUBLISHED_SERVER_COMPATIBLE_FIXES) and the client resolves them by prerequisite ID.
95
+ supervisor_gate: `Run ${PRINTED_CONDUCTOR_INSTALL_COMMAND} to plan the repository gate and store the safe defaults, then retry readiness.`,
96
+ install_setup: `Run ${PRINTED_CONDUCTOR_INSTALL_COMMAND}, then retry readiness.`,
97
+ install_guided: `Run ${PRINTED_INSTALL_COMMAND}, then retry readiness.`,
98
+ executor: `Run ${PRINTED_REPO_WIDE_EXECUTOR_COMMAND}. ${PRINTED_EXECUTOR_ID_INSTRUCTION} Then retry readiness.`,
99
+ doctor: `Run ${PRINTED_DOCTOR_COMMAND} and follow the remedy it prints for this item, then retry readiness.`,
100
+ local_login: "Sign in to Claude on this machine (run claude, then /login), then retry readiness.",
101
+ gh_cli: "Install the GitHub CLI (gh) and run gh auth login, then retry readiness.",
102
+ node_engine: "Install a Node version that satisfies the engines range in the package, then retry readiness.",
103
+ support: "Service availability failed. Report it to Bridge support with the time of this readiness check.",
104
+ profile_policy: "Declare notify.webhook_url in a run policy, then save a profile that uses it with --launch-profile <name> --policy-file <path>.",
105
+ asset_refresh: "Refresh the committed command and agent files, review the changes, then commit them or mark them as customized.",
106
+ reindex_manual: "Re-index the repository (/parse-repository).",
80
107
  none: "",
81
108
  };
109
+ const PUBLISHED_INSTALL_COMMAND = `${LAUNCHER} install epic-implementer --required-check "epic-implementer-ci / gate"`;
110
+ /**
111
+ * BAPI-1635 — the fix texts the PUBLISHED client (0.2.72) accepts from a server.
112
+ * That client drops the whole server prerequisite list when one row carries any
113
+ * other text, so the Python projector may put only these on the wire and sends
114
+ * the empty fix for every richer remedy. These are the exact published bytes, kept
115
+ * as literals: they are NOT built from {@link READINESS_PREREQUISITE_FIXES}, which
116
+ * has changed since. Nothing is added here without a published client that
117
+ * accepts it.
118
+ */
119
+ export const PUBLISHED_SERVER_COMPATIBLE_FIXES = [
120
+ "Retry the readiness check.",
121
+ `Run ${PUBLISHED_INSTALL_COMMAND}, then retry readiness.`,
122
+ "Re-index the repository, then retry readiness.",
123
+ "Wait for indexing to finish, then retry readiness.",
124
+ `Run ${PUBLISHED_INSTALL_COMMAND}, merge the workflow changes, then re-index the repository.`,
125
+ `Run ${LAUNCHER} install epic-implementer --test-command "<command>". Replace <command> with the one command that runs your tests.`,
126
+ "Declare a notify webhook, or verify the account email with live email delivery.",
127
+ "Check the self-host installation guide, then retry readiness.",
128
+ "Turn on Allow unattended Epic Implementer runs on the repository Setup page, or use --attended.",
129
+ `Run ${LAUNCHER} connect-github, then retry readiness.`,
130
+ "",
131
+ ];
132
+ /**
133
+ * BAPI-1635 — the remedy a KNOWN unmet prerequisite resolves to, by catalog ID.
134
+ * Each value is a key of the flat {@link READINESS_PREREQUISITE_FIXES}; the map is
135
+ * separate so the flat object stays string-valued for `Object.values(...)`
136
+ * validators. No ID defaults to `setup`: that text is reserved for evidence of a
137
+ * real setup pull request that needs merging. `retry` is never a default here —
138
+ * it belongs to unknown observations alone.
139
+ */
140
+ export const READINESS_PREREQUISITE_FIXES_BY_ID = {
141
+ 'server.unattended-posture': 'consent',
142
+ 'server.resolved-merge-mode': 'install_setup',
143
+ 'server.provider-repository': 'github',
144
+ 'server.supervisor-setup': 'supervisor_gate',
145
+ 'server.supervisor-config': 'supervisor_gate',
146
+ 'server.supervisor-required-checks': 'supervisor_gate',
147
+ 'server.review-policy': 'install_setup',
148
+ 'server.github-credentials': 'github',
149
+ 'server.provider-default-branch-readable': 'github',
150
+ 'server.github-actions-permission': 'github',
151
+ 'server.merge-execution-workflow': 'install_setup',
152
+ 'server.merge-execution-branch-policy': 'install_setup',
153
+ 'server.reconciler-liveness': 'self_host',
154
+ 'server.executor-readiness': 'executor',
155
+ 'server.review-workflow': 'missing_review_workflow',
156
+ 'server.conductor-ci-workflow': 'install_setup',
157
+ 'server.unattended-notify-default': 'escalation',
158
+ 'server.escalation-webhook-reachable': 'escalation',
159
+ 'server.repository-workflow-readiness': 'install_setup',
160
+ 'server.database-migration-current': 'self_host',
161
+ 'server.worker-present': 'self_host',
162
+ 'server.single-transition-authority': 'self_host',
163
+ 'server.indexed-workflows': 'reindex_manual',
164
+ 'server.integration-branch-unset': 'install_setup',
165
+ 'server.service-availability': 'support',
166
+ 'install.claude-login': 'local_login',
167
+ 'install.identity': 'install_guided',
168
+ 'install.credential': 'install_guided',
169
+ 'install.connectivity': 'install_guided',
170
+ 'install.bootstrap': 'install_guided',
171
+ 'install.integrations': 'install_guided',
172
+ 'install.github': 'github',
173
+ 'install.indexing': 'reindex_manual',
174
+ 'conductor.ledger': 'install_setup',
175
+ 'conductor.git-hooks': 'install_setup',
176
+ 'conductor.mcp-profile': 'install_setup',
177
+ 'conductor.gh-cli': 'gh_cli',
178
+ 'conductor.merge-credential': 'install_setup',
179
+ 'conductor.native-ledger': 'install_setup',
180
+ 'conductor.mcp-registration-form': 'install_setup',
181
+ 'conductor.node-engine': 'node_engine',
182
+ 'conductor.deny-enforcement': 'install_setup',
183
+ 'conductor.claude-login': 'local_login',
184
+ 'plane.legacy-environment': 'self_host',
185
+ 'plane.repository-root': 'self_host',
186
+ 'plane.worktree-presence': 'self_host',
187
+ 'plane.claude-login': 'self_host',
188
+ 'plane.repo-identity': 'self_host',
189
+ 'plane.bridge-credentials': 'self_host',
190
+ 'plane.credential-permissions': 'self_host',
191
+ 'plane.executor-build': 'self_host',
192
+ 'plane.runtime-entrypoint': 'self_host',
193
+ 'plane.server-port': 'self_host',
194
+ 'plane.alembic-head': 'self_host',
195
+ 'plane.existing-plane': 'self_host',
196
+ 'conductor.merge-credential-capability': 'install_setup',
197
+ 'conductor.worktree-preparation': 'doctor',
198
+ 'conductor.install-section-supervisor-gate-profile': 'supervisor_gate',
199
+ 'conductor.install-section-supervisor-required-checks': 'supervisor_gate',
200
+ 'conductor.install-section-supervisor-review-alignment': 'install_setup',
201
+ 'conductor.install-section-github-actions-permission': 'github',
202
+ 'conductor.install-section-merge-execution-eligibility': 'install_setup',
203
+ 'conductor.install-section-executor-provisioning': 'self_host',
204
+ 'conductor.install-section-executor-service-state': 'self_host',
205
+ 'conductor.install-section-epic-implementer-profile-token': 'install_setup',
206
+ 'conductor.install-section-conductor-hook-targets': 'install_setup',
207
+ 'conductor.install-section-gh-actions-merge-auth': 'github',
208
+ 'conductor.install-section-gh-actions-merge-observable': 'github',
209
+ 'conductor.install-section-epic-implementer-ledger-loadability': 'install_setup',
210
+ 'server.admission-evidence': 'install_setup',
211
+ 'server.admission-unattended-consent': 'consent',
212
+ 'server.admission-notify-webhook': 'escalation',
213
+ 'server.admission-repository-readiness': 'install_setup',
214
+ 'server.admission-required-checks': 'supervisor_gate',
215
+ 'server.admission-index-provenance': 'reindex_manual',
216
+ 'server.admission-durable-actor': 'self_host',
217
+ 'server.admission-migration-head': 'self_host',
218
+ 'server.gate-profile': 'supervisor_gate',
219
+ 'server.gate-profile-warnings': 'supervisor_gate',
220
+ 'server.effective-review-mode': 'install_setup',
221
+ 'server.epic-branch-ci-decision': 'install_setup',
222
+ 'server.epic-branch-ci-coverage-warning': 'install_setup',
223
+ 'server.diagnostics': 'doctor',
224
+ 'conductor.command-drift': 'asset_refresh',
225
+ 'escalation-reachability': 'escalation',
226
+ };
227
+ /**
228
+ * BAPI-1635 — the one remedy for a prerequisite. A met or not-applicable item has
229
+ * none; a genuinely unknown observation retries; a known unmet item gets its
230
+ * per-ID remedy. A self-host-scoped item keeps the self-host text in every
231
+ * unmet state, as it did before. A known unmet ID with no map entry is a
232
+ * defect the generator rejects, so it falls back to retry rather than throwing.
233
+ */
234
+ export function resolveReadinessRemedy(item) {
235
+ if (item.state === 'met' || item.state === 'not_applicable')
236
+ return READINESS_PREREQUISITE_FIXES.none;
237
+ if (item.scope === 'self_host')
238
+ return READINESS_PREREQUISITE_FIXES.self_host;
239
+ if (item.state === 'unknown')
240
+ return READINESS_PREREQUISITE_FIXES.retry;
241
+ // A webhook that failed its probe while live email is confirmed arrives as a warning. Its meaning is that
242
+ // escalations still reach the account email, which the server can no longer say on the wire.
243
+ if (item.id === 'server.escalation-webhook-reachable' && item.impact === 'warning') {
244
+ return READINESS_PREREQUISITE_FIXES.webhook_failed_email_available;
245
+ }
246
+ const key = READINESS_PREREQUISITE_FIXES_BY_ID[item.id];
247
+ return key ? READINESS_PREREQUISITE_FIXES[key] : READINESS_PREREQUISITE_FIXES.retry;
248
+ }
249
+ /**
250
+ * BAPI-1635 — the profile-policy remedy for a known unmet escalation route. It
251
+ * names the declaration and the save command and never carries a webhook value.
252
+ * `launcherCommand` is the already-validated command prefix for the detected
253
+ * launcher; the package launcher is used when none is supplied.
254
+ */
255
+ export function formatProfilePolicyRemedy(launcherCommand) {
256
+ const command = `${launcherCommand ?? PRINTED_CONDUCTOR_INSTALL_COMMAND}`;
257
+ return `Declare notify.webhook_url in a run policy, then save a profile with ${command} --launch-profile <name> --policy-file <path>.`;
258
+ }
259
+ /**
260
+ * The command an older Bridge API printed in its remedies, kept as the literal
261
+ * bytes it sent. It is NOT built from {@link PRINTED_CONDUCTOR_INSTALL_COMMAND}:
262
+ * that command changed in BAPI-1603, and the text an older server sends did not.
263
+ */
264
+ const PREVIOUS_SERVER_INSTALL_COMMAND = `${LAUNCHER} install epic-implementer --required-check "epic-implementer-ci / gate"`;
265
+ /**
266
+ * BAPI-1602 — the remedy texts an older Bridge API sends for rows this build still
267
+ * knows. They are accepted ONLY so an older server's readiness report parses and
268
+ * renders with its own text; they are fixed literals, are
269
+ * never printed by this build, and nothing new may be added here.
270
+ */
271
+ export const PREVIOUS_SERVER_READINESS_FIXES = [
272
+ `Run ${PREVIOUS_SERVER_INSTALL_COMMAND}, then retry readiness.`,
273
+ `Run ${PREVIOUS_SERVER_INSTALL_COMMAND}, merge the workflow changes, then re-index the repository.`,
274
+ ];
275
+ /** Structured explanations are descriptive and never grant effect consent. */
276
+ export function assessmentRemedyQuestion(remedy, evidence) {
277
+ const hosted = !['repository_admin', 'local_user', 'bridge_support', 'self_host_operator'].includes(remedy.audience ?? '') || remedy.audience === 'bridge_support' ||
278
+ (remedy.reference === 'self_host' && remedy.audience !== 'self_host_operator');
279
+ const actions = {
280
+ none: 'No action required.', retry: READINESS_PREREQUISITE_FIXES.retry,
281
+ setup: READINESS_PREREQUISITE_FIXES.setup, github: READINESS_PREREQUISITE_FIXES.github,
282
+ index: READINESS_PREREQUISITE_FIXES.no_index, workflow: READINESS_PREREQUISITE_FIXES.missing_workflow,
283
+ missing_review_workflow: READINESS_PREREQUISITE_FIXES.missing_review_workflow,
284
+ escalation: READINESS_PREREQUISITE_FIXES.escalation,
285
+ support: 'Contact Bridge support to investigate service availability.',
286
+ self_host: READINESS_PREREQUISITE_FIXES.self_host,
287
+ local_login: 'Sign in locally, then retry readiness.',
288
+ };
289
+ const action = hosted ? actions.support : actions[remedy.reference] ?? actions.support;
290
+ return { purpose: action, evidence: [...evidence],
291
+ options: [{ id: 'act', label: 'Review and perform the named remedy' }, { id: 'defer', label: 'Keep this prerequisite unresolved' }],
292
+ consequences: ['Performing the remedy may make fresh evidence available. Readiness will be checked again; this report does not authorize an operation or launch.'],
293
+ deferred: 'Independent completed work is retained. The affected prerequisite remains unresolved.',
294
+ recovery: 'Rerun setup or read-only readiness after the remedy. Existing consent checks still apply.' };
295
+ }
@@ -281,7 +281,7 @@ export function createReadinessCheck(input) {
281
281
  /** Fixed prose for a check that had to be replaced because it was malformed. */
282
282
  export const READINESS_MALFORMED_CHECK_DETAIL = "this prerequisite reported a result that failed the readiness contract, so its real state is unknown";
283
283
  /** Fixed remediation for a replaced malformed check. */
284
- export const READINESS_MALFORMED_CHECK_REMEDIATION = "re-run `epic-implementer readiness`; if it persists, run `epic-implementer doctor` and `install conductor` to re-collect this locus.";
284
+ export const READINESS_MALFORMED_CHECK_REMEDIATION = "re-run `epic-implementer readiness`; if it persists, run `epic-implementer doctor` and `install epic-implementer` to re-collect this locus.";
285
285
  /** Fixed label for a replaced malformed check. */
286
286
  export const READINESS_MALFORMED_CHECK_LABEL = "Unreadable prerequisite";
287
287
  /**
@@ -1,5 +1,105 @@
1
1
  // Generated by scripts/generate-readiness-prerequisites.mjs. Do not edit.
2
- export const READINESS_PRE_CREATE_CODES = { "INDEXED_WORKFLOWS_NOT_MET": "indexed_workflows_not_met", "ESCALATION_CHANNEL_NOT_MET": "escalation_channel_not_met", "TEST_COMMAND_NOT_MET": "test_command_not_met" };
2
+ export const READINESS_PREREQUISITE_FIXES_BY_ID = {
3
+ "server.unattended-posture": "consent",
4
+ "server.resolved-merge-mode": "install_setup",
5
+ "server.provider-repository": "github",
6
+ "server.supervisor-setup": "supervisor_gate",
7
+ "server.supervisor-config": "supervisor_gate",
8
+ "server.supervisor-required-checks": "supervisor_gate",
9
+ "server.review-policy": "install_setup",
10
+ "server.github-credentials": "github",
11
+ "server.provider-default-branch-readable": "github",
12
+ "server.github-actions-permission": "github",
13
+ "server.merge-execution-workflow": "install_setup",
14
+ "server.merge-execution-branch-policy": "install_setup",
15
+ "server.reconciler-liveness": "self_host",
16
+ "server.executor-readiness": "executor",
17
+ "server.review-workflow": "missing_review_workflow",
18
+ "server.conductor-ci-workflow": "install_setup",
19
+ "server.unattended-notify-default": "escalation",
20
+ "server.escalation-webhook-reachable": "escalation",
21
+ "server.repository-workflow-readiness": "install_setup",
22
+ "server.database-migration-current": "self_host",
23
+ "server.worker-present": "self_host",
24
+ "server.single-transition-authority": "self_host",
25
+ "server.indexed-workflows": "reindex_manual",
26
+ "server.integration-branch-unset": "install_setup",
27
+ "server.service-availability": "support",
28
+ "install.claude-login": "local_login",
29
+ "install.identity": "install_guided",
30
+ "install.credential": "install_guided",
31
+ "install.connectivity": "install_guided",
32
+ "install.bootstrap": "install_guided",
33
+ "install.integrations": "install_guided",
34
+ "install.github": "github",
35
+ "install.indexing": "reindex_manual",
36
+ "conductor.ledger": "install_setup",
37
+ "conductor.git-hooks": "install_setup",
38
+ "conductor.mcp-profile": "install_setup",
39
+ "conductor.gh-cli": "gh_cli",
40
+ "conductor.merge-credential": "install_setup",
41
+ "conductor.native-ledger": "install_setup",
42
+ "conductor.mcp-registration-form": "install_setup",
43
+ "conductor.node-engine": "node_engine",
44
+ "conductor.deny-enforcement": "install_setup",
45
+ "conductor.claude-login": "local_login",
46
+ "plane.legacy-environment": "self_host",
47
+ "plane.repository-root": "self_host",
48
+ "plane.worktree-presence": "self_host",
49
+ "plane.claude-login": "self_host",
50
+ "plane.repo-identity": "self_host",
51
+ "plane.bridge-credentials": "self_host",
52
+ "plane.credential-permissions": "self_host",
53
+ "plane.executor-build": "self_host",
54
+ "plane.runtime-entrypoint": "self_host",
55
+ "plane.server-port": "self_host",
56
+ "plane.alembic-head": "self_host",
57
+ "plane.existing-plane": "self_host",
58
+ "conductor.merge-credential-capability": "install_setup",
59
+ "conductor.worktree-preparation": "doctor",
60
+ "conductor.install-section-supervisor-gate-profile": "supervisor_gate",
61
+ "conductor.install-section-supervisor-required-checks": "supervisor_gate",
62
+ "conductor.install-section-supervisor-review-alignment": "install_setup",
63
+ "conductor.install-section-github-actions-permission": "github",
64
+ "conductor.install-section-merge-execution-eligibility": "install_setup",
65
+ "conductor.install-section-executor-provisioning": "self_host",
66
+ "conductor.install-section-executor-service-state": "self_host",
67
+ "conductor.install-section-epic-implementer-profile-token": "install_setup",
68
+ "conductor.install-section-conductor-hook-targets": "install_setup",
69
+ "conductor.install-section-gh-actions-merge-auth": "github",
70
+ "conductor.install-section-gh-actions-merge-observable": "github",
71
+ "conductor.install-section-epic-implementer-ledger-loadability": "install_setup",
72
+ "server.admission-evidence": "install_setup",
73
+ "server.admission-unattended-consent": "consent",
74
+ "server.admission-notify-webhook": "escalation",
75
+ "server.admission-repository-readiness": "install_setup",
76
+ "server.admission-required-checks": "supervisor_gate",
77
+ "server.admission-index-provenance": "reindex_manual",
78
+ "server.admission-durable-actor": "self_host",
79
+ "server.admission-migration-head": "self_host",
80
+ "server.gate-profile": "supervisor_gate",
81
+ "server.gate-profile-warnings": "supervisor_gate",
82
+ "server.effective-review-mode": "install_setup",
83
+ "server.epic-branch-ci-decision": "install_setup",
84
+ "server.epic-branch-ci-coverage-warning": "install_setup",
85
+ "server.diagnostics": "doctor",
86
+ "conductor.command-drift": "asset_refresh",
87
+ "escalation-reachability": "escalation"
88
+ };
89
+ export const READINESS_SERVER_COMPATIBLE_FIXES = [
90
+ "",
91
+ "Check the self-host installation guide, then retry readiness.",
92
+ "Declare a notify webhook, or verify the account email with live email delivery.",
93
+ "Re-index the repository, then retry readiness.",
94
+ "Retry the readiness check.",
95
+ "Run npx -y @bridge_gpt/mcp-server connect-github, then retry readiness.",
96
+ "Run npx -y @bridge_gpt/mcp-server install epic-implementer --required-check \"epic-implementer-ci / gate\", merge the workflow changes, then re-index the repository.",
97
+ "Run npx -y @bridge_gpt/mcp-server install epic-implementer --required-check \"epic-implementer-ci / gate\", then retry readiness.",
98
+ "Run npx -y @bridge_gpt/mcp-server install epic-implementer --test-command \"<command>\". Replace <command> with the one command that runs your tests.",
99
+ "Turn on Allow unattended Epic Implementer runs on the repository Setup page, or use --attended.",
100
+ "Wait for indexing to finish, then retry readiness."
101
+ ];
102
+ export const READINESS_PRE_CREATE_CODES = { "INDEXED_WORKFLOWS_NOT_MET": "indexed_workflows_not_met", "ESCALATION_CHANNEL_NOT_MET": "escalation_channel_not_met" };
3
103
  export const READINESS_PREREQUISITE_CATALOG = [
4
104
  {
5
105
  "id": "server.unattended-posture",
@@ -49,6 +149,12 @@ export const READINESS_PREREQUISITE_CATALOG = [
49
149
  "impact": "blocking",
50
150
  "scope": "customer"
51
151
  },
152
+ {
153
+ "id": "server.provider-default-branch-readable",
154
+ "label": "Provider default branch readable",
155
+ "impact": "blocking",
156
+ "scope": "customer"
157
+ },
52
158
  {
53
159
  "id": "server.github-actions-permission",
54
160
  "label": "GitHub App actions permission",
@@ -97,6 +203,12 @@ export const READINESS_PREREQUISITE_CATALOG = [
97
203
  "impact": "blocking",
98
204
  "scope": "customer"
99
205
  },
206
+ {
207
+ "id": "server.escalation-webhook-reachable",
208
+ "label": "Escalation webhook reachable",
209
+ "impact": "blocking",
210
+ "scope": "customer"
211
+ },
100
212
  {
101
213
  "id": "server.repository-workflow-readiness",
102
214
  "label": "Repository workflow readiness",
@@ -128,9 +240,9 @@ export const READINESS_PREREQUISITE_CATALOG = [
128
240
  "scope": "customer"
129
241
  },
130
242
  {
131
- "id": "server.test-command",
132
- "label": "Known test command",
133
- "impact": "blocking",
243
+ "id": "server.integration-branch-unset",
244
+ "label": "Integration branch configured",
245
+ "impact": "warning",
134
246
  "scope": "customer"
135
247
  },
136
248
  {
@@ -530,3 +642,198 @@ export const READINESS_LEGACY_IDS = {
530
642
  "worktree_preparation": "conductor.worktree-preparation"
531
643
  };
532
644
  export const READINESS_PREREQUISITE_BY_ID = new Map(READINESS_PREREQUISITE_CATALOG.map(d => [d.id, d]));
645
+ export const READINESS_ASSESSMENT_V1 = {
646
+ "version": 1,
647
+ "applicability": [
648
+ "applicable",
649
+ "policy_inapplicable",
650
+ "unknown"
651
+ ],
652
+ "basis": [
653
+ "required",
654
+ "attended",
655
+ "no_feature_branch",
656
+ "auto_merge_disabled",
657
+ "review_not_required",
658
+ "stored_gate",
659
+ "no_ci_gate",
660
+ "reporting_ci",
661
+ "policy_unreadable",
662
+ "context_not_required",
663
+ "legacy_gate"
664
+ ],
665
+ "states": [
666
+ "confirmed",
667
+ "absent",
668
+ "deficient",
669
+ "pending",
670
+ "unreadable",
671
+ "unverified",
672
+ "unknown"
673
+ ],
674
+ "impacts": [
675
+ "mandatory",
676
+ "advisory",
677
+ "optional"
678
+ ],
679
+ "blocking_effects": [
680
+ "none",
681
+ "blocker",
682
+ "unresolved"
683
+ ],
684
+ "scopes": [
685
+ "repository",
686
+ "service",
687
+ "canonical_index",
688
+ "parse_run",
689
+ "indexed_commit",
690
+ "default_branch",
691
+ "local"
692
+ ],
693
+ "reasons": [
694
+ "confirmed",
695
+ "absent",
696
+ "deficient",
697
+ "pending",
698
+ "unreadable",
699
+ "unverified",
700
+ "unknown",
701
+ "revision_unbound",
702
+ "policy_inapplicable",
703
+ "webhook_failed_email_available"
704
+ ],
705
+ "remedies": [
706
+ "none",
707
+ "retry",
708
+ "setup",
709
+ "github",
710
+ "index",
711
+ "workflow",
712
+ "missing_review_workflow",
713
+ "escalation",
714
+ "support",
715
+ "self_host",
716
+ "local_login"
717
+ ],
718
+ "audiences": [
719
+ "repository_admin",
720
+ "local_user",
721
+ "bridge_support",
722
+ "self_host_operator"
723
+ ],
724
+ "assessment_only_ids": [
725
+ "server.canonical-index",
726
+ "server.parse-progress"
727
+ ],
728
+ "coverage": [
729
+ {
730
+ "id": "server.supervisor-setup",
731
+ "scope": "repository"
732
+ },
733
+ {
734
+ "id": "server.supervisor-config",
735
+ "scope": "repository"
736
+ },
737
+ {
738
+ "id": "server.github-credentials",
739
+ "scope": "repository"
740
+ },
741
+ {
742
+ "id": "server.unattended-posture",
743
+ "scope": "repository"
744
+ },
745
+ {
746
+ "id": "server.database-migration-current",
747
+ "scope": "service"
748
+ },
749
+ {
750
+ "id": "server.worker-present",
751
+ "scope": "service"
752
+ },
753
+ {
754
+ "id": "server.single-transition-authority",
755
+ "scope": "service"
756
+ },
757
+ {
758
+ "id": "server.service-availability",
759
+ "scope": "service"
760
+ },
761
+ {
762
+ "id": "server.unattended-notify-default",
763
+ "scope": "repository"
764
+ },
765
+ {
766
+ "id": "server.canonical-index",
767
+ "scope": "canonical_index"
768
+ },
769
+ {
770
+ "id": "server.parse-progress",
771
+ "scope": "parse_run"
772
+ },
773
+ {
774
+ "id": "server.review-workflow",
775
+ "scope": "indexed_commit"
776
+ },
777
+ {
778
+ "id": "server.conductor-ci-workflow",
779
+ "scope": "indexed_commit"
780
+ },
781
+ {
782
+ "id": "server.review-workflow",
783
+ "scope": "default_branch"
784
+ },
785
+ {
786
+ "id": "server.conductor-ci-workflow",
787
+ "scope": "default_branch"
788
+ },
789
+ {
790
+ "id": "server.supervisor-required-checks",
791
+ "scope": "repository"
792
+ },
793
+ {
794
+ "id": "server.gate-profile",
795
+ "scope": "repository"
796
+ },
797
+ {
798
+ "id": "server.executor-readiness",
799
+ "scope": "repository"
800
+ }
801
+ ],
802
+ "identifier_max_length": 128,
803
+ "sha_pattern": "^[0-9a-f]{40}$",
804
+ "exemption_bases_by_id": {
805
+ "server.review-workflow": [
806
+ "attended",
807
+ "no_feature_branch",
808
+ "auto_merge_disabled",
809
+ "review_not_required"
810
+ ],
811
+ "server.conductor-ci-workflow": [
812
+ "attended",
813
+ "no_feature_branch",
814
+ "auto_merge_disabled",
815
+ "stored_gate",
816
+ "no_ci_gate",
817
+ "reporting_ci"
818
+ ],
819
+ "server.canonical-index": [
820
+ "no_feature_branch"
821
+ ],
822
+ "server.unattended-posture": [
823
+ "attended"
824
+ ],
825
+ "server.unattended-notify-default": [
826
+ "attended"
827
+ ],
828
+ "server.executor-readiness": [
829
+ "context_not_required"
830
+ ],
831
+ "server.supervisor-required-checks": [
832
+ "stored_gate",
833
+ "no_ci_gate"
834
+ ],
835
+ "server.gate-profile": [
836
+ "legacy_gate"
837
+ ]
838
+ }
839
+ };