@bridge_gpt/mcp-server 0.2.70 → 0.2.71

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 (61) hide show
  1. package/README.md +5 -5
  2. package/build/agent-launchers/claude-executor-adapter.js +10 -1
  3. package/build/agent-registry.js +5 -5
  4. package/build/agents.generated.js +11 -1
  5. package/build/bounded-wait.js +9 -1
  6. package/build/bridge-permissions.js +13 -5
  7. package/build/commands.generated.js +3 -3
  8. package/build/conductor/bridge-api-client.js +260 -2
  9. package/build/conductor/command-drift-production.js +7 -2
  10. package/build/conductor/doctor.js +9 -3
  11. package/build/conductor/epic-implementer-cli.js +4 -0
  12. package/build/conductor/gate-discovery.js +524 -10
  13. package/build/conductor/gate-settings-review.js +451 -0
  14. package/build/conductor/launch-need-probes.js +16 -11
  15. package/build/conductor/launch-plan.js +145 -0
  16. package/build/conductor/precheck-timings.js +14 -0
  17. package/build/conductor/preview-observations.js +10 -0
  18. package/build/conductor/readiness-sections.js +4 -1
  19. package/build/conductor/recovery-cli.js +59 -2
  20. package/build/conductor/recovery-operations.js +45 -2
  21. package/build/docs.generated.js +1 -1
  22. package/build/drive-epic.js +188 -45
  23. package/build/epic-ci-workflow-drift.js +71 -23
  24. package/build/epic-ci-workflow-install.js +83 -26
  25. package/build/epic-ci-workflow-v1.js +132 -0
  26. package/build/epic-ci-workflow.js +174 -13
  27. package/build/epic-implementer-bin.js +18 -18
  28. package/build/executor/ci-rerun-job.js +220 -14
  29. package/build/executor/env.js +207 -3
  30. package/build/executor/gate-qualification-job.js +20 -5
  31. package/build/executor/job-runner.js +112 -11
  32. package/build/executor/likely-tests.js +6 -1
  33. package/build/executor/preflight.js +5 -0
  34. package/build/executor/process-containment.js +18 -0
  35. package/build/executor/prompt-spec.js +72 -13
  36. package/build/executor/reconcile-overlap-job.js +6 -1
  37. package/build/executor/worker-command.js +136 -1
  38. package/build/executor/worker-database.js +30 -11
  39. package/build/executor/worker-resources.js +12 -1
  40. package/build/executor/worker-verification-guidance.js +29 -0
  41. package/build/index.js +221 -165
  42. package/build/install-bridge-conductor-gate.js +195 -14
  43. package/build/install-bridge-conductor-setup.js +20 -6
  44. package/build/install-bridge-conductor.js +355 -37
  45. package/build/install-bridge.js +1 -1
  46. package/build/merge-workflow-install.js +20 -0
  47. package/build/pipelines.generated.js +2 -2
  48. package/build/plan-execution-ledger.js +23 -8
  49. package/build/plane/plane-freshness.js +6 -2
  50. package/build/plane/preflight.js +19 -0
  51. package/build/printed-remedy-commands.js +8 -1
  52. package/build/readme.generated.js +1 -1
  53. package/build/repository-toolchains.js +581 -0
  54. package/build/setup-epic.js +24 -7
  55. package/build/test-command-detection.js +58 -21
  56. package/build/ticket-delivery-artifacts.js +7 -0
  57. package/build/ticket-delivery-enrollment.js +67 -4
  58. package/build/version.generated.js +3 -3
  59. package/docs/EPIC-IMPLEMENTER.md +38 -0
  60. package/docs/epic-implementer/getting-started.md +58 -2
  61. package/package.json +2 -2
@@ -26,17 +26,61 @@
26
26
  * `on: pull_request` only, `permissions: contents: read`, no secrets, no
27
27
  * path filters, `ubuntu-latest`. The execution job runs only when the pull
28
28
  * request head is this repository; a fork pull request never checks out or runs
29
- * repository code. The checkout does not persist its token. The command must be
30
- * self-contained: it installs whatever it needs, because the workflow provisions
31
- * no runtime.
29
+ * repository code. The checkout does not persist its token.
30
+ *
31
+ * ## Toolchain provisioning (renderer version 2, BAPI-1536)
32
+ *
33
+ * Version 1 provisioned nothing, so a command that needed installed dependencies
34
+ * had to install them itself. Version 2 adds fixed setup steps between the
35
+ * checkout and the stored command, chosen from the repository's own lockfiles by
36
+ * the shared resolver (`repository-toolchains.ts`) at the moment the workflow is
37
+ * generated. The resolver reads the local working tree only. Server indexing
38
+ * metadata is deliberately NOT an input: it can be stale, absent, or describe a
39
+ * different checkout, and the workflow must be reproducible from the files it is
40
+ * committed next to.
41
+ *
42
+ * - JavaScript, Python, and Go are provisioned, in that order, when found.
43
+ * Manager priority, version-file precedence, and fixed fallbacks are defined in
44
+ * `repository-toolchains.ts`; the user-facing summary is the packaged
45
+ * `getting-started` guide.
46
+ * - Every action is pinned to a fixed major and every manager bootstrap version
47
+ * is a documented constant. Installation shell lines are fixed text. No value
48
+ * taken from the repository is rendered into a step: Node and Python versions
49
+ * are a fixed file name, and a declared pnpm or Yarn version is read by the
50
+ * action or Corepack at CI runtime. A validated pnpm version appears only in
51
+ * the header marker.
52
+ * - uv and Poetry environments are placed on `PATH`, so the stored command runs
53
+ * unchanged inside the project environment.
54
+ * - Rust uses the runner's own toolchain. Python projects with no supported
55
+ * dependency file, projects with no lockfile at all, and Make-only projects
56
+ * receive no provisioning: their command must be self-contained.
57
+ * - The complete resolved set is written into the header (a single canonical
58
+ * line) so a later run can re-render the file byte for byte and tell a
59
+ * legitimate toolchain change from a hand edit.
60
+ *
61
+ * The command still never receives a prefix or an install: it stays on its one
62
+ * protected scalar line.
32
63
  */
64
+ import { BUN_VERSION_RANGE, NODE_FALLBACK_MAJOR, PNPM_FALLBACK_MAJOR, POETRY_VERSION, PYTHON_FALLBACK_MINOR, YARN_BERRY_FALLBACK_MAJOR, serializeRepositoryToolchains, validateRepositoryToolchains, } from "./repository-toolchains.js";
33
65
  import { validateTestCommand } from "./test-command-validation.js";
34
66
  /** Repository-relative path of the managed workflow. */
35
67
  export const EPIC_CI_WORKFLOW_PATH = ".github/workflows/epic-implementer-ci.yml";
36
68
  /** The renderer version written into the managed header. */
37
- export const EPIC_CI_WORKFLOW_RENDERER_VERSION = 1;
69
+ export const EPIC_CI_WORKFLOW_RENDERER_VERSION = 2;
38
70
  /** The header marker key; the line is `# <key>: <version>`. */
39
71
  export const EPIC_CI_WORKFLOW_VERSION_MARKER_KEY = "x-bridge-ci-renderer-version";
72
+ /** The header marker key for the canonical toolchain set; the line is `# <key>: <json>`. */
73
+ export const EPIC_CI_WORKFLOW_TOOLCHAINS_MARKER_KEY = "x-bridge-ci-toolchains";
74
+ /** The `name:` of the one step that runs the stored command. */
75
+ export const EPIC_CI_COMMAND_STEP_NAME = "Run the stored test command";
76
+ /** Pinned action majors. Changing any of these is a renderer-version change. */
77
+ export const EPIC_CI_ACTION_CHECKOUT = "actions/checkout@v7";
78
+ export const EPIC_CI_ACTION_SETUP_NODE = "actions/setup-node@v7";
79
+ export const EPIC_CI_ACTION_SETUP_PYTHON = "actions/setup-python@v7";
80
+ export const EPIC_CI_ACTION_SETUP_GO = "actions/setup-go@v6";
81
+ export const EPIC_CI_ACTION_SETUP_PNPM = "pnpm/action-setup@v4";
82
+ export const EPIC_CI_ACTION_SETUP_BUN = "oven-sh/setup-bun@v2";
83
+ export const EPIC_CI_ACTION_SETUP_UV = "astral-sh/setup-uv@v6";
40
84
  /** The workflow `name:`. */
41
85
  export const EPIC_CI_WORKFLOW_NAME = "epic-implementer-ci";
42
86
  /**
@@ -64,12 +108,121 @@ const YAML_UNSAFE_RAW = /[\u007f-\u009f\u2028\u2029\ufeff]/g;
64
108
  export function encodeCommandScalar(testCommand) {
65
109
  return JSON.stringify(testCommand).replace(YAML_UNSAFE_RAW, (ch) => "\\u" + ch.charCodeAt(0).toString(16).padStart(4, "0"));
66
110
  }
111
+ function nodeSetupLines(node) {
112
+ return [
113
+ " - name: Set up Node.js",
114
+ " uses: " + EPIC_CI_ACTION_SETUP_NODE,
115
+ " with:",
116
+ node === "fixed"
117
+ ? ' node-version: "' + NODE_FALLBACK_MAJOR + '"'
118
+ : " node-version-file: " + node,
119
+ ];
120
+ }
121
+ function pythonSetupLines(python) {
122
+ return [
123
+ " - name: Set up Python",
124
+ " uses: " + EPIC_CI_ACTION_SETUP_PYTHON,
125
+ " with:",
126
+ python === "fixed"
127
+ ? ' python-version: "' + PYTHON_FALLBACK_MINOR + '"'
128
+ : " python-version-file: " + python,
129
+ ];
130
+ }
131
+ function javaScriptSetupLines(js) {
132
+ switch (js.manager) {
133
+ case "npm":
134
+ return [...nodeSetupLines(js.node), " - name: Install dependencies", " run: npm ci"];
135
+ case "pnpm":
136
+ return [
137
+ " - name: Set up pnpm",
138
+ " uses: " + EPIC_CI_ACTION_SETUP_PNPM,
139
+ // A declared `packageManager` is read by the action itself at CI runtime.
140
+ // Passing `version:` as well makes it fail with "Multiple versions of pnpm
141
+ // specified" whenever the two strings differ (a Corepack `+sha` suffix is
142
+ // enough), so the input is given only for the fixed fallback.
143
+ ...(js.pnpm.source === "default" ? [" with:", ' version: "' + PNPM_FALLBACK_MAJOR + '"'] : []),
144
+ ...nodeSetupLines(js.node),
145
+ " - name: Install dependencies",
146
+ " run: pnpm install --frozen-lockfile",
147
+ ];
148
+ case "yarn":
149
+ if (js.generation === "classic") {
150
+ return [...nodeSetupLines(js.node), " - name: Install dependencies", " run: yarn install --frozen-lockfile"];
151
+ }
152
+ // Corepack reads a declared Yarn version from package.json at CI runtime;
153
+ // the activation below is only the fallback major when none is declared.
154
+ return [
155
+ ...nodeSetupLines(js.node),
156
+ " - name: Enable Corepack",
157
+ " run: corepack enable",
158
+ " - name: Activate Yarn",
159
+ " run: corepack prepare yarn@" + YARN_BERRY_FALLBACK_MAJOR + " --activate",
160
+ " - name: Install dependencies",
161
+ " run: yarn install --immutable",
162
+ ];
163
+ case "bun":
164
+ return [
165
+ " - name: Set up Bun",
166
+ " uses: " + EPIC_CI_ACTION_SETUP_BUN,
167
+ " with:",
168
+ ' bun-version: "' + BUN_VERSION_RANGE + '"',
169
+ " - name: Install dependencies",
170
+ " run: bun install --frozen-lockfile",
171
+ ];
172
+ }
173
+ }
174
+ const PROJECT_ENVIRONMENT_PATH_LINES = [
175
+ " - name: Add the project environment to PATH",
176
+ ' run: echo "$GITHUB_WORKSPACE/.venv/bin" >> "$GITHUB_PATH"',
177
+ ];
178
+ function pythonSetupLinesFor(py) {
179
+ const setup = pythonSetupLines(py.python);
180
+ switch (py.manager) {
181
+ case "uv":
182
+ return [
183
+ ...setup,
184
+ " - name: Set up uv",
185
+ " uses: " + EPIC_CI_ACTION_SETUP_UV,
186
+ " - name: Install dependencies",
187
+ " run: uv sync --frozen",
188
+ ...PROJECT_ENVIRONMENT_PATH_LINES,
189
+ ];
190
+ case "poetry":
191
+ return [
192
+ ...setup,
193
+ " - name: Install Poetry",
194
+ " run: python -m pip install poetry==" + POETRY_VERSION,
195
+ " - name: Configure Poetry",
196
+ " run: poetry config virtualenvs.in-project true",
197
+ " - name: Install dependencies",
198
+ " run: poetry install",
199
+ ...PROJECT_ENVIRONMENT_PATH_LINES,
200
+ ];
201
+ case "pip":
202
+ return [...setup, " - name: Install dependencies", " run: pip install -r requirements.txt"];
203
+ }
204
+ }
205
+ /** The setup steps for a validated set, in the fixed JavaScript, Python, Go order. */
206
+ function toolchainSetupLines(toolchains) {
207
+ const lines = [];
208
+ if (toolchains.javascript !== null)
209
+ lines.push(...javaScriptSetupLines(toolchains.javascript));
210
+ if (toolchains.python !== null)
211
+ lines.push(...pythonSetupLinesFor(toolchains.python));
212
+ if (toolchains.go !== null) {
213
+ lines.push(" - name: Set up Go", " uses: " + EPIC_CI_ACTION_SETUP_GO, " with:", " go-version-file: " + toolchains.go.dependencyFile);
214
+ }
215
+ return lines;
216
+ }
67
217
  /**
68
- * Render the workflow for `testCommand`. Deterministic: the same command always
69
- * gives the same bytes. Throws `TestCommandValidationError` for a bad command.
218
+ * Render the workflow for `testCommand` and the resolved `toolchains`.
219
+ * Deterministic: the same inputs always give the same bytes. Throws
220
+ * `TestCommandValidationError` for a bad command and `RepositoryToolchainError`
221
+ * for a toolchain set outside the closed vocabulary.
70
222
  */
71
- export function renderEpicImplementerCiWorkflow(testCommand) {
223
+ export function renderEpicImplementerCiWorkflow(testCommand, toolchains) {
72
224
  const command = validateTestCommand(testCommand);
225
+ const validated = validateRepositoryToolchains(toolchains);
73
226
  const lines = [
74
227
  "# ===========================================================================",
75
228
  "# Epic Implementer CI gate — MANAGED FILE",
@@ -79,6 +232,7 @@ export function renderEpicImplementerCiWorkflow(testCommand) {
79
232
  "# refuses to overwrite a modified or unrecognized copy.",
80
233
  "#",
81
234
  "# " + EPIC_CI_WORKFLOW_VERSION_MARKER_KEY + ": " + String(EPIC_CI_WORKFLOW_RENDERER_VERSION),
235
+ "# " + EPIC_CI_WORKFLOW_TOOLCHAINS_MARKER_KEY + ": " + serializeRepositoryToolchains(validated),
82
236
  "#",
83
237
  "# WHAT THIS WORKFLOW IS",
84
238
  "#",
@@ -93,13 +247,19 @@ export function renderEpicImplementerCiWorkflow(testCommand) {
93
247
  "# passes for it immediately and says so. Nothing here uses a secret, and the",
94
248
  "# token is read-only.",
95
249
  "#",
250
+ "# DEPENDENCIES",
251
+ "#",
252
+ "# The setup steps before the test command were chosen from the lockfiles in",
253
+ "# the repository root when this file was generated; the toolchains line above",
254
+ "# records the choice. They install dependencies and nothing else. When no",
255
+ "# supported dependency file was found, nothing is installed for that",
256
+ "# ecosystem and the command must install what it needs itself.",
257
+ "#",
96
258
  "# THE TEST COMMAND",
97
259
  "#",
98
260
  "# The command below is the repository's stored test command, run with bash",
99
- "# from the repository root. It must be self-contained: this workflow installs",
100
- "# no language runtime or dependencies, so the command must install what it",
101
- "# needs. To change it, save a new command through Bridge setup and re-run the",
102
- "# installer; do not edit it here.",
261
+ "# from the repository root after the setup steps. To change it, save a new",
262
+ "# command through Bridge setup and re-run the installer; do not edit it here.",
103
263
  "# ===========================================================================",
104
264
  "name: " + EPIC_CI_WORKFLOW_NAME,
105
265
  "",
@@ -117,10 +277,11 @@ export function renderEpicImplementerCiWorkflow(testCommand) {
117
277
  " timeout-minutes: " + String(EPIC_CI_TEST_JOB_TIMEOUT_MINUTES),
118
278
  " steps:",
119
279
  " - name: Check out the pull request",
120
- " uses: actions/checkout@v7",
280
+ " uses: " + EPIC_CI_ACTION_CHECKOUT,
121
281
  " with:",
122
282
  " persist-credentials: false",
123
- " - name: Run the stored test command",
283
+ ...toolchainSetupLines(validated),
284
+ " - name: " + EPIC_CI_COMMAND_STEP_NAME,
124
285
  " shell: bash",
125
286
  EPIC_CI_COMMAND_LINE_PREFIX + encodeCommandScalar(command),
126
287
  "",