@miraland-labs/conduit-bridge 0.16.115 → 0.16.117

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/dist/execution.js CHANGED
@@ -13,7 +13,7 @@ import { execFile } from "node:child_process";
13
13
  import { promisify } from "node:util";
14
14
  import { buildWorkspaceBrief, ensureCommitAvailable, fetchOrigin, normalizeRepositoryUrl, resolveAttemptStartCommit } from "./brief.js";
15
15
  import { buildSovereignExecutionFacts, bootstrapResultForWorkspace, changedExecutionFact, resumeExecutionFacts, workspaceIsClean } from "./execution-facts.js";
16
- import { agentOutputCause, boundedDetail, bridgeCause, executionFactChangedSignal, verificationRedBaseSignal, verificationScopeConflictSignal } from "./failure-signal.js";
16
+ import { agentOutputCause, boundedDetail, bridgeCause, contractScopeConflictFailure, executionFactChangedSignal, verificationRedBaseSignal, verificationScopeConflictSignal } from "./failure-signal.js";
17
17
  import { forgeTransportFailure } from "./transport-fault.js";
18
18
  import { managedWorkspacePath, switchManagedWorkspace } from "./on-shift-apply.js";
19
19
  import { formatResetMinute, parseQuotaResetAt } from "./quota-reset.js";
@@ -207,11 +207,10 @@ export function classifyFinalizeFailure(message) {
207
207
  // Bridge names the contract defect it found (K3); an unknown throw below stays prose until its
208
208
  // own site names a code.
209
209
  if (FINALIZE_CONTRACT_PATTERN.test(message)) {
210
- // The scope conflict Holds (contract/hold), and the runner's envelope schema admits only
211
- // contract/rework from a supplied envelope — sending it would refuse the whole report. It stays
212
- // prose until the finalize site emits it as a typed signal (K3 step 2b design).
210
+ // The envelope carries the contract and hold pair, which the runner schema admits. The prose
211
+ // stays beside it for the owner's words.
213
212
  const failure = CONTRACT_SCOPE_CONFLICT_MESSAGE.test(message)
214
- ? undefined
213
+ ? contractScopeConflictFailure(message)
215
214
  : VERIFICATION_UNWITNESSABLE_MESSAGE.test(message)
216
215
  ? bridgeCause("verification_unwitnessable", message)
217
216
  : message.startsWith(AGENT_NO_LAND_COMMIT_PREFIX)
@@ -8,10 +8,9 @@ import { z } from "zod";
8
8
  * beside the prose: drivers that hold structured knowledge (a vendor envelope status, an exit
9
9
  * code, the denied tool) emit it, and classification reads the signal first, the regex second.
10
10
  *
11
- * This file is mirrored byte-identical as packages/conduit-bridge/src/failure-signal.ts and
12
- * src/conductor/failure-signal.ts. Bridge cannot import from the control plane, and the other
13
- * way round, so test/failure-signal.test.ts pins the two files together instead of trusting
14
- * them to stay in step.
11
+ * The Bridge source is packages/conduit-bridge/src/failure-signal.ts. The control-plane copy at
12
+ * src/conductor/failure-signal.ts is generated by `npm run sync:twins`. Do not edit that copy.
13
+ * Bridge cannot import from the control plane, and the other way round.
15
14
  */
16
15
  export const failureSignalSchema = z.object({
17
16
  phase: z.enum(["claim", "checkout", "bootstrap", "agent", "verification", "delivery_report", "land"]),
@@ -118,7 +117,7 @@ export const BRIDGE_CAUSES = {
118
117
  workspace_head_changed: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "The checkout changed after Conduit prepared the assignment.", next_action: "Let the checkout settle, then recheck readiness." },
119
118
  base_not_ancestor: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "Conduit could not prepare the required project version on this computer.", next_action: "No Git work is required from the product owner. Keep the computer and Bridge online, then try again so Bridge can refresh the project. If the hold returns, the computer operator should check Bridge's repository access." },
120
119
  workspace_dirty: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "The source workspace has uncommitted changes.", next_action: "Commit, stash, or discard the local changes, then recheck readiness." },
121
- missing_verification: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "This checkout has no verification commands Conduit can run for this package.", next_action: "Conductor will adjust how this package is verified. Open Connect only if the computer itself is unhealthy — you do not need to author test commands." },
120
+ missing_verification: { class: "environment", disposition: "hold", responsible_party: "conduit", message: "This checkout has no verification commands Conduit can run for this package.", next_action: "Conductor will adjust how this package is verified. You do not need to author test commands or rewrite the plan for tooling." },
122
121
  verification_unwitnessable: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "The project's verification command runs but prints nothing, so test evidence cannot be witnessed.", next_action: "Fix the verification recipe in the checkout so it prints real output, then recheck readiness. You do not need to author test commands for the agent." },
123
122
  execution_contract_failed: { class: "contract", disposition: "rework", responsible_party: "conduit", message: "The agent could not satisfy the approved execution contract.", next_action: "Review the last run and rework the same contract; change the plan only if its authority or outcome is wrong." },
124
123
  agent_no_land_commit: { class: "contract", disposition: "rework", responsible_party: "conduit", message: "The agent finished without committing the repository changes this package requires.", next_action: "Retry implement. Conductor will brief a land-focused recovery attempt — you do not need to edit technical constraints." },
@@ -126,6 +125,23 @@ export const BRIDGE_CAUSES = {
126
125
  forge_unreachable: { class: "transient", disposition: "retry", responsible_party: "conduit", message: "The connection to the code host failed mid-run.", next_action: "Nothing to repair here — the run stopped on a network fault, not on the work. Retry the same plan." },
127
126
  agent_model_abort: { class: "transient", disposition: "retry", responsible_party: "conduit", message: "The agent CLI stopped its own run: it detected a loop, asked for a different model, or the prompt did not fit the context window.", next_action: "Conduit retries on another model of the same intelligence tier. The product owner does not need to author technical constraints." },
128
127
  agent_execution_failed: { class: "transient", disposition: "retry", responsible_party: "conduit", message: "The agent run failed before delivery.", next_action: "Conduit will retry with bounded backoff while the authoring budget remains. No technical constraints are required from the owner." },
128
+ verification_failed_after_run: { class: "transient", disposition: "retry", responsible_party: "conduit", message: "The agent run failed its own verification before delivery.", next_action: "Conduit will diagnose the retained failed run and brief the next authoring attempt." },
129
+ bridge_finalize_failed: { class: "platform", disposition: "stop", responsible_party: "conduit", message: "Bridge stopped while finishing the delivery report.", next_action: "Inspect Bridge logs for the finalize fault. Fix Bridge or open a revision if the plan is wrong, then Retry." },
130
+ bridge_preflight_missing: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "This computer has not reported Bridge readiness.", next_action: "Run Bridge Doctor and reinstall or restart the background service, then recheck readiness." },
131
+ bridge_preflight_stale: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "This computer's Bridge readiness report is stale.", next_action: "Wake or restart the Bridge and wait for a fresh heartbeat, then recheck readiness." },
132
+ hosted_computer: { class: "environment", disposition: "hold", responsible_party: "conduit", message: "This hosted computer is Conduit's responsibility.", next_action: "Conduit fixes the hosted computer; Recheck runs the work package again." },
133
+ dependency_failed: { class: "contract", disposition: "hold", responsible_party: "conduit", message: "Earlier work this package depends on failed, so this work can never start.", next_action: "Recover or revise the package it depends on. This work resumes on its own once that one completes." },
134
+ dispatch_admit_blocked: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "Matching computers look ready but dispatch still cannot admit them.", next_action: "Confirm Bridge is on shift for this machine, then recheck. If it persists, restart Bridge." },
135
+ driver_fuel_mismatch: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "The selected driver does not have a usable fuel source.", next_action: "Correct the driver fuel setting, then recheck readiness." },
136
+ driver_quota_exhausted: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "The agent lane on this computer has spent its subscription allowance.", next_action: "Wait for the allowance to refill, bring another agent lane online to start sooner, or point this lane's model settings at a model that still has allowance." },
137
+ local_fuel_lanes_unavailable: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "Every local-fuel agent lane on this computer is currently unavailable.", next_action: "Wait for a reported provider allowance to recover, or bring another agent lane online to start sooner." },
138
+ execution_class_required: { class: "authority", disposition: "decision", responsible_party: "project_owner", message: "This work package is missing stamped execution_class.", next_action: "Revise the plan so the planner authors a class for every work item, then retry." },
139
+ no_online_driver: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "This computer has no online agent lane ready for work.", next_action: "Bring an authenticated agent lane online, then recheck readiness." },
140
+ runner_behind_server: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "This computer's assignment poll no longer matches the server's response shape.", next_action: "Restart the runner, then recheck readiness." },
141
+ stale_bridge: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "This computer is running an unsupported Bridge version.", next_action: "Update and reinstall Bridge, then recheck readiness." },
142
+ workspace_diverged: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "This computer's checkout holds local commits the project does not have, so it would run on stale code.", next_action: "Ask the computer operator to push or park the local commits so the checkout can follow the project again, then recheck readiness." },
143
+ workspace_repository_missing: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "The configured workspace is not a repository checkout.", next_action: "Select or create the required repository checkout, then recheck readiness." },
144
+ workspace_tip_lag: { class: "environment", disposition: "hold", responsible_party: "computer_operator", message: "Conduit could not prepare the required project version on this computer.", next_action: "No Git work is required from the product owner. Keep the computer and Bridge online, then try again so Bridge can refresh the project. If the hold returns, the computer operator should check Bridge's repository access." },
129
145
  };
130
146
  /** Is this string a code Bridge may name as a cause? Narrows a caller-supplied reason. */
131
147
  export function isBridgeCauseCode(value) {
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * The refill time a vendor states in a quota refusal, as an absolute clock.
3
3
  *
4
- * This file is mirrored byte-identical as packages/conduit-bridge/src/quota-reset.ts and
5
- * src/conductor/quota-reset.ts. Bridge cannot import from the control plane, and the other way
6
- * round, so test/failure-classification.test.ts pins the two files together instead of trusting
7
- * them to stay in step.
4
+ * The Bridge source is packages/conduit-bridge/src/quota-reset.ts. The control-plane copy at
5
+ * src/conductor/quota-reset.ts is generated by `npm run sync:twins`. Do not edit that copy. Bridge
6
+ * cannot import from the control plane, and the other way round.
8
7
  *
9
8
  * Vendors phrase the refill as an absolute clock time (RFC 1123), a wall clock in a named zone
10
9
  * (Claude Code's "resets 3:10pm (UTC)"), a duration ("try again in 2h 14m", or agy's Go form
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miraland-labs/conduit-bridge",
3
- "version": "0.16.115",
3
+ "version": "0.16.117",
4
4
  "description": "Conduit Bridge CLI \u2014 join, connect, disconnect, multi-driver lanes, and run Claude Code / Codex / Cursor / OpenCode / Pi / Kiro / Antigravity / Grok Build agents for a Conduit organization",
5
5
  "type": "module",
6
6
  "bin": {