@bridge_gpt/mcp-server 0.2.74 → 0.2.75

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 (62) hide show
  1. package/README.md +14 -7
  2. package/build/agent-launchers/prompt.js +9 -21
  3. package/build/agents.generated.js +2 -2
  4. package/build/authored-plan.js +542 -0
  5. package/build/bridge-permissions.js +8 -0
  6. package/build/commands.generated.js +5 -5
  7. package/build/conductor/bridge-api-client.js +666 -46
  8. package/build/conductor/epic-implementer-cli.js +337 -93
  9. package/build/conductor/gate-discovery.js +209 -9
  10. package/build/conductor/gate-settings-review.js +7 -11
  11. package/build/conductor/launch-plan.js +58 -12
  12. package/build/conductor/open-decision-phrases.js +50 -0
  13. package/build/conductor/prerequisite-inputs.js +181 -14
  14. package/build/connect-github-api.js +18 -0
  15. package/build/connect-github.js +35 -18
  16. package/build/docs.generated.js +2 -2
  17. package/build/drive-epic.js +387 -12
  18. package/build/epic-ci-workflow.js +3 -2
  19. package/build/epic-implementer-bin.js +152 -38
  20. package/build/epic-implementer-bundle-cli.js +61 -0
  21. package/build/epic-implementer-claude-hook-bin.js +1 -1
  22. package/build/epic-implementer-env.js +3 -4
  23. package/build/epic-integration-pr.js +5 -2
  24. package/build/executor/completion-contract.js +24 -1
  25. package/build/executor/gate-qualification-job.js +193 -23
  26. package/build/executor/gate-qualification-tests-ran.js +232 -0
  27. package/build/executor/job-runner.js +9 -722
  28. package/build/executor/job-type-wrappers.js +734 -0
  29. package/build/executor/preflight.js +6 -2
  30. package/build/executor/process-containment.js +8 -1
  31. package/build/executor/required-verification.js +28 -2
  32. package/build/executor/runner.js +4 -1
  33. package/build/executor/types.js +9 -0
  34. package/build/executor/worker-database.js +6 -1
  35. package/build/executor/worker-guard-hook.js +24 -2
  36. package/build/generated/ticket-status.js +20 -0
  37. package/build/index.js +391 -257
  38. package/build/install-bridge-conductor-answers.js +28 -1
  39. package/build/install-bridge-conductor-apply.js +11 -3
  40. package/build/install-bridge-conductor-assessment.js +114 -12
  41. package/build/install-bridge-conductor-compact.js +2 -0
  42. package/build/install-bridge-conductor-gate.js +257 -80
  43. package/build/install-bridge-conductor-setup.js +4 -4
  44. package/build/install-bridge-conductor-trial-report.js +170 -0
  45. package/build/install-bridge-conductor.js +303 -31
  46. package/build/pipelines.generated.js +7 -7
  47. package/build/plan-generation.js +17 -0
  48. package/build/printed-remedy-commands.js +54 -0
  49. package/build/readme.generated.js +1 -1
  50. package/build/repository-toolchains.js +11 -5
  51. package/build/scripts/saved-commands-config-field-driver.js +65 -0
  52. package/build/setup-epic.js +10 -1
  53. package/build/test-support/executor-source-files.js +1 -1
  54. package/build/v2-readiness-requirements.js +5 -1
  55. package/build/version.generated.js +3 -3
  56. package/build/worker-guard-hook-bin.js +2 -2
  57. package/docs/EPIC-IMPLEMENTER.md +4 -4
  58. package/docs/install/github-app.md +79 -92
  59. package/package.json +1 -1
  60. package/build/conductor/epic-reconcile.js +0 -603
  61. package/build/conductor/epic-runtime.js +0 -2020
  62. package/build/conductor/epic-state.js +0 -774
@@ -71,6 +71,8 @@ export const PLAN_GENERATION_EXCLUSION_REASONS = ["unfinished_spike"];
71
71
  export const PLAN_GENERATION_ORDER_SOURCES = ["epic_manifest", "key_order"];
72
72
  /** Why the plan runs one child at a time, when it does. */
73
73
  export const PLAN_GENERATION_SERIALIZED_REASONS = ["unknown_touched_files", "key_order_fallback"];
74
+ /** Why a present ordered-child-manifest section did not supply the plan's order. */
75
+ export const PLAN_GENERATION_ORDER_FALLBACK_REASONS = ["manifest_unreadable"];
74
76
  /** The backend status categories the builder recognizes. */
75
77
  export const RECOGNIZED_STATUS_CATEGORIES = ["new", "indeterminate", "done"];
76
78
  /** Ticket keys in stored text. */
@@ -316,13 +318,26 @@ export function parseGeneratedPlanSummary(value) {
316
318
  return null;
317
319
  unknownFiles.push(key);
318
320
  }
321
+ let fallbackReason;
322
+ if (Object.prototype.hasOwnProperty.call(record, "order_fallback_reason")) {
323
+ if (!isOneOf(PLAN_GENERATION_ORDER_FALLBACK_REASONS, record.order_fallback_reason))
324
+ return null;
325
+ fallbackReason = record.order_fallback_reason;
326
+ }
319
327
  return {
320
328
  order_source: record.order_source,
321
329
  serialized_reason: serialized,
330
+ ...(fallbackReason === undefined ? {} : { order_fallback_reason: fallbackReason }),
322
331
  excluded,
323
332
  unknown_files: unknownFiles,
324
333
  };
325
334
  }
335
+ /** Any Markdown (levels 1-6) or Jira (h1.-h6.) heading starting "ordered child manifest". */
336
+ const ANY_MANIFEST_HEADING = /^\s{0,3}(?:#{1,6}\s+|h[1-6]\.\s*)ordered child manifest/i;
337
+ /** True when the description has a heading line (not prose) naming an ordered child manifest. */
338
+ function hasManifestLikeHeading(description) {
339
+ return description.split(/\r?\n/).some((line) => ANY_MANIFEST_HEADING.test(line));
340
+ }
326
341
  // ---------------------------------------------------------------------------
327
342
  // The builder
328
343
  // ---------------------------------------------------------------------------
@@ -370,6 +385,7 @@ export function buildGeneratedEpicPlan(input) {
370
385
  const items = parseOrderedChildManifest(input.epicDescription);
371
386
  const manifest = items === null ? null : applyManifest(items, allKeys, retained, excludedKeys);
372
387
  const orderSource = manifest === null ? "key_order" : "epic_manifest";
388
+ const manifestUnreadable = manifest === null && hasManifestLikeHeading(input.epicDescription);
373
389
  const order = manifest?.order ?? [...retained].sort(compareTicketKeys);
374
390
  // --- Files. -----------------------------------------------------------------
375
391
  const inventory = buildTrackedInventory(input.trackedFiles);
@@ -417,6 +433,7 @@ export function buildGeneratedEpicPlan(input) {
417
433
  summary: {
418
434
  order_source: orderSource,
419
435
  serialized_reason: serializedReason,
436
+ ...(manifestUnreadable ? { order_fallback_reason: "manifest_unreadable" } : {}),
420
437
  excluded: [...excludedKeys].sort(compareTicketKeys).map((key) => ({ ticket_key: key, reason: "unfinished_spike" })),
421
438
  unknown_files: unknownFiles,
422
439
  },
@@ -111,6 +111,22 @@ export const READINESS_PREREQUISITE_FIXES = {
111
111
  * Client-only: it is never sent on the wire, so it stays out of the generated table above.
112
112
  */
113
113
  export const PRE_SETUP_READINESS_REMEDY = "Run setup; this item is checked again once this setup is saved.";
114
+ /**
115
+ * Reverse lookup over {@link READINESS_PREREQUISITE_FIXES}, built once. Only this
116
+ * table feeds it: the older-server literals are deliberately not classified here.
117
+ * The table values are pairwise distinct (a test asserts it), so the map is never
118
+ * ambiguous. The empty string is a valid value, so `""` classifies as `"none"`.
119
+ */
120
+ const READINESS_FIX_KEY_BY_VALUE = new Map(Object.entries(READINESS_PREREQUISITE_FIXES).map(([key, value]) => [value, key]));
121
+ /**
122
+ * Classify a remedy string by exact match against the values of
123
+ * {@link READINESS_PREREQUISITE_FIXES}. The match is byte for byte: no trimming, no
124
+ * case folding, no prefix handling, no substring matching. Any other string returns
125
+ * `undefined`.
126
+ */
127
+ export function classifyReadinessFix(fix) {
128
+ return READINESS_FIX_KEY_BY_VALUE.get(fix);
129
+ }
114
130
  const PUBLISHED_INSTALL_COMMAND = `${LAUNCHER} install epic-implementer --required-check "epic-implementer-ci / gate"`;
115
131
  /**
116
132
  * BAPI-1635 — the fix texts the PUBLISHED client (0.2.72) accepts from a server.
@@ -134,6 +150,44 @@ export const PUBLISHED_SERVER_COMPATIBLE_FIXES = [
134
150
  `Run ${LAUNCHER} connect-github, then retry readiness.`,
135
151
  "",
136
152
  ];
153
+ const INDEXED_WORKFLOWS_ROW_ID = "server.indexed-workflows";
154
+ /** The exact wire fix a missing managed workflow arrives with (published bytes). */
155
+ const MISSING_WORKFLOW_WIRE_FIX = `Run ${PUBLISHED_INSTALL_COMMAND}, merge the workflow changes, then re-index the repository.`;
156
+ // BAPI-1700 — shared sentence pieces for the two client-only no-gate remedies.
157
+ const STORE_GATE_OR_ATTENDED = "/install-epic-implementer to store a test gate, or start the run with --attended.";
158
+ const REVIEW_WORKFLOW_FILE = ".github/workflows/claude-review.yml";
159
+ const MANAGED_ONLY_DISPLAY_REMEDY = `Run ${STORE_GATE_OR_ATTENDED}`;
160
+ const REVIEW_INCLUSIVE_DISPLAY_REMEDY = `Add ${REVIEW_WORKFLOW_FILE}. Then run ${STORE_GATE_OR_ATTENDED} Then re-index the repository.`;
161
+ /**
162
+ * True only when the report's repository-scoped `review_workflow` section clearly
163
+ * shows the review file present: the probe succeeded AND the file is present. An
164
+ * absent or unreadable section, a failed probe, or a missing file is not clear.
165
+ */
166
+ function reviewWorkflowClearlySatisfied(report) {
167
+ const section = report?.review_workflow;
168
+ return section !== null && section !== undefined
169
+ && section.probe_succeeded === true && section.workflow_present === true;
170
+ }
171
+ /**
172
+ * BAPI-1700 — display text for the indexed-workflows row. Presentation only.
173
+ *
174
+ * The server sends the managed-workflow wire fix for a repository with no stored
175
+ * test gate. That fix is only half the story: such a repository can also store a
176
+ * gate with `/install-epic-implementer`, or start the run with `--attended`. This
177
+ * swaps in that wording for the EXACT row ID and EXACT published wire text, and
178
+ * returns `row.fix` unchanged for anything else (another ID, a near-miss, or a
179
+ * review-only remedy). It never mutates the row, and its output is never fed back
180
+ * through wire validation or added to any published-fix list.
181
+ *
182
+ * Managed-only wording is used only when the supplied report's `review_workflow`
183
+ * section clearly shows the review file present. With no report, or any unclear or
184
+ * conflicting evidence, the wording keeps the review-workflow step.
185
+ */
186
+ export function indexedWorkflowsDisplayRemedy(row, report) {
187
+ if (row.id !== INDEXED_WORKFLOWS_ROW_ID || row.fix !== MISSING_WORKFLOW_WIRE_FIX)
188
+ return row.fix;
189
+ return reviewWorkflowClearlySatisfied(report) ? MANAGED_ONLY_DISPLAY_REMEDY : REVIEW_INCLUSIVE_DISPLAY_REMEDY;
190
+ }
137
191
  /**
138
192
  * BAPI-1635 — the remedy a KNOWN unmet prerequisite resolves to, by catalog ID.
139
193
  * Each value is a key of the flat {@link READINESS_PREREQUISITE_FIXES}; the map is