@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.
- package/README.md +14 -7
- package/build/agent-launchers/prompt.js +9 -21
- package/build/agents.generated.js +2 -2
- package/build/authored-plan.js +542 -0
- package/build/bridge-permissions.js +8 -0
- package/build/commands.generated.js +5 -5
- package/build/conductor/bridge-api-client.js +666 -46
- package/build/conductor/epic-implementer-cli.js +337 -93
- package/build/conductor/gate-discovery.js +209 -9
- package/build/conductor/gate-settings-review.js +7 -11
- package/build/conductor/launch-plan.js +58 -12
- package/build/conductor/open-decision-phrases.js +50 -0
- package/build/conductor/prerequisite-inputs.js +181 -14
- package/build/connect-github-api.js +18 -0
- package/build/connect-github.js +35 -18
- package/build/docs.generated.js +2 -2
- package/build/drive-epic.js +387 -12
- package/build/epic-ci-workflow.js +3 -2
- package/build/epic-implementer-bin.js +152 -38
- package/build/epic-implementer-bundle-cli.js +61 -0
- package/build/epic-implementer-claude-hook-bin.js +1 -1
- package/build/epic-implementer-env.js +3 -4
- package/build/epic-integration-pr.js +5 -2
- package/build/executor/completion-contract.js +24 -1
- package/build/executor/gate-qualification-job.js +193 -23
- package/build/executor/gate-qualification-tests-ran.js +232 -0
- package/build/executor/job-runner.js +9 -722
- package/build/executor/job-type-wrappers.js +734 -0
- package/build/executor/preflight.js +6 -2
- package/build/executor/process-containment.js +8 -1
- package/build/executor/required-verification.js +28 -2
- package/build/executor/runner.js +4 -1
- package/build/executor/types.js +9 -0
- package/build/executor/worker-database.js +6 -1
- package/build/executor/worker-guard-hook.js +24 -2
- package/build/generated/ticket-status.js +20 -0
- package/build/index.js +391 -257
- package/build/install-bridge-conductor-answers.js +28 -1
- package/build/install-bridge-conductor-apply.js +11 -3
- package/build/install-bridge-conductor-assessment.js +114 -12
- package/build/install-bridge-conductor-compact.js +2 -0
- package/build/install-bridge-conductor-gate.js +257 -80
- package/build/install-bridge-conductor-setup.js +4 -4
- package/build/install-bridge-conductor-trial-report.js +170 -0
- package/build/install-bridge-conductor.js +303 -31
- package/build/pipelines.generated.js +7 -7
- package/build/plan-generation.js +17 -0
- package/build/printed-remedy-commands.js +54 -0
- package/build/readme.generated.js +1 -1
- package/build/repository-toolchains.js +11 -5
- package/build/scripts/saved-commands-config-field-driver.js +65 -0
- package/build/setup-epic.js +10 -1
- package/build/test-support/executor-source-files.js +1 -1
- package/build/v2-readiness-requirements.js +5 -1
- package/build/version.generated.js +3 -3
- package/build/worker-guard-hook-bin.js +2 -2
- package/docs/EPIC-IMPLEMENTER.md +4 -4
- package/docs/install/github-app.md +79 -92
- package/package.json +1 -1
- package/build/conductor/epic-reconcile.js +0 -603
- package/build/conductor/epic-runtime.js +0 -2020
- package/build/conductor/epic-state.js +0 -774
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One plain-language presentation of a test-command trial result (BAPI-1698).
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS MODULE EXISTS. Setup used to answer every failed trial the same way:
|
|
5
|
+
* "run setup again". For a deterministic failure (a missing program, a failing
|
|
6
|
+
* test, a command that runs no tests) an unchanged retry fails again, and the
|
|
7
|
+
* owner learns nothing. This module turns the server's closed phase token and
|
|
8
|
+
* the optional per-command facts into ONE headline, ONE explanation, ONE remedy,
|
|
9
|
+
* and plain per-command statuses, so every setup path tells the owner the same
|
|
10
|
+
* true thing.
|
|
11
|
+
*
|
|
12
|
+
* Pure: no terminal output, no server call, no file read. It never invents a
|
|
13
|
+
* command-level outcome: per-command statuses are paired with command text only
|
|
14
|
+
* when the server's validated list matches the commands one for one.
|
|
15
|
+
*/
|
|
16
|
+
import { CONDUCTOR_GATE_QUALIFICATION_PHASES, } from "./conductor/bridge-api-client.js";
|
|
17
|
+
/** True for a closed phase token; anything else reads as no phase. */
|
|
18
|
+
export function isTrialPhase(value) {
|
|
19
|
+
return CONDUCTOR_GATE_QUALIFICATION_PHASES.includes(value);
|
|
20
|
+
}
|
|
21
|
+
/** The instruction a remedy points to when the command itself should change. */
|
|
22
|
+
export const CHANGE_TEST_COMMAND_TEXT = 'change the command with --test-command "<your command>"';
|
|
23
|
+
/** The success wording every setup path uses. Never "proven". */
|
|
24
|
+
export const PASSED_TRIAL_RUN_TEXT = "passed the trial run";
|
|
25
|
+
function anyKilledBySignal(results) {
|
|
26
|
+
return (results ?? []).some((r) => r.reason === "killed_by_signal");
|
|
27
|
+
}
|
|
28
|
+
/** The one advice table. Every failed kind has its own explanation and remedy. */
|
|
29
|
+
export function presentTrialResult(input) {
|
|
30
|
+
if (input.interrupted === true) {
|
|
31
|
+
return {
|
|
32
|
+
kind: "interrupted",
|
|
33
|
+
headline: "Did not finish",
|
|
34
|
+
explanation: "The trial run did not produce a result: a clean checkout of your default branch was not available, " +
|
|
35
|
+
"or the run was interrupted before every command finished.",
|
|
36
|
+
treatment: "notice",
|
|
37
|
+
remedy: "Nothing about the command was learned, so it is fine to try again.",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
switch (input.phase) {
|
|
41
|
+
case "passed":
|
|
42
|
+
return {
|
|
43
|
+
kind: "passed",
|
|
44
|
+
headline: "Passed the trial run",
|
|
45
|
+
explanation: "Every command ran in a clean checkout of your default branch and passed.",
|
|
46
|
+
treatment: "success",
|
|
47
|
+
remedy: null,
|
|
48
|
+
};
|
|
49
|
+
case "could_not_start":
|
|
50
|
+
return {
|
|
51
|
+
kind: "could_not_start",
|
|
52
|
+
headline: "Could not start",
|
|
53
|
+
explanation: "A command could not be started. A program or folder it needs is probably not in a clean checkout " +
|
|
54
|
+
"of your default branch (for example, a virtual environment that exists only on your computer).",
|
|
55
|
+
treatment: "failure",
|
|
56
|
+
remedy: `Declare the install that creates it, or ${CHANGE_TEST_COMMAND_TEXT}.`,
|
|
57
|
+
};
|
|
58
|
+
case "ran_and_failed":
|
|
59
|
+
return {
|
|
60
|
+
kind: "ran_and_failed",
|
|
61
|
+
headline: "Ran and failed",
|
|
62
|
+
explanation: anyKilledBySignal(input.commandResults)
|
|
63
|
+
? "A command started and was then killed by a signal from outside Bridge (not a timeout), so it did not pass."
|
|
64
|
+
: "The commands ran, and at least one did not pass.",
|
|
65
|
+
treatment: "failure",
|
|
66
|
+
remedy: `Fix the failing tests, or ${CHANGE_TEST_COMMAND_TEXT}.`,
|
|
67
|
+
};
|
|
68
|
+
case "no_tests_ran":
|
|
69
|
+
return {
|
|
70
|
+
kind: "no_tests_ran",
|
|
71
|
+
headline: "No tests ran",
|
|
72
|
+
explanation: "The command finished without an error, but Bridge found no sign that it ran any test, " +
|
|
73
|
+
`so it has not ${PASSED_TRIAL_RUN_TEXT}.`,
|
|
74
|
+
treatment: "failure",
|
|
75
|
+
remedy: `Give a command that runs your tests: ${CHANGE_TEST_COMMAND_TEXT}.`,
|
|
76
|
+
};
|
|
77
|
+
case "dependency_preparation_failed":
|
|
78
|
+
return {
|
|
79
|
+
kind: "dependency_preparation_failed",
|
|
80
|
+
headline: "Dependency install failed",
|
|
81
|
+
explanation: "The dependency install failed, so the tests did not run.",
|
|
82
|
+
treatment: "failure",
|
|
83
|
+
remedy: "Correct the install step (for example, a lockfile that no longer matches the manifest), then run setup again.",
|
|
84
|
+
};
|
|
85
|
+
case "worker_database_preparation_failed":
|
|
86
|
+
return {
|
|
87
|
+
kind: "worker_database_preparation_failed",
|
|
88
|
+
headline: "Test database not ready",
|
|
89
|
+
explanation: "The test database the trial needs could not be prepared, so the tests did not run. This is not a test failure.",
|
|
90
|
+
treatment: "failure",
|
|
91
|
+
remedy: "Repair the worker database setup on the computer that ran the trial (its executor log names the reason), " +
|
|
92
|
+
"then run setup again.",
|
|
93
|
+
};
|
|
94
|
+
default:
|
|
95
|
+
return {
|
|
96
|
+
kind: "evidence_unavailable",
|
|
97
|
+
headline: "Result unclear",
|
|
98
|
+
explanation: input.dependencyInstallDeclared === true
|
|
99
|
+
? "Bridge cannot tell whether the dependency install ran before the tests, so it cannot say why the check did not pass."
|
|
100
|
+
: "The trial did not pass, but Bridge cannot tell which part failed. The server or the executor that ran it may be older.",
|
|
101
|
+
treatment: "notice",
|
|
102
|
+
remedy: "Update the Bridge executor and server to the latest version so setup can say what happened, " +
|
|
103
|
+
`or ${CHANGE_TEST_COMMAND_TEXT}.`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** One command's plain status. Never a raw token. */
|
|
108
|
+
export function commandStatusText(result) {
|
|
109
|
+
switch (result.outcome) {
|
|
110
|
+
case "exited_zero":
|
|
111
|
+
return "passed";
|
|
112
|
+
case "exited_nonzero":
|
|
113
|
+
return result.reason === "killed_by_signal" ? "killed by a signal" : "failed";
|
|
114
|
+
case "no_tests_ran":
|
|
115
|
+
return "ran no tests";
|
|
116
|
+
case "timed_out":
|
|
117
|
+
return "ran out of time";
|
|
118
|
+
case "launch_error":
|
|
119
|
+
return "could not start";
|
|
120
|
+
case "cancelled":
|
|
121
|
+
return "did not finish";
|
|
122
|
+
case "not_run":
|
|
123
|
+
return result.reason === "stopped_after_interruption"
|
|
124
|
+
? "did not run (an earlier command stopped the run)"
|
|
125
|
+
: "did not run";
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** Replace control characters, as the success path always has, so a command line prints safely. */
|
|
129
|
+
export function sanitizeCommandText(text) {
|
|
130
|
+
return text.replace(/[\u0000-\u001F\u007F]/g, "?");
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Pair command text with per-command statuses ONLY when the server's validated
|
|
134
|
+
* list has exactly one fact per command. Otherwise every command is listed
|
|
135
|
+
* without a status beneath the overall result. For an interrupted run every
|
|
136
|
+
* command reads "did not finish": Bridge does not know which ones started.
|
|
137
|
+
*/
|
|
138
|
+
export function trialCommandLines(input) {
|
|
139
|
+
const commands = input.commands.map(sanitizeCommandText);
|
|
140
|
+
if (input.interrupted === true)
|
|
141
|
+
return commands.map((command) => ({ command, status: "did not finish" }));
|
|
142
|
+
const results = input.commandResults ?? null;
|
|
143
|
+
if (results === null || results.length !== commands.length) {
|
|
144
|
+
return commands.map((command) => ({ command, status: null }));
|
|
145
|
+
}
|
|
146
|
+
return commands.map((command, index) => ({ command, status: commandStatusText(results[index]) }));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The lines a terminal prints, in order: headline, consequence, commands, remedy.
|
|
150
|
+
* `consequence` is the caller's own sentence (what was or was not stored).
|
|
151
|
+
*/
|
|
152
|
+
export function renderTrialReport(input) {
|
|
153
|
+
const indent = input.indent ?? " ";
|
|
154
|
+
const { presentation } = input;
|
|
155
|
+
const severity = presentation.treatment === "success" ? "" : presentation.treatment === "failure" ? "Failed: " : "Note: ";
|
|
156
|
+
const lines = [
|
|
157
|
+
`${indent}Test trial — ${severity}${presentation.headline}. ${presentation.explanation}`,
|
|
158
|
+
`${indent}${input.consequence}`,
|
|
159
|
+
];
|
|
160
|
+
if (input.commands.length > 0) {
|
|
161
|
+
const attributed = input.commands.some((line) => line.status !== null);
|
|
162
|
+
lines.push(`${indent}${attributed ? "Commands:" : "Commands tried (the result above covers them together):"}`);
|
|
163
|
+
for (const line of input.commands) {
|
|
164
|
+
lines.push(`${indent} - ${line.command}${line.status !== null ? ` — ${line.status}` : ""}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (presentation.remedy !== null)
|
|
168
|
+
lines.push(`${indent}Next: ${presentation.remedy}`);
|
|
169
|
+
return lines;
|
|
170
|
+
}
|