@bridge_gpt/mcp-server 0.2.72 → 0.2.74

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 (181) hide show
  1. package/README.md +5 -5
  2. package/build/agent-launchers/claude-executor-adapter.js +15 -0
  3. package/build/agents.generated.js +6 -6
  4. package/build/bridge-config.js +7 -1
  5. package/build/bridge-permissions.js +30 -0
  6. package/build/ci-system-detection.js +50 -0
  7. package/build/ci-trigger-adapters.js +631 -0
  8. package/build/ci-trigger-install.js +106 -0
  9. package/build/codex-launcher-pin.js +33 -2
  10. package/build/codex-skill-adapter.js +3 -1
  11. package/build/command-host.js +33 -0
  12. package/build/command-provisioning.js +4 -3
  13. package/build/commands.generated.js +7 -6
  14. package/build/conductor/bridge-api-client.js +867 -35
  15. package/build/conductor/bring-up-facts.js +18 -5
  16. package/build/conductor/command-drift-production.js +42 -17
  17. package/build/conductor/command-drift.js +48 -1
  18. package/build/conductor/declare-blocked.js +554 -0
  19. package/build/conductor/declared-extras.js +335 -0
  20. package/build/conductor/doctor.js +108 -21
  21. package/build/conductor/driver-commands.js +141 -0
  22. package/build/conductor/driver-guard.js +277 -0
  23. package/build/conductor/driver-lapse.js +321 -0
  24. package/build/conductor/driver-pass-output.js +104 -0
  25. package/build/conductor/driver-pass.js +571 -0
  26. package/build/conductor/driver-register.js +176 -0
  27. package/build/conductor/driver-release.js +174 -0
  28. package/build/conductor/driver-session-state.js +315 -0
  29. package/build/conductor/epic-branch-ci-inspection.js +281 -43
  30. package/build/conductor/epic-implementer-cli.js +199 -15
  31. package/build/conductor/epic-server-database.js +162 -0
  32. package/build/conductor/epic-server-guidance.js +278 -0
  33. package/build/conductor/epic-server-journal.js +239 -0
  34. package/build/conductor/epic-server-processes.js +324 -0
  35. package/build/conductor/epic-server-recipe.js +397 -0
  36. package/build/conductor/epic-server-runtime.js +1207 -0
  37. package/build/conductor/epic-server-sfcc-upload.js +1567 -0
  38. package/build/conductor/epic-server-sfcc.js +85 -0
  39. package/build/conductor/epic-server-state.js +427 -0
  40. package/build/conductor/epic-server.js +647 -0
  41. package/build/conductor/gate-discovery.js +196 -11
  42. package/build/conductor/gate-settings-review.js +261 -4
  43. package/build/conductor/launch-need-probes.js +6 -53
  44. package/build/conductor/launch-plan.js +313 -156
  45. package/build/conductor/prerequisite-inputs.js +879 -45
  46. package/build/conductor/readiness-assessment.js +16 -1
  47. package/build/conductor/readiness-cli.js +20 -9
  48. package/build/conductor/readiness-prerequisites.js +28 -9
  49. package/build/conductor/readiness-sections.js +133 -126
  50. package/build/conductor/readiness.js +1 -1
  51. package/build/conductor/recovery-cli.js +13 -2
  52. package/build/conductor/tools.js +6 -5
  53. package/build/conductor/wait-run-attention.js +2 -2
  54. package/build/conductor/wait-run-cli.js +208 -22
  55. package/build/conductor/worker-database-doctor-inspector.js +33 -2
  56. package/build/conductor/worker-setup-tally.js +27 -0
  57. package/build/credential-delivery.js +280 -0
  58. package/build/credential-launch-safety.js +142 -0
  59. package/build/credential-materialization.js +91 -16
  60. package/build/credential-references-node-deps.js +29 -0
  61. package/build/credential-references.js +1394 -0
  62. package/build/credential-references.test-fixtures.js +211 -0
  63. package/build/credential-scan-conventions.js +145 -0
  64. package/build/credential-scan.js +517 -0
  65. package/build/credential-store.js +121 -1
  66. package/build/credentials-cli.js +252 -3
  67. package/build/dependency-install-declarations.js +102 -1
  68. package/build/docs.generated.js +10 -3
  69. package/build/doctor.js +95 -3
  70. package/build/drive-epic-help.js +21 -2
  71. package/build/drive-epic.js +2095 -375
  72. package/build/engine-paths.js +20 -0
  73. package/build/epic-branch-ci-summary.js +157 -0
  74. package/build/epic-capability-statement.js +175 -0
  75. package/build/epic-ci-workflow-drift.js +77 -23
  76. package/build/epic-ci-workflow-install.js +137 -44
  77. package/build/epic-ci-workflow-v2.js +274 -0
  78. package/build/epic-ci-workflow-v3.js +273 -0
  79. package/build/epic-ci-workflow.js +165 -18
  80. package/build/epic-implementer-bin.js +2204 -56
  81. package/build/epic-launch-context.js +702 -0
  82. package/build/epic-server-record.js +288 -0
  83. package/build/epic-shared/bridge-client.js +11 -3
  84. package/build/escalation-reachability.js +43 -0
  85. package/build/executor/ci-fix-test-runs.js +334 -0
  86. package/build/executor/completion-contract.js +8 -1
  87. package/build/executor/credential-delivery-step.js +168 -0
  88. package/build/executor/deps.js +3 -1
  89. package/build/executor/env.js +98 -23
  90. package/build/executor/epic-server-context.js +157 -0
  91. package/build/executor/gate-qualification-job.js +127 -26
  92. package/build/executor/guarded-fast-forward-push.js +13 -8
  93. package/build/executor/http-client.js +52 -5
  94. package/build/executor/job-runner.js +577 -81
  95. package/build/executor/observation.js +8 -0
  96. package/build/executor/permissions.js +85 -3
  97. package/build/executor/pre-pr-checks.js +363 -0
  98. package/build/executor/prompt-spec.js +149 -3
  99. package/build/executor/reconcile-overlap-job.js +5 -3
  100. package/build/executor/required-work-diagnostics.js +4 -2
  101. package/build/executor/required-work-ledger.js +936 -38
  102. package/build/executor/results.js +58 -0
  103. package/build/executor/terminal-mutation.js +8 -0
  104. package/build/executor/worker-command.js +72 -3
  105. package/build/executor/worker-database-config.js +281 -0
  106. package/build/executor/worker-database-target.js +16 -12
  107. package/build/executor/worker-database.js +320 -101
  108. package/build/executor/worker-finalization.js +7 -1
  109. package/build/executor/worker-resources.js +25 -3
  110. package/build/executor/worker-verification-guidance.js +18 -3
  111. package/build/executor/worktree.js +20 -1
  112. package/build/executor-launch.js +58 -4
  113. package/build/generated-assets-catalog.js +2 -2
  114. package/build/git-exclude-lock.js +187 -0
  115. package/build/index.js +824 -366
  116. package/build/init.js +26 -11
  117. package/build/install-bridge-conductor-answers.js +528 -0
  118. package/build/install-bridge-conductor-apply.js +288 -0
  119. package/build/install-bridge-conductor-assessment.js +1222 -0
  120. package/build/install-bridge-conductor-compact.js +186 -0
  121. package/build/install-bridge-conductor-contracts.js +72 -0
  122. package/build/install-bridge-conductor-gate.js +1312 -198
  123. package/build/install-bridge-conductor-setup.js +577 -83
  124. package/build/install-bridge-conductor.js +3381 -544
  125. package/build/install-bridge.js +280 -25
  126. package/build/install-doctor.js +38 -8
  127. package/build/install-maintenance.js +26 -3
  128. package/build/install-sfcc-detection.js +120 -0
  129. package/build/install-sfcc-setup.js +185 -0
  130. package/build/launcher-config-inspection.js +162 -1
  131. package/build/mcp-grant-candidates.js +779 -0
  132. package/build/mcp-grant-doctor.js +63 -0
  133. package/build/mcp-grant.js +288 -0
  134. package/build/mcp-host-targets.js +8 -0
  135. package/build/mcp-identity.js +23 -0
  136. package/build/mcp-invoke.js +292 -15
  137. package/build/mcp-presets.js +107 -0
  138. package/build/mcp-provisioning.js +155 -6
  139. package/build/mcp-registration-doctor.js +31 -2
  140. package/build/mcp-server-invocation.js +19 -1
  141. package/build/merge-workflow-install.js +243 -110
  142. package/build/pipelines.generated.js +7 -6
  143. package/build/plan-discovery.js +97 -4
  144. package/build/plan-execution-ledger.js +100 -7
  145. package/build/plan-generation-io.js +262 -0
  146. package/build/plan-generation.js +424 -0
  147. package/build/plane/build-freshness.js +6 -1
  148. package/build/plane/cli.js +75 -9
  149. package/build/plane/plane-freshness.js +17 -0
  150. package/build/plane/preflight.js +50 -10
  151. package/build/plane/shutdown.js +19 -0
  152. package/build/plane/status.js +8 -2
  153. package/build/plane/terminal-run-cleanup.js +18 -4
  154. package/build/printed-remedy-commands.js +211 -12
  155. package/build/project-root.js +40 -0
  156. package/build/readiness-check.js +77 -0
  157. package/build/readiness-prerequisites.generated.js +122 -14
  158. package/build/readme.generated.js +1 -1
  159. package/build/repository-state-paths.js +41 -0
  160. package/build/repository-toolchains.js +6 -3
  161. package/build/run-unit-tests-launcher.js +8 -1
  162. package/build/setup-epic.js +1305 -210
  163. package/build/setup-progress.js +44 -0
  164. package/build/setup-question.js +122 -4
  165. package/build/sfcc/credentials.js +3 -2
  166. package/build/sfcc/hostname.js +98 -2
  167. package/build/sfcc/tool-wrapper.js +6 -95
  168. package/build/start-tickets.js +193 -29
  169. package/build/test-support/executor-source-files.js +200 -0
  170. package/build/testing-config-client.js +25 -2
  171. package/build/third-party-mcp-targets.js +63 -2
  172. package/build/ticket-delivery-enrollment.js +9 -0
  173. package/build/upgrade-cli.js +85 -2
  174. package/build/v2-readiness-requirements.js +28 -1
  175. package/build/version.generated.js +3 -3
  176. package/build/with-credentials.js +208 -0
  177. package/build/worktree-credential-delivery.js +340 -0
  178. package/docs/EPIC-IMPLEMENTER-INSTALL.md +9 -1
  179. package/docs/epic-implementer/getting-started.md +3 -1
  180. package/docs/epic-implementer/self-hosting.md +14 -1
  181. package/package.json +2 -2
@@ -21,6 +21,103 @@ import { renderPreexistingAtBaseGuidance, renderWorkerVerificationGuidance, rend
21
21
  import { CiFixContext, ExecutorNamedError } from "./job-errors.js";
22
22
  import { EPIC_WORKAROUNDS_DIR, epicWorkaroundRecordPath } from "../epic-workarounds-path.js";
23
23
  import { WORKER_BACKGROUND_WORK_RULE } from "./required-work-diagnostics.js";
24
+ import { validateEpicCapabilityStatement } from "../epic-capability-statement.js";
25
+ import { epicServerAcquireCommandSeconds } from "./epic-server-context.js";
26
+ import { EPIC_SERVER_DEFAULT_TIMING } from "../conductor/epic-server-recipe.js";
27
+ import { buildSfccUploadWorkerText, buildSfccWorkerPolicyText, SFCC_UPLOAD_WORKER_COMMAND_SECONDS, } from "../conductor/epic-server-sfcc.js";
28
+ /**
29
+ * BAPI-1546: the epic-server turn paragraph, a SEPARATE builder so the
30
+ * workaround contract ({@link buildEpicWorkaroundWorkerInstruction}) stays
31
+ * byte-identical. Appended beside it only when the repository opted in:
32
+ * `disabled` returns null and the caller appends nothing.
33
+ *
34
+ * - local, live: acquire a bounded turn through the own-build launcher, with
35
+ * the running helper's own turn wait (from its proven recipe) and the longest
36
+ * the command can take (that wait plus the rebuild budget), run the
37
+ * check against the printed address with the printed login file, release with
38
+ * the printed lease, and bind the served SHA and generation in the evidence.
39
+ * A lost lease discards the observation. The spawn env raises the harness
40
+ * command ceiling to that same number (`withEpicServerEnv`).
41
+ * - local, unavailable: one bounded acquire attempt; its output is the
42
+ * `no_live_server` observation under the hand-off rules.
43
+ * - SFCC: own-branch uploads onto the shared active version, one fresh upload
44
+ * before the single retry, upload intervals, and the evidence label.
45
+ *
46
+ * Single-line and free of `;`, quotes, and apostrophes, like the paragraph it
47
+ * follows. A missing server is a hand-off; a check that ran and failed is a real
48
+ * failure.
49
+ */
50
+ export function buildEpicServerWorkerInstruction(context, ticketKey) {
51
+ if (context.kind === "disabled")
52
+ return null;
53
+ if (context.kind === "sfcc") {
54
+ const sfccTicket = ticketKey && /^[A-Z][A-Z0-9_]{0,19}-\d{1,9}$/.test(ticketKey) ? ticketKey : "<TICKET>";
55
+ const sfcc = buildSfccWorkerPolicyText(context.origin, sfccTicket, SFCC_UPLOAD_WORKER_COMMAND_SECONDS);
56
+ return /[;'"\r\n]/.test(sfcc) ? null : sfcc;
57
+ }
58
+ const ticket = ticketKey && /^[A-Z][A-Z0-9_]{0,19}-\d{1,9}$/.test(ticketKey) ? ticketKey : "<TICKET>";
59
+ const wait = context.kind === "local_live" ? context.turnWaitSeconds : EPIC_SERVER_DEFAULT_TIMING.acquire_wait_seconds;
60
+ const acquire = "epic-implementer epic-server turn acquire --ticket " + ticket + " --head <your full head SHA> --wait " + wait +
61
+ " (it can take up to " + epicServerAcquireCommandSeconds(context) + " seconds before it prints, so run it in the foreground " +
62
+ "with a command timeout at least that long)";
63
+ const handoff = "If acquire prints outcome unavailable with cause no_live_server, rerun the same command once as the corrected " +
64
+ "invocation. If that also fails, record the step escalated with a hand-off whose cause is no_live_server, quoting " +
65
+ "the command, its output, and your head SHA, and naming the next human step. Nothing parks for this. A failed " +
66
+ "assertion or an application error from a check that did run is a real verification failure, never a hand-off.";
67
+ const turnRules = "On success it prints url, served_sha, generation, login_file, and lease. Run the check against that url only, " +
68
+ "sign in with the KEY=VALUE pairs in login_file, and never print, log, or commit them. Then run " +
69
+ "epic-implementer epic-server turn release --lease <the printed lease>. Write served_sha and generation into the " +
70
+ "step evidence. If release reports outcome lost, the turn expired or a newer generation fenced it: discard that " +
71
+ "observation, then acquire again and rerun, or record the hand-off below. Never record a lost observation as " +
72
+ "executed, and do not poll the lease in the background.";
73
+ let line;
74
+ if (context.kind === "local_live") {
75
+ line =
76
+ "Epic server: this run has one local epic server for e2e_tests and rendered_ui_review steps, shared by turns. " +
77
+ "Before each such check, take a bounded turn at your own head with " + acquire + " through the epic-implementer " +
78
+ "launcher on your PATH. " + turnRules + " " + handoff;
79
+ }
80
+ else {
81
+ line =
82
+ "Epic server: this run opted in to a local epic server, but it was not running when this worker started. For an " +
83
+ "e2e_tests or rendered_ui_review step, make one bounded attempt with " + acquire + " through the epic-implementer " +
84
+ "launcher on your PATH. If it is granted, follow the turn rules. " + turnRules + " Otherwise its output is the " +
85
+ "observation. " + handoff;
86
+ }
87
+ if (context.sfccUpload === true) {
88
+ // The same upload sentences as the SFCC text, then the turn rules apply as above.
89
+ line =
90
+ line + " This run also approved a sandbox code version. " + buildSfccUploadWorkerText(ticket, SFCC_UPLOAD_WORKER_COMMAND_SECONDS) +
91
+ " Run the upload before you acquire the turn, and acquire the turn again for any repeated check.";
92
+ }
93
+ return /[;'"\r\n]/.test(line) ? null : line;
94
+ }
95
+ /**
96
+ * BAPI-1545: one advisory line telling an implement worker what the repository
97
+ * owner configured: the approved extra MCP servers, the epic-server mode, and
98
+ * the epic-server recipe state. Appended right after
99
+ * {@link buildEpicWorkaroundWorkerInstruction}, which stays byte-identical.
100
+ *
101
+ * The statement is revalidated here. Anything malformed returns `null`, and the
102
+ * caller then appends nothing, so the prompt is byte-identical to a repository
103
+ * with no statement. The line is SINGLE-LINE and free of `;`, quotes, and
104
+ * apostrophes, like the instruction it follows. It describes configuration, not
105
+ * runtime proof: a capability that fails at runtime still goes through the
106
+ * workaround and verification hand-off rules, never a claimed pass.
107
+ */
108
+ export function buildEpicCapabilityStatementWorkerInstruction(statement) {
109
+ const valid = validateEpicCapabilityStatement(statement);
110
+ if (valid === null)
111
+ return null;
112
+ const servers = valid.approved_servers.length > 0 ? valid.approved_servers.join(", ") : "none";
113
+ const line = "Capability statement from the repository owner setup, advisory configuration only and not proof " +
114
+ "that anything works at runtime: approved extra MCP servers are " + servers + ". The MCP grant is " +
115
+ valid.grant_state + ". The epic server mode is " + valid.epic_server_mode + " and its recipe is " +
116
+ valid.recipe + ". Treat anything listed as none, absent, unusable, or unknown as unavailable. If a " +
117
+ "check needs an unavailable or failing capability, follow the workaround and verification hand-off " +
118
+ "rules above and never report that check as passed.";
119
+ return /[;'"\r\n]/.test(line) ? null : line;
120
+ }
24
121
  /**
25
122
  * BAPI-1399 — the workaround contract for a PR-producing Epic Implementer worker.
26
123
  *
@@ -51,6 +148,12 @@ import { WORKER_BACKGROUND_WORK_RULE } from "./required-work-diagnostics.js";
51
148
  * failure. Review steps always run and are recorded executed. The server alone
52
149
  * decides whether a hand-off counts, from persisted run state.
53
150
  *
151
+ * BAPI-1609 adds `not_applicable` for a pre-PR step, review steps included, with
152
+ * genuinely nothing to verify (optional `rule_hint` and `target_path`). It is never
153
+ * admitted as a hand-off: the run carries it and the server labels the claim. The
154
+ * guidance also separates `no_database` (none provided or reachable) from a
155
+ * provided-but-broken database, and says a database nudge never rejects the record.
156
+ *
54
157
  * BAPI-1533 puts a test invocation rule ahead of that order: a selector that
55
158
  * collects zero tests is an invocation error (never a pass, never a missing
56
159
  * capability), every affected test-running step is rerun from the repository
@@ -87,7 +190,18 @@ export function buildEpicWorkaroundWorkerInstruction(ticketKey, handoffEnabled)
87
190
  "workaround: guard exactly the deferred behavior (for example, check for a missing setting and skip " +
88
191
  "only that feature), keep the core path working, and write " + record + " naming the requirement, " +
89
192
  "the guarded substitute you delivered, and the step a human must still take. Commit that record on " +
90
- "this ticket branch with git add -f " + record + ". For a core gap, never write a workaround or a " +
193
+ "this ticket branch with git add -f " + record + ". " +
194
+ "Minor-gap disposition, for this Epic Implementer run only: when you deliver a guarded substitute " +
195
+ "for a minor gap, record that plan step as executed, not escalated. Its evidence must say that the " +
196
+ "substitute, not the original requirement, was delivered, and name the substitute, the workaround " +
197
+ "record, and the owner action still owed and when. A missing future value is a minor gap only when " +
198
+ "it is informational at this hand-off, such as a release version named in docs or a PR description " +
199
+ "that is set at publish, and a clearly marked placeholder keeps the essential behavior and every " +
200
+ "safety and correctness guarantee. A value that runtime behavior or safe operation needs is not " +
201
+ "minor just because a person supplies it later. Needing information from an outside action is not " +
202
+ "taking that action. This rule overrides the general escalation and disposition instructions only " +
203
+ "for these substitutions. Never mark unfinished core work executed to unblock delivery. " +
204
+ "For a core gap, never write a workaround or a " +
91
205
  "record: leave the required work unfinished so the run parks this ticket for a human. Planned " +
92
206
  "hand-offs: if a running app or database, a toolchain version, or live credentials are needed only " +
93
207
  "to verify an acceptance criterion and not to implement it safely, that is a planned hand-off and " +
@@ -107,6 +221,9 @@ export function buildEpicWorkaroundWorkerInstruction(ticketKey, handoffEnabled)
107
221
  "check before it produced any result, both on your first invocation and on the corrected rerun" + allowsClause +
108
222
  ", record the step escalated with a handoff object of exactly six fields. The cause is one of " +
109
223
  "no_live_server, no_database, toolchain_unavailable, credential_unavailable, or mcp_unavailable. " +
224
+ "no_database means no database was provided or reachable for the job. A database that was provided " +
225
+ "but is broken (a missing extension, a failed migration, a refused connection) is a verification " +
226
+ "failure, not that cause. " +
110
227
  "The criterion is the affected acceptance criterion. The observation names the command you first " +
111
228
  "ran and the missing capability it hit. The corrected_invocation names the corrected rerun and the " +
112
229
  "missing capability it hit. The observed_head_sha is the full head SHA both ran against, and it must " +
@@ -116,11 +233,24 @@ export function buildEpicWorkaroundWorkerInstruction(ticketKey, handoffEnabled)
116
233
  "A failed assertion, an " +
117
234
  "application error from a check that did run, and unfinished implementation or test authoring stay " +
118
235
  "blockers, and an unclear failure stays an ordinary escalation. Only those three step classes may be " +
119
- "handed off. Neither you nor the server turns an ordinary escalation into a hand-off, and you never " +
236
+ "handed off with a missing-capability cause. Neither you nor the server turns an ordinary escalation into a hand-off, and you never " +
120
237
  "invent a missing capability observation. Review steps (test_gap_review, " +
121
238
  "final_plan_review, and combined_review_test) always run, acknowledge the handed-off criterion from " +
122
239
  "that escalated record and the workaround record written in the same job, and are recorded executed, " +
123
- "never handed off. A hand-off counts only at the head it observed, so a new head needs a fresh " +
240
+ "never handed off with a capability cause. The one exception is not_applicable, described next. " +
241
+ "Nothing to verify: for any pre-PR step, review steps included, that has genuinely nothing to check " +
242
+ "for this ticket (a rendered-UI review when no rendered file changes, a named test target that does " +
243
+ "not exist and that no step creates, or zero tests collected after your corrected rerun), record it " +
244
+ "escalated with a handoff of the same six fields and cause not_applicable. You may add rule_hint " +
245
+ "(no_rendered_surface, target_absent, or zero_tests) and, with target_absent, target_path (the " +
246
+ "repository-relative path). Not applicable is never for unfinished implementation or a check you " +
247
+ "could not run, and a step that already failed keeps its plain escalation. Recording a step you cannot " +
248
+ "do, honestly, keeps the run moving: this run carries it to the integration pull request list instead " +
249
+ "of parking the ticket, and the server labels the claim afterwards. A not_applicable record never " +
250
+ "counts as a hand-off. If the reply advises that the executor provisioned a job database after you " +
251
+ "claimed no_database, the record is still accepted and need not be withdrawn. Check the database " +
252
+ "settings in your own environment and run the step if the database works. " +
253
+ "A hand-off counts only at the head it observed, so a new head needs a fresh " +
124
254
  "observation. A step that already failed at one head can be handed off only from a new head, " +
125
255
  "never at the head where it failed." +
126
256
  (handoffEnabled === true ? " " + renderPreexistingAtBaseGuidance(record) : ""));
@@ -795,3 +925,19 @@ export async function renderPromptSpecPrompt(job, context) {
795
925
  (!context.deferComparisonGuidance && job.job_type === "ci_fix"
796
926
  ? "\n\n" + renderWorkerTimeBudgetGuidance(context.timeoutSeconds) : "");
797
927
  }
928
+ /**
929
+ * BAPI-1647: one line naming the referenced credentials this worker did NOT
930
+ * receive, using child 1's closed status vocabulary (`source_missing`,
931
+ * `unreadable`, `parse_error`, `key_missing`) and the delivery outcomes. Names
932
+ * only — the caller formats each notice through `credential-delivery.ts`, which
933
+ * never carries a value, a path, or exception text. Returns "" when nothing is
934
+ * missing, so the prompt stays byte-identical.
935
+ */
936
+ export function buildCredentialNoticeWorkerInstruction(noticeLines) {
937
+ if (noticeLines.length === 0)
938
+ return "";
939
+ return ("Credential notice: some approved credentials were not provided to this worker. " +
940
+ noticeLines.join("; ") +
941
+ ". Work without them; do not search for, recreate, or ask for their values. If a step truly needs one, " +
942
+ "follow the workaround contract.");
943
+ }
@@ -52,6 +52,7 @@ import { classifyMergeTree } from "./merge-tree-classifier.js";
52
52
  import { RECONCILE_OVERLAP_PAYLOAD_SCHEMA_VERSION, } from "./reconcile-overlap-types.js";
53
53
  import { runRequiredVerificationCommands } from "./required-verification.js";
54
54
  import { validateWorkerFinalization } from "./worker-finalization.js";
55
+ import { payloadWorkerDatabaseConfigOption } from "./worker-database-config.js";
55
56
  export const RECONCILE_OVERLAP_JOB_TYPE = "reconcile_overlap";
56
57
  /** Result-envelope bounds, mirrored from the server's result model. */
57
58
  export const RECONCILE_EDITED_PATHS_MAX = 40;
@@ -256,9 +257,10 @@ export function validateReconcileOverlapPayload(job) {
256
257
  conflictReportPath,
257
258
  prompt,
258
259
  reconcileGeneration: generation,
259
- workerEnvOption: Object.prototype.hasOwnProperty.call(payload, "worker_env")
260
- ? { workerEnv: payload.worker_env }
261
- : {},
260
+ workerEnvOption: {
261
+ ...(Object.prototype.hasOwnProperty.call(payload, "worker_env") ? { workerEnv: payload.worker_env } : {}),
262
+ ...payloadWorkerDatabaseConfigOption(payload),
263
+ },
262
264
  },
263
265
  };
264
266
  }
@@ -25,6 +25,8 @@ export const COMPLETION_WINDOW_CLOSED_ON_LIVE_AGENT = "completion_window_closed_
25
25
  * rule about WHEN to report, not a demand to cancel productive background work:
26
26
  * the worker either waits for what it started or stops it, then reports. Shared
27
27
  * by the generic prompt assembly and the Claude held-stdin guidance, which
28
- * composes it at most once.
28
+ * composes it at most once. It is guidance only: it adds no diagnostic and no
29
+ * completion gate.
29
30
  */
30
- export const WORKER_BACKGROUND_WORK_RULE = "Do not post a final result while a sub-agent or background task you started is still running; wait for it or stop it.";
31
+ export const WORKER_BACKGROUND_WORK_RULE = "Before you write `.conductor/result.json`, post a final result, or end the turn, wait for or stop every " +
32
+ "background task and sub-agent you started in this session. Never end your job with your own task still running.";