opencode-swarm 7.145.0 → 7.145.1
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/background/workspace-snapshot.d.ts +29 -0
- package/dist/cli/{config-doctor-dzsv3pqy.js → config-doctor-96jmxr7s.js} +3 -3
- package/dist/cli/{core-qkh9me8x.js → core-w78pc1hh.js} +3 -3
- package/dist/cli/{curation-policy-5x6346tf.js → curation-policy-smyc2mrm.js} +5 -5
- package/dist/cli/{curator-zssndq5x.js → curator-59hzdxrv.js} +30 -30
- package/dist/cli/{curator-llm-factory-q5p4578g.js → curator-llm-factory-g794pv51.js} +30 -30
- package/dist/cli/{evidence-summary-service-dqcpapj8.js → evidence-summary-service-41m0cna6.js} +13 -13
- package/dist/cli/{gate-evidence-bkdqryqg.js → gate-evidence-7aywx7qa.js} +8 -8
- package/dist/cli/{guardrail-explain-kspf83x5.js → guardrail-explain-j88dhm6w.js} +31 -31
- package/dist/cli/{guardrail-log-qg4sq6gr.js → guardrail-log-xcb3ke8s.js} +4 -4
- package/dist/cli/{hive-promoter-3h7dhnek.js → hive-promoter-nnnx5692.js} +30 -30
- package/dist/cli/{index-0pcq32y2.js → index-17e73wac.js} +1 -1
- package/dist/cli/{index-4e5a28h7.js → index-19v4tccw.js} +2 -2
- package/dist/cli/{index-fp464as8.js → index-2qrd8mfa.js} +1 -1
- package/dist/cli/{index-wk54ey3h.js → index-34tawmyx.js} +1 -1
- package/dist/cli/{index-s6cwsnrw.js → index-41t3hgaa.js} +10 -10
- package/dist/cli/{index-zfhe7vbb.js → index-7axx11dt.js} +1 -1
- package/dist/cli/{index-h4hasck4.js → index-8ef23wex.js} +4 -4
- package/dist/cli/{index-4zwjc9sb.js → index-90w06fqr.js} +100 -3
- package/dist/cli/{index-kp87kr1a.js → index-b7ntt9cw.js} +3 -3
- package/dist/cli/{index-6ezbzd5e.js → index-bst6epnr.js} +298 -160
- package/dist/cli/{index-apjdytwx.js → index-cqfp05jb.js} +3 -3
- package/dist/cli/{index-zz5qsjd1.js → index-dppzthm9.js} +64 -36
- package/dist/cli/{index-s72naw1j.js → index-dzan8czb.js} +1 -1
- package/dist/cli/{index-e00wbqw5.js → index-evpgszmp.js} +2 -2
- package/dist/cli/{index-c13ttmak.js → index-ff66fbjt.js} +10 -10
- package/dist/cli/{index-jy9bwa9k.js → index-fwnhh6s7.js} +2 -2
- package/dist/cli/{index-77ef8gye.js → index-gey2257h.js} +1 -1
- package/dist/cli/{index-pa86tpgt.js → index-gf03198s.js} +1 -1
- package/dist/cli/{index-v64kjqvg.js → index-kxzgnz2h.js} +17 -17
- package/dist/cli/{index-6q3agdmr.js → index-mpf01swm.js} +1 -1
- package/dist/cli/{index-mkks7jwg.js → index-mrkgxfeh.js} +3 -3
- package/dist/cli/{index-7g276m9m.js → index-neh8azwc.js} +2 -2
- package/dist/cli/{index-qfawexc8.js → index-qpke2x5h.js} +6 -6
- package/dist/cli/{index-ffdwj1an.js → index-rtkttser.js} +1 -1
- package/dist/cli/{index-b3xret0a.js → index-sfemjcb8.js} +5 -5
- package/dist/cli/{index-k6pdsct6.js → index-tm0bezd9.js} +1 -1
- package/dist/cli/{index-0jr9zn34.js → index-tw8ck794.js} +1 -1
- package/dist/cli/{index-hfzcztv6.js → index-xz4x17z0.js} +32 -32
- package/dist/cli/{index-2dnqazyr.js → index-ymyke19q.js} +1 -1
- package/dist/cli/{index-b30x236n.js → index-z9yhhk6q.js} +96 -8
- package/dist/cli/{index-6hqhyb0f.js → index-zpp507z0.js} +18 -4
- package/dist/cli/index.js +30 -30
- package/dist/cli/{knowledge-escalator-w1mbaktt.js → knowledge-escalator-s6acdpwj.js} +13 -13
- package/dist/cli/{knowledge-events-a0dj6gy6.js → knowledge-events-jprkz49t.js} +11 -11
- package/dist/cli/{knowledge-link-mzdjvjsd.js → knowledge-link-zvtmj756.js} +4 -4
- package/dist/cli/{knowledge-store-8kk3rghx.js → knowledge-store-mc4awds4.js} +5 -5
- package/dist/cli/{knowledge-validator-91ym56e0.js → knowledge-validator-pe4ncrvj.js} +7 -7
- package/dist/cli/model-preflight-77dwxfv5.js +170 -0
- package/dist/cli/{pending-delegations-6vsrmw5w.js → pending-delegations-epzht3d7.js} +3 -3
- package/dist/cli/{pr-subscriptions-zc3skxde.js → pr-subscriptions-2ahy8g87.js} +3 -3
- package/dist/cli/{runner-jj32v8bk.js → runner-ra9pjhp2.js} +5 -5
- package/dist/cli/{scan-cursor-12jxwd14.js → scan-cursor-hdzhqwzj.js} +6 -6
- package/dist/cli/{schema-nq9tcz87.js → schema-pg85z06v.js} +1 -1
- package/dist/cli/{scope-persistence-dv6z7n08.js → scope-persistence-v8we8ja7.js} +9 -6
- package/dist/cli/{skill-generator-drscnzq9.js → skill-generator-ctskfct2.js} +15 -15
- package/dist/cli/{telemetry-z54dgdrh.js → telemetry-c21dgffc.js} +1 -1
- package/dist/cli/{workspace-snapshot-q21mgbsh.js → workspace-snapshot-kznz5e13.js} +4 -2
- package/dist/cli/{worktree-collision-ownership-rfyyjjct.js → worktree-collision-ownership-f7se4wbf.js} +8 -8
- package/dist/cli/{worktree-isolation-4tehtym5.js → worktree-isolation-j4qb7mgb.js} +32 -30
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +4 -0
- package/dist/index.js +307 -293
- package/dist/observability/catalog.d.ts +2 -2
- package/dist/scope/scope-binding.d.ts +16 -0
- package/dist/services/model-preflight.d.ts +151 -0
- package/dist/services/session-reflection.d.ts +24 -0
- package/dist/telemetry.d.ts +12 -1
- package/dist/tools/placeholder-scan.d.ts +64 -0
- package/dist/tools/sast-scan.d.ts +6 -0
- package/package.json +1 -1
- package/dist/cli/{curator-drift-yn5d0mvq.js → curator-drift-r50x1rac.js} +1 -1
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
captureWorkingTreeFingerprint,
|
|
4
|
+
createModelEvaluationExecutor,
|
|
5
|
+
pLimit,
|
|
6
|
+
resolveExecutableFromPath,
|
|
7
|
+
runEvaluation,
|
|
8
|
+
runExternalTool
|
|
9
|
+
} from "./index-34tawmyx.js";
|
|
2
10
|
import {
|
|
3
11
|
stableCanonicalStringify
|
|
4
|
-
} from "./index-
|
|
12
|
+
} from "./index-ymyke19q.js";
|
|
5
13
|
import {
|
|
6
14
|
detectStraySwarmDirs,
|
|
7
15
|
readDoctorArtifact,
|
|
8
16
|
removeStraySwarmDir,
|
|
9
17
|
runConfigDoctor
|
|
10
|
-
} from "./index-
|
|
18
|
+
} from "./index-tw8ck794.js";
|
|
11
19
|
import {
|
|
12
20
|
MAX_TRANSIENT_RETRIES,
|
|
13
21
|
archiveEvidence,
|
|
@@ -52,27 +60,7 @@ import {
|
|
|
52
60
|
updateTaskStatus,
|
|
53
61
|
validateProjectRoot,
|
|
54
62
|
validateSymlinkBoundary
|
|
55
|
-
} from "./index-
|
|
56
|
-
import {
|
|
57
|
-
loadDatabaseCtor
|
|
58
|
-
} from "./index-134d35c1.js";
|
|
59
|
-
import {
|
|
60
|
-
LANGUAGE_REGISTRY,
|
|
61
|
-
_internals as _internals3,
|
|
62
|
-
_internals1 as _internals4,
|
|
63
|
-
buildNativeTargetCommand,
|
|
64
|
-
getProfileForFile,
|
|
65
|
-
isCommandAvailable,
|
|
66
|
-
tool
|
|
67
|
-
} from "./index-abtrcs16.js";
|
|
68
|
-
import {
|
|
69
|
-
captureWorkingTreeFingerprint,
|
|
70
|
-
createModelEvaluationExecutor,
|
|
71
|
-
pLimit,
|
|
72
|
-
resolveExecutableFromPath,
|
|
73
|
-
runEvaluation,
|
|
74
|
-
runExternalTool
|
|
75
|
-
} from "./index-wk54ey3h.js";
|
|
63
|
+
} from "./index-kxzgnz2h.js";
|
|
76
64
|
import {
|
|
77
65
|
EvaluationTaskV1Schema,
|
|
78
66
|
GateAuditManifestV1Schema,
|
|
@@ -89,7 +77,19 @@ import {
|
|
|
89
77
|
saveGateAuditResult,
|
|
90
78
|
savePromotionDecision,
|
|
91
79
|
saveTaskSetSnapshot
|
|
92
|
-
} from "./index-
|
|
80
|
+
} from "./index-fwnhh6s7.js";
|
|
81
|
+
import {
|
|
82
|
+
loadDatabaseCtor
|
|
83
|
+
} from "./index-134d35c1.js";
|
|
84
|
+
import {
|
|
85
|
+
LANGUAGE_REGISTRY,
|
|
86
|
+
_internals as _internals3,
|
|
87
|
+
_internals1 as _internals4,
|
|
88
|
+
buildNativeTargetCommand,
|
|
89
|
+
getProfileForFile,
|
|
90
|
+
isCommandAvailable,
|
|
91
|
+
tool
|
|
92
|
+
} from "./index-abtrcs16.js";
|
|
93
93
|
import {
|
|
94
94
|
canonicalHash,
|
|
95
95
|
canonicalJson,
|
|
@@ -101,11 +101,14 @@ import {
|
|
|
101
101
|
resolveContainedExistingPath,
|
|
102
102
|
sha256
|
|
103
103
|
} from "./index-y8552snf.js";
|
|
104
|
+
import {
|
|
105
|
+
readRecentEscalations
|
|
106
|
+
} from "./index-sfemjcb8.js";
|
|
104
107
|
import {
|
|
105
108
|
alreadyCuratedThisGeneration,
|
|
106
109
|
claimNextScanBatch,
|
|
107
110
|
resolveCohortId
|
|
108
|
-
} from "./index-
|
|
111
|
+
} from "./index-evpgszmp.js";
|
|
109
112
|
import {
|
|
110
113
|
CURATOR_INIT_PROMPT,
|
|
111
114
|
CURATOR_PHASE_PROMPT,
|
|
@@ -148,13 +151,13 @@ import {
|
|
|
148
151
|
resolveRemoteRefsContainingHead,
|
|
149
152
|
resolveRemoteRefsContainingHeadAsync,
|
|
150
153
|
switchPrFeedbackTrackingCandidateAsync
|
|
151
|
-
} from "./index-
|
|
154
|
+
} from "./index-z9yhhk6q.js";
|
|
152
155
|
import {
|
|
153
156
|
buildCorrelationId,
|
|
154
157
|
listActive,
|
|
155
158
|
subscribe,
|
|
156
159
|
unsubscribe
|
|
157
|
-
} from "./index-
|
|
160
|
+
} from "./index-gey2257h.js";
|
|
158
161
|
import {
|
|
159
162
|
BUNDLED_PROJECT_SKILL_ROOT,
|
|
160
163
|
DEFAULT_SKILL_MIN_CONFIDENCE,
|
|
@@ -175,10 +178,7 @@ import {
|
|
|
175
178
|
retireSkill,
|
|
176
179
|
selectCandidateEntries,
|
|
177
180
|
syncBundledProjectSkillsIfMissingAsync
|
|
178
|
-
} from "./index-
|
|
179
|
-
import {
|
|
180
|
-
readRecentEscalations
|
|
181
|
-
} from "./index-b3xret0a.js";
|
|
181
|
+
} from "./index-mrkgxfeh.js";
|
|
182
182
|
import {
|
|
183
183
|
appendUnactionable,
|
|
184
184
|
quarantineEntry,
|
|
@@ -189,11 +189,11 @@ import {
|
|
|
189
189
|
validateActionableFields,
|
|
190
190
|
validateLesson,
|
|
191
191
|
validateSkillPath
|
|
192
|
-
} from "./index-
|
|
192
|
+
} from "./index-8ef23wex.js";
|
|
193
193
|
import {
|
|
194
194
|
authorizeCuration,
|
|
195
195
|
buildConfigFingerprintInput
|
|
196
|
-
} from "./index-
|
|
196
|
+
} from "./index-2qrd8mfa.js";
|
|
197
197
|
import {
|
|
198
198
|
cohortConfigFingerprint
|
|
199
199
|
} from "./index-rtry5xyf.js";
|
|
@@ -212,7 +212,7 @@ import {
|
|
|
212
212
|
findByBatchId,
|
|
213
213
|
readDelegations,
|
|
214
214
|
sweepStaleDelegations
|
|
215
|
-
} from "./index-
|
|
215
|
+
} from "./index-rtkttser.js";
|
|
216
216
|
import {
|
|
217
217
|
WORKTREE_LIFECYCLE_LOCK_FILE,
|
|
218
218
|
recordWorktreeProvisioningOwner,
|
|
@@ -242,18 +242,18 @@ import {
|
|
|
242
242
|
startupOrphanRecovery,
|
|
243
243
|
withTaskEvidenceTransaction,
|
|
244
244
|
writeWorkflowWalFile
|
|
245
|
-
} from "./index-
|
|
245
|
+
} from "./index-41t3hgaa.js";
|
|
246
246
|
import {
|
|
247
247
|
provisionWorktree,
|
|
248
248
|
removeWorktree
|
|
249
|
-
} from "./index-
|
|
249
|
+
} from "./index-zpp507z0.js";
|
|
250
250
|
import {
|
|
251
251
|
MAX_PENDING_SCOPE_BINDINGS,
|
|
252
252
|
canonicalWorkspaceIdentity,
|
|
253
253
|
clearAllScopes,
|
|
254
254
|
clearScopeBindingFromDisk,
|
|
255
255
|
clearScopeBindings
|
|
256
|
-
} from "./index-
|
|
256
|
+
} from "./index-90w06fqr.js";
|
|
257
257
|
import {
|
|
258
258
|
appendLedgerEvent,
|
|
259
259
|
computePlanHash,
|
|
@@ -266,7 +266,7 @@ import {
|
|
|
266
266
|
readPlanEpochIdentity,
|
|
267
267
|
replayFromLedgerWithStatus,
|
|
268
268
|
takeSnapshotEvent
|
|
269
|
-
} from "./index-
|
|
269
|
+
} from "./index-cqfp05jb.js";
|
|
270
270
|
import {
|
|
271
271
|
isPathWithinDeclaredScope,
|
|
272
272
|
sanitizeDiagnosticText
|
|
@@ -317,7 +317,7 @@ import {
|
|
|
317
317
|
transactFile,
|
|
318
318
|
transactKnowledge,
|
|
319
319
|
wordBigrams
|
|
320
|
-
} from "./index-
|
|
320
|
+
} from "./index-qpke2x5h.js";
|
|
321
321
|
import {
|
|
322
322
|
MAX_EVENT_LOG_ENTRIES,
|
|
323
323
|
_internals as _internals2,
|
|
@@ -331,31 +331,20 @@ import {
|
|
|
331
331
|
recordKnowledgeEvent,
|
|
332
332
|
recordPhaseCloseIntent,
|
|
333
333
|
resolveKnowledgeEventsPath
|
|
334
|
-
} from "./index-
|
|
334
|
+
} from "./index-ff66fbjt.js";
|
|
335
335
|
import {
|
|
336
336
|
resolveWorktreeIsolationConfig
|
|
337
|
-
} from "./index-
|
|
337
|
+
} from "./index-neh8azwc.js";
|
|
338
338
|
import {
|
|
339
339
|
RetrospectiveEvidenceSchema
|
|
340
340
|
} from "./index-gprxjmm7.js";
|
|
341
|
-
import {
|
|
342
|
-
readSwarmFileAsync,
|
|
343
|
-
safeHook,
|
|
344
|
-
validateSwarmPath
|
|
345
|
-
} from "./index-w8pgjr75.js";
|
|
346
|
-
import {
|
|
347
|
-
bunSpawn,
|
|
348
|
-
bunSpawnSync,
|
|
349
|
-
bunWrite,
|
|
350
|
-
mergeEnvForChild
|
|
351
|
-
} from "./index-zj6t9zgx.js";
|
|
352
341
|
import {
|
|
353
342
|
PlanSchema,
|
|
354
343
|
exports_loader,
|
|
355
344
|
init_loader,
|
|
356
345
|
loadPluginConfig,
|
|
357
346
|
loadPluginConfigWithMeta
|
|
358
|
-
} from "./index-
|
|
347
|
+
} from "./index-17e73wac.js";
|
|
359
348
|
import {
|
|
360
349
|
DEFAULT_SKILL_OPT_CONFIG,
|
|
361
350
|
FALLBACK_MODELS_MAX,
|
|
@@ -369,7 +358,7 @@ import {
|
|
|
369
358
|
package_default,
|
|
370
359
|
resolveAutoReviewConfig,
|
|
371
360
|
stripKnownSwarmPrefix
|
|
372
|
-
} from "./index-
|
|
361
|
+
} from "./index-7axx11dt.js";
|
|
373
362
|
import {
|
|
374
363
|
AGENT_TOOL_MAP,
|
|
375
364
|
ALL_AGENT_NAMES,
|
|
@@ -394,6 +383,17 @@ import {
|
|
|
394
383
|
getDeferredWarnings,
|
|
395
384
|
init_warning_buffer
|
|
396
385
|
} from "./index-4rhhvd1a.js";
|
|
386
|
+
import {
|
|
387
|
+
readSwarmFileAsync,
|
|
388
|
+
safeHook,
|
|
389
|
+
validateSwarmPath
|
|
390
|
+
} from "./index-w8pgjr75.js";
|
|
391
|
+
import {
|
|
392
|
+
bunSpawn,
|
|
393
|
+
bunSpawnSync,
|
|
394
|
+
bunWrite,
|
|
395
|
+
mergeEnvForChild
|
|
396
|
+
} from "./index-zj6t9zgx.js";
|
|
397
397
|
import {
|
|
398
398
|
resolveHiveDataDir,
|
|
399
399
|
resolveHiveEventsPath,
|
|
@@ -409,10 +409,10 @@ import {
|
|
|
409
409
|
resolveLinkDir,
|
|
410
410
|
sanitizeLinkId,
|
|
411
411
|
writeLinkPointer
|
|
412
|
-
} from "./index-
|
|
412
|
+
} from "./index-dzan8czb.js";
|
|
413
413
|
import {
|
|
414
414
|
atomicWriteFile
|
|
415
|
-
} from "./index-
|
|
415
|
+
} from "./index-mpf01swm.js";
|
|
416
416
|
import {
|
|
417
417
|
KNOWLEDGE_SCHEMA_VERSION,
|
|
418
418
|
OUTCOME_BLOCK_THRESHOLD,
|
|
@@ -432,12 +432,12 @@ import {
|
|
|
432
432
|
listActiveLocks,
|
|
433
433
|
tryAcquireLock,
|
|
434
434
|
withEvidenceLock
|
|
435
|
-
} from "./index-
|
|
435
|
+
} from "./index-gf03198s.js";
|
|
436
436
|
import {
|
|
437
437
|
emit,
|
|
438
438
|
getLastHeartbeat,
|
|
439
439
|
telemetry
|
|
440
|
-
} from "./index-
|
|
440
|
+
} from "./index-dppzthm9.js";
|
|
441
441
|
import {
|
|
442
442
|
require_proper_lockfile
|
|
443
443
|
} from "./index-7g4c7s5r.js";
|
|
@@ -940,6 +940,7 @@ init_zod();
|
|
|
940
940
|
import * as fs51 from "fs";
|
|
941
941
|
import * as path111 from "path";
|
|
942
942
|
init_agent_names();
|
|
943
|
+
init_constants();
|
|
943
944
|
init_schema();
|
|
944
945
|
|
|
945
946
|
// src/full-auto/policy.ts
|
|
@@ -4191,7 +4192,7 @@ async function cleanupRecoveredWorktree(directory, descriptor) {
|
|
|
4191
4192
|
awaitingMergeByCallID,
|
|
4192
4193
|
cleanupStandardWorktreeForCallId,
|
|
4193
4194
|
standardWorktreeByCallID
|
|
4194
|
-
} = await import("./worktree-isolation-
|
|
4195
|
+
} = await import("./worktree-isolation-j4qb7mgb.js");
|
|
4195
4196
|
standardWorktreeByCallID.delete(descriptor.callID);
|
|
4196
4197
|
if (hasResidue)
|
|
4197
4198
|
awaitingMergeByCallID.set(descriptor.callID, {
|
|
@@ -4293,7 +4294,7 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
4293
4294
|
awaitingMergeByCallID,
|
|
4294
4295
|
finishStandardWorktreeDispatch,
|
|
4295
4296
|
standardWorktreeByCallID
|
|
4296
|
-
} = await import("./worktree-isolation-
|
|
4297
|
+
} = await import("./worktree-isolation-j4qb7mgb.js");
|
|
4297
4298
|
const descriptor = wal.worktree;
|
|
4298
4299
|
const reconstructedDispatch = {
|
|
4299
4300
|
callID: descriptor.callID,
|
|
@@ -15556,7 +15557,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
|
|
|
15556
15557
|
};
|
|
15557
15558
|
}
|
|
15558
15559
|
async function sweepActiveNearDuplicates(directory, options = {}) {
|
|
15559
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
15560
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-b7ntt9cw.js");
|
|
15560
15561
|
const { config } = loadPluginConfigWithMeta2(directory);
|
|
15561
15562
|
const sweepConfig = config.learning?.dedup_sweep;
|
|
15562
15563
|
if (sweepConfig?.enabled === false)
|
|
@@ -16640,7 +16641,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
|
|
|
16640
16641
|
}
|
|
16641
16642
|
if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
|
|
16642
16643
|
try {
|
|
16643
|
-
const skillModule = await import("./skill-generator-
|
|
16644
|
+
const skillModule = await import("./skill-generator-ctskfct2.js");
|
|
16644
16645
|
for (const cand of skillCandidates) {
|
|
16645
16646
|
if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
|
|
16646
16647
|
continue;
|
|
@@ -17100,7 +17101,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
|
|
|
17100
17101
|
} catch {}
|
|
17101
17102
|
}
|
|
17102
17103
|
if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
|
|
17103
|
-
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-
|
|
17104
|
+
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-s6acdpwj.js");
|
|
17104
17105
|
for (const { id } of contradictedEntries) {
|
|
17105
17106
|
try {
|
|
17106
17107
|
await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
|
|
@@ -17919,7 +17920,7 @@ async function runCuratorPostMortem(directory, options = {}) {
|
|
|
17919
17920
|
warnings.push("Failed to collect knowledge summary.");
|
|
17920
17921
|
}
|
|
17921
17922
|
try {
|
|
17922
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
17923
|
+
const { getScanStatus } = await import("./scan-cursor-hdzhqwzj.js");
|
|
17923
17924
|
const scanStatus = await getScanStatus(directory);
|
|
17924
17925
|
if (scanStatus.remaining_estimate > 0) {
|
|
17925
17926
|
warnings.push(`Fair scan: reviewed ${knowledgeSummary.length} entries this sweep (generation ${scanStatus.generation}); ${scanStatus.remaining_estimate} more eligible entries will be visited in future curation sweeps.`);
|
|
@@ -18091,9 +18092,9 @@ var _internals24 = {
|
|
|
18091
18092
|
verifyPostMortemKnowledgeActions,
|
|
18092
18093
|
repairPostMortemActions,
|
|
18093
18094
|
loadDefaultKnowledgeConfig: async (directory) => {
|
|
18094
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
18095
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-pg85z06v.js");
|
|
18095
18096
|
try {
|
|
18096
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
18097
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-b7ntt9cw.js");
|
|
18097
18098
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
18098
18099
|
return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
18099
18100
|
} catch {
|
|
@@ -18101,11 +18102,11 @@ var _internals24 = {
|
|
|
18101
18102
|
}
|
|
18102
18103
|
},
|
|
18103
18104
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
|
|
18104
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
18105
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-59hzdxrv.js");
|
|
18105
18106
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
|
|
18106
18107
|
},
|
|
18107
18108
|
checkHivePromotions: async (entries, knowledgeConfig, directory) => {
|
|
18108
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
18109
|
+
const { checkHivePromotions } = await import("./hive-promoter-nnnx5692.js");
|
|
18109
18110
|
return checkHivePromotions(entries, knowledgeConfig, directory);
|
|
18110
18111
|
},
|
|
18111
18112
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -18114,7 +18115,7 @@ var _internals24 = {
|
|
|
18114
18115
|
activateProposal,
|
|
18115
18116
|
listSkills: listSkills2,
|
|
18116
18117
|
sanitizeSlug
|
|
18117
|
-
} = await import("./skill-generator-
|
|
18118
|
+
} = await import("./skill-generator-ctskfct2.js");
|
|
18118
18119
|
const result = {
|
|
18119
18120
|
approved: [],
|
|
18120
18121
|
rejected: [],
|
|
@@ -18156,7 +18157,7 @@ var _internals24 = {
|
|
|
18156
18157
|
return result;
|
|
18157
18158
|
},
|
|
18158
18159
|
readPriorDriftReports: async (directory) => {
|
|
18159
|
-
const { readPriorDriftReports } = await import("./curator-drift-
|
|
18160
|
+
const { readPriorDriftReports } = await import("./curator-drift-r50x1rac.js");
|
|
18160
18161
|
return readPriorDriftReports(directory);
|
|
18161
18162
|
},
|
|
18162
18163
|
readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
|
|
@@ -19450,9 +19451,9 @@ function hashContent(content) {
|
|
|
19450
19451
|
return createHash7("sha1").update(content).digest("hex");
|
|
19451
19452
|
}
|
|
19452
19453
|
async function loadConfigForPolicyCurator(directory) {
|
|
19453
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
19454
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-pg85z06v.js");
|
|
19454
19455
|
try {
|
|
19455
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
19456
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-b7ntt9cw.js");
|
|
19456
19457
|
const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
|
|
19457
19458
|
return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
|
|
19458
19459
|
} catch {
|
|
@@ -26227,6 +26228,78 @@ async function gatherGateFailures(directory) {
|
|
|
26227
26228
|
} catch {}
|
|
26228
26229
|
return [...failures.values()].sort((a, b) => b.count - a.count);
|
|
26229
26230
|
}
|
|
26231
|
+
var REJECTION_LEDGER_EVENT_TYPES = new Set([
|
|
26232
|
+
"coder_retry_circuit_breaker",
|
|
26233
|
+
"plan_critic_gate_manual_approval",
|
|
26234
|
+
"architect_loop_detected",
|
|
26235
|
+
"agent_conflict_detected"
|
|
26236
|
+
]);
|
|
26237
|
+
var MAX_LEDGER_BYTES = 16 * 1024 * 1024;
|
|
26238
|
+
async function gatherLedgerRejections(directory, sessionId) {
|
|
26239
|
+
const counts = {};
|
|
26240
|
+
const readLedger = async (filePath) => {
|
|
26241
|
+
try {
|
|
26242
|
+
const handle = await fs13.open(filePath, "r");
|
|
26243
|
+
try {
|
|
26244
|
+
const stat5 = await handle.stat();
|
|
26245
|
+
if (!stat5.isFile())
|
|
26246
|
+
return null;
|
|
26247
|
+
const length = Math.min(stat5.size, MAX_LEDGER_BYTES);
|
|
26248
|
+
const buffer = Buffer.alloc(length);
|
|
26249
|
+
await handle.read(buffer, 0, length, stat5.size - length);
|
|
26250
|
+
return buffer.toString("utf-8");
|
|
26251
|
+
} finally {
|
|
26252
|
+
await handle.close().catch(() => {});
|
|
26253
|
+
}
|
|
26254
|
+
} catch {
|
|
26255
|
+
return null;
|
|
26256
|
+
}
|
|
26257
|
+
};
|
|
26258
|
+
const readContained = async (root, ...segments) => {
|
|
26259
|
+
const target = path36.join(root, ...segments);
|
|
26260
|
+
try {
|
|
26261
|
+
const realRoot = await fs13.realpath(path36.join(root));
|
|
26262
|
+
const realTarget = await fs13.realpath(target);
|
|
26263
|
+
const rel = path36.relative(realRoot, realTarget);
|
|
26264
|
+
if (rel.startsWith("..") || path36.isAbsolute(rel))
|
|
26265
|
+
return null;
|
|
26266
|
+
} catch {
|
|
26267
|
+
return null;
|
|
26268
|
+
}
|
|
26269
|
+
return readLedger(target);
|
|
26270
|
+
};
|
|
26271
|
+
let content = await readLedger(path36.join(directory, ".swarm", "events.jsonl"));
|
|
26272
|
+
if (content === null) {
|
|
26273
|
+
try {
|
|
26274
|
+
const archiveRoot = path36.join(directory, ".swarm", "archive");
|
|
26275
|
+
const archiveEntries = await fs13.readdir(archiveRoot);
|
|
26276
|
+
const archives = archiveEntries.filter((entry) => entry.startsWith("swarm-")).sort();
|
|
26277
|
+
for (let index = archives.length - 1;index >= 0 && content === null; index--) {
|
|
26278
|
+
content = await readContained(archiveRoot, archives[index], "events.jsonl");
|
|
26279
|
+
}
|
|
26280
|
+
} catch {}
|
|
26281
|
+
}
|
|
26282
|
+
if (content === null)
|
|
26283
|
+
return counts;
|
|
26284
|
+
for (const line of content.split(`
|
|
26285
|
+
`)) {
|
|
26286
|
+
const trimmed = line.trim();
|
|
26287
|
+
if (!trimmed)
|
|
26288
|
+
continue;
|
|
26289
|
+
try {
|
|
26290
|
+
const parsed = JSON.parse(trimmed);
|
|
26291
|
+
if (typeof parsed.type === "string" && REJECTION_LEDGER_EVENT_TYPES.has(parsed.type)) {
|
|
26292
|
+
if (sessionId !== undefined) {
|
|
26293
|
+
const eventSession = typeof parsed.sessionId === "string" ? parsed.sessionId : typeof parsed.sessionID === "string" ? parsed.sessionID : undefined;
|
|
26294
|
+
if (eventSession !== undefined && eventSession !== sessionId)
|
|
26295
|
+
continue;
|
|
26296
|
+
}
|
|
26297
|
+
counts[parsed.type] = (counts[parsed.type] ?? 0) + 1;
|
|
26298
|
+
}
|
|
26299
|
+
} catch {}
|
|
26300
|
+
}
|
|
26301
|
+
return counts;
|
|
26302
|
+
}
|
|
26230
26303
|
var CONTRADICTION_LOWER = 0.45;
|
|
26231
26304
|
var CONTRADICTION_SESSION_CAP = 50;
|
|
26232
26305
|
var CONTRADICTION_PAIR_CAP = 10;
|
|
@@ -26581,8 +26654,22 @@ function buildDeterministicReport(data) {
|
|
|
26581
26654
|
const lines = [];
|
|
26582
26655
|
lines.push("## Problems Encountered");
|
|
26583
26656
|
lines.push("");
|
|
26657
|
+
const ledgerEntries = Object.entries(data.ledgerRejections ?? {}).filter(([, count]) => count > 0).sort((a, b) => b[1] - a[1]);
|
|
26658
|
+
const ledgerTotal = ledgerEntries.reduce((sum, [, count]) => sum + count, 0);
|
|
26659
|
+
const ledgerLines = () => {
|
|
26660
|
+
if (ledgerTotal === 0)
|
|
26661
|
+
return;
|
|
26662
|
+
lines.push(`${ledgerTotal} rejection/circuit-breaker event(s) in the session ledger (events.jsonl):`);
|
|
26663
|
+
for (const [type, count] of ledgerEntries.slice(0, 8)) {
|
|
26664
|
+
lines.push(`- ${type}: ${count}`);
|
|
26665
|
+
}
|
|
26666
|
+
};
|
|
26584
26667
|
if (data.totalToolFailures === 0 && data.gateFailures.length === 0) {
|
|
26585
|
-
|
|
26668
|
+
if (ledgerTotal > 0) {
|
|
26669
|
+
ledgerLines();
|
|
26670
|
+
} else {
|
|
26671
|
+
lines.push("No tool failures or gate rejections recorded this session.");
|
|
26672
|
+
}
|
|
26586
26673
|
lines.push("");
|
|
26587
26674
|
} else {
|
|
26588
26675
|
if (data.totalToolFailures > 0) {
|
|
@@ -26603,6 +26690,10 @@ function buildDeterministicReport(data) {
|
|
|
26603
26690
|
lines.push(`- ${cat}: ${count} occurrence(s)`);
|
|
26604
26691
|
}
|
|
26605
26692
|
}
|
|
26693
|
+
if (ledgerTotal > 0) {
|
|
26694
|
+
lines.push("");
|
|
26695
|
+
ledgerLines();
|
|
26696
|
+
}
|
|
26606
26697
|
lines.push("");
|
|
26607
26698
|
}
|
|
26608
26699
|
if (data.toolProblems.length > 0) {
|
|
@@ -26624,7 +26715,7 @@ function buildDeterministicReport(data) {
|
|
|
26624
26715
|
}
|
|
26625
26716
|
lines.push("## Process Improvements");
|
|
26626
26717
|
lines.push("");
|
|
26627
|
-
if (data.totalToolFailures === 0 && data.gateFailures.length === 0 && data.lessonsFromRetros.length === 0) {
|
|
26718
|
+
if (data.totalToolFailures === 0 && data.gateFailures.length === 0 && ledgerTotal === 0 && data.lessonsFromRetros.length === 0) {
|
|
26628
26719
|
lines.push("Session completed without notable issues.");
|
|
26629
26720
|
} else {
|
|
26630
26721
|
lines.push("_Deterministic fallback: no LLM client available for deep analysis. Review the data above manually._");
|
|
@@ -26638,6 +26729,7 @@ async function runSessionReflection(input) {
|
|
|
26638
26729
|
const agentDispatches = gatherAgentDispatches(input.agentSessions);
|
|
26639
26730
|
const { lessons, taxonomy } = await gatherRetroLessonsAndTaxonomy(input.directory);
|
|
26640
26731
|
const gateFailures = await gatherGateFailures(input.directory);
|
|
26732
|
+
const ledgerRejections = await _internals32.gatherLedgerRejections(input.directory, input.sessionId);
|
|
26641
26733
|
const skillViolations = _internals32.gatherSkillViolations(input.directory, input.sessionId);
|
|
26642
26734
|
const contradictionCandidates = await _internals32.gatherContradictionCandidates(input.directory, input.sessionStart, input.dedupThreshold ?? DEFAULT_DEDUP_THRESHOLD2);
|
|
26643
26735
|
const realtimeCounts = await _internals32.gatherRealtimeAdmissionCounts(input.directory, input.sessionStart);
|
|
@@ -26658,7 +26750,8 @@ async function runSessionReflection(input) {
|
|
|
26658
26750
|
errorTaxonomy: taxonomy,
|
|
26659
26751
|
knowledgeDelta,
|
|
26660
26752
|
skillViolations,
|
|
26661
|
-
contradictionCandidates
|
|
26753
|
+
contradictionCandidates,
|
|
26754
|
+
ledgerRejections
|
|
26662
26755
|
};
|
|
26663
26756
|
const signalsReport = buildSignalsBlock(data);
|
|
26664
26757
|
const actionProposals = buildActionProposals(data);
|
|
@@ -26705,6 +26798,7 @@ var _internals32 = {
|
|
|
26705
26798
|
gatherAgentDispatches,
|
|
26706
26799
|
gatherRetroLessonsAndTaxonomy,
|
|
26707
26800
|
gatherGateFailures,
|
|
26801
|
+
gatherLedgerRejections,
|
|
26708
26802
|
buildReflectionDataSummary,
|
|
26709
26803
|
buildDeterministicReport,
|
|
26710
26804
|
gatherSkillViolations,
|
|
@@ -29579,7 +29673,7 @@ async function runFinalizeStage(ctx) {
|
|
|
29579
29673
|
}
|
|
29580
29674
|
}
|
|
29581
29675
|
try {
|
|
29582
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
29676
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-pg85z06v.js");
|
|
29583
29677
|
const { config: pmLoadedConfig } = _internals38.loadPluginConfigWithMeta(ctx.directory);
|
|
29584
29678
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
29585
29679
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -30437,7 +30531,7 @@ var _internals38 = {
|
|
|
30437
30531
|
closePlanTerminalState: reconcileCloseTerminalStateForPlan,
|
|
30438
30532
|
endAgentSession,
|
|
30439
30533
|
flushAndDrainTelemetry: async () => {
|
|
30440
|
-
const { flushAndDrainTelemetry } = await import("./telemetry-
|
|
30534
|
+
const { flushAndDrainTelemetry } = await import("./telemetry-c21dgffc.js");
|
|
30441
30535
|
return flushAndDrainTelemetry();
|
|
30442
30536
|
}
|
|
30443
30537
|
};
|
|
@@ -31843,9 +31937,9 @@ var _internals43 = {
|
|
|
31843
31937
|
loadPluginConfigWithMeta,
|
|
31844
31938
|
loadCuratorDeps: async () => {
|
|
31845
31939
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
31846
|
-
import("./schema-
|
|
31847
|
-
import("./curator-
|
|
31848
|
-
import("./curator-llm-factory-
|
|
31940
|
+
import("./schema-pg85z06v.js"),
|
|
31941
|
+
import("./curator-59hzdxrv.js"),
|
|
31942
|
+
import("./curator-llm-factory-g794pv51.js")
|
|
31849
31943
|
]);
|
|
31850
31944
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
31851
31945
|
}
|
|
@@ -32799,7 +32893,7 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
32799
32893
|
let scanCompleted = false;
|
|
32800
32894
|
let scanRemaining = 0;
|
|
32801
32895
|
try {
|
|
32802
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
32896
|
+
const { getScanStatus } = await import("./scan-cursor-hdzhqwzj.js");
|
|
32803
32897
|
const status = await getScanStatus(directory);
|
|
32804
32898
|
scanGeneration = status.generation;
|
|
32805
32899
|
scanCompleted = status.completed;
|
|
@@ -32807,19 +32901,19 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
32807
32901
|
} catch {}
|
|
32808
32902
|
let configMatch = null;
|
|
32809
32903
|
try {
|
|
32810
|
-
const { isLinked: isLinked2 } = await import("./knowledge-link-
|
|
32904
|
+
const { isLinked: isLinked2 } = await import("./knowledge-link-zvtmj756.js");
|
|
32811
32905
|
if (isLinked2(directory)) {
|
|
32812
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
32906
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-pg85z06v.js");
|
|
32813
32907
|
let config;
|
|
32814
32908
|
try {
|
|
32815
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
32909
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-b7ntt9cw.js");
|
|
32816
32910
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
32817
32911
|
config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
32818
32912
|
} catch {
|
|
32819
32913
|
config = KnowledgeConfigSchema2.parse({});
|
|
32820
32914
|
}
|
|
32821
32915
|
const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
|
|
32822
|
-
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-
|
|
32916
|
+
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-smyc2mrm.js");
|
|
32823
32917
|
const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
|
|
32824
32918
|
const cohortFp = await readCohortConfigFingerprint(directory);
|
|
32825
32919
|
configMatch = cohortFp === null ? null : currentFp === cohortFp;
|
|
@@ -34095,7 +34189,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
34095
34189
|
const result = runConfigDoctor(config, directory);
|
|
34096
34190
|
let output;
|
|
34097
34191
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
34098
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
34192
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-96jmxr7s.js");
|
|
34099
34193
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
|
|
34100
34194
|
applyLossy: true
|
|
34101
34195
|
});
|
|
@@ -34132,6 +34226,29 @@ async function handleDoctorCommand(directory, args) {
|
|
|
34132
34226
|
`)}
|
|
34133
34227
|
`;
|
|
34134
34228
|
}
|
|
34229
|
+
try {
|
|
34230
|
+
const { runModelPreflight } = await import("./model-preflight-77dwxfv5.js");
|
|
34231
|
+
const preflight = await runModelPreflight(config, swarmState.opencodeClient);
|
|
34232
|
+
if (preflight.catalogAvailable) {
|
|
34233
|
+
const unresolved = preflight.resolutions.filter((resolution) => resolution.status === "unresolved");
|
|
34234
|
+
if (unresolved.length > 0) {
|
|
34235
|
+
output += `
|
|
34236
|
+
---
|
|
34237
|
+
|
|
34238
|
+
## Agent Model Resolution
|
|
34239
|
+
|
|
34240
|
+
`;
|
|
34241
|
+
output += `${unresolved.length} configured agent model(s) do not resolve against the provider catalog:
|
|
34242
|
+
|
|
34243
|
+
`;
|
|
34244
|
+
for (const resolution of unresolved) {
|
|
34245
|
+
output += `- \`${resolution.agent}\` \u2192 \`${resolution.model}\`: ${resolution.detail ?? "does not resolve"}
|
|
34246
|
+
`;
|
|
34247
|
+
}
|
|
34248
|
+
output += "\nDispatching these agents will fail permanently. Fix `agents.<role>.model` in opencode-swarm.json or remove the override.\n";
|
|
34249
|
+
}
|
|
34250
|
+
}
|
|
34251
|
+
} catch {}
|
|
34135
34252
|
const strayDirs = detectStraySwarmDirs(directory);
|
|
34136
34253
|
if (strayDirs.length > 0) {
|
|
34137
34254
|
if (enableAutoFix) {
|
|
@@ -35012,7 +35129,7 @@ async function handleEvidenceCommand(directory, args) {
|
|
|
35012
35129
|
return formatTaskEvidenceMarkdown(evidenceData);
|
|
35013
35130
|
}
|
|
35014
35131
|
async function handleEvidenceSummaryCommand(directory) {
|
|
35015
|
-
const { buildEvidenceSummary } = await import("./evidence-summary-service-
|
|
35132
|
+
const { buildEvidenceSummary } = await import("./evidence-summary-service-41m0cna6.js");
|
|
35016
35133
|
const artifact = await buildEvidenceSummary(directory);
|
|
35017
35134
|
if (!artifact) {
|
|
35018
35135
|
return "No plan found. Run `/swarm plan` to check plan status.";
|
|
@@ -38377,6 +38494,7 @@ async function sastScan(input, directory, config) {
|
|
|
38377
38494
|
const allFindings = [];
|
|
38378
38495
|
let filesScanned = 0;
|
|
38379
38496
|
let _filesSkipped = 0;
|
|
38497
|
+
let nonCodeSkipped = 0;
|
|
38380
38498
|
const scannedFilePaths = [];
|
|
38381
38499
|
if (abort_signal?.aborted) {
|
|
38382
38500
|
return cancelledScanResult(allFindings, filesScanned);
|
|
@@ -38414,6 +38532,7 @@ async function sastScan(input, directory, config) {
|
|
|
38414
38532
|
const langDef = getLanguageForExtension(ext);
|
|
38415
38533
|
if (!profile && !langDef) {
|
|
38416
38534
|
_filesSkipped++;
|
|
38535
|
+
nonCodeSkipped++;
|
|
38417
38536
|
continue;
|
|
38418
38537
|
}
|
|
38419
38538
|
const language = profile?.id ?? langDef.id;
|
|
@@ -38649,15 +38768,21 @@ async function sastScan(input, directory, config) {
|
|
|
38649
38768
|
}
|
|
38650
38769
|
}
|
|
38651
38770
|
let zeroCoverageError;
|
|
38771
|
+
let nonCodeOnly = false;
|
|
38652
38772
|
if (filesScanned === 0) {
|
|
38653
|
-
|
|
38654
|
-
|
|
38773
|
+
if (!baselineUsed && nonCodeSkipped > 0 && nonCodeSkipped === changed_files.length) {
|
|
38774
|
+
nonCodeOnly = true;
|
|
38775
|
+
} else {
|
|
38776
|
+
verdict = "fail";
|
|
38777
|
+
zeroCoverageError = "SAST requires at least one file to scan; zero files were scanned";
|
|
38778
|
+
}
|
|
38655
38779
|
}
|
|
38656
38780
|
const summary = {
|
|
38657
38781
|
engine,
|
|
38658
38782
|
files_scanned: filesScanned,
|
|
38659
38783
|
findings_count: finalFindings.length,
|
|
38660
|
-
findings_by_severity: findingsBySeverity
|
|
38784
|
+
findings_by_severity: findingsBySeverity,
|
|
38785
|
+
...nonCodeOnly ? { files_skipped_non_code: nonCodeSkipped } : {}
|
|
38661
38786
|
};
|
|
38662
38787
|
if (abort_signal?.aborted) {
|
|
38663
38788
|
return cancelledScanResult(allFindings, filesScanned);
|
|
@@ -38668,7 +38793,7 @@ async function sastScan(input, directory, config) {
|
|
|
38668
38793
|
timestamp: new Date().toISOString(),
|
|
38669
38794
|
agent: "sast_scan",
|
|
38670
38795
|
verdict,
|
|
38671
|
-
summary: `Scanned ${filesScanned} files, found ${finalFindings.length} finding(s) using ${engine}`,
|
|
38796
|
+
summary: nonCodeOnly ? `No scannable code files in input (${nonCodeSkipped} non-code file(s) skipped); nothing to scan` : `Scanned ${filesScanned} files, found ${finalFindings.length} finding(s) using ${engine}`,
|
|
38672
38797
|
...summary,
|
|
38673
38798
|
findings: finalFindings,
|
|
38674
38799
|
...baselineUsed && {
|
|
@@ -46324,10 +46449,10 @@ function rustModulePathToSpecifier(modulePath, sourceFile, workspaceRoot) {
|
|
|
46324
46449
|
}
|
|
46325
46450
|
if (parts[0] === "crate" && sourceFile && workspaceRoot) {
|
|
46326
46451
|
const target = path72.join(workspaceRoot, ...parts.slice(1));
|
|
46327
|
-
let
|
|
46328
|
-
if (!
|
|
46329
|
-
|
|
46330
|
-
return
|
|
46452
|
+
let relative10 = path72.relative(path72.dirname(sourceFile), target).replace(/\\/g, "/");
|
|
46453
|
+
if (!relative10.startsWith("."))
|
|
46454
|
+
relative10 = `./${relative10}`;
|
|
46455
|
+
return relative10;
|
|
46331
46456
|
}
|
|
46332
46457
|
return modulePath;
|
|
46333
46458
|
}
|
|
@@ -46768,10 +46893,10 @@ function safeRelativePath(value) {
|
|
|
46768
46893
|
return normalized;
|
|
46769
46894
|
}
|
|
46770
46895
|
function relativeFromRoot(root, absolutePath2) {
|
|
46771
|
-
const
|
|
46772
|
-
if (
|
|
46896
|
+
const relative11 = path73.relative(path73.resolve(root), path73.resolve(absolutePath2));
|
|
46897
|
+
if (relative11.startsWith("..") || path73.isAbsolute(relative11))
|
|
46773
46898
|
return null;
|
|
46774
|
-
return safeRelativePath(
|
|
46899
|
+
return safeRelativePath(relative11);
|
|
46775
46900
|
}
|
|
46776
46901
|
function absoluteFromRelative(root, relativePath2) {
|
|
46777
46902
|
const safe = safeRelativePath(relativePath2);
|
|
@@ -46779,8 +46904,8 @@ function absoluteFromRelative(root, relativePath2) {
|
|
|
46779
46904
|
return null;
|
|
46780
46905
|
const resolvedRoot = path73.resolve(root);
|
|
46781
46906
|
const absolute = path73.resolve(resolvedRoot, safe);
|
|
46782
|
-
const
|
|
46783
|
-
if (
|
|
46907
|
+
const relative11 = path73.relative(resolvedRoot, absolute);
|
|
46908
|
+
if (relative11.startsWith("..") || path73.isAbsolute(relative11))
|
|
46784
46909
|
return null;
|
|
46785
46910
|
return absolute;
|
|
46786
46911
|
}
|
|
@@ -46810,8 +46935,8 @@ function diagnosticPaths(root, diagnostics) {
|
|
|
46810
46935
|
if (witness.kind === "stable-skip")
|
|
46811
46936
|
stable.add(safe);
|
|
46812
46937
|
}
|
|
46813
|
-
for (const
|
|
46814
|
-
if (witnesses.get(
|
|
46938
|
+
for (const relative11 of reportedStable) {
|
|
46939
|
+
if (witnesses.get(relative11)?.kind !== "stable-skip")
|
|
46815
46940
|
return null;
|
|
46816
46941
|
}
|
|
46817
46942
|
return { stable, witnesses };
|
|
@@ -46833,50 +46958,50 @@ async function writeFingerprint(root, graph, options) {
|
|
|
46833
46958
|
return refuseFingerprint(root);
|
|
46834
46959
|
const current = new Map;
|
|
46835
46960
|
for (const input of walk.metadata) {
|
|
46836
|
-
const
|
|
46837
|
-
if (
|
|
46961
|
+
const relative11 = relativeFromRoot(root, input.absolutePath);
|
|
46962
|
+
if (relative11 === null)
|
|
46838
46963
|
return refuseFingerprint(root);
|
|
46839
|
-
current.set(
|
|
46964
|
+
current.set(relative11, {
|
|
46840
46965
|
size: input.sizeBytes,
|
|
46841
46966
|
mtimeMs: input.mtimeMs
|
|
46842
46967
|
});
|
|
46843
46968
|
}
|
|
46844
|
-
for (const [
|
|
46845
|
-
const observed = current.get(
|
|
46969
|
+
for (const [relative11, witness] of certifiedInputs.witnesses) {
|
|
46970
|
+
const observed = current.get(relative11);
|
|
46846
46971
|
if (observed === undefined || observed.size !== witness.sizeBytes || observed.mtimeMs !== witness.mtimeMs) {
|
|
46847
46972
|
return refuseFingerprint(root);
|
|
46848
46973
|
}
|
|
46849
46974
|
}
|
|
46850
46975
|
const nodePaths = new Set;
|
|
46851
46976
|
for (const node of Object.values(graph.nodes)) {
|
|
46852
|
-
const
|
|
46853
|
-
if (
|
|
46977
|
+
const relative11 = relativeFromRoot(root, node.filePath);
|
|
46978
|
+
if (relative11 === null)
|
|
46854
46979
|
return refuseFingerprint(root);
|
|
46855
46980
|
if (typeof node.sizeBytes !== "number" || !Number.isFinite(node.sizeBytes) || node.sizeBytes < 0 || typeof node.mtimeMs !== "number" || !Number.isFinite(node.mtimeMs) || node.mtimeMs < 0) {
|
|
46856
46981
|
return refuseFingerprint(root);
|
|
46857
46982
|
}
|
|
46858
|
-
const observed = current.get(
|
|
46983
|
+
const observed = current.get(relative11);
|
|
46859
46984
|
if (observed === undefined || observed.size !== node.sizeBytes || observed.mtimeMs !== node.mtimeMs) {
|
|
46860
46985
|
return refuseFingerprint(root);
|
|
46861
46986
|
}
|
|
46862
|
-
nodePaths.add(
|
|
46987
|
+
nodePaths.add(relative11);
|
|
46863
46988
|
}
|
|
46864
46989
|
for (const input of walk.metadata) {
|
|
46865
|
-
const
|
|
46866
|
-
if (
|
|
46990
|
+
const relative11 = relativeFromRoot(root, input.absolutePath);
|
|
46991
|
+
if (relative11 === null)
|
|
46867
46992
|
return refuseFingerprint(root);
|
|
46868
|
-
if (input.kind === "manifest" && certifiedInputs.witnesses.get(
|
|
46993
|
+
if (input.kind === "manifest" && certifiedInputs.witnesses.get(relative11)?.kind !== "manifest") {
|
|
46869
46994
|
return refuseFingerprint(root);
|
|
46870
46995
|
}
|
|
46871
46996
|
if (input.kind !== "source")
|
|
46872
46997
|
continue;
|
|
46873
|
-
if (!nodePaths.has(
|
|
46998
|
+
if (!nodePaths.has(relative11) && !certifiedInputs.stable.has(relative11)) {
|
|
46874
46999
|
return refuseFingerprint(root);
|
|
46875
47000
|
}
|
|
46876
47001
|
}
|
|
46877
47002
|
const files = Object.create(null);
|
|
46878
|
-
for (const
|
|
46879
|
-
files[
|
|
47003
|
+
for (const relative11 of [...current.keys()].sort((a, b) => a.localeCompare(b))) {
|
|
47004
|
+
files[relative11] = current.get(relative11);
|
|
46880
47005
|
}
|
|
46881
47006
|
if (Object.keys(files).length > MAX_FINGERPRINT_ENTRIES)
|
|
46882
47007
|
return refuseFingerprint(root);
|
|
@@ -49508,8 +49633,8 @@ function resolvePathShimTarget(shimPath, linter, platform = _internals70.platfor
|
|
|
49508
49633
|
}
|
|
49509
49634
|
const allowedRoots = [canonicalShimDir, canonicalShimParent];
|
|
49510
49635
|
const isContained = allowedRoots.some((root) => {
|
|
49511
|
-
const
|
|
49512
|
-
return
|
|
49636
|
+
const relative12 = path79.relative(root, canonicalTarget);
|
|
49637
|
+
return relative12 === "" || !relative12.startsWith("..") && !path79.isAbsolute(relative12);
|
|
49513
49638
|
});
|
|
49514
49639
|
if (!isContained)
|
|
49515
49640
|
return null;
|
|
@@ -49689,8 +49814,8 @@ function resolveContainedWindowsBatchCommand(cwd, fileName, args) {
|
|
|
49689
49814
|
} catch {
|
|
49690
49815
|
return null;
|
|
49691
49816
|
}
|
|
49692
|
-
const
|
|
49693
|
-
if (
|
|
49817
|
+
const relative12 = path79.relative(canonicalCwd, canonicalCandidate);
|
|
49818
|
+
if (relative12 === "" || relative12.startsWith("..") || path79.isAbsolute(relative12)) {
|
|
49694
49819
|
return null;
|
|
49695
49820
|
}
|
|
49696
49821
|
return buildWindowsBatchCommand(canonicalCandidate, args);
|
|
@@ -50613,14 +50738,14 @@ function isPathWithinScope(realPath, scanDir) {
|
|
|
50613
50738
|
}
|
|
50614
50739
|
var DISCOVERY_YIELD_INTERVAL = 100;
|
|
50615
50740
|
function toSafeRelativePath(rootDir, targetPath) {
|
|
50616
|
-
const
|
|
50617
|
-
if (!
|
|
50741
|
+
const relative13 = path80.relative(rootDir, targetPath).replace(/\\/g, "/");
|
|
50742
|
+
if (!relative13 || relative13 === ".")
|
|
50618
50743
|
return ".";
|
|
50619
|
-
if (
|
|
50744
|
+
if (relative13.startsWith("..") || path80.isAbsolute(relative13)) {
|
|
50620
50745
|
const basename19 = path80.basename(targetPath).replace(/\\/g, "/");
|
|
50621
50746
|
return basename19 || ".";
|
|
50622
50747
|
}
|
|
50623
|
-
return
|
|
50748
|
+
return relative13;
|
|
50624
50749
|
}
|
|
50625
50750
|
function recordIncompletePath(target, rootDir, targetPath, reason) {
|
|
50626
50751
|
if (target.length >= MAX_INCOMPLETE_PATHS) {
|
|
@@ -52138,8 +52263,8 @@ function resolveNativeTarget(target, workingDir) {
|
|
|
52138
52263
|
} catch {
|
|
52139
52264
|
return { success: false, error: "Native target path does not exist" };
|
|
52140
52265
|
}
|
|
52141
|
-
const
|
|
52142
|
-
if (
|
|
52266
|
+
const relative14 = path83.relative(rootReal, targetReal);
|
|
52267
|
+
if (relative14.startsWith("..") || path83.isAbsolute(relative14)) {
|
|
52143
52268
|
return { success: false, error: "Native target path escapes project root" };
|
|
52144
52269
|
}
|
|
52145
52270
|
if (!_internals74.isCommandAvailable(target.framework === "go-test" ? "go" : "ctest")) {
|
|
@@ -52149,7 +52274,7 @@ function resolveNativeTarget(target, workingDir) {
|
|
|
52149
52274
|
};
|
|
52150
52275
|
}
|
|
52151
52276
|
let executionDirectory = rootReal;
|
|
52152
|
-
let commandRelative =
|
|
52277
|
+
let commandRelative = relative14;
|
|
52153
52278
|
if (target.framework === "go-test") {
|
|
52154
52279
|
const hasRootWorkspace = fs35.existsSync(path83.join(rootReal, "go.work"));
|
|
52155
52280
|
let moduleRoot;
|
|
@@ -52187,7 +52312,7 @@ function resolveNativeTarget(target, workingDir) {
|
|
|
52187
52312
|
path: commandRelative.length === 0 ? "." : commandRelative.replace(/\\/g, "/")
|
|
52188
52313
|
},
|
|
52189
52314
|
executionDirectory,
|
|
52190
|
-
historyPath:
|
|
52315
|
+
historyPath: relative14.length === 0 ? "." : relative14.replace(/\\/g, "/")
|
|
52191
52316
|
};
|
|
52192
52317
|
}
|
|
52193
52318
|
function hasPackageJsonDependency(deps, ...patterns) {
|
|
@@ -53598,11 +53723,11 @@ function normalizeHistoryTestFile(testFile, workingDir) {
|
|
|
53598
53723
|
const normalized = testFile.replace(/\\/g, "/");
|
|
53599
53724
|
if (!path83.isAbsolute(testFile))
|
|
53600
53725
|
return normalized;
|
|
53601
|
-
const
|
|
53602
|
-
if (
|
|
53726
|
+
const relative14 = path83.relative(workingDir, testFile);
|
|
53727
|
+
if (relative14.startsWith("..") || path83.isAbsolute(relative14)) {
|
|
53603
53728
|
return normalized;
|
|
53604
53729
|
}
|
|
53605
|
-
return
|
|
53730
|
+
return relative14.replace(/\\/g, "/");
|
|
53606
53731
|
}
|
|
53607
53732
|
function combineAggregateResult(current, next) {
|
|
53608
53733
|
if (current === "fail" || next === "fail")
|
|
@@ -56779,8 +56904,8 @@ function sameFileSnapshot(left, right) {
|
|
|
56779
56904
|
return sameFileIdentity(left, right) && left.size === right.size && left.mtimeNs === right.mtimeNs && left.ctimeNs === right.ctimeNs;
|
|
56780
56905
|
}
|
|
56781
56906
|
function isContained(root, candidate) {
|
|
56782
|
-
const
|
|
56783
|
-
return
|
|
56907
|
+
const relative17 = path89.relative(root, candidate);
|
|
56908
|
+
return relative17.length > 0 && !relative17.startsWith(`..${path89.sep}`) && relative17 !== ".." && !path89.isAbsolute(relative17);
|
|
56784
56909
|
}
|
|
56785
56910
|
function selectorKey(selector) {
|
|
56786
56911
|
switch (selector.kind) {
|
|
@@ -58094,15 +58219,15 @@ function normalizedProjectFile(directory, file) {
|
|
|
58094
58219
|
return null;
|
|
58095
58220
|
const root = path91.resolve(directory);
|
|
58096
58221
|
const absolute = path91.resolve(root, file);
|
|
58097
|
-
const
|
|
58098
|
-
if (!
|
|
58222
|
+
const relative18 = path91.relative(root, absolute).replaceAll("\\", "/");
|
|
58223
|
+
if (!relative18 || relative18 === ".." || relative18.startsWith("../") || path91.isAbsolute(relative18)) {
|
|
58099
58224
|
return null;
|
|
58100
58225
|
}
|
|
58101
|
-
return
|
|
58226
|
+
return relative18;
|
|
58102
58227
|
}
|
|
58103
58228
|
function isWithinRoot2(root, candidate) {
|
|
58104
|
-
const
|
|
58105
|
-
return
|
|
58229
|
+
const relative18 = path91.relative(root, candidate);
|
|
58230
|
+
return relative18 === "" || relative18 !== ".." && !relative18.startsWith(`..${path91.sep}`) && !path91.isAbsolute(relative18);
|
|
58106
58231
|
}
|
|
58107
58232
|
function deletedPathIsContained(canonicalRoot, absolute) {
|
|
58108
58233
|
let current = path91.dirname(absolute);
|
|
@@ -58488,8 +58613,8 @@ function hasControlCharacter3(value) {
|
|
|
58488
58613
|
return false;
|
|
58489
58614
|
}
|
|
58490
58615
|
function isContained2(root, candidate) {
|
|
58491
|
-
const
|
|
58492
|
-
return
|
|
58616
|
+
const relative19 = path92.relative(root, candidate);
|
|
58617
|
+
return relative19.length > 0 && relative19 !== ".." && !relative19.startsWith(`..${path92.sep}`) && !path92.isAbsolute(relative19);
|
|
58493
58618
|
}
|
|
58494
58619
|
function canonicalPath(relativePath2) {
|
|
58495
58620
|
return relativePath2.split(path92.sep).join("/");
|
|
@@ -59254,8 +59379,8 @@ function normalizedRelativePath(file) {
|
|
|
59254
59379
|
return normalized.replace(/^\.\//, "");
|
|
59255
59380
|
}
|
|
59256
59381
|
function isWithinRoot3(root, candidate) {
|
|
59257
|
-
const
|
|
59258
|
-
return
|
|
59382
|
+
const relative21 = path94.relative(root, candidate);
|
|
59383
|
+
return relative21.length > 0 && relative21 !== ".." && !relative21.startsWith(`..${path94.sep}`) && !path94.isAbsolute(relative21);
|
|
59259
59384
|
}
|
|
59260
59385
|
function rangesOverlap(start, end, ranges) {
|
|
59261
59386
|
return ranges.some((range) => start <= range.end && end >= range.start);
|
|
@@ -59821,8 +59946,8 @@ function formatSelector(selector) {
|
|
|
59821
59946
|
}
|
|
59822
59947
|
}
|
|
59823
59948
|
function isPathInside(parent, candidate) {
|
|
59824
|
-
const
|
|
59825
|
-
return
|
|
59949
|
+
const relative22 = path95.relative(parent, candidate);
|
|
59950
|
+
return relative22.length > 0 && relative22 !== ".." && !relative22.startsWith(`..${path95.sep}`) && !path95.isAbsolute(relative22);
|
|
59826
59951
|
}
|
|
59827
59952
|
function sameFileSnapshot3(left, right) {
|
|
59828
59953
|
return (left.dev !== 0n || left.ino !== 0n) && (right.dev !== 0n || right.ino !== 0n) && left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeNs === right.mtimeNs && left.ctimeNs === right.ctimeNs;
|
|
@@ -62287,7 +62412,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
|
|
|
62287
62412
|
if (!input.dispatcher) {
|
|
62288
62413
|
throw new Error("no evaluation dispatcher available (cannot run validation)");
|
|
62289
62414
|
}
|
|
62290
|
-
const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-
|
|
62415
|
+
const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-ra9pjhp2.js");
|
|
62291
62416
|
const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
|
|
62292
62417
|
const result = await _internals91.evaluateCandidateV1({
|
|
62293
62418
|
projectRoot: input.directory,
|
|
@@ -64190,7 +64315,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
64190
64315
|
async function handleHelpCommand(ctx) {
|
|
64191
64316
|
const targetCommand = ctx.args.join(" ");
|
|
64192
64317
|
if (!targetCommand) {
|
|
64193
|
-
const { buildHelpText } = await import("./index-
|
|
64318
|
+
const { buildHelpText } = await import("./index-xz4x17z0.js");
|
|
64194
64319
|
return buildHelpText();
|
|
64195
64320
|
}
|
|
64196
64321
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -64199,7 +64324,7 @@ async function handleHelpCommand(ctx) {
|
|
|
64199
64324
|
return _internals94.buildDetailedHelp(resolved.key, resolved.entry);
|
|
64200
64325
|
}
|
|
64201
64326
|
const similar = _internals94.findSimilarCommands(targetCommand);
|
|
64202
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
64327
|
+
const { buildHelpText: fullHelp } = await import("./index-xz4x17z0.js");
|
|
64203
64328
|
if (similar.length > 0) {
|
|
64204
64329
|
return `Command '/swarm ${targetCommand}' not found.
|
|
64205
64330
|
|
|
@@ -64376,7 +64501,7 @@ var COMMAND_REGISTRY = {
|
|
|
64376
64501
|
},
|
|
64377
64502
|
"guardrail explain": {
|
|
64378
64503
|
handler: async (ctx) => {
|
|
64379
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
64504
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-j88dhm6w.js");
|
|
64380
64505
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
64381
64506
|
},
|
|
64382
64507
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -64386,7 +64511,7 @@ var COMMAND_REGISTRY = {
|
|
|
64386
64511
|
},
|
|
64387
64512
|
"guardrail-explain": {
|
|
64388
64513
|
handler: async (ctx) => {
|
|
64389
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
64514
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-j88dhm6w.js");
|
|
64390
64515
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
64391
64516
|
},
|
|
64392
64517
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -64396,7 +64521,7 @@ var COMMAND_REGISTRY = {
|
|
|
64396
64521
|
},
|
|
64397
64522
|
"guardrail-log": {
|
|
64398
64523
|
handler: async (ctx) => {
|
|
64399
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
64524
|
+
const { handleGuardrailLog } = await import("./guardrail-log-xcb3ke8s.js");
|
|
64400
64525
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
64401
64526
|
},
|
|
64402
64527
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -68226,8 +68351,8 @@ function dcEvaluateRecursiveDeleteTargets(input) {
|
|
|
68226
68351
|
}
|
|
68227
68352
|
const filesystemTarget = target.replace(/[\\/]+/g, path109.sep);
|
|
68228
68353
|
const resolved = path109.resolve(input.cwd, filesystemTarget);
|
|
68229
|
-
const
|
|
68230
|
-
if (
|
|
68354
|
+
const relative24 = path109.relative(path109.resolve(input.cwd), resolved);
|
|
68355
|
+
if (relative24 === "" || relative24 === ".." || relative24.startsWith(`..${path109.sep}`) || path109.isAbsolute(relative24)) {
|
|
68231
68356
|
return {
|
|
68232
68357
|
allowed: false,
|
|
68233
68358
|
code: "DESTRUCTIVE_TARGET_OUTSIDE_WORKSPACE",
|
|
@@ -68242,7 +68367,7 @@ function dcEvaluateRecursiveDeleteTargets(input) {
|
|
|
68242
68367
|
reason: `BLOCKED: Recursive delete target "${safeTarget}" is not an allowlisted build/cache artifact.`
|
|
68243
68368
|
};
|
|
68244
68369
|
}
|
|
68245
|
-
const normalizedRelative =
|
|
68370
|
+
const normalizedRelative = relative24.replace(/\\/g, "/");
|
|
68246
68371
|
const isBare = components.length === 1;
|
|
68247
68372
|
if (!isBare) {
|
|
68248
68373
|
hasNested = true;
|
|
@@ -71390,7 +71515,7 @@ function getDisplayBudget() {
|
|
|
71390
71515
|
async function rehydratePrSubscriptions(sessionID, directory) {
|
|
71391
71516
|
const map = new Map;
|
|
71392
71517
|
try {
|
|
71393
|
-
const { listActive: listActive2 } = await import("./pr-subscriptions-
|
|
71518
|
+
const { listActive: listActive2 } = await import("./pr-subscriptions-2ahy8g87.js");
|
|
71394
71519
|
const records = await listActive2(directory);
|
|
71395
71520
|
for (const record of records) {
|
|
71396
71521
|
if (record.sessionID !== sessionID)
|
|
@@ -71622,14 +71747,23 @@ function serializeStandardWorktreeDispatches(sessionID, message) {
|
|
|
71622
71747
|
pushAdvisory(session2, `${message} Serialization tracking is at capacity (256 sessions active); ` + `continuing in normal parallel mode.`);
|
|
71623
71748
|
return;
|
|
71624
71749
|
}
|
|
71750
|
+
standardWorktreeDegradationReasonBySession.set(sessionID, {
|
|
71751
|
+
reason: message,
|
|
71752
|
+
at: Date.now()
|
|
71753
|
+
});
|
|
71625
71754
|
const session = ensureAgentSession(sessionID);
|
|
71626
71755
|
session.maxConcurrencyOverride = 1;
|
|
71627
71756
|
pushAdvisory(session, `${message} Serializing standard coder dispatches for this session.`);
|
|
71628
71757
|
}
|
|
71758
|
+
var standardWorktreeDegradationReasonBySession = new Map;
|
|
71759
|
+
function getStandardWorktreeDegradationReason(sessionID) {
|
|
71760
|
+
return standardWorktreeDegradationReasonBySession.get(sessionID);
|
|
71761
|
+
}
|
|
71629
71762
|
function resetStandardWorktreeIsolationState() {
|
|
71630
71763
|
standardWorktreeByCallID.clear();
|
|
71631
71764
|
standardWorktreeSerializationSessions.clear();
|
|
71632
71765
|
serializationStateBySessionID.clear();
|
|
71766
|
+
standardWorktreeDegradationReasonBySession.clear();
|
|
71633
71767
|
awaitingMergeByCallID.clear();
|
|
71634
71768
|
standardWorktreeMergeQueue = Promise.resolve();
|
|
71635
71769
|
standardWorktreeLaneIndexBySession.clear();
|
|
@@ -71639,6 +71773,7 @@ function releaseStandardWorktreeSerialization(sessionID) {
|
|
|
71639
71773
|
return false;
|
|
71640
71774
|
standardWorktreeSerializationSessions.delete(sessionID);
|
|
71641
71775
|
serializationStateBySessionID.delete(sessionID);
|
|
71776
|
+
standardWorktreeDegradationReasonBySession.delete(sessionID);
|
|
71642
71777
|
const session = ensureAgentSession(sessionID);
|
|
71643
71778
|
session.maxConcurrencyOverride = undefined;
|
|
71644
71779
|
pushAdvisory(session, `WORKTREE_SERIALIZATION_RELEASED: ${sessionID} regains parallel dispatch eligibility (release-after-dispatches or TTL).`);
|
|
@@ -71665,6 +71800,7 @@ function rememberStandardWorktreeSerializationSession(sessionID) {
|
|
|
71665
71800
|
if (!hasInFlightStandardWorktreeDispatch(key)) {
|
|
71666
71801
|
standardWorktreeSerializationSessions.delete(key);
|
|
71667
71802
|
serializationStateBySessionID.delete(key);
|
|
71803
|
+
standardWorktreeDegradationReasonBySession.delete(key);
|
|
71668
71804
|
evicted = true;
|
|
71669
71805
|
break;
|
|
71670
71806
|
}
|
|
@@ -71795,7 +71931,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
|
|
|
71795
71931
|
return extracted === expectedSessionId;
|
|
71796
71932
|
}
|
|
71797
71933
|
async function inspectStandardWorktreeCollisionOwnership(identity) {
|
|
71798
|
-
const collisionOwnership = await import("./worktree-collision-ownership-
|
|
71934
|
+
const collisionOwnership = await import("./worktree-collision-ownership-f7se4wbf.js");
|
|
71799
71935
|
return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
|
|
71800
71936
|
}
|
|
71801
71937
|
async function precreateStandardWorktreeSession(args) {
|
|
@@ -71943,7 +72079,7 @@ async function precreateStandardWorktreeSession(args) {
|
|
|
71943
72079
|
const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, provisionResult.worktreePath);
|
|
71944
72080
|
if (laneProfile) {
|
|
71945
72081
|
try {
|
|
71946
|
-
const { writeLaneProfileToDiskReal } = await import("./core-
|
|
72082
|
+
const { writeLaneProfileToDiskReal } = await import("./core-w78pc1hh.js");
|
|
71947
72083
|
await writeLaneProfileToDiskReal(provisionResult.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
|
|
71948
72084
|
} catch {}
|
|
71949
72085
|
}
|
|
@@ -71967,7 +72103,9 @@ async function precreateStandardWorktreeSession(args) {
|
|
|
71967
72103
|
await _internals96.removeWorktree(provisionResult.worktreePath, args.directory, {
|
|
71968
72104
|
force: true,
|
|
71969
72105
|
worktreeDir: worktreeConfig.worktree_dir
|
|
71970
|
-
}).catch(() => {
|
|
72106
|
+
}).catch((cleanupError) => {
|
|
72107
|
+
log(`[worktree-isolation] session-create failure cleanup could not remove lane ${provisionResult.worktreePath}: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`);
|
|
72108
|
+
});
|
|
71971
72109
|
_internals96.removeWorktreeProvisioningOwner(args.directory, args.callID);
|
|
71972
72110
|
const createError = createResult.error;
|
|
71973
72111
|
const detail = typeof createError === "string" ? createError : JSON.stringify(createError ?? "missing session id");
|
|
@@ -72599,7 +72737,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
|
|
|
72599
72737
|
}
|
|
72600
72738
|
clearWorktreeMergeStatus(statusKey);
|
|
72601
72739
|
try {
|
|
72602
|
-
const { removeLaneProfileFromDiskReal } = await import("./core-
|
|
72740
|
+
const { removeLaneProfileFromDiskReal } = await import("./core-w78pc1hh.js");
|
|
72603
72741
|
await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
|
|
72604
72742
|
} catch {}
|
|
72605
72743
|
const state = serializationStateBySessionID.get(dispatch.parentSessionID);
|
|
@@ -72745,4 +72883,4 @@ var _internals96 = {
|
|
|
72745
72883
|
resolveGitExecutable
|
|
72746
72884
|
};
|
|
72747
72885
|
|
|
72748
|
-
export { parseLeanLaneIndex, computeLaneRuntimeProfile, MAX_TRACKED_STANDARD_WORKTREE_CALLS, awaitingMergeByCallID, standardWorktreeByCallID, standardWorktreeSerializationSessions, resetStandardWorktreeIsolationState, checkStandardWorktreeSerializationRelease, sanitizeWorktreeTaskId, preProvisionCollisionCheck, isLaneOwnedByCurrentSession, precreateStandardWorktreeSession, preserveBackgroundWorktreeOwnershipForCallId, preserveDirtyWorktreeForCallId, preserveDirtyWorktreeAtPath, cleanupStandardWorktreeForCallId, abortStandardWorktreeDispatch, finishStandardWorktreeDispatch, readLaneEnvFileFromDisk, _internals96 as _internals, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcExtractRecursiveRmTargets, dcEvaluateRecursiveDeleteTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals23 as _internals1, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals27 as _internals2, createHivePromoterHook, promoteToHive, promoteFromSwarm, handleCloseCommand, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getPluginConfigDir, getPluginCachePaths, getPluginLockFilePaths, VERSION_PINNED_LEAF, discoverVersionPinnedCachePaths, readCachePackageVersion, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, safeRealpathSync, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleRecoverCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleReviewCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, COMMAND_REGISTRY, VALID_COMMANDS, _internals94 as _internals3, resolveCommand };
|
|
72886
|
+
export { parseLeanLaneIndex, computeLaneRuntimeProfile, MAX_TRACKED_STANDARD_WORKTREE_CALLS, awaitingMergeByCallID, standardWorktreeByCallID, standardWorktreeSerializationSessions, getStandardWorktreeDegradationReason, resetStandardWorktreeIsolationState, checkStandardWorktreeSerializationRelease, sanitizeWorktreeTaskId, preProvisionCollisionCheck, isLaneOwnedByCurrentSession, precreateStandardWorktreeSession, preserveBackgroundWorktreeOwnershipForCallId, preserveDirtyWorktreeForCallId, preserveDirtyWorktreeAtPath, cleanupStandardWorktreeForCallId, abortStandardWorktreeDispatch, finishStandardWorktreeDispatch, readLaneEnvFileFromDisk, _internals96 as _internals, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcExtractRecursiveRmTargets, dcEvaluateRecursiveDeleteTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals23 as _internals1, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals27 as _internals2, createHivePromoterHook, promoteToHive, promoteFromSwarm, handleCloseCommand, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getPluginConfigDir, getPluginCachePaths, getPluginLockFilePaths, VERSION_PINNED_LEAF, discoverVersionPinnedCachePaths, readCachePackageVersion, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, safeRealpathSync, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleRecoverCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleReviewCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, COMMAND_REGISTRY, VALID_COMMANDS, _internals94 as _internals3, resolveCommand };
|