@bridge_gpt/mcp-server 0.2.70 → 0.2.72
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.
- package/README.md +55 -17
- package/build/agent-launchers/claude-executor-adapter.js +29 -4
- package/build/agent-notes.js +171 -95
- package/build/agent-registry.js +5 -5
- package/build/agents.generated.js +12 -2
- package/build/bounded-wait.js +9 -1
- package/build/bridge-permissions.js +17 -5
- package/build/bridge-worktree-inspection.js +237 -0
- package/build/check-evidence.js +6 -0
- package/build/claude-review-workflow.js +1 -1
- package/build/cli-help.js +6 -0
- package/build/codex-auto-recovery.js +126 -0
- package/build/codex-skill-adapter.js +2 -0
- package/build/commands.generated.js +5 -5
- package/build/conductor/bridge-api-client.js +776 -23
- package/build/conductor/command-drift-production.js +7 -2
- package/build/conductor/doctor.js +93 -13
- package/build/conductor/epic-implementer-cli.js +55 -2
- package/build/conductor/gate-discovery.js +659 -19
- package/build/conductor/gate-settings-review.js +751 -0
- package/build/conductor/git-hooks-uninstall.js +112 -0
- package/build/conductor/git-hooks.js +81 -15
- package/build/conductor/guided-repair.js +10 -1
- package/build/conductor/install-doctor.js +2 -4
- package/build/conductor/launch-need-probes.js +16 -11
- package/build/conductor/launch-plan.js +185 -0
- package/build/conductor/local-merge.js +12 -1
- package/build/conductor/merge-execution-contract.js +1 -1
- package/build/conductor/merged-child-check.js +2 -1
- package/build/conductor/precheck-timings.js +14 -0
- package/build/conductor/prerequisite-inputs.js +379 -0
- package/build/conductor/preview-observations.js +10 -0
- package/build/conductor/readiness-assessment.js +78 -0
- package/build/conductor/readiness-cli.js +10 -0
- package/build/conductor/readiness-prerequisites.js +53 -0
- package/build/conductor/readiness-sections.js +25 -9
- package/build/conductor/readiness.js +20 -2
- package/build/conductor/recovery-cli.js +281 -14
- package/build/conductor/recovery-operations.js +78 -5
- package/build/conductor/repair-contract.js +33 -0
- package/build/conductor/tools.js +34 -3
- package/build/conductor/wait-run-attention.js +115 -0
- package/build/conductor/wait-run-cli.js +96 -3
- package/build/conductor/worker-database-doctor-inspector.js +1 -0
- package/build/credential-store.js +25 -20
- package/build/dependency-install-declarations.js +157 -0
- package/build/docs.generated.js +4 -4
- package/build/doctor.js +37 -5
- package/build/drive-epic-help.js +2 -2
- package/build/drive-epic.js +240 -56
- package/build/epic-ci-workflow-drift.js +71 -23
- package/build/epic-ci-workflow-install.js +83 -26
- package/build/epic-ci-workflow-v1.js +132 -0
- package/build/epic-ci-workflow.js +174 -13
- package/build/epic-implementer-bin.js +119 -44
- package/build/epic-launch-profile.js +1 -1
- package/build/executor/ci-rerun-job.js +220 -14
- package/build/executor/cli.js +2 -0
- package/build/executor/completion-contract.js +16 -0
- package/build/executor/credentials.js +1 -1
- package/build/executor/delivery-observations.js +113 -0
- package/build/executor/delivery-outcome.js +30 -0
- package/build/executor/dependency-refresh-runner.js +132 -0
- package/build/executor/dependency-refresh.js +530 -0
- package/build/executor/deps.js +4 -0
- package/build/executor/env.js +274 -5
- package/build/executor/gate-qualification-job.js +20 -5
- package/build/executor/harness-coverage.js +19 -0
- package/build/executor/http-client.js +35 -1
- package/build/executor/index.js +2 -1
- package/build/executor/install-preflight.js +1 -1
- package/build/executor/job-runner.js +355 -36
- package/build/executor/likely-tests.js +100 -98
- package/build/executor/preflight.js +5 -0
- package/build/executor/process-containment.js +18 -0
- package/build/executor/prompt-spec.js +84 -15
- package/build/executor/reconcile-overlap-job.js +6 -1
- package/build/executor/required-verification.js +28 -0
- package/build/executor/required-work-diagnostics.js +30 -0
- package/build/executor/required-work-ledger.js +19 -1
- package/build/executor/results.js +42 -0
- package/build/executor/service-discovery.js +42 -0
- package/build/executor/service-lifecycle.js +109 -2
- package/build/executor/service-uninstall.js +205 -0
- package/build/executor/service-unit.js +5 -3
- package/build/executor/test-clock.js +3 -0
- package/build/executor/verification-hints.js +179 -0
- package/build/executor/worker-command.js +188 -1
- package/build/executor/worker-database.js +299 -40
- package/build/executor/worker-finalization.js +65 -10
- package/build/executor/worker-guard-hook.js +10 -2
- package/build/executor/worker-resources.js +12 -1
- package/build/executor/worker-verification-guidance.js +64 -0
- package/build/executor/worktree-inspection.js +42 -0
- package/build/github-sign-in.js +1 -1
- package/build/index.js +767 -310
- package/build/init.js +3 -3
- package/build/install-bridge-conductor-gate.js +416 -41
- package/build/install-bridge-conductor-setup.js +135 -32
- package/build/install-bridge-conductor.js +769 -353
- package/build/install-bridge.js +419 -124
- package/build/install-maintenance.js +104 -0
- package/build/install-reexec.js +1 -1
- package/build/local-cleanup.js +59 -0
- package/build/mcp-install-state.js +68 -2
- package/build/merge-workflow-install.js +22 -2
- package/build/package-script-semantics.js +10 -0
- package/build/pipeline-utils.js +1 -1
- package/build/pipelines.generated.js +6 -6
- package/build/plan-execution-ledger.js +171 -10
- package/build/plane/plane-freshness.js +12 -9
- package/build/plane/preflight.js +19 -0
- package/build/plane/terminal-run-cleanup.js +5 -1
- package/build/plane/terminal-run-status.js +4 -0
- package/build/printed-remedy-commands.js +31 -4
- package/build/readiness-check.js +1 -78
- package/build/readiness-prerequisites.generated.js +199 -0
- package/build/readme.generated.js +1 -1
- package/build/repository-toolchains.js +623 -0
- package/build/setup-change-policy.js +32 -0
- package/build/setup-epic.js +26 -9
- package/build/setup-question.js +62 -0
- package/build/start-tickets.js +4 -0
- package/build/test-command-detection.js +61 -80
- package/build/test-support/notes-fs.js +40 -0
- package/build/ticket-delivery-artifacts.js +7 -0
- package/build/ticket-delivery-enrollment.js +80 -4
- package/build/ticket-delivery-run-scope.js +128 -0
- package/build/version.generated.js +3 -3
- package/build/worker-guard-hook-bin.js +2 -2
- package/build/worktrees.js +105 -0
- package/docs/EPIC-IMPLEMENTER.md +43 -0
- package/docs/epic-implementer/getting-started.md +95 -14
- package/package.json +2 -2
|
@@ -19,13 +19,18 @@ import { probeCommandDrift, } from "./command-drift.js";
|
|
|
19
19
|
/** Bounded timeout for one Git subprocess. */
|
|
20
20
|
const GIT_TIMEOUT_MS = 5_000;
|
|
21
21
|
const BLOB_ID = /^[0-9a-f]{40}([0-9a-f]{24})?$/;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* `timeoutMs` bounds each Git subprocess. Production keeps the 5 s default;
|
|
24
|
+
* tests that run real Git on a shared, loaded CI machine pass a longer bound so
|
|
25
|
+
* a slow process start is not mistaken for "Git could not be inspected".
|
|
26
|
+
*/
|
|
27
|
+
export function createGitRunner(cwd, timeoutMs = GIT_TIMEOUT_MS) {
|
|
23
28
|
return (args, input) => {
|
|
24
29
|
const result = spawnSync("git", args, {
|
|
25
30
|
cwd,
|
|
26
31
|
input,
|
|
27
32
|
encoding: "utf-8",
|
|
28
|
-
timeout:
|
|
33
|
+
timeout: timeoutMs,
|
|
29
34
|
stdio: [input === undefined ? "ignore" : "pipe", "pipe", "ignore"],
|
|
30
35
|
});
|
|
31
36
|
if (result.error)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { sanitizeHarnessCoverage } from "../executor/harness-coverage.js";
|
|
2
|
+
import { monotonicNow, elapsedMs } from "./precheck-timings.js";
|
|
1
3
|
/**
|
|
2
4
|
* Combined, strictly read-only epic-implementer doctor report (BAPI-395, BAPI-418).
|
|
3
5
|
*
|
|
@@ -84,7 +86,7 @@ export const DENY_ENFORCEMENT_SKIP_REMEDIATION = "run `epic-implementer doctor`
|
|
|
84
86
|
/** Explicit display value for an unset `BRIDGE_MCP_PROFILE`. */
|
|
85
87
|
export const MCP_PROFILE_UNSET = "(unset)";
|
|
86
88
|
/** BAPI-1461: the printed setup command, used in stored-token remedies. */
|
|
87
|
-
const PRINTED_SETUP_COMMAND = `npx -y ${MCP_PACKAGE_NAME} install
|
|
89
|
+
const PRINTED_SETUP_COMMAND = `npx -y ${MCP_PACKAGE_NAME} install epic-implementer`;
|
|
88
90
|
/** BAPI-1461: the fix for a stored token GitHub rejected. */
|
|
89
91
|
export const STORED_MERGE_TOKEN_REJECTED_REMEDIATION = `replace the stored merge token: run \`${PRINTED_SETUP_COMMAND}\` and accept the offer to ` +
|
|
90
92
|
`replace it, or remove it with \`${PRINTED_SETUP_COMMAND} --remove-merge-token\`.`;
|
|
@@ -161,6 +163,48 @@ export const WORKER_DATABASE_DOCTOR_OWNER = "host operator";
|
|
|
161
163
|
export const WORKER_DATABASE_DOCTOR_TIMEOUT_MS = 20_000;
|
|
162
164
|
/** Maximum validated names listed per inventory group; the rest are counted. */
|
|
163
165
|
export const WORKER_DATABASE_DOCTOR_NAME_LIMIT = 20;
|
|
166
|
+
const MIGRATION_CAUSE_LABELS = {
|
|
167
|
+
multiple_heads: "Multiple heads",
|
|
168
|
+
revision_missing: "Missing revision",
|
|
169
|
+
ssl_refused: "SSL refused",
|
|
170
|
+
connection_refused: "Connection refused",
|
|
171
|
+
permission_denied: "Permission denied",
|
|
172
|
+
timeout: "Timed out",
|
|
173
|
+
other: "Other failure",
|
|
174
|
+
};
|
|
175
|
+
/** Most owner roles ever displayed. */
|
|
176
|
+
export const WORKER_DATABASE_DOCTOR_OWNER_ROLE_LIMIT = 5;
|
|
177
|
+
const OWNER_ROLE_PATTERN = /^[A-Za-z_][A-Za-z0-9_$-]{0,62}$/;
|
|
178
|
+
/** True only for a whole-string valid PostgreSQL role name; nothing is trimmed into validity. */
|
|
179
|
+
export function isDisplayableOwnerRole(value) {
|
|
180
|
+
return typeof value === "string" && OWNER_ROLE_PATTERN.test(value);
|
|
181
|
+
}
|
|
182
|
+
/** Revalidate, deduplicate, sort (byte order), and cap an untrusted owner list. */
|
|
183
|
+
export function sanitizeOwnerRoles(value) {
|
|
184
|
+
if (!Array.isArray(value))
|
|
185
|
+
return [];
|
|
186
|
+
const roles = new Set();
|
|
187
|
+
for (const entry of value)
|
|
188
|
+
if (isDisplayableOwnerRole(entry))
|
|
189
|
+
roles.add(entry);
|
|
190
|
+
return [...roles]
|
|
191
|
+
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
|
|
192
|
+
.slice(0, WORKER_DATABASE_DOCTOR_OWNER_ROLE_LIMIT);
|
|
193
|
+
}
|
|
194
|
+
/** Exact owner total when it is a safe integer no smaller than the displayed list; otherwise the list length. */
|
|
195
|
+
export function sanitizeOwnerRoleTotal(value, displayed) {
|
|
196
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= displayed ? value : displayed;
|
|
197
|
+
}
|
|
198
|
+
/** `postgres, ci_owner (+1 more)` — validated roles only. */
|
|
199
|
+
export function formatOwnerRoles(roles, total) {
|
|
200
|
+
const more = total - roles.length;
|
|
201
|
+
return roles.join(", ") + (more > 0 ? ` (+${more} more)` : "");
|
|
202
|
+
}
|
|
203
|
+
function safeMigrationCause(value) {
|
|
204
|
+
return typeof value === "string" && Object.prototype.hasOwnProperty.call(MIGRATION_CAUSE_LABELS, value)
|
|
205
|
+
? value
|
|
206
|
+
: undefined;
|
|
207
|
+
}
|
|
164
208
|
const ROW_STATES = new Set(["healthy", "unsafe", "unknown"]);
|
|
165
209
|
const RETAIN_REASONS = new Set([
|
|
166
210
|
"owner_alive",
|
|
@@ -253,13 +297,19 @@ function boundaryRow(boundary) {
|
|
|
253
297
|
return makeRow("worker-db-boundary", "bridgeapi boundary", state, detail);
|
|
254
298
|
}
|
|
255
299
|
function alembicRow(alembic) {
|
|
256
|
-
const
|
|
300
|
+
const a = (alembic ?? {});
|
|
301
|
+
const state = safeState(a.state);
|
|
302
|
+
// A cause is meaningful only on an unsafe result; it is dropped everywhere else.
|
|
303
|
+
const cause = state === "unsafe" ? safeMigrationCause(a.cause) : undefined;
|
|
257
304
|
const detail = state === "healthy"
|
|
258
|
-
? "the operator checkout
|
|
305
|
+
? "the operator checkout has one migration head and renders base:head offline " +
|
|
306
|
+
"(no live database connection, object permission, or worker-branch check)"
|
|
259
307
|
: state === "unsafe"
|
|
260
|
-
?
|
|
261
|
-
|
|
262
|
-
|
|
308
|
+
? cause
|
|
309
|
+
? `the operator checkout's offline migration check failed: ${MIGRATION_CAUSE_LABELS[cause]} (cause: ${cause})`
|
|
310
|
+
: "the operator checkout's .venv Alembic is missing"
|
|
311
|
+
: "unknown — the operator checkout's offline migration check could not be completed";
|
|
312
|
+
return { ...makeRow("worker-db-alembic", "operator-checkout Alembic", state, detail), ...(cause ? { cause } : {}) };
|
|
263
313
|
}
|
|
264
314
|
function safeNameList(value, redacted) {
|
|
265
315
|
if (!Array.isArray(value))
|
|
@@ -283,7 +333,7 @@ function sanitizeInventory(inventory) {
|
|
|
283
333
|
!Array.isArray(value.leftovers) ||
|
|
284
334
|
!Array.isArray(value.unverifiable) ||
|
|
285
335
|
typeof value.harnessCount !== "number" ||
|
|
286
|
-
!Number.
|
|
336
|
+
!Number.isSafeInteger(value.harnessCount) ||
|
|
287
337
|
value.harnessCount < 0) {
|
|
288
338
|
return { state: "unknown" };
|
|
289
339
|
}
|
|
@@ -302,15 +352,37 @@ function sanitizeInventory(inventory) {
|
|
|
302
352
|
: "unrecognized";
|
|
303
353
|
unverifiable.push({ name: e.name, reason });
|
|
304
354
|
}
|
|
355
|
+
const harnessOwners = sanitizeOwnerRoles(value.harnessOwners);
|
|
305
356
|
return {
|
|
306
357
|
state: "known",
|
|
307
358
|
active,
|
|
308
359
|
leftovers,
|
|
309
360
|
unverifiable,
|
|
310
361
|
harness_count: value.harnessCount,
|
|
362
|
+
...(sanitizeHarnessCoverage(value.harnessCoverage, value.harnessCount)
|
|
363
|
+
? { harness_coverage: sanitizeHarnessCoverage(value.harnessCoverage, value.harnessCount) } : {}),
|
|
364
|
+
harness_owners: harnessOwners,
|
|
365
|
+
harness_owner_total: sanitizeOwnerRoleTotal(value.harnessOwnerCount, harnessOwners.length),
|
|
311
366
|
redacted_count: redacted.count,
|
|
312
367
|
};
|
|
313
368
|
}
|
|
369
|
+
function harnessRow(inventory) {
|
|
370
|
+
const healthy = inventory.harness_count === 0;
|
|
371
|
+
const owners = healthy ? [] : inventory.harness_owners;
|
|
372
|
+
const coverage = inventory.harness_coverage;
|
|
373
|
+
const coverageClause = coverage?.activity === "known"
|
|
374
|
+
? `; ${coverage.covered} in use or CI-owned; ${coverage.uncovered} uncovered; activity known ` +
|
|
375
|
+
`(overlapping categories: ${coverage.inUse} in use, ${coverage.ciOwned} CI-owned)`
|
|
376
|
+
: "; activity unknown";
|
|
377
|
+
const ownerClause = owners.length > 0
|
|
378
|
+
? `; owners shown: ${formatOwnerRoles(owners, inventory.harness_owner_total)} — ` +
|
|
379
|
+
"drop as the owning role, not the CI role (see the harness reaper and owner-role guidance in the runbook)"
|
|
380
|
+
: "";
|
|
381
|
+
const row = makeRow("worker-db-harness", "conductor_harness databases", healthy ? "healthy" : "unsafe", `${inventory.harness_count} present (owned by the Python harness reaper; the executor never cleans them)` +
|
|
382
|
+
coverageClause + ownerClause);
|
|
383
|
+
return { ...row, ...(coverage ? { harness_coverage: coverage } : {}),
|
|
384
|
+
...(owners.length > 0 ? { owner_roles: owners, owner_role_total: inventory.harness_owner_total } : {}) };
|
|
385
|
+
}
|
|
314
386
|
function inventoryRows(inventory) {
|
|
315
387
|
if (inventory.state === "unknown") {
|
|
316
388
|
const detail = "unknown — the database inventory could not be read";
|
|
@@ -328,7 +400,7 @@ function inventoryRows(inventory) {
|
|
|
328
400
|
"(dead executor on this host; the next executor start sweeps them)"),
|
|
329
401
|
makeRow("worker-db-unverifiable", "unverifiable worker databases", unverifiableCount === 0 ? "healthy" : "unsafe", `${unverifiableCount} with unreadable, malformed, foreign-host, or unknown ownership ` +
|
|
330
402
|
"(left in place; review manually)"),
|
|
331
|
-
|
|
403
|
+
harnessRow(inventory),
|
|
332
404
|
];
|
|
333
405
|
}
|
|
334
406
|
/** Project a (possibly hostile or malformed) inspection into the sanitized advisory section. */
|
|
@@ -344,7 +416,7 @@ export function buildWorkerDatabaseDoctorSection(inspection) {
|
|
|
344
416
|
boundaryRow(insp.boundary),
|
|
345
417
|
alembicRow(insp.alembic),
|
|
346
418
|
...inventoryRows(inventory),
|
|
347
|
-
],
|
|
419
|
+
].map((row) => ({ ...row, duration_ms: inspection?.timings?.[row.id] ?? elapsedMs(monotonicNow()) })),
|
|
348
420
|
inventory,
|
|
349
421
|
};
|
|
350
422
|
}
|
|
@@ -358,6 +430,11 @@ export function buildWorkerDatabaseDoctorSection(inspection) {
|
|
|
358
430
|
* say that the inspection failed without echoing exception text.
|
|
359
431
|
*/
|
|
360
432
|
export async function collectWorkerDatabaseDoctorSection(inspect, timeoutMs = WORKER_DATABASE_DOCTOR_TIMEOUT_MS, onFailure) {
|
|
433
|
+
const started = monotonicNow();
|
|
434
|
+
const failedSection = () => {
|
|
435
|
+
const section = buildWorkerDatabaseDoctorSection(null);
|
|
436
|
+
return { ...section, rows: section.rows.map((row) => ({ ...row, duration_ms: elapsedMs(started) })) };
|
|
437
|
+
};
|
|
361
438
|
let timer;
|
|
362
439
|
try {
|
|
363
440
|
const timeout = new Promise((resolve) => {
|
|
@@ -367,11 +444,11 @@ export async function collectWorkerDatabaseDoctorSection(inspect, timeoutMs = WO
|
|
|
367
444
|
const inspection = await Promise.race([Promise.resolve().then(inspect), timeout]);
|
|
368
445
|
if (inspection === null)
|
|
369
446
|
onFailure?.("timeout");
|
|
370
|
-
return buildWorkerDatabaseDoctorSection(inspection);
|
|
447
|
+
return inspection === null ? failedSection() : buildWorkerDatabaseDoctorSection(inspection);
|
|
371
448
|
}
|
|
372
449
|
catch {
|
|
373
450
|
onFailure?.("error");
|
|
374
|
-
return
|
|
451
|
+
return failedSection();
|
|
375
452
|
}
|
|
376
453
|
finally {
|
|
377
454
|
if (timer)
|
|
@@ -424,7 +501,7 @@ export function formatWorkerDatabaseDoctorSection(section) {
|
|
|
424
501
|
* therefore resolve credentials themselves (CLAUDE.md "Shell-Spawned Credential
|
|
425
502
|
* Resolution"): the four BAPI-872 recovery verbs, the six run-addressed repair
|
|
426
503
|
* verbs (BAPI-1154's three and BAPI-1176's three), and BAPI-1300's parked-child
|
|
427
|
-
* continuation pair
|
|
504
|
+
* continuation pair, and BAPI-1557's `prerequisite-inputs`. `.mcp.json` env is invisible to
|
|
428
505
|
* them — only `BAPI_API_KEY` in the parent env and the user-scoped credential
|
|
429
506
|
* store count.
|
|
430
507
|
*/
|
|
@@ -444,6 +521,8 @@ export const CREDENTIALED_RECOVERY_COMMANDS = [
|
|
|
444
521
|
"continuation-receipt",
|
|
445
522
|
// BAPI-1469: the read-only bounded wait on a run's state.
|
|
446
523
|
"wait-run",
|
|
524
|
+
// BAPI-1557: reads stored tickets and writes private local scanner inputs.
|
|
525
|
+
"prerequisite-inputs",
|
|
447
526
|
];
|
|
448
527
|
/** Remediation for recovery/repair verbs that cannot resolve Bridge credentials. */
|
|
449
528
|
export const REPAIR_CREDENTIAL_REMEDIATION = "export BAPI_API_KEY in the shell that runs `conductor`, or store a credential for this " +
|
|
@@ -1443,7 +1522,8 @@ export const CONDUCTOR_LEDGER_REMEDIATION = "run `epic-implementer doctor` for t
|
|
|
1443
1522
|
"owner-only permissions; the ledger is local observability and never blocks a run.";
|
|
1444
1523
|
/** Remediation for degraded or missing managed git hooks. */
|
|
1445
1524
|
export const CONDUCTOR_GIT_HOOKS_REMEDIATION = "run `epic-implementer install-git-hooks` from a persistent install to install the managed post-commit and " +
|
|
1446
|
-
"reference-transaction hooks;
|
|
1525
|
+
"reference-transaction hooks; use `epic-implementer uninstall-git-hooks` for consented removal. " +
|
|
1526
|
+
"They are local, opportunistic, and bypassable, and never gate engine admission.";
|
|
1447
1527
|
/** Remediation for a Claude login this host cannot confirm. */
|
|
1448
1528
|
export const CONDUCTOR_CLAUDE_LOGIN_REMEDIATION = "run `claude login` on the host that will run conductor workers; Bridge stores no Anthropic " +
|
|
1449
1529
|
"credential and can only advise here.";
|
|
@@ -69,7 +69,7 @@ export function getConductorUsage() {
|
|
|
69
69
|
"Local append-only event ledger for multi-agent coordination, plus run-control",
|
|
70
70
|
"commands. The ledger commands talk ONLY to the local SQLite store",
|
|
71
71
|
"(~/.config/bridge/events.db); the run-control commands (stop-run through",
|
|
72
|
-
"
|
|
72
|
+
"acknowledge-gaps), epic-status, readiness, and the read-only wait-run call the Bridge API.",
|
|
73
73
|
"",
|
|
74
74
|
"Commands:",
|
|
75
75
|
" emit-event Append one semantic event to the ledger",
|
|
@@ -86,6 +86,7 @@ export function getConductorUsage() {
|
|
|
86
86
|
" Remediations are NOT run automatically; always exits 0.",
|
|
87
87
|
" purge Delete ALL ledger rows (events, messages, supervisor_projection)",
|
|
88
88
|
" install-git-hooks Install local, opportunistic, non-blocking git hooks",
|
|
89
|
+
" uninstall-git-hooks Remove Bridge-managed hook text [--dry-run]",
|
|
89
90
|
" git-hook post-commit Run the post-commit producer (invoked by the installed hook)",
|
|
90
91
|
" git-hook reference-transaction --phase <p> --stdin-file <f>",
|
|
91
92
|
" Run the reference-transaction producer (invoked by the hook)",
|
|
@@ -144,10 +145,21 @@ export function getConductorUsage() {
|
|
|
144
145
|
" Record the OWNER's decision on verification hand-offs (a human decision,",
|
|
145
146
|
" never automatic). Also remove .bridge/epic-workarounds/<KEY>.md in a new",
|
|
146
147
|
" epic-head commit: the PR leaves draft only when both holds are clear.",
|
|
147
|
-
"
|
|
148
|
+
" acknowledge-gaps --epic-run-id <id> --digest <CURRENT_DIGEST> --reason <text> [--json]",
|
|
149
|
+
" The OWNER's one acknowledgement of the run's carried-gap list, by its",
|
|
150
|
+
" current digest (from the PR report or explain-run). Never run by the",
|
|
151
|
+
" driver or a worker; it verifies, readies and merges nothing.",
|
|
152
|
+
" wait-run --epic-run-id <id> [--ticket-key <key>] [--since <token>] [--timeout <seconds>]",
|
|
153
|
+
" [--until change|attention] [--json]",
|
|
148
154
|
" Read-only: wait until the run's observable state changes, the run finishes,",
|
|
149
155
|
" or the window closes (default 110 s; values above 240 are clamped to 240).",
|
|
156
|
+
" --until attention wakes only when a new incident appears (a park, a",
|
|
157
|
+
" needs-human reason, a failed job, a paused/stopped or non-active run).",
|
|
150
158
|
" Pass the previous result's token as --since. Changes nothing.",
|
|
159
|
+
" prerequisite-inputs --epic-key <KEY> --child <KEY> [--child <KEY> ...] [--json]",
|
|
160
|
+
" Reads stored ticket descriptions and writes one private scanner input file per",
|
|
161
|
+
" child under ~/.local/state/bapi-conductor-runs/<EPIC>/. Changes nothing on",
|
|
162
|
+
" the server.",
|
|
151
163
|
"",
|
|
152
164
|
"supervise options:",
|
|
153
165
|
" --run-id <id> Run/session identifier to supervise (required)",
|
|
@@ -279,6 +291,10 @@ export function getConductorUsage() {
|
|
|
279
291
|
" anchored PR head to whatever the PR's head currently is, for a ticket parked",
|
|
280
292
|
" by a human/external push. Both retry internally on a concurrent row change —",
|
|
281
293
|
" neither accepts, nor ever asks for, a version counter.",
|
|
294
|
+
" --external-repair <operation-id> (adopt only) adopt fast-forward repair",
|
|
295
|
+
" commits pushed to the ticket's own branch while no engine job ran. The server",
|
|
296
|
+
" proves ancestry, the PR, no live work, and head ownership first; the ticket",
|
|
297
|
+
" then passes the ordinary gates. Run only by the run's supervisor/driver.",
|
|
282
298
|
"",
|
|
283
299
|
"Incident examples:",
|
|
284
300
|
" # A run is misbehaving and must stop immediately:",
|
|
@@ -338,6 +354,7 @@ const VALID_COMMANDS = new Set([
|
|
|
338
354
|
"readiness",
|
|
339
355
|
"purge",
|
|
340
356
|
"install-git-hooks",
|
|
357
|
+
"uninstall-git-hooks",
|
|
341
358
|
"git-hook",
|
|
342
359
|
"file-scope-guard",
|
|
343
360
|
"likely-tests",
|
|
@@ -365,10 +382,14 @@ const VALID_COMMANDS = new Set([
|
|
|
365
382
|
"rerun-ci",
|
|
366
383
|
// BAPI-1494: CLI-only owner decision on verification hand-offs — never an MCP tool.
|
|
367
384
|
"resolve-handoff",
|
|
385
|
+
// BAPI-1562: CLI-only owner acknowledgement of the carried-gap list — never an MCP tool.
|
|
386
|
+
"acknowledge-gaps",
|
|
368
387
|
// BAPI-1532: CLI-only answer to a named plan failure — never an MCP tool.
|
|
369
388
|
"regenerate-plan",
|
|
370
389
|
// BAPI-1469: CLI-only read-only bounded wait on a run's state — never an MCP tool.
|
|
371
390
|
"wait-run",
|
|
391
|
+
// BAPI-1557: CLI-only stored-ticket reader and private local-state writer — never an MCP tool.
|
|
392
|
+
"prerequisite-inputs",
|
|
372
393
|
// Private, and deliberately ABSENT from the usage text: `__hook-bin` exists as
|
|
373
394
|
// the bundled-artifact regression guard for BAPI-772 (mirroring `plane
|
|
374
395
|
// __entrypoint`), not as a supported operator workflow.
|
|
@@ -1413,6 +1434,11 @@ export async function runPurgeCommand(argv) {
|
|
|
1413
1434
|
].join("\n"));
|
|
1414
1435
|
return 0;
|
|
1415
1436
|
}
|
|
1437
|
+
/** BAPI-1551 — the stderr note naming how many leading references are always-run guards. */
|
|
1438
|
+
export function likelyTestsRequiredNote(count) {
|
|
1439
|
+
return `The first ${count} references are this repository's always-run guards. ` +
|
|
1440
|
+
"Run them before you push, whatever you changed.";
|
|
1441
|
+
}
|
|
1416
1442
|
const LIKELY_TESTS_FAILURE_NOTE = "Likely-tests discovery unavailable: internal discovery failure (not an empty result).\n";
|
|
1417
1443
|
export async function runLikelyTestsCommand(argv, deps = {}) {
|
|
1418
1444
|
const stdout = deps.stdout ?? ((text) => { process.stdout.write(text); });
|
|
@@ -1441,6 +1467,11 @@ export async function runLikelyTestsCommand(argv, deps = {}) {
|
|
|
1441
1467
|
printed += 1;
|
|
1442
1468
|
}
|
|
1443
1469
|
}
|
|
1470
|
+
// BAPI-1551 — the always-run guards print first; say so on stderr only, so
|
|
1471
|
+
// stdout stays references and nothing else.
|
|
1472
|
+
const required = (result.required ?? []).filter(validTestReference).length;
|
|
1473
|
+
if (required > 0)
|
|
1474
|
+
stderr(likelyTestsRequiredNote(required) + "\n");
|
|
1444
1475
|
const failed = result.diagnostics.some(d => d === "git_unavailable" || d === "invalid_arguments");
|
|
1445
1476
|
for (const diagnostic of new Set(result.diagnostics)) {
|
|
1446
1477
|
if (diagnostic !== "empty")
|
|
@@ -1509,6 +1540,10 @@ export async function runEpicImplementerCli(argv, likelyTestsDeps) {
|
|
|
1509
1540
|
return await runPurgeCommand(parsed.argv);
|
|
1510
1541
|
case "install-git-hooks":
|
|
1511
1542
|
return runInstallGitHooksCommand(parsed.argv);
|
|
1543
|
+
case "uninstall-git-hooks": {
|
|
1544
|
+
const { runUninstallGitHooksCommand } = await import("./git-hooks-uninstall.js");
|
|
1545
|
+
return runUninstallGitHooksCommand(parsed.argv);
|
|
1546
|
+
}
|
|
1512
1547
|
case "git-hook":
|
|
1513
1548
|
return await runGitHookCommand(parsed.argv);
|
|
1514
1549
|
case CONDUCTOR_HOOK_BIN_ACTION:
|
|
@@ -1601,6 +1636,11 @@ export async function runEpicImplementerCli(argv, likelyTestsDeps) {
|
|
|
1601
1636
|
const { runResolveHandoffCommand } = await import("./recovery-cli.js");
|
|
1602
1637
|
return await runResolveHandoffCommand(parsed.argv);
|
|
1603
1638
|
}
|
|
1639
|
+
case "acknowledge-gaps": {
|
|
1640
|
+
// BAPI-1562: delegates only to the owner's list acknowledgement.
|
|
1641
|
+
const { runAcknowledgeGapsCommand } = await import("./recovery-cli.js");
|
|
1642
|
+
return await runAcknowledgeGapsCommand(parsed.argv);
|
|
1643
|
+
}
|
|
1604
1644
|
case "regenerate-plan": {
|
|
1605
1645
|
// BAPI-1532: delegates only to the pinned plan-regeneration operation.
|
|
1606
1646
|
const { runRegeneratePlanCommand } = await import("./recovery-cli.js");
|
|
@@ -1619,6 +1659,19 @@ export async function runEpicImplementerCli(argv, likelyTestsDeps) {
|
|
|
1619
1659
|
}
|
|
1620
1660
|
return await runWaitRunCommand(parsed.argv);
|
|
1621
1661
|
}
|
|
1662
|
+
case "prerequisite-inputs": {
|
|
1663
|
+
// BAPI-1557: dispatched before any MCP server is built or connected. A
|
|
1664
|
+
// module-load failure gets fixed wording, never exception text.
|
|
1665
|
+
let runPrerequisiteInputsCommand;
|
|
1666
|
+
try {
|
|
1667
|
+
({ runPrerequisiteInputsCommand } = await import("./prerequisite-inputs.js"));
|
|
1668
|
+
}
|
|
1669
|
+
catch {
|
|
1670
|
+
console.error("Error: prerequisite-inputs could not be loaded; no scanner input was written.");
|
|
1671
|
+
return 1;
|
|
1672
|
+
}
|
|
1673
|
+
return await runPrerequisiteInputsCommand(parsed.argv);
|
|
1674
|
+
}
|
|
1622
1675
|
default:
|
|
1623
1676
|
console.error('Error: Unknown command. Run "epic-implementer --help" for usage.');
|
|
1624
1677
|
return 1;
|