opencode-swarm 7.172.0 → 7.172.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/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/cli/{coder-settlement-0k46xqk2.js → coder-settlement-trba7st8.js} +12 -12
- package/dist/cli/{config-doctor-x41bxjp6.js → config-doctor-229ewr8f.js} +3 -3
- package/dist/cli/{core-3spww0at.js → core-2ytpkhxc.js} +4 -4
- package/dist/cli/{curation-policy-92qhvewe.js → curation-policy-cvjd6kz8.js} +5 -5
- package/dist/cli/{curator-drift-fqvxe2zw.js → curator-drift-b0pbzjxv.js} +4 -4
- package/dist/cli/curator-llm-factory-8evp80zs.js +72 -0
- package/dist/cli/{curator-eyz6gg74.js → curator-qfwgj2y7.js} +37 -37
- package/dist/cli/{evidence-summary-service-kf0vb1hf.js → evidence-summary-service-5t5vr9w9.js} +16 -16
- package/dist/cli/{gate-evidence-89wvxgs9.js → gate-evidence-27j4pm1v.js} +7 -7
- package/dist/cli/guardrail-explain-65zzxh0c.js +73 -0
- package/dist/cli/{guardrail-log-kfjk62sz.js → guardrail-log-0y9xmnpd.js} +8 -8
- package/dist/cli/{guardrail-reset-d8m1h5sz.js → guardrail-reset-f5d89j15.js} +37 -37
- package/dist/cli/{hive-promoter-0ekf5zp1.js → hive-promoter-66bhdee6.js} +37 -37
- package/dist/cli/{index-3kqzzwvd.js → index-0tmrdj9m.js} +1 -1
- package/dist/cli/{index-5hambjmn.js → index-27k76kef.js} +30 -18
- package/dist/cli/{index-12w05bxk.js → index-31fes86t.js} +2 -2
- package/dist/cli/{index-xn9tm7sr.js → index-3d3h79cj.js} +39 -39
- package/dist/cli/{index-8k09fkqj.js → index-3vscksqk.js} +4 -4
- package/dist/cli/{index-1vsmh63p.js → index-4xszpb54.js} +76 -76
- package/dist/cli/{index-328eg2bb.js → index-5z71h1j4.js} +4 -4
- package/dist/cli/{index-y8y2bjsy.js → index-93b6dm58.js} +4 -4
- package/dist/cli/{index-mj07x42s.js → index-9bg5vc22.js} +2 -2
- package/dist/cli/{index-k441jgzk.js → index-9p00xent.js} +1 -1
- package/dist/cli/{index-29j9sjbw.js → index-aa0yaw9b.js} +2 -2
- package/dist/cli/{index-efkckdaw.js → index-bdqefjxg.js} +1 -1
- package/dist/cli/{index-zbw6h4xn.js → index-byf75cte.js} +2 -2
- package/dist/cli/{index-39x78qk0.js → index-d1nb8eb3.js} +8 -8
- package/dist/cli/{index-63t4m2t5.js → index-d8mbaj41.js} +133 -23
- package/dist/cli/{index-ecaws78e.js → index-depxc452.js} +1 -1
- package/dist/cli/{index-2rdj9mdh.js → index-etjq0r06.js} +4 -4
- package/dist/cli/{index-jvg7hvjp.js → index-fck5xq4y.js} +4 -4
- package/dist/cli/{index-w1d5nsdc.js → index-fgzh858k.js} +2 -2
- package/dist/cli/{index-dpb1xs5m.js → index-gdrdtbw6.js} +2 -2
- package/dist/cli/{index-nqbmk4b9.js → index-h91jjw6t.js} +1 -1
- package/dist/cli/{index-nyrhz1h1.js → index-ha3wsy2e.js} +1 -1
- package/dist/cli/{index-677gzqmd.js → index-hydccmm1.js} +1 -1
- package/dist/cli/{index-br3r0y73.js → index-jmn35na4.js} +3 -3
- package/dist/cli/{index-1s3t3jdc.js → index-jzrx2sx2.js} +1 -1
- package/dist/cli/{index-6fb3y9pm.js → index-ma38q4rf.js} +1 -1
- package/dist/cli/{index-0y2ygy5f.js → index-mfjep91k.js} +7 -7
- package/dist/cli/{index-53ges0rk.js → index-mq1z10v1.js} +7 -7
- package/dist/cli/{index-v6msnkz2.js → index-mq69g46a.js} +2 -2
- package/dist/cli/{index-s723hx7z.js → index-nzpw41w6.js} +1 -1
- package/dist/cli/{index-8wnjcav5.js → index-p5fdk20g.js} +4 -4
- package/dist/cli/{index-r08tgb71.js → index-pre6sqz8.js} +2 -2
- package/dist/cli/{index-gmw8a1qa.js → index-t7yn457b.js} +1 -1
- package/dist/cli/{index-34jdempk.js → index-tr3tbtgw.js} +2 -2
- package/dist/cli/{index-6jshhpjw.js → index-vbgpxbmm.js} +3 -3
- package/dist/cli/{index-tfmb620d.js → index-wk58ymh3.js} +37 -37
- package/dist/cli/{index-7q1m8rsw.js → index-wpcwwf61.js} +7 -7
- package/dist/cli/{index-a2kv054j.js → index-ws3ggk1h.js} +6 -6
- package/dist/cli/{index-v2fge66b.js → index-y5x1swr8.js} +7 -7
- package/dist/cli/{index-25fa4krx.js → index-ybwtp7n4.js} +8 -8
- package/dist/cli/{index-dga9j6s1.js → index-yf1mvexg.js} +2 -2
- package/dist/cli/{index-z81mxyhm.js → index-yxptsaea.js} +5 -5
- package/dist/cli/index.js +38 -38
- package/dist/cli/{knowledge-escalator-qtz01ffw.js → knowledge-escalator-f5d966wd.js} +13 -13
- package/dist/cli/{knowledge-events-8w0mvkzc.js → knowledge-events-9ye18tpn.js} +11 -11
- package/dist/cli/{knowledge-link-3xp7h4xn.js → knowledge-link-51m3c09s.js} +4 -4
- package/dist/cli/{knowledge-store-p5ps09qg.js → knowledge-store-g8ge5m6j.js} +5 -5
- package/dist/cli/{knowledge-validator-rc63wfkp.js → knowledge-validator-r2hdm42z.js} +7 -7
- package/dist/cli/{mcp-pmfg7wpk.js → mcp-4q7ntdm7.js} +1 -1
- package/dist/cli/{model-preflight-2mvdbj0c.js → model-preflight-ap5k7585.js} +1 -1
- package/dist/cli/{pending-delegations-1sg6g7et.js → pending-delegations-52t70c1w.js} +11 -11
- package/dist/cli/{pr-subscriptions-yd804apk.js → pr-subscriptions-915nbgys.js} +11 -11
- package/dist/cli/{pr-workflow-gate-pf3ssffq.js → pr-workflow-gate-zbaqx5gr.js} +37 -37
- package/dist/cli/{runner-rry4z6j2.js → runner-k2t9n662.js} +5 -5
- package/dist/cli/{scan-cursor-j93ek248.js → scan-cursor-922rhxag.js} +6 -6
- package/dist/cli/{schema-hvptm5hf.js → schema-8r56yn5m.js} +2 -2
- package/dist/cli/{scope-persistence-3tfvswtk.js → scope-persistence-xsxj83mx.js} +15 -15
- package/dist/cli/{server-rbvx63t6.js → server-vmdq6des.js} +37 -37
- package/dist/cli/{skill-generator-r9wc6xt1.js → skill-generator-q9kmx4yk.js} +15 -15
- package/dist/cli/{snapshot-coordination-init-7w5em40w.js → snapshot-coordination-init-0qmg827p.js} +37 -37
- package/dist/cli/{telemetry-vw919tfm.js → telemetry-zed80n86.js} +1 -1
- package/dist/cli/{workspace-snapshot-x54wxr6a.js → workspace-snapshot-93dx9rbt.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-yetwf2ch.js → worktree-collision-ownership-yvth2mxb.js} +12 -12
- package/dist/cli/{worktree-isolation-sxfj78hv.js → worktree-isolation-sqzqrnd6.js} +37 -37
- package/dist/index.js +13 -13
- package/dist/plan/index.d.ts +1 -0
- package/dist/plan/ledger.d.ts +10 -0
- package/dist/plan/manager.d.ts +38 -2
- package/dist/tools/phase-complete.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-jnsjqq99.js +0 -72
- package/dist/cli/guardrail-explain-rz4kaqyp.js +0 -73
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
PluginConfigSchema,
|
|
13
13
|
init_schema,
|
|
14
14
|
stripKnownSwarmPrefix
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-byf75cte.js";
|
|
16
16
|
import {
|
|
17
17
|
ALL_AGENT_NAMES,
|
|
18
18
|
TOOL_NAME_SET,
|
|
19
19
|
init_constants,
|
|
20
20
|
init_tool_metadata
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-depxc452.js";
|
|
22
22
|
import {
|
|
23
23
|
log
|
|
24
24
|
} from "./index-zgwm4ryv.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ALL_AGENT_NAMES,
|
|
4
4
|
SUMMARIZER_EXEMPT_TOOL_NAMES,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-depxc452.js";
|
|
7
7
|
import {
|
|
8
8
|
OUTCOME_BLOCK_THRESHOLD,
|
|
9
9
|
init_knowledge_types
|
|
@@ -21,7 +21,7 @@ var package_default;
|
|
|
21
21
|
var init_package = __esm(() => {
|
|
22
22
|
package_default = {
|
|
23
23
|
name: "opencode-swarm",
|
|
24
|
-
version: "7.172.
|
|
24
|
+
version: "7.172.2",
|
|
25
25
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
26
26
|
main: "dist/index.js",
|
|
27
27
|
types: "dist/index.d.ts",
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-ma38q4rf.js";
|
|
5
5
|
import {
|
|
6
6
|
observeReceiptTransition
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-gdrdtbw6.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveHiveEventsPath
|
|
10
10
|
} from "./index-ae75rja9.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveKnowledgeStoreDir
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-jzrx2sx2.js";
|
|
14
14
|
import {
|
|
15
15
|
assertProjectRoot,
|
|
16
16
|
atomicWriteFile
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-yf1mvexg.js";
|
|
18
18
|
import {
|
|
19
19
|
require_proper_lockfile
|
|
20
20
|
} from "./index-7g4c7s5r.js";
|
|
21
21
|
import {
|
|
22
22
|
emit
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-jmn35na4.js";
|
|
24
24
|
import {
|
|
25
25
|
canonicalRootKey
|
|
26
26
|
} from "./index-1xnse449.js";
|
|
27
27
|
import {
|
|
28
28
|
loadPluginConfigWithMeta
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-0tmrdj9m.js";
|
|
30
30
|
import {
|
|
31
31
|
KnowledgeConfigSchema,
|
|
32
32
|
init_schema
|
|
33
|
-
} from "./index-
|
|
33
|
+
} from "./index-byf75cte.js";
|
|
34
34
|
import {
|
|
35
35
|
init_logger,
|
|
36
36
|
warn
|
|
@@ -2813,7 +2813,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
|
|
|
2813
2813
|
}
|
|
2814
2814
|
let bumps = 0;
|
|
2815
2815
|
if (deltas.length > 0) {
|
|
2816
|
-
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-
|
|
2816
|
+
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-g8ge5m6j.js");
|
|
2817
2817
|
bumps = await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
2818
2818
|
}
|
|
2819
2819
|
return {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
EvaluationRunV1Schema,
|
|
4
4
|
GateAuditResultV1Schema,
|
|
5
5
|
getProtectedEvaluationRunIds
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-nzpw41w6.js";
|
|
7
7
|
import {
|
|
8
8
|
readEffectiveSpecSync
|
|
9
9
|
} from "./index-z2deqhpp.js";
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
readTaskEvidence,
|
|
24
24
|
readTaskEvidenceRaw,
|
|
25
25
|
sanitizeTaskId
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-3vscksqk.js";
|
|
27
27
|
import {
|
|
28
28
|
estimateCharsForTokens,
|
|
29
29
|
estimateTokens,
|
|
30
30
|
readSwarmFileAsync,
|
|
31
31
|
validateSwarmPath
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-ma38q4rf.js";
|
|
33
33
|
import {
|
|
34
34
|
bunHash,
|
|
35
35
|
bunWrite,
|
|
@@ -58,10 +58,10 @@ import {
|
|
|
58
58
|
replayFromLedgerWithStatus,
|
|
59
59
|
takeSnapshotEvent,
|
|
60
60
|
takeSnapshotWithRetry
|
|
61
|
-
} from "./index-
|
|
61
|
+
} from "./index-27k76kef.js";
|
|
62
62
|
import {
|
|
63
63
|
appendCoreEventSync
|
|
64
|
-
} from "./index-
|
|
64
|
+
} from "./index-9bg5vc22.js";
|
|
65
65
|
import {
|
|
66
66
|
derivePlanId,
|
|
67
67
|
derivePlanIdentityHash,
|
|
@@ -69,32 +69,32 @@ import {
|
|
|
69
69
|
importCoordinationOnce,
|
|
70
70
|
listCoordinationStates,
|
|
71
71
|
transitionCoordinationState
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-9p00xent.js";
|
|
73
73
|
import {
|
|
74
74
|
DURABILITY_CLASSES,
|
|
75
75
|
getProjectDb,
|
|
76
76
|
projectDbExists,
|
|
77
77
|
withDurabilityClass
|
|
78
|
-
} from "./index-
|
|
78
|
+
} from "./index-bdqefjxg.js";
|
|
79
79
|
import {
|
|
80
80
|
assertProjectRoot,
|
|
81
81
|
tryAcquireLock,
|
|
82
82
|
withEvidenceLock
|
|
83
|
-
} from "./index-
|
|
83
|
+
} from "./index-yf1mvexg.js";
|
|
84
84
|
import {
|
|
85
85
|
emit
|
|
86
|
-
} from "./index-
|
|
86
|
+
} from "./index-jmn35na4.js";
|
|
87
87
|
import {
|
|
88
88
|
atomicWriteSwarmFileSync,
|
|
89
89
|
invalidateCachedArtifact,
|
|
90
90
|
readCachedParsedFile
|
|
91
|
-
} from "./index-
|
|
91
|
+
} from "./index-ws3ggk1h.js";
|
|
92
92
|
import {
|
|
93
93
|
canonicalRootKeyFresh
|
|
94
94
|
} from "./index-1xnse449.js";
|
|
95
95
|
import {
|
|
96
96
|
PlanSchema
|
|
97
|
-
} from "./index-
|
|
97
|
+
} from "./index-0tmrdj9m.js";
|
|
98
98
|
import {
|
|
99
99
|
GIT_BINARY_ENV_VAR,
|
|
100
100
|
describeGitResolution,
|
|
@@ -1880,6 +1880,11 @@ var _internals5 = {
|
|
|
1880
1880
|
loadPlanJsonOnly,
|
|
1881
1881
|
readPlanJsonUtf8,
|
|
1882
1882
|
readPlanFileUtf8,
|
|
1883
|
+
verifyWrittenPlanJson,
|
|
1884
|
+
ledgerExists,
|
|
1885
|
+
replayFromLedger,
|
|
1886
|
+
loadLastApprovedPlan,
|
|
1887
|
+
readLedgerEventsWithIntegrity,
|
|
1883
1888
|
regeneratePlanMarkdown,
|
|
1884
1889
|
isGitRepo,
|
|
1885
1890
|
isEpicModeActiveForProject,
|
|
@@ -2265,14 +2270,20 @@ async function loadPlan(directory, cache) {
|
|
|
2265
2270
|
rawPlanId = derivePlanId(rawParsed);
|
|
2266
2271
|
}
|
|
2267
2272
|
} catch {}
|
|
2268
|
-
if (await ledgerExists(directory)) {
|
|
2269
|
-
const
|
|
2273
|
+
if (await _internals5.ledgerExists(directory)) {
|
|
2274
|
+
const catchIntegrity = await _internals5.readLedgerEventsWithIntegrity(directory);
|
|
2275
|
+
const ledgerEventsForCatch = catchIntegrity.events;
|
|
2270
2276
|
const catchFirstEvent = ledgerEventsForCatch.length > 0 ? ledgerEventsForCatch[0] : null;
|
|
2271
2277
|
const identityMatch = rawPlanId === null || catchFirstEvent === null || catchFirstEvent.plan_id === rawPlanId;
|
|
2272
2278
|
if (!identityMatch) {
|
|
2273
2279
|
warn(`[loadPlan] Ledger identity mismatch in validation-failure path (ledger: ${catchFirstEvent?.plan_id}, plan: ${rawPlanId}) \u2014 skipping ledger rebuild (migration detected).`);
|
|
2274
2280
|
} else if (catchFirstEvent !== null && rawPlanId !== null) {
|
|
2275
|
-
|
|
2281
|
+
let rebuilt = null;
|
|
2282
|
+
try {
|
|
2283
|
+
rebuilt = await _internals5.replayFromLedger(directory);
|
|
2284
|
+
} catch (replayError) {
|
|
2285
|
+
warn(`[loadPlan] Ledger replay threw in validation-failure path: ${replayError instanceof Error ? replayError.message : String(replayError)}. Falling back to critic-approved snapshot before legacy migration.`);
|
|
2286
|
+
}
|
|
2276
2287
|
if (rebuilt) {
|
|
2277
2288
|
await rebuildPlan(directory, rebuilt, {
|
|
2278
2289
|
reason: "validation_failure_recovery"
|
|
@@ -2280,6 +2291,30 @@ async function loadPlan(directory, cache) {
|
|
|
2280
2291
|
warn("[loadPlan] Rebuilt plan from ledger after validation failure. Projection was stale.");
|
|
2281
2292
|
return rebuilt;
|
|
2282
2293
|
}
|
|
2294
|
+
try {
|
|
2295
|
+
const approved = await _internals5.loadLastApprovedPlan(directory, catchFirstEvent.plan_id);
|
|
2296
|
+
if (approved) {
|
|
2297
|
+
const { removedCount } = await savePlanWithAutoAcknowledgedRemovals(directory, approved.plan, "load_plan_recovery_from_approved_snapshot", "restore from critic-approved snapshot");
|
|
2298
|
+
if (removedCount > 0) {
|
|
2299
|
+
approved.plan._midLoadRemovals = {
|
|
2300
|
+
count: removedCount,
|
|
2301
|
+
source: "load_plan_recovery_from_approved_snapshot"
|
|
2302
|
+
};
|
|
2303
|
+
}
|
|
2304
|
+
try {
|
|
2305
|
+
await takeSnapshotEvent(directory, approved.plan, {
|
|
2306
|
+
source: "recovery_from_approved_snapshot",
|
|
2307
|
+
approvalMetadata: approved.approval
|
|
2308
|
+
});
|
|
2309
|
+
} catch (healError) {
|
|
2310
|
+
warn(`[loadPlan] Recovery-heal snapshot append failed: ${healError instanceof Error ? healError.message : String(healError)}. Next loadPlan may re-enter recovery path.`);
|
|
2311
|
+
}
|
|
2312
|
+
warn(`[loadPlan] Recovered from critic-approved snapshot seq=${approved.seq} after validation failure with exhausted ledger replay (approved snapshot beats lossy Markdown migration).`);
|
|
2313
|
+
return approved.plan;
|
|
2314
|
+
}
|
|
2315
|
+
} catch (approvedError) {
|
|
2316
|
+
warn(`[loadPlan] Approved-snapshot recovery failed in validation-failure path: ${approvedError instanceof Error ? approvedError.message : String(approvedError)}`);
|
|
2317
|
+
}
|
|
2283
2318
|
}
|
|
2284
2319
|
}
|
|
2285
2320
|
const planMdContent2 = await readSwarmFileAsync(directory, "plan.md", cache);
|
|
@@ -2292,12 +2327,13 @@ async function loadPlan(directory, cache) {
|
|
|
2292
2327
|
source: "load_plan_migration_from_md"
|
|
2293
2328
|
};
|
|
2294
2329
|
}
|
|
2330
|
+
await appendMigrationProvenanceEvent(directory, migrated);
|
|
2295
2331
|
return migrated;
|
|
2296
2332
|
}
|
|
2297
2333
|
}
|
|
2298
2334
|
}
|
|
2299
2335
|
}
|
|
2300
|
-
if (await ledgerExists(directory)) {
|
|
2336
|
+
if (await _internals5.ledgerExists(directory)) {
|
|
2301
2337
|
const resolvedDir = canonicalRootKeyFresh(directory);
|
|
2302
2338
|
const existingMutex = recoveryMutexes.get(resolvedDir);
|
|
2303
2339
|
if (existingMutex) {
|
|
@@ -2312,7 +2348,12 @@ async function loadPlan(directory, cache) {
|
|
|
2312
2348
|
});
|
|
2313
2349
|
recoveryMutexes.set(resolvedDir, mutex);
|
|
2314
2350
|
try {
|
|
2315
|
-
|
|
2351
|
+
let rebuilt = null;
|
|
2352
|
+
try {
|
|
2353
|
+
rebuilt = await _internals5.replayFromLedger(directory);
|
|
2354
|
+
} catch (replayError) {
|
|
2355
|
+
warn(`[loadPlan] Ledger replay threw in missing-projection path: ${replayError instanceof Error ? replayError.message : String(replayError)}. Falling back to critic-approved snapshot before legacy migration.`);
|
|
2356
|
+
}
|
|
2316
2357
|
if (rebuilt) {
|
|
2317
2358
|
const { removedCount } = await savePlanWithAutoAcknowledgedRemovals(directory, rebuilt, "load_plan_rebuild_from_ledger", "rebuild plan from ledger replay");
|
|
2318
2359
|
if (removedCount > 0) {
|
|
@@ -2324,13 +2365,14 @@ async function loadPlan(directory, cache) {
|
|
|
2324
2365
|
return rebuilt;
|
|
2325
2366
|
}
|
|
2326
2367
|
try {
|
|
2327
|
-
const
|
|
2368
|
+
const anchorIntegrity = await _internals5.readLedgerEventsWithIntegrity(directory);
|
|
2369
|
+
const anchorEvents = anchorIntegrity.events;
|
|
2328
2370
|
if (anchorEvents.length === 0) {
|
|
2329
2371
|
warn("[loadPlan] Ledger present but no events readable \u2014 refusing approved-snapshot recovery (cannot verify plan identity).");
|
|
2330
2372
|
return null;
|
|
2331
2373
|
}
|
|
2332
2374
|
const expectedPlanId = anchorEvents[0].plan_id;
|
|
2333
|
-
const approved = await loadLastApprovedPlan(directory, expectedPlanId);
|
|
2375
|
+
const approved = await _internals5.loadLastApprovedPlan(directory, expectedPlanId);
|
|
2334
2376
|
if (approved) {
|
|
2335
2377
|
const approvedPhase = approved.approval && typeof approved.approval === "object" && "phase" in approved.approval ? approved.approval.phase : undefined;
|
|
2336
2378
|
warn(`[loadPlan] Ledger replay returned no plan \u2014 recovered from critic-approved snapshot seq=${approved.seq} timestamp=${approved.timestamp} (approval phase=${approvedPhase ?? "unknown"}). This may roll the plan back to an earlier phase \u2014 verify before continuing.`);
|
|
@@ -2362,7 +2404,14 @@ async function loadPlan(directory, cache) {
|
|
|
2362
2404
|
const planMdContent = await readSwarmFileAsync(directory, "plan.md", cache);
|
|
2363
2405
|
if (planMdContent !== null) {
|
|
2364
2406
|
const migrated = migrateLegacyPlan(planMdContent);
|
|
2365
|
-
await
|
|
2407
|
+
const { removedCount } = await savePlanWithAutoAcknowledgedRemovals(directory, migrated, "load_plan_migration_from_md", "migrate legacy plan.md to plan.json");
|
|
2408
|
+
if (removedCount > 0) {
|
|
2409
|
+
migrated._midLoadRemovals = {
|
|
2410
|
+
count: removedCount,
|
|
2411
|
+
source: "load_plan_migration_from_md"
|
|
2412
|
+
};
|
|
2413
|
+
}
|
|
2414
|
+
await appendMigrationProvenanceEvent(directory, migrated);
|
|
2366
2415
|
return migrated;
|
|
2367
2416
|
}
|
|
2368
2417
|
return null;
|
|
@@ -2403,6 +2452,57 @@ async function withPlanLifecycleLock(directory, taskId, fn) {
|
|
|
2403
2452
|
}
|
|
2404
2453
|
}
|
|
2405
2454
|
}
|
|
2455
|
+
|
|
2456
|
+
class PlanWriteVerificationError extends Error {
|
|
2457
|
+
constructor(message) {
|
|
2458
|
+
super(message);
|
|
2459
|
+
this.name = "PlanWriteVerificationError";
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
var PLAN_WRITE_VERIFY_READ_RETRIES = 4;
|
|
2463
|
+
var PLAN_WRITE_VERIFY_READ_BACKOFF_MS = 200;
|
|
2464
|
+
async function verifyWrittenPlanJson(directory, expected) {
|
|
2465
|
+
let content;
|
|
2466
|
+
try {
|
|
2467
|
+
content = await readSwarmFileAsync(directory, "plan.json", undefined, (filePath) => _internals5.readPlanFileUtf8(filePath), false);
|
|
2468
|
+
} catch (error2) {
|
|
2469
|
+
throw new PlanWriteVerificationError(`PLAN_WRITE_VERIFICATION_FAILED: plan.json read-back could not be read (${error2 instanceof Error ? error2.message : String(error2)})`);
|
|
2470
|
+
}
|
|
2471
|
+
for (let attempt = 0;content === null && attempt < PLAN_WRITE_VERIFY_READ_RETRIES; attempt++) {
|
|
2472
|
+
await new Promise((resolve3) => setTimeout(resolve3, PLAN_WRITE_VERIFY_READ_BACKOFF_MS * (attempt + 1)));
|
|
2473
|
+
try {
|
|
2474
|
+
content = await readSwarmFileAsync(directory, "plan.json", undefined, (filePath) => _internals5.readPlanFileUtf8(filePath), false);
|
|
2475
|
+
} catch {}
|
|
2476
|
+
}
|
|
2477
|
+
if (content === null) {
|
|
2478
|
+
throw new PlanWriteVerificationError("PLAN_WRITE_VERIFICATION_FAILED: plan.json read-back returned no content after write");
|
|
2479
|
+
}
|
|
2480
|
+
let parsed;
|
|
2481
|
+
try {
|
|
2482
|
+
parsed = JSON.parse(content);
|
|
2483
|
+
} catch (error2) {
|
|
2484
|
+
throw new PlanWriteVerificationError(`PLAN_WRITE_VERIFICATION_FAILED: plan.json read-back did not parse (${error2 instanceof Error ? error2.message : String(error2)})`);
|
|
2485
|
+
}
|
|
2486
|
+
if (JSON.stringify(parsed) !== JSON.stringify(expected)) {
|
|
2487
|
+
throw new PlanWriteVerificationError("PLAN_WRITE_VERIFICATION_FAILED: plan.json read-back content differs from the projected plan");
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
async function appendMigrationProvenanceEvent(directory, plan) {
|
|
2491
|
+
try {
|
|
2492
|
+
await appendLedgerEvent(directory, {
|
|
2493
|
+
event_type: "plan_rebuilt",
|
|
2494
|
+
source: "load_plan_migration_from_md",
|
|
2495
|
+
plan_id: derivePlanId(plan),
|
|
2496
|
+
payload: {
|
|
2497
|
+
reason: "load_plan_migration_from_md",
|
|
2498
|
+
phases_count: plan.phases.length,
|
|
2499
|
+
tasks_count: plan.phases.reduce((sum, phase) => sum + phase.tasks.length, 0)
|
|
2500
|
+
}
|
|
2501
|
+
});
|
|
2502
|
+
} catch (error2) {
|
|
2503
|
+
warn(`[loadPlan] Markdown-migration provenance event append failed (plan remains migrated): ${error2 instanceof Error ? error2.message : String(error2)}`);
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2406
2506
|
async function savePlan(directory, plan, options) {
|
|
2407
2507
|
if (directory === null || directory === undefined || typeof directory !== "string" || directory.trim().length === 0) {
|
|
2408
2508
|
throw new Error(`Invalid directory: directory must be a non-empty string`);
|
|
@@ -2414,11 +2514,10 @@ async function savePlan(directory, plan, options) {
|
|
|
2414
2514
|
throw new PlanConcurrentModificationError(`Plan write blocked: plan.json is locked by ${lockResult.existing?.agent ?? "another agent"} (task: ${lockResult.existing?.taskId ?? "unknown"})`);
|
|
2415
2515
|
}
|
|
2416
2516
|
try {
|
|
2417
|
-
await savePlan(directory, plan, {
|
|
2517
|
+
return await savePlan(directory, plan, {
|
|
2418
2518
|
...options,
|
|
2419
2519
|
planLockAlreadyHeld: true
|
|
2420
2520
|
});
|
|
2421
|
-
return;
|
|
2422
2521
|
} finally {
|
|
2423
2522
|
if (lockResult.lock._release) {
|
|
2424
2523
|
await lockResult.lock._release().catch(() => {});
|
|
@@ -2491,7 +2590,7 @@ async function savePlan(directory, plan, options) {
|
|
|
2491
2590
|
throw new PlanConcurrentModificationError("RECONCILE_LEDGER_PROJECTION_STALE: the ledger identity or tail changed before the recovery snapshot could be appended.");
|
|
2492
2591
|
}
|
|
2493
2592
|
try {
|
|
2494
|
-
const integrity = await readLedgerEventsWithIntegrity(directory);
|
|
2593
|
+
const integrity = await _internals5.readLedgerEventsWithIntegrity(directory);
|
|
2495
2594
|
if (integrity.truncated) {
|
|
2496
2595
|
await replaceTruncatedLedgerWithRecoveryRoot(directory, validated, {
|
|
2497
2596
|
seq: expected.expectedSeq,
|
|
@@ -2633,7 +2732,7 @@ async function savePlan(directory, plan, options) {
|
|
|
2633
2732
|
}
|
|
2634
2733
|
}
|
|
2635
2734
|
const ledgerStatusTaskIds = collectLedgerStatusTaskIds(await readLedgerEvents(directory));
|
|
2636
|
-
const replayedBeforeProjection = await replayFromLedger(directory);
|
|
2735
|
+
const replayedBeforeProjection = await _internals5.replayFromLedger(directory);
|
|
2637
2736
|
const projectionCandidate = replayedBeforeProjection ? mergeStatusesTakingPrecedence(validated, replayedBeforeProjection, ledgerStatusTaskIds) : validated;
|
|
2638
2737
|
if (replayedBeforeProjection && computePlanLedgerHash(replayedBeforeProjection) !== computePlanLedgerHash(projectionCandidate)) {
|
|
2639
2738
|
options?.preCommitCheck?.();
|
|
@@ -2664,6 +2763,7 @@ async function savePlan(directory, plan, options) {
|
|
|
2664
2763
|
} catch {}
|
|
2665
2764
|
}
|
|
2666
2765
|
invalidateCachedArtifact(planPath);
|
|
2766
|
+
await _internals5.verifyWrittenPlanJson(directory, projectedPlan);
|
|
2667
2767
|
try {
|
|
2668
2768
|
const markerPath = path4.join(swarmDir, ".plan-write-marker");
|
|
2669
2769
|
const inProgressMarker = JSON.stringify({
|
|
@@ -2675,6 +2775,7 @@ async function savePlan(directory, plan, options) {
|
|
|
2675
2775
|
});
|
|
2676
2776
|
await bunWrite(markerPath, inProgressMarker);
|
|
2677
2777
|
} catch {}
|
|
2778
|
+
let mdWriteError;
|
|
2678
2779
|
try {
|
|
2679
2780
|
const contentHash = computePlanContentHash(projectedPlan);
|
|
2680
2781
|
const markdown = derivePlanMarkdown(projectedPlan);
|
|
@@ -2693,6 +2794,7 @@ ${markdown}`;
|
|
|
2693
2794
|
invalidateCachedArtifact(mdPath);
|
|
2694
2795
|
} catch (mdError) {
|
|
2695
2796
|
const message = mdError instanceof Error ? mdError.message : String(mdError);
|
|
2797
|
+
mdWriteError = message;
|
|
2696
2798
|
warn(`[savePlan] plan.md write failed (non-fatal, plan.json is authoritative): ${message}`);
|
|
2697
2799
|
try {
|
|
2698
2800
|
emit("plan_md_write_failed", {
|
|
@@ -2745,6 +2847,14 @@ ${markdown}`;
|
|
|
2745
2847
|
warn(`[savePlan] task checkpoint receipt lifecycle sync failed (plan remains authoritative): ${receiptError instanceof Error ? receiptError.message : String(receiptError)}`);
|
|
2746
2848
|
}
|
|
2747
2849
|
}
|
|
2850
|
+
if (mdWriteError !== undefined) {
|
|
2851
|
+
return {
|
|
2852
|
+
durability: "incomplete",
|
|
2853
|
+
degraded_surfaces: ["plan.md"],
|
|
2854
|
+
md_write_error: mdWriteError
|
|
2855
|
+
};
|
|
2856
|
+
}
|
|
2857
|
+
return { durability: "complete", degraded_surfaces: [] };
|
|
2748
2858
|
}
|
|
2749
2859
|
async function rebuildPlan(directory, plan, options) {
|
|
2750
2860
|
assertProjectRoot(directory);
|
|
@@ -811,7 +811,7 @@ var init_tool_metadata = __esm(() => {
|
|
|
811
811
|
agents: ["architect"]
|
|
812
812
|
},
|
|
813
813
|
dispatch_lanes_async: {
|
|
814
|
-
description: "launch read-only advisory lanes non-blockingly and return a batch id plus lane session handles immediately
|
|
814
|
+
description: "launch read-only advisory lanes non-blockingly and return a batch id plus lane session handles immediately; each lane agent must be a registered generated agent name (unregistered bare roles are refused on multi-swarm hosts); launch_timeout_ms is only a promptAsync acceptance budget, not a lane runtime timeout; poll incrementally with collect_lane_results (wait omitted), or join with wait: true for all results",
|
|
815
815
|
agents: ["architect"]
|
|
816
816
|
},
|
|
817
817
|
collect_lane_results: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
authorizeCuration
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-hydccmm1.js";
|
|
5
5
|
import {
|
|
6
6
|
findNearDuplicate,
|
|
7
7
|
inferTags,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
resolveSwarmKnowledgePath,
|
|
10
10
|
resolveSwarmRejectedPath,
|
|
11
11
|
transactKnowledge
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-mq1z10v1.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveKnowledgeStoreDir
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-jzrx2sx2.js";
|
|
16
16
|
import {
|
|
17
17
|
atomicWriteFile
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-yf1mvexg.js";
|
|
19
19
|
import {
|
|
20
20
|
require_proper_lockfile
|
|
21
21
|
} from "./index-7g4c7s5r.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
_internals,
|
|
4
4
|
resolveWorktreeIsolationConfig
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-vbgpxbmm.js";
|
|
6
6
|
import {
|
|
7
7
|
ApprovalEvidenceSchema,
|
|
8
8
|
BaseEvidenceSchema,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
loadPluginConfigWithMeta,
|
|
45
45
|
loadPluginConfigWithMetaAsync,
|
|
46
46
|
resetConfigAdvisoryDedup
|
|
47
|
-
} from "./index-
|
|
47
|
+
} from "./index-0tmrdj9m.js";
|
|
48
48
|
import"./index-0mhftbpp.js";
|
|
49
49
|
import"./index-a1w58b47.js";
|
|
50
50
|
import {
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
TurboConfigSchema,
|
|
71
71
|
WorktreeIsolationConfigSchema,
|
|
72
72
|
resolveAutoReviewConfig
|
|
73
|
-
} from "./index-
|
|
73
|
+
} from "./index-byf75cte.js";
|
|
74
74
|
import {
|
|
75
75
|
ALL_AGENT_NAMES,
|
|
76
76
|
ALL_SUBAGENT_NAMES,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
QA_AGENTS,
|
|
81
81
|
isQAAgent,
|
|
82
82
|
isSubagent
|
|
83
|
-
} from "./index-
|
|
83
|
+
} from "./index-depxc452.js";
|
|
84
84
|
import"./index-bk5tah7q.js";
|
|
85
85
|
import"./index-gknz3bv1.js";
|
|
86
86
|
import"./index-zpsr8rpc.js";
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
detectWindowsWrites,
|
|
15
15
|
getSharedClassifierGuardrailBlock,
|
|
16
16
|
resolveWriteTargets
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-4xszpb54.js";
|
|
18
18
|
import {
|
|
19
19
|
checkFileAuthority,
|
|
20
20
|
classifyFile,
|
|
21
21
|
isInDeclaredScope,
|
|
22
22
|
redactPath,
|
|
23
23
|
redactShellCommand
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-5z71h1j4.js";
|
|
25
25
|
|
|
26
26
|
// src/services/guardrail-explain-service.ts
|
|
27
27
|
import path from "path";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
pseudonymousRef,
|
|
4
4
|
resolveLineageSalt,
|
|
5
5
|
telemetry
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-jmn35na4.js";
|
|
7
7
|
import {
|
|
8
8
|
atomicWriteSwarmFile
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-ws3ggk1h.js";
|
|
10
10
|
import {
|
|
11
11
|
canonicalRootKeyFresh
|
|
12
12
|
} from "./index-1xnse449.js";
|
|
@@ -722,7 +722,7 @@ var CATALOG_SOURCE = [
|
|
|
722
722
|
category: "plan",
|
|
723
723
|
severity: "notice",
|
|
724
724
|
privacyClass: "operational",
|
|
725
|
-
producer: "src/plan/manager.ts:
|
|
725
|
+
producer: "src/plan/manager.ts:358",
|
|
726
726
|
consumers: NO_CONSUMERS,
|
|
727
727
|
futureOwnerIssue: ISSUE_SINK,
|
|
728
728
|
retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
|
|
@@ -735,7 +735,7 @@ var CATALOG_SOURCE = [
|
|
|
735
735
|
category: "plan",
|
|
736
736
|
severity: "warning",
|
|
737
737
|
privacyClass: "sensitive",
|
|
738
|
-
producer: "src/plan/manager.ts:
|
|
738
|
+
producer: "src/plan/manager.ts:2056",
|
|
739
739
|
consumers: NO_CONSUMERS,
|
|
740
740
|
futureOwnerIssue: ISSUE_SINK,
|
|
741
741
|
retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
|
|
@@ -748,7 +748,7 @@ var CATALOG_SOURCE = [
|
|
|
748
748
|
category: "plan",
|
|
749
749
|
severity: "error",
|
|
750
750
|
privacyClass: "sensitive",
|
|
751
|
-
producer: "src/plan/ledger.ts:
|
|
751
|
+
producer: "src/plan/ledger.ts:1594",
|
|
752
752
|
consumers: NO_CONSUMERS,
|
|
753
753
|
futureOwnerIssue: ISSUE_SINK,
|
|
754
754
|
retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-ma38q4rf.js";
|
|
5
5
|
import {
|
|
6
6
|
bunWrite
|
|
7
7
|
} from "./index-2s7dvzff.js";
|
|
@@ -18,21 +18,21 @@ import {
|
|
|
18
18
|
releaseCoordinationLease,
|
|
19
19
|
transitionCoordinationState,
|
|
20
20
|
withCoordinationTransaction
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-9p00xent.js";
|
|
22
22
|
import {
|
|
23
23
|
getProjectDb,
|
|
24
24
|
projectDbExists
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-bdqefjxg.js";
|
|
26
26
|
import {
|
|
27
27
|
observeDelegationLedgerPressure
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-gdrdtbw6.js";
|
|
29
29
|
import {
|
|
30
30
|
EvidenceLockTimeoutError,
|
|
31
31
|
withEvidenceLock
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-yf1mvexg.js";
|
|
33
33
|
import {
|
|
34
34
|
telemetry
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-jmn35na4.js";
|
|
36
36
|
import {
|
|
37
37
|
canonicalRootKeyFresh,
|
|
38
38
|
sameProjectRoot
|
|
@@ -4641,7 +4641,7 @@ async function reconcileLegacyCoderSettlements(directory, maxRecords, onReconcil
|
|
|
4641
4641
|
const candidates = readDelegations(directory).filter((record) => record.normalizedAgent === "coder" && Boolean(record.legacyCoderSettlementTransfer) && Boolean(record.terminalResult)).slice(0, maxRecords);
|
|
4642
4642
|
if (candidates.length === 0)
|
|
4643
4643
|
return 0;
|
|
4644
|
-
const { transferCoderSettlementToBackground } = await import("./coder-settlement-
|
|
4644
|
+
const { transferCoderSettlementToBackground } = await import("./coder-settlement-trba7st8.js");
|
|
4645
4645
|
let transferred = 0;
|
|
4646
4646
|
for (const record of candidates) {
|
|
4647
4647
|
try {
|