@miraland-labs/conduit-bridge 0.11.0 → 0.11.2
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 +16 -8
- package/package.json +1 -1
package/dist/execution.js
CHANGED
|
@@ -24,7 +24,10 @@ function changesRequestedFeedback(summary) {
|
|
|
24
24
|
}
|
|
25
25
|
/** Failures that require an operator/configuration change must never burn the remaining attempts. */
|
|
26
26
|
export function retryableAgentFailure(message) {
|
|
27
|
-
|
|
27
|
+
// `cannot enforce` is a driver projection refusing a class it structurally cannot bound (Pi and
|
|
28
|
+
// observe_network). No number of retries on that lane changes it, and retrying an immutable input
|
|
29
|
+
// is how one assignment burned ~80 attempts. Fail closed; the message names the drivers that work.
|
|
30
|
+
return !/unknown (?:option|argument)|unrecognized (?:option|argument)|not logged in|no login|not authenticated|login required|\bENOENT\b|could not verify the installed CLI|requires local fuel|No Bridge-mapped|cannot enforce|preflight/i.test(message);
|
|
28
31
|
}
|
|
29
32
|
const assignmentSchema = z.object({
|
|
30
33
|
id: z.string().uuid(),
|
|
@@ -54,7 +57,6 @@ const taskSpecSchema = z.object({
|
|
|
54
57
|
execution_class: z.enum(["observe", "observe_network", "publish_artifact", "verify", "mutate_repo"]).optional(),
|
|
55
58
|
lands: z.boolean().optional(),
|
|
56
59
|
privileged_grants: z.array(z.string()).optional(),
|
|
57
|
-
external_network: z.boolean().optional(),
|
|
58
60
|
instruction: z.string().optional(),
|
|
59
61
|
evidence_standard: z.unknown().optional(),
|
|
60
62
|
working_language: z.enum(["en", "zh"]).optional(),
|
|
@@ -340,11 +342,11 @@ async function runClaimedAssignment(client, config, driver, workspace, brief, ta
|
|
|
340
342
|
catch (error) {
|
|
341
343
|
const detail = error instanceof Error ? error.message : "missing stamped execution_class";
|
|
342
344
|
console.error(`Assignment ${taskId}: ${detail}`);
|
|
343
|
-
//
|
|
344
|
-
//
|
|
345
|
+
// Non-retryable: control plane restamps on dispatch/claim. Infinite retry here burned path-4
|
|
346
|
+
// attempt budget when a pre-inversion task row still lacked the stamp.
|
|
345
347
|
await queueTerminal(client, taskId, {
|
|
346
348
|
action: "fail",
|
|
347
|
-
body: { error: detail, retryable:
|
|
349
|
+
body: { error: detail, retryable: false, idempotency_key: `bridge:fail:${active.attemptId}:missing-class` },
|
|
348
350
|
});
|
|
349
351
|
return;
|
|
350
352
|
}
|
|
@@ -706,10 +708,12 @@ async function prepareDelivery(client, attemptId, taskId, report) {
|
|
|
706
708
|
};
|
|
707
709
|
}
|
|
708
710
|
export function validateDeliveryReport(report, spec, grants = []) {
|
|
709
|
-
validateChangeScope(report, spec.change_scope ?? []);
|
|
710
711
|
// Research findings live in the report. Do not demand a published pack URL for work_role=research
|
|
711
712
|
// even when a planner mis-labeled the package as deliverable=artifact.
|
|
712
713
|
const artifactDelivery = spec.deliverable === "artifact" && spec.work_role !== "research";
|
|
714
|
+
// Artifact packs are not git landings — do not demand head_commit when the planner put
|
|
715
|
+
// `.conduit/artifacts/**` in change_scope as a write hint (path-4 canary incident).
|
|
716
|
+
validateChangeScope(report, spec.change_scope ?? [], { requireHeadCommit: !artifactDelivery });
|
|
713
717
|
if (artifactDelivery) {
|
|
714
718
|
const published = report.evidence.some((item) => {
|
|
715
719
|
if (!["preview", "research", "documentation"].includes(item.kind))
|
|
@@ -776,11 +780,15 @@ function referenceKind(kind) {
|
|
|
776
780
|
return "document";
|
|
777
781
|
return "other";
|
|
778
782
|
}
|
|
779
|
-
export function validateChangeScope(report, changeScope) {
|
|
783
|
+
export function validateChangeScope(report, changeScope, options = {}) {
|
|
780
784
|
if (!changeScope.length)
|
|
781
785
|
return;
|
|
782
|
-
|
|
786
|
+
const requireHeadCommit = options.requireHeadCommit !== false;
|
|
787
|
+
if (requireHeadCommit && !report.head_commit) {
|
|
783
788
|
throw new Error("Repository changes require a delivered head commit");
|
|
789
|
+
}
|
|
790
|
+
if (!report.changes.length)
|
|
791
|
+
return;
|
|
784
792
|
const paths = report.changes.map((change) => change.split(/\s+[—-]\s+/, 1)[0].trim().replaceAll("\\", "/"));
|
|
785
793
|
const outside = paths.filter((path) => !path || path.startsWith("/") || path.split("/").includes("..") || !changeScope.some((scope) => pathMatchesScope(path, scope)));
|
|
786
794
|
if (outside.length)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miraland-labs/conduit-bridge",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Conduit Bridge CLI — join, connect, disconnect, multi-driver lanes, and run Claude Code / Codex / Cursor / OpenCode / Pi / Kiro / Antigravity agents for a Conduit organization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|