opencode-swarm 7.164.6 → 7.164.7
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 +1 -1
- package/dist/background/pending-delegations.d.ts +3 -0
- package/dist/background/pr-subscriptions.d.ts +1 -8
- package/dist/cli/{coder-settlement-6qgvzx40.js → coder-settlement-p8wwmtnn.js} +14 -14
- package/dist/cli/{config-doctor-d1cbh67h.js → config-doctor-wxf488mw.js} +5 -3
- package/dist/cli/{core-g0cvvj3b.js → core-671ybpbt.js} +2 -2
- package/dist/cli/{curation-policy-7f8x9yg6.js → curation-policy-de7emfqc.js} +7 -6
- package/dist/cli/{curator-drift-0r0scc8r.js → curator-drift-nvxv8xkk.js} +7 -5
- package/dist/cli/{curator-q3qn89wn.js → curator-eaz5rj6k.js} +39 -37
- package/dist/cli/curator-llm-factory-swzyfnh6.js +68 -0
- package/dist/cli/{dispatch-q4v8x2pk.js → dispatch-dqybvj8v.js} +10 -6
- package/dist/cli/{evidence-summary-service-3meyb8rc.js → evidence-summary-service-deqsc8hj.js} +19 -16
- package/dist/cli/{gate-evidence-mhc0w7vp.js → gate-evidence-mafg71qb.js} +14 -8
- package/dist/cli/guardrail-explain-ygq7cx9w.js +69 -0
- package/dist/cli/{guardrail-log-0nd1eqvz.js → guardrail-log-k3w9dq6x.js} +9 -8
- package/dist/cli/{guardrail-reset-mzeyd6jh.js → guardrail-reset-ae2step4.js} +39 -37
- package/dist/cli/hive-promoter-a4cs5sbr.js +83 -0
- package/dist/cli/{index-x6zyc38w.js → index-0zjwnbze.js} +1 -1
- package/dist/cli/{index-qdbgc16x.js → index-1ekzd5wf.js} +20 -12
- package/dist/cli/{index-fxxja498.js → index-2czt53wz.js} +1 -1
- package/dist/cli/{index-g5714mpv.js → index-388sxv1b.js} +17 -8
- package/dist/cli/{index-kvb4dwgf.js → index-3kgg2n6z.js} +12 -6
- package/dist/cli/{index-pvp5tnn2.js → index-3sv8t7ca.js} +2 -2
- package/dist/cli/{index-hdapetg1.js → index-46yrz972.js} +3 -3
- package/dist/cli/{index-zypacgjc.js → index-4vx89ymn.js} +5 -5
- package/dist/cli/{index-6f9yvd67.js → index-581bcqp9.js} +2 -2
- package/dist/cli/{index-gwg7a00b.js → index-63enf73z.js} +20 -15
- package/dist/cli/index-7qefgq4j.js +71 -0
- package/dist/cli/{index-5p1tzpwh.js → index-8ck1jkhd.js} +3 -2
- package/dist/cli/{index-zfwd65c2.js → index-8ntf8jnj.js} +19 -18
- package/dist/cli/{index-m1nrd3yd.js → index-8psybzzf.js} +1 -1
- package/dist/cli/{index-2c3np82d.js → index-8tqqmsav.js} +1 -1
- package/dist/cli/{index-tegp2mny.js → index-93znbdam.js} +9 -5
- package/dist/cli/{index-x76mprg2.js → index-9qkytpwa.js} +185 -376
- package/dist/cli/{index-p56xc59p.js → index-9ydhzegh.js} +28 -17
- package/dist/cli/{index-935ww10s.js → index-bvjwmmdc.js} +1233 -1190
- package/dist/cli/{index-ty3vtqe2.js → index-c4j9sjcs.js} +4 -4
- package/dist/cli/index-cw912re7.js +200 -0
- package/dist/cli/{index-j3hsjynw.js → index-fq1wfsmw.js} +100 -97
- package/dist/cli/{index-59hvr3f4.js → index-gm65h7bh.js} +9 -6
- package/dist/cli/{index-jzvrvdmr.js → index-h3k3rgyr.js} +4 -4
- package/dist/cli/{index-12xzj0hm.js → index-jkwfajh1.js} +4 -4
- package/dist/cli/{index-1dz8hv7p.js → index-kvq1e82k.js} +3 -3
- package/dist/cli/{index-ze5zyv28.js → index-mr3h3sm5.js} +2 -2
- package/dist/cli/{index-rysxqae0.js → index-rey1tzcw.js} +7 -7
- package/dist/cli/index-ry16d01s.js +107 -0
- package/dist/cli/{index-ay9cr8tr.js → index-ry4mwbc2.js} +1 -1
- package/dist/cli/{index-b0m3efpf.js → index-sxxh4ams.js} +2 -2
- package/dist/cli/{index-cyhw0der.js → index-t1qzjhnj.js} +13 -13
- package/dist/cli/{index-j645xpsm.js → index-v1fj9exz.js} +12 -5
- package/dist/cli/{index-3f7hqtgg.js → index-w3gtqey0.js} +4 -1
- package/dist/cli/{index-9qvmsyab.js → index-wgqeqy68.js} +2 -2
- package/dist/cli/{index-g94qqwnz.js → index-x2t2tbm2.js} +2 -2
- package/dist/cli/{index-zjg5ajf5.js → index-x3qzt684.js} +71 -47
- package/dist/cli/{index-t1nkr7cz.js → index-xc3q62ev.js} +2 -2
- package/dist/cli/{index-ew99d4y6.js → index-xy59dnvq.js} +1 -1
- package/dist/cli/{index-4k16cz8r.js → index-y75xd50f.js} +36 -27
- package/dist/cli/{index-7v3bb0h3.js → index-yzn1fm9a.js} +1 -1
- package/dist/cli/{index-yh8wxegw.js → index-zg34ngdf.js} +21 -11
- package/dist/cli/{index-y4z0rhsa.js → index-zg8tvjb0.js} +41 -39
- package/dist/cli/index.js +39 -37
- package/dist/cli/{knowledge-escalator-aca0nhqg.js → knowledge-escalator-t532h2ym.js} +15 -14
- package/dist/cli/{knowledge-events-n5t313ht.js → knowledge-events-hdtc0cxe.js} +13 -12
- package/dist/cli/{knowledge-link-8ea4ksda.js → knowledge-link-hhnmc4g1.js} +6 -5
- package/dist/cli/{knowledge-store-j97ejf6a.js → knowledge-store-45jadhmb.js} +7 -6
- package/dist/cli/{knowledge-validator-01evhydg.js → knowledge-validator-5e6qbq6h.js} +9 -8
- package/dist/cli/{model-preflight-pmnbfzjv.js → model-preflight-bq035tfh.js} +1 -1
- package/dist/cli/{pending-delegations-w73abdk3.js → pending-delegations-z0crvst3.js} +7 -7
- package/dist/cli/{pr-subscriptions-05dzvavk.js → pr-subscriptions-73fs8y3n.js} +7 -6
- package/dist/cli/{pr-workflow-gate-t0tnkx5f.js → pr-workflow-gate-rpdts7wy.js} +39 -37
- package/dist/cli/{runner-fh7t0mn9.js → runner-5qqh83e2.js} +6 -6
- package/dist/cli/{scan-cursor-63zx2qd8.js → scan-cursor-t75qznf3.js} +8 -7
- package/dist/cli/{schema-t1scx08g.js → schema-8dfjsrk6.js} +2 -2
- package/dist/cli/{scope-persistence-1a5qmchf.js → scope-persistence-zfmz4sws.js} +12 -10
- package/dist/cli/{skill-generator-7werbwgv.js → skill-generator-psdb10jw.js} +17 -16
- package/dist/cli/{telemetry-j14cj552.js → telemetry-85gxedng.js} +1 -1
- package/dist/cli/{workspace-snapshot-yq0tc49d.js → workspace-snapshot-eh18vgkn.js} +2 -1
- package/dist/cli/{worktree-collision-ownership-wzdzky33.js → worktree-collision-ownership-xrqssqzd.js} +12 -15
- package/dist/cli/{worktree-isolation-m02ay3kg.js → worktree-isolation-s9m3bgah.js} +39 -37
- package/dist/db/canonical-project.d.ts +10 -3
- package/dist/db/project-db.d.ts +4 -0
- package/dist/evidence/task-gate-repair.d.ts +1 -1
- package/dist/gate-evidence.d.ts +19 -1
- package/dist/index.js +581 -581
- package/dist/plan/ledger.d.ts +2 -0
- package/dist/tools/pre-check-batch.d.ts +1 -1
- package/dist/utils/canonical-root.d.ts +21 -1
- package/dist/utils/filesystem-identity.d.ts +59 -0
- package/package.json +2 -1
- package/dist/cli/curator-llm-factory-dw7md4nr.js +0 -66
- package/dist/cli/guardrail-explain-6cbszhw1.js +0 -67
- package/dist/cli/hive-promoter-w7g879cm.js +0 -81
- package/dist/cli/index-ddszzne4.js +0 -42
|
@@ -11,16 +11,16 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
init_schema,
|
|
13
13
|
stripKnownSwarmPrefix
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-8ck1jkhd.js";
|
|
15
15
|
import {
|
|
16
16
|
observeStoreHealth
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-9ydhzegh.js";
|
|
18
18
|
import {
|
|
19
19
|
init_constants
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-8psybzzf.js";
|
|
21
21
|
import {
|
|
22
22
|
telemetry
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-kvq1e82k.js";
|
|
24
24
|
import {
|
|
25
25
|
init_logger,
|
|
26
26
|
warn
|
|
@@ -665,7 +665,7 @@ var CATALOG_SOURCE = [
|
|
|
665
665
|
category: "plan",
|
|
666
666
|
severity: "notice",
|
|
667
667
|
privacyClass: "operational",
|
|
668
|
-
producer: "src/plan/manager.ts:
|
|
668
|
+
producer: "src/plan/manager.ts:346",
|
|
669
669
|
consumers: NO_CONSUMERS,
|
|
670
670
|
futureOwnerIssue: ISSUE_SINK,
|
|
671
671
|
retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
|
|
@@ -678,7 +678,7 @@ var CATALOG_SOURCE = [
|
|
|
678
678
|
category: "plan",
|
|
679
679
|
severity: "warning",
|
|
680
680
|
privacyClass: "sensitive",
|
|
681
|
-
producer: "src/plan/manager.ts:
|
|
681
|
+
producer: "src/plan/manager.ts:1854",
|
|
682
682
|
consumers: NO_CONSUMERS,
|
|
683
683
|
futureOwnerIssue: ISSUE_SINK,
|
|
684
684
|
retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
|
|
@@ -691,7 +691,7 @@ var CATALOG_SOURCE = [
|
|
|
691
691
|
category: "plan",
|
|
692
692
|
severity: "error",
|
|
693
693
|
privacyClass: "sensitive",
|
|
694
|
-
producer: "src/plan/ledger.ts:
|
|
694
|
+
producer: "src/plan/ledger.ts:1176",
|
|
695
695
|
consumers: NO_CONSUMERS,
|
|
696
696
|
futureOwnerIssue: ISSUE_SINK,
|
|
697
697
|
retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
withEvidenceLock
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-2czt53wz.js";
|
|
5
5
|
import {
|
|
6
6
|
atomicWriteFileAnyRoot
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-t1qzjhnj.js";
|
|
8
8
|
|
|
9
9
|
// src/evidence/task-file.ts
|
|
10
10
|
import * as path from "path";
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
} from "./index-ae75rja9.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveKnowledgeStoreDir
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-93znbdam.js";
|
|
10
10
|
import {
|
|
11
11
|
atomicWriteFile
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-mr3h3sm5.js";
|
|
13
13
|
import {
|
|
14
14
|
init_knowledge_types,
|
|
15
15
|
isActiveStatus
|
|
16
16
|
} from "./index-bk5tah7q.js";
|
|
17
17
|
import {
|
|
18
18
|
readCachedParsedFile
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-t1qzjhnj.js";
|
|
20
20
|
import {
|
|
21
21
|
require_proper_lockfile
|
|
22
22
|
} from "./index-7g4c7s5r.js";
|
|
@@ -713,7 +713,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
713
713
|
const {
|
|
714
714
|
readAuthoritativeKnowledgeCounterRollups,
|
|
715
715
|
effectiveRetrievalOutcomes
|
|
716
|
-
} = await import("./knowledge-events-
|
|
716
|
+
} = await import("./knowledge-events-hdtc0cxe.js");
|
|
717
717
|
const rollups = await readAuthoritativeKnowledgeCounterRollups(directory);
|
|
718
718
|
const flagIds = new Set;
|
|
719
719
|
for (const e of atFloor) {
|
|
@@ -780,11 +780,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
780
780
|
});
|
|
781
781
|
}
|
|
782
782
|
if (action === "quarantine" && toQuarantine.length > 0) {
|
|
783
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
784
|
-
const { KnowledgeConfigSchema } = await import("./schema-
|
|
783
|
+
const { quarantineEntry } = await import("./knowledge-validator-5e6qbq6h.js");
|
|
784
|
+
const { KnowledgeConfigSchema } = await import("./schema-8dfjsrk6.js");
|
|
785
785
|
let config;
|
|
786
786
|
try {
|
|
787
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
787
|
+
const { loadPluginConfigWithMeta } = await import("./index-c4j9sjcs.js");
|
|
788
788
|
const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
|
|
789
789
|
config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
|
|
790
790
|
} catch {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/utils/filesystem-identity.ts
|
|
3
|
+
import * as fsSync from "fs";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
var _internals = {
|
|
6
|
+
realpathSyncNative: fsSync.realpathSync.native,
|
|
7
|
+
realpathSync: fsSync.realpathSync,
|
|
8
|
+
lstatSync: fsSync.lstatSync,
|
|
9
|
+
platform: () => process.platform
|
|
10
|
+
};
|
|
11
|
+
function normalizeIdentityPath(resolved) {
|
|
12
|
+
const normalized = _internals.platform() === "win32" ? path.win32.normalize(resolved) : path.posix.normalize(resolved);
|
|
13
|
+
return _internals.platform() === "win32" ? normalized.replaceAll("\\", "/").toLowerCase() : normalized;
|
|
14
|
+
}
|
|
15
|
+
function canonicalExistingFilesystemPath(entryPath) {
|
|
16
|
+
if (typeof entryPath !== "string")
|
|
17
|
+
return null;
|
|
18
|
+
const resolvedInput = path.resolve(entryPath);
|
|
19
|
+
try {
|
|
20
|
+
return normalizeIdentityPath(_internals.realpathSyncNative(resolvedInput));
|
|
21
|
+
} catch {
|
|
22
|
+
try {
|
|
23
|
+
return normalizeIdentityPath(_internals.realpathSync(resolvedInput));
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function legacyCanonicalExistingFilesystemPath(entryPath) {
|
|
30
|
+
if (typeof entryPath !== "string")
|
|
31
|
+
return null;
|
|
32
|
+
try {
|
|
33
|
+
return normalizeIdentityPath(_internals.realpathSync(path.resolve(entryPath)));
|
|
34
|
+
} catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function appendLinkedAncestorWitnesses(witnesses, startPath) {
|
|
39
|
+
let probe = path.resolve(startPath);
|
|
40
|
+
for (let depth = 0;depth < 4096; depth++) {
|
|
41
|
+
const parent = path.dirname(probe);
|
|
42
|
+
if (parent === probe)
|
|
43
|
+
return;
|
|
44
|
+
probe = parent;
|
|
45
|
+
try {
|
|
46
|
+
if (!_internals.lstatSync(probe).isSymbolicLink())
|
|
47
|
+
continue;
|
|
48
|
+
} catch {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const canonical = canonicalExistingFilesystemPath(probe);
|
|
52
|
+
if (canonical !== null) {
|
|
53
|
+
witnesses.push({ lexicalPath: probe, canonicalPath: canonical });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function filesystemIdentityWitnesses(entryPath) {
|
|
58
|
+
const lexicalPath = path.resolve(entryPath);
|
|
59
|
+
const canonicalPath = canonicalExistingFilesystemPath(lexicalPath);
|
|
60
|
+
if (canonicalPath === null)
|
|
61
|
+
return [];
|
|
62
|
+
const witnesses = [{ lexicalPath, canonicalPath }];
|
|
63
|
+
appendLinkedAncestorWitnesses(witnesses, lexicalPath);
|
|
64
|
+
return witnesses;
|
|
65
|
+
}
|
|
66
|
+
function canonicalPathFromExistingAncestor(entryPath) {
|
|
67
|
+
let probe = path.resolve(entryPath);
|
|
68
|
+
const tail = [];
|
|
69
|
+
for (let depth = 0;depth < 4096; depth++) {
|
|
70
|
+
let stat;
|
|
71
|
+
try {
|
|
72
|
+
stat = _internals.lstatSync(probe);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
const code = error && typeof error === "object" && "code" in error ? String(error.code) : undefined;
|
|
75
|
+
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
76
|
+
return null;
|
|
77
|
+
const parent = path.dirname(probe);
|
|
78
|
+
if (parent === probe)
|
|
79
|
+
return null;
|
|
80
|
+
tail.unshift(path.basename(probe));
|
|
81
|
+
probe = parent;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const canonicalAncestor = canonicalExistingFilesystemPath(probe);
|
|
85
|
+
if (canonicalAncestor === null)
|
|
86
|
+
return null;
|
|
87
|
+
let existingAncestorIsLink = false;
|
|
88
|
+
existingAncestorIsLink = stat.isSymbolicLink();
|
|
89
|
+
return {
|
|
90
|
+
canonicalPath: normalizeIdentityPath(path.join(canonicalAncestor, ...tail)),
|
|
91
|
+
existingAncestor: probe,
|
|
92
|
+
existingAncestorIsLink,
|
|
93
|
+
identityWitnesses: filesystemIdentityWitnesses(probe)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
function canonicalPathForFutureIo(entryPath) {
|
|
99
|
+
return canonicalExistingFilesystemPath(entryPath) ?? canonicalPathFromExistingAncestor(entryPath)?.canonicalPath ?? null;
|
|
100
|
+
}
|
|
101
|
+
function sameExistingFilesystemPath(a, b) {
|
|
102
|
+
const canonicalA = canonicalExistingFilesystemPath(a);
|
|
103
|
+
const canonicalB = canonicalExistingFilesystemPath(b);
|
|
104
|
+
return canonicalA !== null && canonicalB !== null && canonicalA === canonicalB;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { canonicalExistingFilesystemPath, legacyCanonicalExistingFilesystemPath, filesystemIdentityWitnesses, canonicalPathFromExistingAncestor, canonicalPathForFutureIo, sameExistingFilesystemPath };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-8tqqmsav.js";
|
|
5
5
|
import {
|
|
6
6
|
atomicWriteSwarmFileSync
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-t1qzjhnj.js";
|
|
8
8
|
|
|
9
9
|
// src/hooks/delegation-gate/worktree-provisioning-owner.ts
|
|
10
10
|
import { createHash } from "crypto";
|
|
@@ -177,7 +177,7 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
177
177
|
"src/commands/handoff.ts:48 (pre-#2035)",
|
|
178
178
|
"src/commands/handoff.ts:79 (pre-#2035)",
|
|
179
179
|
"src/memory/local-jsonl-provider.ts:1288",
|
|
180
|
-
"src/config/bundled-skills.ts:
|
|
180
|
+
"src/config/bundled-skills.ts:251"
|
|
181
181
|
]
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -213,16 +213,16 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
213
213
|
"src/evidence/task-file.ts:67 (pre-#2035)",
|
|
214
214
|
"src/scope/scope-persistence.ts:2304 (pre-#2035)",
|
|
215
215
|
"src/scope/scope-persistence.ts:2318 (pre-#2035)",
|
|
216
|
-
"src/plan/manager.ts:
|
|
217
|
-
"src/plan/manager.ts:
|
|
218
|
-
"src/plan/manager.ts:
|
|
216
|
+
"src/plan/manager.ts:630",
|
|
217
|
+
"src/plan/manager.ts:1786",
|
|
218
|
+
"src/plan/manager.ts:1832",
|
|
219
219
|
"src/review/evidence.ts:175",
|
|
220
220
|
"src/turbo/lean/evidence.ts:182",
|
|
221
221
|
"src/summaries/manager.ts:122",
|
|
222
222
|
"src/evidence/manager.ts:288",
|
|
223
223
|
"src/evidence/manager.ts:456",
|
|
224
224
|
"src/tools/sast-baseline.ts:199",
|
|
225
|
-
"src/tools/repo-graph/storage.ts:
|
|
225
|
+
"src/tools/repo-graph/storage.ts:494",
|
|
226
226
|
"src/memory/reflection-service.ts:547 (pre-#2035)",
|
|
227
227
|
"src/hooks/review-receipt.ts:608",
|
|
228
228
|
"src/hooks/review-receipt.ts:674",
|
|
@@ -231,12 +231,12 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
231
231
|
"src/evidence/phase-participation.ts:303 (pre-#2035)",
|
|
232
232
|
"src/turbo/lean/integration.ts:426",
|
|
233
233
|
"src/turbo/lean/reviewer.ts:403",
|
|
234
|
-
"src/plan/ledger.ts:
|
|
234
|
+
"src/plan/ledger.ts:746",
|
|
235
235
|
"src/services/synonym-map.ts:389",
|
|
236
236
|
"src/services/skill-optimizer/store.ts:340",
|
|
237
237
|
"src/services/skill-optimizer/store.ts:503",
|
|
238
|
-
"src/turbo/epic/state.ts:
|
|
239
|
-
"src/turbo/epic/calibration.ts:
|
|
238
|
+
"src/turbo/epic/state.ts:182",
|
|
239
|
+
"src/turbo/epic/calibration.ts:202",
|
|
240
240
|
"src/commands/archive-sqlite.ts:318",
|
|
241
241
|
"src/memory/jsonl-migration.ts:161"
|
|
242
242
|
],
|
|
@@ -250,7 +250,7 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
250
250
|
quarantineEligible: true,
|
|
251
251
|
parsesTarget: true,
|
|
252
252
|
producers: [
|
|
253
|
-
"src/turbo/lean/state.ts:
|
|
253
|
+
"src/turbo/lean/state.ts:251",
|
|
254
254
|
"src/turbo/lean/recovery.ts:175",
|
|
255
255
|
"src/hooks/delegation-gate/worktree-merge-status.ts:110"
|
|
256
256
|
]
|
|
@@ -270,7 +270,7 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
270
270
|
"src/tools/spec-write.ts:98",
|
|
271
271
|
"src/sdd/effective-spec.ts:1149",
|
|
272
272
|
"src/background/lane-output-store.ts:353",
|
|
273
|
-
"src/background/pending-delegations.ts:
|
|
273
|
+
"src/background/pending-delegations.ts:1117",
|
|
274
274
|
"src/background/delegation-health.ts:391",
|
|
275
275
|
"src/tools/submit-phase-council-verdicts.ts:458",
|
|
276
276
|
"src/summaries/store.ts:46 (pre-#2035)"
|
|
@@ -340,7 +340,7 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
340
340
|
token: "instance",
|
|
341
341
|
quarantineEligible: true,
|
|
342
342
|
parsesTarget: true,
|
|
343
|
-
producers: ["src/plan/manager.ts:
|
|
343
|
+
producers: ["src/plan/manager.ts:1972", "src/plan/manager.ts:2161"],
|
|
344
344
|
note: "plan-durability (invariant 5) fd-write paths; grammars registered, writers unchanged in this PR"
|
|
345
345
|
},
|
|
346
346
|
{
|
|
@@ -402,8 +402,8 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
402
402
|
"src/hooks/skill-usage-log.ts:1675",
|
|
403
403
|
"src/hooks/skill-usage-pending.ts:817",
|
|
404
404
|
"src/parallel/file-locks.ts:113",
|
|
405
|
-
"src/plan/ledger.ts:
|
|
406
|
-
"src/plan/ledger.ts:
|
|
405
|
+
"src/plan/ledger.ts:1344",
|
|
406
|
+
"src/plan/ledger.ts:1345"
|
|
407
407
|
],
|
|
408
408
|
note: "constant-name temps: reported when stale, never auto-quarantined. file-locks meta sidecars live under the scanner-skipped .swarm/locks/ subtree; the ledger reconcile temp embeds instance tokens but its .tmp-suffix shape maps here (conservatively report-only)"
|
|
409
409
|
}
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
PlanSchema,
|
|
5
5
|
TaskStatusSchema,
|
|
6
6
|
init_loader
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-xy59dnvq.js";
|
|
8
8
|
import {
|
|
9
9
|
assertProjectRoot,
|
|
10
10
|
withEvidenceLock
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-2czt53wz.js";
|
|
12
12
|
import {
|
|
13
13
|
emit
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-kvq1e82k.js";
|
|
15
15
|
import {
|
|
16
16
|
criticalWarn,
|
|
17
17
|
init_logger,
|
|
@@ -85,6 +85,12 @@ function getLedgerPath(directory) {
|
|
|
85
85
|
function getPlanJsonPath(directory) {
|
|
86
86
|
return path.join(directory, ".swarm", PLAN_JSON_FILENAME);
|
|
87
87
|
}
|
|
88
|
+
function compareCodeUnits(a, b) {
|
|
89
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
90
|
+
}
|
|
91
|
+
function readLedgerDirectory(directory) {
|
|
92
|
+
return fs.readdirSync(directory);
|
|
93
|
+
}
|
|
88
94
|
function asRecord(value) {
|
|
89
95
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
90
96
|
return value;
|
|
@@ -619,7 +625,7 @@ async function replaceTruncatedLedgerWithRecoveryRoot(directory, plan, expected)
|
|
|
619
625
|
let archiveName = `plan-ledger.reconcile-archive.${Date.now()}.${Math.floor(Math.random() * 1e9)}${archiveSuffix}`;
|
|
620
626
|
let archivePath = path.join(swarmDir, archiveName);
|
|
621
627
|
let archiveNeedsWrite = true;
|
|
622
|
-
for (const candidate of
|
|
628
|
+
for (const candidate of _internals.readLedgerDirectory(swarmDir).sort(compareCodeUnits)) {
|
|
623
629
|
if (!candidate.startsWith("plan-ledger.reconcile-archive.") || !candidate.endsWith(archiveSuffix)) {
|
|
624
630
|
continue;
|
|
625
631
|
}
|
|
@@ -877,7 +883,7 @@ async function quarantineLedgerSuffix(directory, badSuffix) {
|
|
|
877
883
|
const hash = crypto.createHash("sha256").update(badSuffix, "utf8").digest("hex").slice(0, 12);
|
|
878
884
|
const swarmDir = path.join(directory, ".swarm");
|
|
879
885
|
try {
|
|
880
|
-
const existing =
|
|
886
|
+
const existing = _internals.readLedgerDirectory(swarmDir).sort(compareCodeUnits).filter((name) => name.startsWith("plan-ledger.quarantine.") && name.endsWith(`.${hash}`));
|
|
881
887
|
for (const name of existing) {
|
|
882
888
|
const existingPath = path.join(swarmDir, name);
|
|
883
889
|
if (fs.readFileSync(existingPath, "utf8") === badSuffix) {
|
|
@@ -959,6 +965,7 @@ var _internals = {
|
|
|
959
965
|
getPlanJsonPath,
|
|
960
966
|
writeFileFsyncedThenRename,
|
|
961
967
|
fsyncRecoveryDirectory,
|
|
968
|
+
readLedgerDirectory,
|
|
962
969
|
randomUUID: () => crypto.randomUUID()
|
|
963
970
|
};
|
|
964
971
|
|
|
@@ -6,6 +6,9 @@ import {
|
|
|
6
6
|
init_git_executable,
|
|
7
7
|
resolveGitExecutable
|
|
8
8
|
} from "./index-9e6fdz2h.js";
|
|
9
|
+
import {
|
|
10
|
+
sameProjectRoot
|
|
11
|
+
} from "./index-7qefgq4j.js";
|
|
9
12
|
|
|
10
13
|
// src/background/workspace-snapshot.ts
|
|
11
14
|
import * as child_process from "child_process";
|
|
@@ -1167,7 +1170,7 @@ function changedFilesSinceSnapshot(directory, baseline) {
|
|
|
1167
1170
|
function workspaceSnapshotMatches(expected, current) {
|
|
1168
1171
|
if (!expected)
|
|
1169
1172
|
return { ok: true };
|
|
1170
|
-
if (
|
|
1173
|
+
if (!sameProjectRoot(expected.directory, current.directory)) {
|
|
1171
1174
|
return {
|
|
1172
1175
|
ok: false,
|
|
1173
1176
|
reason: `directory changed: expected ${expected.directory}, got ${current.directory}`
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./index-txdagbh7.js";
|
|
10
10
|
import {
|
|
11
11
|
atomicWriteFile
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-mr3h3sm5.js";
|
|
13
13
|
import {
|
|
14
14
|
assertProjectRoot,
|
|
15
15
|
withEvidenceLock
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-2czt53wz.js";
|
|
17
17
|
import {
|
|
18
18
|
exports_external,
|
|
19
19
|
init_zod
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
detectWindowsWrites,
|
|
15
15
|
getSharedClassifierGuardrailBlock,
|
|
16
16
|
resolveWriteTargets
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-bvjwmmdc.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-jkwfajh1.js";
|
|
25
25
|
|
|
26
26
|
// src/services/guardrail-explain-service.ts
|
|
27
27
|
import path from "path";
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
loadDatabaseCtor
|
|
4
4
|
} from "./index-zaab1wz9.js";
|
|
5
|
+
import {
|
|
6
|
+
canonicalExistingFilesystemPath
|
|
7
|
+
} from "./index-ry16d01s.js";
|
|
5
8
|
import {
|
|
6
9
|
validateSpecContent
|
|
7
10
|
} from "./index-n832052r.js";
|
|
@@ -9,9 +12,13 @@ import {
|
|
|
9
12
|
advisoryWarn,
|
|
10
13
|
init_warning_buffer
|
|
11
14
|
} from "./index-4rhhvd1a.js";
|
|
15
|
+
import {
|
|
16
|
+
canonicalRootKeyFresh,
|
|
17
|
+
lexicalRootAliasKey
|
|
18
|
+
} from "./index-7qefgq4j.js";
|
|
12
19
|
import {
|
|
13
20
|
atomicWriteSwarmFileSync
|
|
14
|
-
} from "./index-
|
|
21
|
+
} from "./index-t1qzjhnj.js";
|
|
15
22
|
|
|
16
23
|
// src/sdd/effective-spec.ts
|
|
17
24
|
import { createHash } from "crypto";
|
|
@@ -727,26 +734,9 @@ function withDurabilityClass(db, cls, fn) {
|
|
|
727
734
|
}
|
|
728
735
|
}
|
|
729
736
|
|
|
730
|
-
// src/db/canonical-project.ts
|
|
731
|
-
import { realpathSync } from "fs";
|
|
732
|
-
import { resolve as resolve2 } from "path";
|
|
733
|
-
var _internals = {
|
|
734
|
-
realpathSync
|
|
735
|
-
};
|
|
736
|
-
function canonicalProjectKey(directory) {
|
|
737
|
-
const lexical = resolve2(directory);
|
|
738
|
-
let canonical;
|
|
739
|
-
try {
|
|
740
|
-
canonical = _internals.realpathSync(lexical);
|
|
741
|
-
} catch {
|
|
742
|
-
canonical = lexical;
|
|
743
|
-
}
|
|
744
|
-
return process.platform === "win32" ? canonical.toLowerCase() : canonical;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
737
|
// src/db/project-db.ts
|
|
748
738
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, unlinkSync } from "fs";
|
|
749
|
-
import { join as join2
|
|
739
|
+
import { join as join2 } from "path";
|
|
750
740
|
|
|
751
741
|
// src/db/db-errors.ts
|
|
752
742
|
class ProjectDbError extends Error {
|
|
@@ -964,6 +954,38 @@ var MIGRATIONS = [
|
|
|
964
954
|
}
|
|
965
955
|
];
|
|
966
956
|
var _projectDbs = new Map;
|
|
957
|
+
var _projectDbAliases = new Map;
|
|
958
|
+
var MAX_ALIASES_PER_PROJECT_DB = 128;
|
|
959
|
+
function lexicalAliasKey(directory) {
|
|
960
|
+
return lexicalRootAliasKey(directory);
|
|
961
|
+
}
|
|
962
|
+
function unbindAlias(alias, physicalKey) {
|
|
963
|
+
if (_projectDbAliases.get(alias) === physicalKey) {
|
|
964
|
+
_projectDbAliases.delete(alias);
|
|
965
|
+
}
|
|
966
|
+
_projectDbs.get(physicalKey)?.aliases.delete(alias);
|
|
967
|
+
}
|
|
968
|
+
function bindAlias(record, physicalKey, alias) {
|
|
969
|
+
const previousKey = _projectDbAliases.get(alias);
|
|
970
|
+
if (previousKey !== undefined && previousKey !== physicalKey) {
|
|
971
|
+
unbindAlias(alias, previousKey);
|
|
972
|
+
}
|
|
973
|
+
record.aliases.delete(alias);
|
|
974
|
+
record.aliases.add(alias);
|
|
975
|
+
_projectDbAliases.set(alias, physicalKey);
|
|
976
|
+
while (record.aliases.size > MAX_ALIASES_PER_PROJECT_DB) {
|
|
977
|
+
const evicted = [...record.aliases].find((candidate) => candidate !== record.primaryAlias && candidate !== alias);
|
|
978
|
+
if (evicted === undefined)
|
|
979
|
+
break;
|
|
980
|
+
unbindAlias(evicted, physicalKey);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
function closeRecord(physicalKey, record) {
|
|
984
|
+
record.db.close();
|
|
985
|
+
_projectDbs.delete(physicalKey);
|
|
986
|
+
for (const alias of [...record.aliases])
|
|
987
|
+
unbindAlias(alias, physicalKey);
|
|
988
|
+
}
|
|
967
989
|
function recordMigrationFailure(db, migration, err, markerDir) {
|
|
968
990
|
const errorText = String(err instanceof Error ? err.message : err).slice(0, MIGRATION_FAILURE_ERROR_MAX_CHARS);
|
|
969
991
|
try {
|
|
@@ -1032,28 +1054,20 @@ function runProjectMigrations(db, markerDir) {
|
|
|
1032
1054
|
removeMigrationFailureMarker(markerDir);
|
|
1033
1055
|
}
|
|
1034
1056
|
function projectDbPath(directory) {
|
|
1035
|
-
return join2(
|
|
1057
|
+
return join2(canonicalRootKeyFresh(directory), ".swarm", "swarm.db");
|
|
1036
1058
|
}
|
|
1037
1059
|
function projectDbExists(directory) {
|
|
1038
|
-
return existsSync2(
|
|
1039
|
-
}
|
|
1040
|
-
function checkpointWalBestEffort(db) {
|
|
1041
|
-
try {
|
|
1042
|
-
const row = db.query("PRAGMA wal_checkpoint(TRUNCATE)").get();
|
|
1043
|
-
if (row && row.busy === 1) {
|
|
1044
|
-
db.run("PRAGMA wal_checkpoint(PASSIVE);");
|
|
1045
|
-
}
|
|
1046
|
-
} catch {
|
|
1047
|
-
try {
|
|
1048
|
-
db.run("PRAGMA wal_checkpoint(PASSIVE);");
|
|
1049
|
-
} catch {}
|
|
1050
|
-
}
|
|
1060
|
+
return existsSync2(projectDbPath(directory));
|
|
1051
1061
|
}
|
|
1052
1062
|
function getProjectDb(directory) {
|
|
1053
|
-
|
|
1063
|
+
mkdirSync2(directory, { recursive: true });
|
|
1064
|
+
const key = canonicalRootKeyFresh(directory);
|
|
1065
|
+
const alias = lexicalAliasKey(directory);
|
|
1054
1066
|
const existing = _projectDbs.get(key);
|
|
1055
|
-
if (existing)
|
|
1056
|
-
|
|
1067
|
+
if (existing) {
|
|
1068
|
+
bindAlias(existing, key, alias);
|
|
1069
|
+
return existing.db;
|
|
1070
|
+
}
|
|
1057
1071
|
const swarmDir = join2(key, ".swarm");
|
|
1058
1072
|
try {
|
|
1059
1073
|
mkdirSync2(swarmDir, { recursive: true });
|
|
@@ -1084,20 +1098,30 @@ function getProjectDb(directory) {
|
|
|
1084
1098
|
throw err;
|
|
1085
1099
|
throw new ProjectDbError("open_failed", `Failed to open .swarm/swarm.db for project ${key}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1086
1100
|
}
|
|
1087
|
-
|
|
1101
|
+
const record = {
|
|
1102
|
+
db,
|
|
1103
|
+
primaryAlias: alias,
|
|
1104
|
+
aliases: new Set
|
|
1105
|
+
};
|
|
1106
|
+
_projectDbs.set(key, record);
|
|
1107
|
+
bindAlias(record, key, alias);
|
|
1088
1108
|
return db;
|
|
1089
1109
|
}
|
|
1090
1110
|
function closeProjectDb(directory) {
|
|
1091
|
-
const
|
|
1092
|
-
const
|
|
1093
|
-
if (
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1111
|
+
const alias = lexicalAliasKey(directory);
|
|
1112
|
+
const currentPath = canonicalExistingFilesystemPath(directory);
|
|
1113
|
+
if (currentPath !== null) {
|
|
1114
|
+
const currentKey = canonicalRootKeyFresh(directory);
|
|
1115
|
+
const currentRecord = _projectDbs.get(currentKey);
|
|
1116
|
+
if (currentRecord)
|
|
1117
|
+
closeRecord(currentKey, currentRecord);
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
const previousKey = _projectDbAliases.get(alias);
|
|
1121
|
+
const previousRecord = previousKey === undefined ? undefined : _projectDbs.get(previousKey);
|
|
1122
|
+
if (previousKey !== undefined && previousRecord) {
|
|
1123
|
+
closeRecord(previousKey, previousRecord);
|
|
1100
1124
|
}
|
|
1101
1125
|
}
|
|
1102
1126
|
|
|
1103
|
-
export { DURABILITY_CLASSES, batchDurabilityClass, applySynchronousForClass, withDurabilityClass,
|
|
1127
|
+
export { DURABILITY_CLASSES, batchDurabilityClass, applySynchronousForClass, withDurabilityClass, DbWriteError, classifyDbWriteError, projectDbPath, projectDbExists, getProjectDb, closeProjectDb, detectSpeckit, resolveSpeckitProjection, loadSddStatusSync, buildOpenSpecProjectionSync, readEffectiveSpecSync, writeProjectedSpecSync, validateSpeckit };
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
SWARM_WORKTREE_DIR_NAME,
|
|
15
15
|
init_constants
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-8psybzzf.js";
|
|
17
17
|
import {
|
|
18
18
|
log
|
|
19
19
|
} from "./index-zgwm4ryv.js";
|
|
@@ -92,7 +92,7 @@ var _internals = {
|
|
|
92
92
|
symlinkSync: fs.symlinkSync
|
|
93
93
|
},
|
|
94
94
|
writeScopeToDisk: async (directory, taskId, files) => {
|
|
95
|
-
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-
|
|
95
|
+
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-zfmz4sws.js");
|
|
96
96
|
return realWrite(directory, taskId, files);
|
|
97
97
|
},
|
|
98
98
|
writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
|