@bridge_gpt/mcp-server 0.2.60 → 0.2.65

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 (89) hide show
  1. package/README.md +58 -11
  2. package/build/agent-launchers/claude-executor-adapter.js +134 -3
  3. package/build/agent-launchers/executor-adapter.js +54 -2
  4. package/build/agents.generated.js +10 -1
  5. package/build/bounded-wait.js +32 -1
  6. package/build/commands.generated.js +8 -7
  7. package/build/conductor/bridge-api-client.js +678 -14
  8. package/build/conductor/bring-up-facts.js +3 -1
  9. package/build/conductor/doctor.js +23 -14
  10. package/build/conductor/epic-child-continuation.js +324 -0
  11. package/build/conductor/epic-implementer-cli.js +142 -17
  12. package/build/conductor/git-hooks.js +529 -118
  13. package/build/conductor/hook-runtime-qualification.js +340 -0
  14. package/build/conductor/merge-execution-contract.js +30 -5
  15. package/build/conductor/merge-execution-eligibility.js +10 -9
  16. package/build/conductor/readiness-sections.js +104 -20
  17. package/build/conductor/readiness.js +129 -25
  18. package/build/conductor/recovery-cli.js +354 -13
  19. package/build/conductor/recovery-operations.js +251 -5
  20. package/build/conductor/repair-contract.js +8 -0
  21. package/build/conductor-bundle-artifacts.js +1 -0
  22. package/build/credential-store.js +194 -0
  23. package/build/docs.generated.js +2 -1
  24. package/build/doctor.js +161 -7
  25. package/build/drive-epic-key.js +12 -0
  26. package/build/drive-epic.js +1318 -111
  27. package/build/epic-coherence-input-cli.js +137 -0
  28. package/build/epic-coherence-input.js +920 -0
  29. package/build/epic-coherence-input.test-fixtures.js +175 -0
  30. package/build/epic-implementer-bin.js +35 -29
  31. package/build/epic-implementer-bundle-cli.js +14 -1
  32. package/build/epic-integration-pr.js +61 -15
  33. package/build/epic-launch-profile.js +464 -0
  34. package/build/epic-run-status.js +5 -0
  35. package/build/epic-shared/bridge-client.js +46 -4
  36. package/build/executor/cli.js +48 -0
  37. package/build/executor/completion-contract.js +423 -0
  38. package/build/executor/completion-supervision.js +286 -0
  39. package/build/executor/credentials.js +19 -1
  40. package/build/executor/deps.js +65 -1
  41. package/build/executor/env.js +6 -0
  42. package/build/executor/heartbeat.js +13 -3
  43. package/build/executor/http-client.js +117 -1
  44. package/build/executor/integration-job.js +759 -0
  45. package/build/executor/job-errors.js +48 -0
  46. package/build/executor/job-runner.js +1386 -35
  47. package/build/executor/job-types.js +10 -2
  48. package/build/executor/observation.js +114 -7
  49. package/build/executor/preflight.js +99 -0
  50. package/build/executor/process-containment.js +756 -0
  51. package/build/executor/process.js +235 -5
  52. package/build/executor/prompt-spec.js +262 -1
  53. package/build/executor/provider-checks.js +69 -0
  54. package/build/executor/rebase-finalization.js +351 -0
  55. package/build/executor/reconcile-overlap-job.js +77 -84
  56. package/build/executor/required-verification.js +313 -0
  57. package/build/executor/required-work-ledger.js +1121 -0
  58. package/build/executor/results.js +142 -0
  59. package/build/executor/resume-pre-spawn.js +87 -4
  60. package/build/executor/runner.js +246 -1
  61. package/build/executor/test-declaration.js +20 -0
  62. package/build/executor/types.js +55 -0
  63. package/build/executor/worker-command.js +49 -13
  64. package/build/executor/worker-finalization.js +88 -11
  65. package/build/executor/worker-guard-hook.js +29 -4
  66. package/build/executor/worktree.js +13 -0
  67. package/build/executor-launch.js +658 -0
  68. package/build/index.js +772 -954
  69. package/build/install-bridge-conductor.js +622 -40
  70. package/build/install-bridge.js +92 -16
  71. package/build/merge-pull-request.js +1 -1
  72. package/build/merge-workflow-config.js +54 -0
  73. package/build/merge-workflow-drift.js +35 -4
  74. package/build/merge-workflow.js +386 -2
  75. package/build/pipelines.generated.js +9 -8
  76. package/build/plan-discovery.js +137 -0
  77. package/build/plan-epic-implementer-eligibility.js +2 -2
  78. package/build/plane/cli.js +37 -3
  79. package/build/plane/member-logs.js +3 -0
  80. package/build/plane/member-roster.js +7 -1
  81. package/build/plane/shutdown.js +59 -1
  82. package/build/plane/supervisor.js +148 -0
  83. package/build/readme.generated.js +1 -1
  84. package/build/scripts/executor-protocol-contract-driver.js +13 -3
  85. package/build/setup-epic.js +130 -48
  86. package/build/version.generated.js +3 -3
  87. package/build/worker-guard-hook-bin.js +2 -2
  88. package/docs/CONDUCTOR.md +116 -2
  89. package/package.json +2 -1
@@ -0,0 +1,175 @@
1
+ /**
2
+ * BAPI-1320 shared fixtures for the epic-coherence input builder and CLI tests:
3
+ * an injected in-memory consumer repository (deliberately with no
4
+ * `mcp_server/src/` directory) plus valid epic and child drafts and an outline.
5
+ * Imported only by `*.test.ts` files; it performs no real I/O.
6
+ */
7
+ import path from "node:path";
8
+ export const ROOT = path.resolve(path.sep, "consumer-repo");
9
+ /**
10
+ * An in-memory repository. `files` and `dirs` are repository-relative;
11
+ * `symlinks` maps an absolute link path to its absolute target.
12
+ */
13
+ export function memoryRepo(files, options = {}) {
14
+ const contents = new Map();
15
+ for (const [rel, body] of Object.entries(files))
16
+ contents.set(path.join(ROOT, rel), body);
17
+ const dirs = new Set([path.sep, ROOT]);
18
+ const addDirs = (abs) => {
19
+ let dir = path.dirname(abs);
20
+ while (!dirs.has(dir)) {
21
+ dirs.add(dir);
22
+ dir = path.dirname(dir);
23
+ }
24
+ };
25
+ for (const abs of contents.keys())
26
+ addDirs(abs);
27
+ for (const rel of options.dirs ?? []) {
28
+ const abs = path.join(ROOT, rel);
29
+ dirs.add(abs);
30
+ addDirs(abs);
31
+ }
32
+ const symlinks = new Map(Object.entries(options.symlinks ?? {}));
33
+ const repo = { fs: undefined, files: contents, writes: [], reads: [], realpaths: [] };
34
+ const missing = (p) => Object.assign(new Error(`ENOENT: ${p}`), { code: "ENOENT" });
35
+ const resolveLinks = (p) => {
36
+ const parts = p.split(path.sep).filter(Boolean);
37
+ let current = path.sep;
38
+ for (const part of parts) {
39
+ current = path.join(current, part);
40
+ const target = symlinks.get(current);
41
+ if (target !== undefined)
42
+ current = target;
43
+ }
44
+ return current;
45
+ };
46
+ repo.fs = {
47
+ readFile: async (p) => {
48
+ repo.reads.push(p);
49
+ const real = resolveLinks(p);
50
+ const body = contents.get(real);
51
+ if (body === undefined)
52
+ throw missing(p);
53
+ return body;
54
+ },
55
+ writeFile: async (p, data) => {
56
+ repo.writes.push(p);
57
+ contents.set(resolveLinks(p), data);
58
+ },
59
+ rename: async (from, to) => {
60
+ const body = contents.get(resolveLinks(from));
61
+ if (body === undefined)
62
+ throw missing(from);
63
+ contents.delete(resolveLinks(from));
64
+ contents.set(resolveLinks(to), body);
65
+ },
66
+ unlink: async (p) => {
67
+ contents.delete(resolveLinks(p));
68
+ },
69
+ realpath: async (p) => {
70
+ repo.realpaths.push(p);
71
+ const real = resolveLinks(p);
72
+ if (contents.has(real) || dirs.has(real))
73
+ return real;
74
+ throw missing(p);
75
+ },
76
+ mkdir: async (p) => {
77
+ const real = resolveLinks(p);
78
+ dirs.add(real);
79
+ addDirs(real);
80
+ },
81
+ };
82
+ return repo;
83
+ }
84
+ export const EPIC_DRAFT = [
85
+ "# Install hardening",
86
+ "",
87
+ "## Summary",
88
+ "",
89
+ "Harden the installer — sûrement.",
90
+ "",
91
+ "## Requirements",
92
+ "",
93
+ "Validate keys before saving them.",
94
+ "",
95
+ "## Release checklist (owner-run)",
96
+ "",
97
+ "- Step 5: the release owner runs the smoke test and posts its output as a comment on the epic.",
98
+ "",
99
+ "## Acceptance Criteria",
100
+ "",
101
+ "These must all hold.",
102
+ "",
103
+ "- AC-1: The installer refuses a bad key.",
104
+ " Verification: Run it with a revoked key;",
105
+ " it exits non-zero.",
106
+ "- AC-2: Production is healthy. Verification: The smoke test output is on the epic.",
107
+ "",
108
+ "## Materials & Access",
109
+ "",
110
+ "No external materials are referenced.",
111
+ "",
112
+ ].join("\n");
113
+ export const CHILD_DRAFT = [
114
+ "# Validate the key",
115
+ "",
116
+ "## Summary",
117
+ "",
118
+ "Call the key-check route before writing credentials.",
119
+ "",
120
+ "## Requirements",
121
+ "",
122
+ "Edit `mcp_server/lib/install.ts`; read `api/library/db/postgres_helpers.py` and `docs/notes/guide.md`.",
123
+ "",
124
+ "## Acceptance Criteria",
125
+ "",
126
+ "- AC-1: Test that a revoked key exits non-zero",
127
+ " and leaves credentials unchanged",
128
+ "- The message names the key-check route.",
129
+ "",
130
+ ].join("\n");
131
+ export const OWNER = {
132
+ id: "OR-1",
133
+ kind: "owner_run",
134
+ who: "Release owner",
135
+ step_ref: "Release checklist step 5",
136
+ step_text: "Step 5: the release owner runs the smoke test and posts its output as a comment on the epic.",
137
+ records_result_in: "a comment on the epic",
138
+ owns_verifications: [{ epic_ac: "AC-2", obligation: "Post the smoke-test output on the epic" }],
139
+ };
140
+ export function outline(overrides = {}, child = {}) {
141
+ return {
142
+ epic: { slug: "install-hardening", draft: "drafts/epic.md" },
143
+ children: [
144
+ {
145
+ id: "1",
146
+ draft: "drafts/child-1.md",
147
+ size_band: "L",
148
+ depends_on: [],
149
+ recommended_after: [],
150
+ edits: ["mcp_server/lib/install.ts"],
151
+ reads: ["api/library/db/postgres_helpers.py"],
152
+ owns_verifications: [
153
+ { epic_ac: "AC-1", obligation: "Test that a revoked key exits non-zero and leaves credentials unchanged" },
154
+ ],
155
+ ...child,
156
+ },
157
+ ],
158
+ non_child_owners: [OWNER],
159
+ ...overrides,
160
+ };
161
+ }
162
+ export function validRepoFiles(outlineDoc = outline()) {
163
+ return {
164
+ "outline.json": JSON.stringify(outlineDoc),
165
+ "drafts/epic.md": EPIC_DRAFT,
166
+ "drafts/child-1.md": CHILD_DRAFT,
167
+ "api/library/db/postgres_helpers.py": "# helpers\n",
168
+ };
169
+ }
170
+ /** Precomputed with the procedure's Python one-liner over the built document. */
171
+ export const EXPECTED_DIGESTS = {
172
+ manifest_sha256: "0c4801b53d85ac2e92ffabb5761f8dcaaeb5ec6e367d973a5c26604922719ca4",
173
+ child_evidence_sha256: "146a6d4e49f8aab7217266e01f20bfd2cad9dbe11a2cb6ee4a02fd78f75f4f87",
174
+ non_child_owners_sha256: "282d913b2805713ac370fbfd0e289b1a9872eb69608792b5cc810da6db9099d7",
175
+ };