@bridge_gpt/mcp-server 0.2.66 → 0.2.67

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 (100) hide show
  1. package/README.md +252 -77
  2. package/build/agent-capabilities/probes.js +15 -5
  3. package/build/agent-launchers/claude-executor-adapter.js +43 -16
  4. package/build/agent-launchers/executor-adapter.js +7 -4
  5. package/build/agents.generated.js +1 -1
  6. package/build/bounded-wait.js +67 -10
  7. package/build/commands.generated.js +11 -11
  8. package/build/conductor/bridge-api-client.js +143 -1
  9. package/build/conductor/bring-up-facts.js +1 -1
  10. package/build/conductor/doctor.js +3 -3
  11. package/build/conductor/epic-implementer-cli.js +22 -6
  12. package/build/conductor/errors.js +4 -3
  13. package/build/conductor/guided-repair.js +6 -2
  14. package/build/conductor/hook-runtime-qualification.js +1 -1
  15. package/build/conductor/merge-execution-contract.js +27 -8
  16. package/build/conductor/merge-execution-eligibility.js +3 -2
  17. package/build/conductor/pr-ci-producer.js +1 -1
  18. package/build/conductor/readiness-cli.js +18 -2
  19. package/build/conductor/readiness-sections.js +41 -6
  20. package/build/conductor/readiness.js +181 -29
  21. package/build/conductor/recovery-cli.js +200 -8
  22. package/build/conductor/recovery-operations.js +69 -3
  23. package/build/conductor/repair-contract.js +54 -3
  24. package/build/conductor/repository-workflow-remedy.js +125 -0
  25. package/build/conductor/tools.js +2 -2
  26. package/build/conductor-bundle-artifacts.js +8 -0
  27. package/build/docs.generated.js +8 -3
  28. package/build/drive-epic-key.js +6 -5
  29. package/build/drive-epic.js +85 -54
  30. package/build/epic-coherence-input.js +2 -1
  31. package/build/epic-implementer-bin.js +22 -20
  32. package/build/epic-implementer-bundle-cli.js +2 -2
  33. package/build/executor/cli.js +3 -2
  34. package/build/executor/completion-contract.js +48 -5
  35. package/build/executor/completion-supervision.js +4 -0
  36. package/build/executor/env.js +19 -0
  37. package/build/executor/heartbeat.js +1 -1
  38. package/build/executor/http-client.js +20 -0
  39. package/build/executor/job-errors.js +25 -0
  40. package/build/executor/job-runner.js +225 -41
  41. package/build/executor/observation.js +6 -1
  42. package/build/executor/preflight.js +51 -14
  43. package/build/executor/required-work-ledger.js +6 -1
  44. package/build/executor/resume-pre-spawn.js +2 -0
  45. package/build/executor/runner.js +8 -2
  46. package/build/executor/service-unit.js +7 -1
  47. package/build/executor/worker-finalization.js +82 -29
  48. package/build/executor/worker-guard-hook.js +137 -33
  49. package/build/executor/worktree.js +82 -1
  50. package/build/index.js +403 -429
  51. package/build/install-bridge-conductor.js +8 -6
  52. package/build/install-bridge.js +3 -3
  53. package/build/phase-context-git-probe.js +68 -0
  54. package/build/phase-result-artifacts.js +173 -5
  55. package/build/pipelines.generated.js +18 -24
  56. package/build/plane/alembic-head.js +12 -3
  57. package/build/plane/base-worktree-guard.js +147 -0
  58. package/build/plane/cli.js +217 -17
  59. package/build/plane/code-snapshot.js +468 -0
  60. package/build/plane/defaults.js +48 -3
  61. package/build/plane/endpoint.js +41 -0
  62. package/build/plane/manifest.js +120 -1
  63. package/build/plane/member-roster.js +94 -19
  64. package/build/plane/preflight.js +30 -2
  65. package/build/plane/process-cwd.js +67 -0
  66. package/build/plane/restart.js +542 -0
  67. package/build/plane/shutdown.js +31 -0
  68. package/build/plane/status.js +143 -8
  69. package/build/plane/supervisor.js +586 -179
  70. package/build/plane/types.js +54 -2
  71. package/build/printed-remedy-commands.js +37 -0
  72. package/build/readiness-check.js +1 -1
  73. package/build/readme.generated.js +1 -1
  74. package/build/review-generation.js +22 -0
  75. package/build/setup-epic.js +44 -19
  76. package/build/sfcc/config.js +9 -0
  77. package/build/sfcc/credentials.js +100 -38
  78. package/build/sfcc/hostname.js +67 -0
  79. package/build/sfcc/permissions.js +17 -13
  80. package/build/sfcc/register.js +1 -1
  81. package/build/sfcc/tool-wrapper.js +39 -43
  82. package/build/sfcc/write-grants.js +17 -11
  83. package/build/sfcc/write-result.js +4 -3
  84. package/build/sfcc/writes-site-preference.js +20 -8
  85. package/build/start-tickets.js +179 -31
  86. package/build/tool-error-envelope.js +61 -0
  87. package/build/version.generated.js +3 -3
  88. package/build/visual-diff.js +22 -1
  89. package/build/worker-guard-hook-bin.js +3 -6
  90. package/build/worker-guard-hook-main.js +47 -0
  91. package/build/worktree-core.js +130 -4
  92. package/docs/EPIC-IMPLEMENTER-INSTALL.md +849 -0
  93. package/docs/EPIC-IMPLEMENTER.md +662 -0
  94. package/docs/install/mcp-tool-integrations.md +24 -15
  95. package/docs/install/sfcc-integration.md +12 -4
  96. package/package.json +1 -1
  97. package/pipelines/plan-epic.json +0 -5
  98. package/pipelines/review-ticket.json +1 -1
  99. package/docs/CONDUCTOR.md +0 -605
  100. package/pipelines/idea-to-pr.json +0 -49
@@ -44,7 +44,6 @@ marked **— none**.
44
44
  | **SFCC WebDAV logs** | WebDAV log credentials (separate from OCAPI) plus the `sfcc_log_monitor_enabled` flag. | `sfcc_webdav_hostname/username/access_key`, `sfcc_log_monitor_enabled` |
45
45
  | **Deep-research flag** | The `deep_research_enabled` config flag on the project (403 otherwise). Web research runs via Gemini/OpenAI. | `config_projects.deep_research_enabled` |
46
46
  | **Image provider** | An image model provider (OpenAI DALL·E / Google Imagen). | platform provider config |
47
- | **Conductor ledger** | The local conductor event ledger (`~/.config/bridge/events.db`) — a local file, not a remote service. | local file |
48
47
 
49
48
  ## Profiles (a form of BLOCK)
50
49
 
@@ -56,13 +55,13 @@ activated. `core` is always implicitly included.
56
55
  | Profile | Registered when |
57
56
  |---|---|
58
57
  | `core` | always |
59
- | `pipeline-authoring` | `BRIDGE_MCP_PROFILE` includes `pipeline-authoring` or `full` |
60
- | `conductor` | includes `conductor` or `full` |
61
- | `sfcc` | includes `sfcc` or `full` — the OCAPI **read** tools and `sfcc_log_query` (2 diagnostics ship in `core`) |
58
+ | `epic_implementer` | includes `epic_implementer` or `full` — the Epic Implementer run tools. The old token `conductor` is not valid and is dropped |
59
+ | `estimation` | includes `estimation` or `full` — `estimate_epic` |
60
+ | `pipeline-authoring` | includes `pipeline-authoring` or `full` — registers **no** tools since BAPI-909; still accepted so old configs keep working |
61
+ | `sfcc` | includes `sfcc` or `full` — the OCAPI **read** tools, `sfcc_log_query`, and the two SFCC diagnostics |
62
62
  | `sfcc-write` | includes `sfcc-write` or `full` — the destructive SFCC **write** tools. Independent of `sfcc`: neither group implies the other (BAPI-817) |
63
63
 
64
- The `pipeline-authoring` tools live in `index.ts` alongside core, gated by
65
- `ACTIVE_GROUPS.has("pipeline-authoring")`.
64
+ `get_pipeline_recipe` was never gated by `pipeline-authoring`; it is a `core` tool.
66
65
 
67
66
  > **This document deliberately states no tool counts.** Counts drift on every
68
67
  > ticket that adds or moves a tool, and nothing here is generated, so a number
@@ -147,7 +146,14 @@ by tier.
147
146
 
148
147
  | Tool | Dependencies (class) |
149
148
  |---|---|
150
- | `estimate_epic` | Jira **[BLOCK]** (resolves the repo from `jira_ticket_key`); no code-index dep |
149
+ | `estimate_epic` | Jira **[BLOCK]** (resolves the repo from `jira_ticket_key`); no code-index dep; registered only under the `estimation` profile |
150
+
151
+ **Epic Implementer eligibility:**
152
+
153
+ | Tool | Dependencies (class) |
154
+ |---|---|
155
+ | `assess_epic_implementer_eligibility` | — none (read-only; predicts which epic children change workflow files from their text; needs no VCS or code index; fails open to `status: "unavailable"`) |
156
+ | `assess_epic_conductor_eligibility` | — none (retired name; always returns `tool_removed` / 410 naming `assess_epic_implementer_eligibility`) |
151
157
 
152
158
  ### Repository parse / index — VCS
153
159
 
@@ -247,21 +253,24 @@ Constraints worth knowing before calling it:
247
253
  authoritative, so a tool-side pass followed by a server refusal is expected for a
248
254
  legacy approved comment that carries no head proof.
249
255
 
250
- ## `conductor` profile
256
+ ## `epic_implementer` profile
251
257
 
252
- Profile-gated **[BLOCK]** to register. The local conductor ledger
253
- (`~/.config/bridge/events.db`) is now driven by the `conductor` CLI and the git hooks
254
- rather than by MCP tools, so only the epic snapshot remains registered here.
258
+ Profile-gated **[BLOCK]** to register. Both tools are read-only and need an Epic
259
+ Implementer run to exist; for an unknown epic or run they return
260
+ `status: "unknown"` rather than an error. The local event ledger
261
+ (`~/.config/bridge/events.db`) is driven by the `epic-implementer` CLI and the git
262
+ hooks, not by MCP tools.
255
263
 
256
264
  | Tool | Dependencies (class) |
257
265
  |---|---|
258
- | `get_epic_snapshot` | Profile-gated **[BLOCK]** · Bridge API epic snapshot (Jira epic keys) |
266
+ | `get_epic_snapshot` | Profile-gated **[BLOCK]** · Bridge API epic run state (by epic key) |
267
+ | `explain_run` | Profile-gated **[BLOCK]** · Bridge API epic run state (by run id or epic key; `ticket_key` narrows it) |
259
268
 
260
269
  ---
261
270
 
262
271
  ## `sfcc` group
263
272
 
264
- ### Always-on diagnostics (ship in `core`)
273
+ ### Diagnostics (gated behind the `sfcc` group since BAPI-912)
265
274
 
266
275
  | Tool | Dependencies (class) |
267
276
  |---|---|
@@ -273,7 +282,7 @@ rather than by MCP tools, so only the epic snapshot remains registered here.
273
282
  All are profile-gated **[BLOCK]** to register, and all require SFCC OCAPI creds +
274
283
  `version` config + a reachable sandbox → SFCC OCAPI **[BLOCK]**.
275
284
 
276
- Every SFCC tool — including the two always-on diagnostics above — additionally
285
+ Every SFCC tool — including the two diagnostics above — additionally
277
286
  crosses the resolved-hostname sandbox boundary at invocation time: if the host
278
287
  the credentials resolve to is not a recognized developer sandbox, the call is
279
288
  refused with `403 TARGET_NOT_SANDBOX` before any request leaves the machine
@@ -331,7 +340,7 @@ wanting both selects `sfcc,sfcc-write` (or `full`).
331
340
  | **SFCC OCAPI** | `check_permissions` + every gated SFCC read and write tool | — |
332
341
  | **SFCC WebDAV logs** | `sfcc_log_query` | — |
333
342
  | **Deep-research flag** | `request_deep_research`, `get_deep_research` | — |
334
- | **Profile gating** | all `pipeline-authoring`, `conductor`, `sfcc`, and `sfcc-write` tools | — |
343
+ | **Profile gating** | all `epic_implementer`, `estimation`, `sfcc`, and `sfcc-write` tools | — |
335
344
 
336
345
  ## Notes & caveats
337
346
 
@@ -80,13 +80,20 @@ future work. No `delete` is granted, because no shipped write tool performs one;
80
80
  { "resource_id": "/system_object_definitions", "methods": ["get"], "read_attributes": "(**)", "write_attributes": "(**)" },
81
81
  { "resource_id": "/system_object_definitions/**", "methods": ["get", "put", "patch"], "read_attributes": "(**)", "write_attributes": "(**)" },
82
82
  { "resource_id": "/custom_object_definitions/**", "methods": ["get", "put", "patch"], "read_attributes": "(**)", "write_attributes": "(**)" },
83
- { "resource_id": "/site_preferences/**", "methods": ["get", "patch"], "read_attributes": "(**)", "write_attributes": "(**)" }
83
+ { "resource_id": "/sites/*/site_preferences/**", "methods": ["get", "patch"], "read_attributes": "(**)", "write_attributes": "(**)" }
84
84
  ]
85
85
  }
86
86
  ```
87
87
 
88
88
  Notes:
89
89
 
90
+ - Value writes (`site_preference_values_set`) are site-scoped: they need the mutation
91
+ resource `/sites/*/site_preferences/**`. The read/search grant keeps the org-level
92
+ `/site_preferences/**`. **If you pasted an earlier mutation grant, it lacks the
93
+ site-scoped resource.** Replace `<YOUR_CLIENT_ID>` with your client id in the newly
94
+ printed grant (`check_permissions` prints it) and paste it again before running
95
+ value writes.
96
+ - `check_permissions` probes a GET only. It shows read access, not write access.
90
97
  - The `client_id` **must match** the Account Manager API client whose credentials you
91
98
  put in `dw.json` / `SFCC_*` below. Replace the value above with your own client id if
92
99
  it differs.
@@ -127,9 +134,10 @@ Create a `dw.json` in your project root (auto-added to git exclude — never com
127
134
  ```
128
135
 
129
136
  Accepted key spellings: `hostname`/`host`, `client-id`/`clientId`/`client_id`,
130
- `client-secret`/`clientSecret`/`client_secret`. Use a single config — a multi-entry
131
- `configs[]` array is rejected outright, not worked around with an explicit `instance`
132
- (see the README's SFCC section for why). Alternatively, export
137
+ `client-secret`/`clientSecret`/`client_secret`. A single config is simplest. With a
138
+ multi-entry `configs[]` array, pass one of the listed sandbox hostnames as `instance`
139
+ and that config's credentials are used (an unapproved host is refused before any
140
+ credential lookup); without an `instance` the call fails as `multi-sandbox`. Alternatively, export
133
141
  `SFCC_HOSTNAME` / `SFCC_CLIENT_ID` / `SFCC_CLIENT_SECRET` in the MCP server environment.
134
142
 
135
143
  ## 3. Set the repo `version` config field
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bridge_gpt/mcp-server",
3
- "version": "0.2.66",
3
+ "version": "0.2.67",
4
4
  "description": "Bridge API MCP server — exposes Jira endpoints as MCP tools for Claude Code agents",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -54,11 +54,6 @@
54
54
  "type": "agent_task",
55
55
  "instruction_file": "write-epic-summary.md",
56
56
  "description": "Write epic overview and summary document"
57
- },
58
- {
59
- "type": "agent_task",
60
- "instruction_file": "store-and-approve-epic-plan.md",
61
- "description": "Create epic run, store the plan DAG, and approve it in the backend"
62
57
  }
63
58
  ]
64
59
  }
@@ -30,7 +30,7 @@
30
30
  {
31
31
  "type": "agent_task",
32
32
  "id": "wait-for-ticket-review",
33
- "instruction": "FIRST, check whether a review was actually submitted. The previous step runs with `on_error: warn_and_continue`, so a rejected submission (a 402, 403 or 500 from the generate endpoint, or a dropped connection) lets the pipeline continue into this step. If that step returned an error message rather than its submission confirmation or a `recovery_get` envelope, do NOT wait: nothing is running, and `wait_for_ticket_review` cannot tell \"never submitted\" from \"still running\" \u2014 it would read `pending` in every window until the caller's own timeout. Treat a failed submission as a terminal failure, report the error the previous step gave, and take the verdict contract's `revise` path.\n\nOtherwise, wait for the review submitted by the previous step to finish, using repeated BOUNDED windows.\n\nCall `wait_for_ticket_review` with `ticket_number` set to the ticket key. Each call uses the default 20-second window (set `budget_ms: 20000` explicitly if needed); do not use a longer window, because some MCP clients time out before a pending result arrives. The tool returns a JSON body with a `state` field:\n\n- `state: \"pending\"` \u2014 NORMAL and expected. The review is still running. Call the tool again immediately. Do NOT sleep, do NOT poll in a shell loop, and do NOT re-run `request_ticket_review`: re-submitting starts a second billable multi-model review and abandons the one already in flight.\n- `state: \"ready\"` \u2014 the review is over. BAPI-1121: a ready result has ALREADY persisted exactly the accepted documents and reconciled the canonical source files \u2014 it writes every leg in `saved_legs` to its canonical path and removes the stale canonical file for every leg in `withheld_legs`. Do NOT call `get_clarifying_questions` or `get_ticket_critique` after a ready result; those retrieval calls were removed from this recipe because reading them again could reintroduce exactly the stale content the wait just withheld. Treat `saved_legs` as the authoritative source set for the next steps, not file presence.\n - `freshness_basis: \"generation\"` is the normal case: `advanced_legs`/`saved_legs` are current-review evidence, proven newer than the submission. Any leg in `withheld_legs` was delivered but NOT proven current \u2014 surface its `reason` (`generation_not_advanced` or `identity_unreadable`) as a visible warning; do not describe the result as an ordinary cost-saved one-leg review when a withholding occurred. A leg in `absent_legs` with `reason: \"not_delivered\"` is an ordinary policy omission (e.g. an Easy-ticket clarify-only review) unless its status also flags it as policy-expected, in which case call that out too.\n - `freshness_basis: \"terminality_only\"` means no submission baseline was available (e.g. a resumed session) \u2014 `advanced_legs` is empty by construction and `saved_legs` was accepted on terminal delivery alone. Surface this prominently as a DEGRADED-freshness warning: the saved artifact(s) may be indistinguishable from a prior attachment, and the downstream identity-footer agreement check is the remaining backstop. Retain this warning when reporting to the next steps rather than treating a `terminality_only` ready result as equivalent to a `generation`-backed one.\n - If the result instead carries `state: \"error\"` alongside a persistence failure (an `ARTIFACT_PERSISTENCE_FAILED` `error`/`status`/`message` envelope), HALT rather than proceeding with whatever files happen to exist on disk \u2014 report the failure; the accepted legs already on disk before the failure are named in the envelope and are not lost, but nothing new was persisted for this window.\n- `state: \"error\"` \u2014 terminal. Report the `reason` and stop; the review will not complete on its own. `UPSTREAM_TERMINAL` means the review failed or expired server-side \u2014 take the verdict contract's `revise` path; do NOT open another wait window and do NOT re-run `request_ticket_review`. `INVALID_RESPONSE` means the delivered document could not be read.\n\nKeep looping on `pending` for as long as this session's own budget allows. There is no iteration cap here: the bound is the caller's \u2014 for the conductor's spec-review worker that is the existing 120-minute job timeout, which produces the ordinary liveness outcome if the review never lands. Never fabricate a verdict or a review result from a pending state.",
33
+ "instruction": "FIRST, check whether a review was actually submitted. The previous step runs with `on_error: warn_and_continue`, so a rejected submission (a 402, 403 or 500 from the generate endpoint, or a dropped connection) lets the pipeline continue into this step. If that step returned an error envelope \u2014 a JSON object with a string `error`, a numeric `status`, and an `operation` field (for example `status: 403` with `error: \"ENTITLEMENT_REQUIRED\"`, or `status: 422` for too little ticket detail) \u2014 rather than its submission confirmation or a `recovery_get` envelope, do NOT wait: nothing is running, and `wait_for_ticket_review` cannot tell \"never submitted\" from \"still running\" \u2014 it would read `pending` in every window until the caller's own timeout. Treat a failed submission as a terminal failure, report the `status`, `error`, and `message` the previous step gave, and take the verdict contract's `revise` path.\n\nOtherwise, wait for the review submitted by the previous step to finish, using repeated BOUNDED windows.\n\nCall `wait_for_ticket_review` with `ticket_number` set to the ticket key. Each call uses the default 20-second window (set `budget_ms: 20000` explicitly if needed); do not use a longer window, because some MCP clients time out before a pending result arrives. The tool returns a JSON body with a `state` field:\n\n- `state: \"pending\"` \u2014 NORMAL and expected. The review is still running. Call the tool again immediately. Do NOT sleep, do NOT poll in a shell loop, and do NOT re-run `request_ticket_review`: re-submitting starts a second billable multi-model review and abandons the one already in flight.\n- `state: \"ready\"` \u2014 the review is over. BAPI-1121: a ready result has ALREADY persisted exactly the accepted documents and reconciled the canonical source files \u2014 it writes every leg in `saved_legs` to its canonical path and removes the stale canonical file for every leg in `withheld_legs`. Do NOT call `get_clarifying_questions` or `get_ticket_critique` after a ready result; those retrieval calls were removed from this recipe because reading them again could reintroduce exactly the stale content the wait just withheld. Treat `saved_legs` as the authoritative source set for the next steps, not file presence.\n - `freshness_basis: \"generation\"` is the normal case: `advanced_legs`/`saved_legs` are current-review evidence, proven newer than the submission. Any leg in `withheld_legs` was delivered but NOT proven current \u2014 surface its `reason` (`generation_not_advanced` or `identity_unreadable`) as a visible warning; do not describe the result as an ordinary cost-saved one-leg review when a withholding occurred. A leg in `absent_legs` with `reason: \"not_delivered\"` is an ordinary policy omission (e.g. an Easy-ticket clarify-only review) unless its status also flags it as policy-expected, in which case call that out too.\n - `freshness_basis: \"terminality_only\"` means no submission baseline was available (e.g. a resumed session) \u2014 `advanced_legs` is empty by construction and `saved_legs` was accepted on terminal delivery alone. Surface this prominently as a DEGRADED-freshness warning: the saved artifact(s) may be indistinguishable from a prior attachment, and the downstream identity-footer agreement check is the remaining backstop. Retain this warning when reporting to the next steps rather than treating a `terminality_only` ready result as equivalent to a `generation`-backed one.\n - If the result instead carries `state: \"error\"` alongside a persistence failure (an `ARTIFACT_PERSISTENCE_FAILED` `error`/`status`/`message` envelope), HALT rather than proceeding with whatever files happen to exist on disk \u2014 report the failure; the accepted legs already on disk before the failure are named in the envelope and are not lost, but nothing new was persisted for this window.\n- `state: \"error\"` \u2014 terminal. Report the `reason` and stop; the review will not complete on its own. `UPSTREAM_TERMINAL` means the review failed or expired server-side \u2014 take the verdict contract's `revise` path; do NOT open another wait window and do NOT re-run `request_ticket_review`. `NO_REVIEW_REQUESTED` means no review was submitted from this session and none is running; `NO_REVIEW_RUNNING` means the submitted review is no longer running on the server \u2014 treat both like `UPSTREAM_TERMINAL`. `INVALID_RESPONSE` means the delivered document could not be read.\n\nKeep looping on `pending` for as long as this session's own budget allows. There is no iteration cap here: the bound is the caller's \u2014 for the conductor's spec-review worker that is the existing 120-minute job timeout, which produces the ordinary liveness outcome if the review never lands. Never fabricate a verdict or a review result from a pending state.",
34
34
  "description": "Wait for the submitted review in repeated bounded windows; a ready result has already persisted the accepted documents and reconciled the canonical files (BAPI-1121). Resumable: a pending result is a normal observation, not a failure.",
35
35
  "on_error": "halt"
36
36
  },