opencode-swarm 7.160.0 → 7.160.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/skills/critic-gate/SKILL.md +8 -1
- package/.opencode/skills/execute/SKILL.md +4 -3
- package/.opencode/skills/phase-wrap/SKILL.md +2 -0
- package/.opencode/skills/running-tests/SKILL.md +6 -0
- package/.opencode/skills/swarm-implement/SKILL.md +2 -0
- package/.opencode/skills/swarm-pr-review/SKILL.md +29 -29
- package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +21 -5
- package/dist/agents/architect.d.ts +1 -1
- package/dist/background/pending-delegations.d.ts +46 -1
- package/dist/background/pr-review-contract.d.ts +245 -2
- package/dist/build/command-resolution.d.ts +13 -0
- package/dist/build/discovery.d.ts +11 -4
- package/dist/cli/{coder-settlement-zn552sp9.js → coder-settlement-gzar5ypz.js} +9 -9
- package/dist/cli/{config-doctor-ddtdz2g0.js → config-doctor-ancn1sj7.js} +3 -3
- package/dist/cli/{core-embasn2j.js → core-bhmqtxev.js} +2 -2
- package/dist/cli/{curation-policy-agr6ga1s.js → curation-policy-47przjwg.js} +4 -4
- package/dist/cli/curator-llm-factory-6mw01jx1.js +67 -0
- package/dist/cli/{curator-dgp6dxxn.js → curator-sgmynbpm.js} +32 -32
- package/dist/cli/{dispatch-7r46tfr9.js → dispatch-q4v8x2pk.js} +1 -1
- package/dist/cli/{evidence-summary-service-sbnyann4.js → evidence-summary-service-1pcfsqhv.js} +13 -13
- package/dist/cli/{gate-evidence-5v67a1dz.js → gate-evidence-w0kjqmew.js} +5 -5
- package/dist/cli/guardrail-explain-k99eje1y.js +68 -0
- package/dist/cli/{guardrail-log-zbnbff1y.js → guardrail-log-md5gcpk7.js} +7 -7
- package/dist/cli/{guardrail-reset-3cnz54hx.js → guardrail-reset-3385eqmq.js} +32 -32
- package/dist/cli/{hive-promoter-7cr7t2kg.js → hive-promoter-r0ekyn5m.js} +32 -32
- package/dist/cli/{index-wzx6atbv.js → index-2123hwbj.js} +3 -3
- package/dist/cli/{index-nj6rmyeh.js → index-3146wmgv.js} +352 -149
- package/dist/cli/{index-5m7qjj29.js → index-3a35tt6a.js} +6 -6
- package/dist/cli/{index-q6gjwy7m.js → index-497a3hhj.js} +2 -2
- package/dist/cli/{index-7qv869f0.js → index-4d8cq6e1.js} +5 -5
- package/dist/cli/{index-w699ekk9.js → index-4dcz9fpn.js} +2 -2
- package/dist/cli/{index-zjvf7edj.js → index-5th50g17.js} +1 -1
- package/dist/cli/{index-va1edd2n.js → index-5xfx5sbw.js} +5 -5
- package/dist/cli/{index-1f4n43yz.js → index-6scakreq.js} +5 -4
- package/dist/cli/{index-962jgzdq.js → index-717pmdce.js} +1 -1
- package/dist/cli/{index-rq7k03rk.js → index-7ezv5j23.js} +1 -1
- package/dist/cli/{index-4mm22fzj.js → index-7h2armwf.js} +1 -1
- package/dist/cli/{index-gt8cxfbp.js → index-am5bz6mf.js} +2 -2
- package/dist/cli/{index-cn233hsy.js → index-awjx0wgk.js} +1 -1
- package/dist/cli/{index-h3re5c78.js → index-c9zp4xwc.js} +12 -1
- package/dist/cli/{index-p39xem8b.js → index-dh5q6z7y.js} +3 -3
- package/dist/cli/{index-xs15netk.js → index-j3ss86kf.js} +1 -1
- package/dist/cli/{index-d9s5hb0m.js → index-k0qy284k.js} +5 -5
- package/dist/cli/{index-sy5aeegg.js → index-k50kxd3w.js} +866 -37
- package/dist/cli/{index-fzkx24q5.js → index-kqzba6ex.js} +2 -2
- package/dist/cli/{index-e75bzfgd.js → index-mmr96pwr.js} +1 -1
- package/dist/cli/{index-85qjc7b2.js → index-nk498mx6.js} +1 -1
- package/dist/cli/{index-9fspg1xw.js → index-prv20xq6.js} +1 -1
- package/dist/cli/{index-ebz97mks.js → index-q8hm27yj.js} +8 -1
- package/dist/cli/{index-8bjv01t8.js → index-re338hf1.js} +4 -4
- package/dist/cli/{index-rnyt2z5r.js → index-s7w6ntw6.js} +321 -448
- package/dist/cli/{index-jmths6jj.js → index-vsy942dt.js} +34 -34
- package/dist/cli/{index-rhc8jve7.js → index-vv760pbg.js} +2 -2
- package/dist/cli/{index-3yh737hc.js → index-war2dt6a.js} +6 -6
- package/dist/cli/{index-yrar1ask.js → index-xkmzsfg5.js} +3 -3
- package/dist/cli/{index-3055dgzp.js → index-xsd7y4hp.js} +4 -4
- package/dist/cli/{index-py6bqwnb.js → index-xtwny1ae.js} +16 -2
- package/dist/cli/{index-9q6w7kke.js → index-yd6y4qr7.js} +1 -1
- package/dist/cli/{index-kkfgygvn.js → index-yp81ebrx.js} +4 -4
- package/dist/cli/{index-9k3zc2t8.js → index-zbnf26br.js} +6 -6
- package/dist/cli/{index-s7w428r3.js → index-znf683sm.js} +1 -1
- package/dist/cli/index.js +32 -32
- package/dist/cli/{knowledge-escalator-zksm9833.js → knowledge-escalator-saekqp8t.js} +12 -12
- package/dist/cli/{knowledge-events-ayta750w.js → knowledge-events-ej8yz3yq.js} +10 -10
- package/dist/cli/{knowledge-link-7c7fjnzc.js → knowledge-link-xezm8hr3.js} +3 -3
- package/dist/cli/{knowledge-store-q5axge8b.js → knowledge-store-3jamj5n4.js} +4 -4
- package/dist/cli/{knowledge-validator-3rrbva2p.js → knowledge-validator-26w2mvqv.js} +6 -6
- package/dist/cli/{model-preflight-x9szw1v4.js → model-preflight-yqqchzjn.js} +1 -1
- package/dist/cli/{pending-delegations-kc7tzxg9.js → pending-delegations-7xak7g59.js} +5 -3
- package/dist/cli/{pr-review-reentry-authorization-vag5gh50.js → pr-review-reentry-authorization-v97q63q4.js} +34 -33
- package/dist/cli/{pr-subscriptions-wbdw9a82.js → pr-subscriptions-asjevc5p.js} +3 -3
- package/dist/cli/{runner-p9wg6z34.js → runner-wsdcy2d6.js} +4 -4
- package/dist/cli/{scan-cursor-4fjwtt1k.js → scan-cursor-1agr50f8.js} +5 -5
- package/dist/cli/{schema-d0nbzj5k.js → schema-z0ygrqgy.js} +4 -2
- package/dist/cli/{scope-persistence-bckcbc8h.js → scope-persistence-tncg38by.js} +8 -8
- package/dist/cli/{skill-generator-kebhevet.js → skill-generator-jq20a09m.js} +14 -14
- package/dist/cli/{worktree-collision-ownership-h8qswnrp.js → worktree-collision-ownership-b9cp9zvw.js} +4 -4
- package/dist/cli/{worktree-isolation-q0kbmadz.js → worktree-isolation-dzyxf8hn.js} +32 -32
- package/dist/config/constants.d.ts +8 -0
- package/dist/config/evidence-schema.d.ts +21 -0
- package/dist/config/schema.d.ts +8 -0
- package/dist/hooks/pr-workflow-gate.d.ts +25 -1
- package/dist/index.js +333 -319
- package/dist/lang/default-backend.d.ts +1 -13
- package/dist/tools/build-check.d.ts +4 -0
- package/dist/tools/dispatch-lanes.d.ts +27 -3
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/sast-baseline.d.ts +2 -0
- package/dist/tools/sast-scan.d.ts +2 -2
- package/dist/tools/submit-pr-review-result.d.ts +5 -0
- package/dist/tools/test-runner.d.ts +2 -0
- package/dist/tools/tool-metadata.d.ts +8 -0
- package/opencode-swarm.schema.json +4 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-7cwvmc46.js +0 -67
- package/dist/cli/guardrail-explain-2gwarnca.js +0 -68
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
resolveExecutableFromPath,
|
|
7
7
|
runEvaluation,
|
|
8
8
|
runExternalTool
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-j3ss86kf.js";
|
|
10
10
|
import {
|
|
11
11
|
finalizeShellAuditForClose,
|
|
12
12
|
isPolicyProtectedPath,
|
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
protectedRoots,
|
|
16
16
|
redactDecisionLineForArchive,
|
|
17
17
|
stableCanonicalStringify
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-2123hwbj.js";
|
|
19
19
|
import {
|
|
20
20
|
detectStraySwarmDirs,
|
|
21
21
|
readDoctorArtifact,
|
|
22
22
|
removeStraySwarmDir,
|
|
23
23
|
runConfigDoctor
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-xtwny1ae.js";
|
|
25
25
|
import {
|
|
26
26
|
MAX_TRANSIENT_RETRIES,
|
|
27
27
|
archiveEvidence,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
validateProjectRoot,
|
|
69
69
|
validateSymlinkBoundary,
|
|
70
70
|
validateTargetWithinRoot
|
|
71
|
-
} from "./index-
|
|
71
|
+
} from "./index-zbnf26br.js";
|
|
72
72
|
import {
|
|
73
73
|
EvaluationTaskV1Schema,
|
|
74
74
|
GateAuditManifestV1Schema,
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
saveGateAuditResult,
|
|
86
86
|
savePromotionDecision,
|
|
87
87
|
saveTaskSetSnapshot
|
|
88
|
-
} from "./index-
|
|
88
|
+
} from "./index-nk498mx6.js";
|
|
89
89
|
import {
|
|
90
90
|
canonicalHash,
|
|
91
91
|
canonicalJson,
|
|
@@ -107,8 +107,9 @@ import {
|
|
|
107
107
|
buildNativeTargetCommand,
|
|
108
108
|
getProfileForFile,
|
|
109
109
|
isCommandAvailable,
|
|
110
|
+
resolveLocalNodeTool,
|
|
110
111
|
tool
|
|
111
|
-
} from "./index-
|
|
112
|
+
} from "./index-3146wmgv.js";
|
|
112
113
|
import {
|
|
113
114
|
BUNDLED_PROJECT_SKILL_ROOT,
|
|
114
115
|
DEFAULT_SKILL_MIN_CONFIDENCE,
|
|
@@ -129,15 +130,15 @@ import {
|
|
|
129
130
|
retireSkill,
|
|
130
131
|
selectCandidateEntries,
|
|
131
132
|
syncBundledProjectSkillsIfMissingAsync
|
|
132
|
-
} from "./index-
|
|
133
|
+
} from "./index-re338hf1.js";
|
|
133
134
|
import {
|
|
134
135
|
readRecentEscalations
|
|
135
|
-
} from "./index-
|
|
136
|
+
} from "./index-5xfx5sbw.js";
|
|
136
137
|
import {
|
|
137
138
|
alreadyCuratedThisGeneration,
|
|
138
139
|
claimNextScanBatch,
|
|
139
140
|
resolveCohortId
|
|
140
|
-
} from "./index-
|
|
141
|
+
} from "./index-am5bz6mf.js";
|
|
141
142
|
import {
|
|
142
143
|
CURATOR_INIT_PROMPT,
|
|
143
144
|
CURATOR_PHASE_PROMPT,
|
|
@@ -161,7 +162,7 @@ import {
|
|
|
161
162
|
listActive,
|
|
162
163
|
subscribe,
|
|
163
164
|
unsubscribe
|
|
164
|
-
} from "./index-
|
|
165
|
+
} from "./index-497a3hhj.js";
|
|
165
166
|
import {
|
|
166
167
|
clearWorktreeMergeStatus,
|
|
167
168
|
getAllWorktreeMergeFailures,
|
|
@@ -173,7 +174,7 @@ import {
|
|
|
173
174
|
listCoderSettlementWalStates,
|
|
174
175
|
recoverCoderSettlement,
|
|
175
176
|
recoverStaleCoderSettlements
|
|
176
|
-
} from "./index-
|
|
177
|
+
} from "./index-4d8cq6e1.js";
|
|
177
178
|
import {
|
|
178
179
|
parsePorcelainV2Snapshot,
|
|
179
180
|
resolveCommitCountSince,
|
|
@@ -206,7 +207,7 @@ import {
|
|
|
206
207
|
WORKTREE_LIFECYCLE_LOCK_FILE,
|
|
207
208
|
recordWorktreeProvisioningOwner,
|
|
208
209
|
removeWorktreeProvisioningOwner
|
|
209
|
-
} from "./index-
|
|
210
|
+
} from "./index-awjx0wgk.js";
|
|
210
211
|
import {
|
|
211
212
|
appendUnactionable,
|
|
212
213
|
quarantineEntry,
|
|
@@ -217,11 +218,11 @@ import {
|
|
|
217
218
|
validateActionableFields,
|
|
218
219
|
validateLesson,
|
|
219
220
|
validateSkillPath
|
|
220
|
-
} from "./index-
|
|
221
|
+
} from "./index-yp81ebrx.js";
|
|
221
222
|
import {
|
|
222
223
|
authorizeCuration,
|
|
223
224
|
buildConfigFingerprintInput
|
|
224
|
-
} from "./index-
|
|
225
|
+
} from "./index-znf683sm.js";
|
|
225
226
|
import {
|
|
226
227
|
cohortConfigFingerprint
|
|
227
228
|
} from "./index-rtry5xyf.js";
|
|
@@ -252,27 +253,40 @@ import {
|
|
|
252
253
|
transitionTaskWorkflowEvidence,
|
|
253
254
|
withTaskEvidenceTransaction,
|
|
254
255
|
writeWorkflowWalFile
|
|
255
|
-
} from "./index-
|
|
256
|
+
} from "./index-4dcz9fpn.js";
|
|
256
257
|
import {
|
|
257
258
|
makeWorktreeBranchName,
|
|
258
259
|
provisionWorktree,
|
|
259
260
|
removeWorktree
|
|
260
|
-
} from "./index-
|
|
261
|
+
} from "./index-kqzba6ex.js";
|
|
261
262
|
import {
|
|
262
263
|
DEFAULT_STALE_DELEGATION_TIMEOUT_MS,
|
|
263
264
|
DELEGATION_COMPACTION_HIGH_WATER_BYTES,
|
|
264
265
|
DELEGATION_COMPACTION_LOW_WATER_BYTES,
|
|
265
266
|
MAX_PR_REVIEW_COLLECTION_RECEIPT_ITEM_IDS,
|
|
266
267
|
MAX_RECOVERY_LEDGER_BYTES,
|
|
268
|
+
PR_REVIEW_BASE_DIMENSION_IDS,
|
|
269
|
+
PR_REVIEW_DISCARDED_EXAMPLE_ITEM_ID,
|
|
270
|
+
PR_REVIEW_FINDINGS_MAX_BYTES,
|
|
271
|
+
PR_REVIEW_HANDOFF_MAX_BYTES,
|
|
272
|
+
PR_REVIEW_RISK_IMPACTS,
|
|
273
|
+
PR_REVIEW_RISK_TAGS,
|
|
274
|
+
PrReviewCriticVerdictFieldsSchema,
|
|
275
|
+
PrReviewResultReceiptSchema,
|
|
276
|
+
PrReviewReviewerVerdictFieldsSchema,
|
|
267
277
|
collectDelegationLedgerHealth,
|
|
268
278
|
findByBatchId,
|
|
269
279
|
maintainBackgroundDelegations,
|
|
280
|
+
parsePrReviewRiskTagsField,
|
|
281
|
+
parsePrReviewVerdictRow,
|
|
282
|
+
prReviewFindingRequiresCritic,
|
|
283
|
+
prReviewLegacyTranscriptCompatibilityEnabled,
|
|
270
284
|
readDelegationHealthArtifact,
|
|
271
285
|
readDelegations,
|
|
272
286
|
scanBackgroundCoderReservationsForAdmission,
|
|
273
287
|
scanDelegationsForRecovery,
|
|
274
288
|
sweepStaleDelegations
|
|
275
|
-
} from "./index-
|
|
289
|
+
} from "./index-k50kxd3w.js";
|
|
276
290
|
import {
|
|
277
291
|
compositeSessionKey,
|
|
278
292
|
sessionKeySuffix
|
|
@@ -283,7 +297,7 @@ import {
|
|
|
283
297
|
clearAllScopes,
|
|
284
298
|
clearScopeBindingFromDisk,
|
|
285
299
|
clearScopeBindings
|
|
286
|
-
} from "./index-
|
|
300
|
+
} from "./index-xsd7y4hp.js";
|
|
287
301
|
import {
|
|
288
302
|
appendLedgerEvent,
|
|
289
303
|
computePlanHash,
|
|
@@ -298,7 +312,7 @@ import {
|
|
|
298
312
|
readPlanEpochIdentity,
|
|
299
313
|
replayFromLedgerWithStatus,
|
|
300
314
|
takeSnapshotEvent
|
|
301
|
-
} from "./index-
|
|
315
|
+
} from "./index-5th50g17.js";
|
|
302
316
|
import {
|
|
303
317
|
CORE_EVENT_LOCKED,
|
|
304
318
|
appendCoreEventSync,
|
|
@@ -308,7 +322,7 @@ import {
|
|
|
308
322
|
hasSpecDriftAuditEvent,
|
|
309
323
|
hasTaskRepairAuditEvent,
|
|
310
324
|
readCoreEvents
|
|
311
|
-
} from "./index-
|
|
325
|
+
} from "./index-7h2armwf.js";
|
|
312
326
|
import {
|
|
313
327
|
sanitizeDiagnosticText
|
|
314
328
|
} from "./index-556ja8an.js";
|
|
@@ -357,7 +371,7 @@ import {
|
|
|
357
371
|
transactFile,
|
|
358
372
|
transactKnowledge,
|
|
359
373
|
wordBigrams
|
|
360
|
-
} from "./index-
|
|
374
|
+
} from "./index-war2dt6a.js";
|
|
361
375
|
import {
|
|
362
376
|
MAX_EVENT_LOG_ENTRIES,
|
|
363
377
|
_internals as _internals2,
|
|
@@ -373,13 +387,13 @@ import {
|
|
|
373
387
|
recordKnowledgeEvent,
|
|
374
388
|
recordPhaseCloseIntent,
|
|
375
389
|
resolveKnowledgeEventsPath
|
|
376
|
-
} from "./index-
|
|
390
|
+
} from "./index-3a35tt6a.js";
|
|
377
391
|
import {
|
|
378
392
|
resolveWorktreeIsolationConfig
|
|
379
|
-
} from "./index-
|
|
393
|
+
} from "./index-xkmzsfg5.js";
|
|
380
394
|
import {
|
|
381
395
|
RetrospectiveEvidenceSchema
|
|
382
|
-
} from "./index-
|
|
396
|
+
} from "./index-q8hm27yj.js";
|
|
383
397
|
import {
|
|
384
398
|
estimateTokens,
|
|
385
399
|
readSwarmFileAsync,
|
|
@@ -399,7 +413,7 @@ import {
|
|
|
399
413
|
init_loader,
|
|
400
414
|
loadPluginConfig,
|
|
401
415
|
loadPluginConfigWithMeta
|
|
402
|
-
} from "./index-
|
|
416
|
+
} from "./index-717pmdce.js";
|
|
403
417
|
import {
|
|
404
418
|
DEFAULT_HARNESS_EVOLUTION_CONFIG,
|
|
405
419
|
DEFAULT_PR_REVIEW_RESILIENCE_CONFIG,
|
|
@@ -415,7 +429,7 @@ import {
|
|
|
415
429
|
package_default,
|
|
416
430
|
resolveAutoReviewConfig,
|
|
417
431
|
stripKnownSwarmPrefix
|
|
418
|
-
} from "./index-
|
|
432
|
+
} from "./index-6scakreq.js";
|
|
419
433
|
import {
|
|
420
434
|
init_git_executable,
|
|
421
435
|
resolveGitExecutable,
|
|
@@ -431,7 +445,7 @@ import {
|
|
|
431
445
|
observeCuratorCompliance,
|
|
432
446
|
observeStoreHealth,
|
|
433
447
|
readLearningHealth
|
|
434
|
-
} from "./index-
|
|
448
|
+
} from "./index-mmr96pwr.js";
|
|
435
449
|
import {
|
|
436
450
|
AGENT_TOOL_MAP,
|
|
437
451
|
ALL_AGENT_NAMES,
|
|
@@ -445,7 +459,7 @@ import {
|
|
|
445
459
|
init_agent_names,
|
|
446
460
|
init_constants,
|
|
447
461
|
init_tool_metadata
|
|
448
|
-
} from "./index-
|
|
462
|
+
} from "./index-c9zp4xwc.js";
|
|
449
463
|
import {
|
|
450
464
|
resolveHiveDataDir,
|
|
451
465
|
resolveHiveEventsPath,
|
|
@@ -461,10 +475,10 @@ import {
|
|
|
461
475
|
resolveLinkDir,
|
|
462
476
|
sanitizeLinkId,
|
|
463
477
|
writeLinkPointer
|
|
464
|
-
} from "./index-
|
|
478
|
+
} from "./index-prv20xq6.js";
|
|
465
479
|
import {
|
|
466
480
|
atomicWriteFile
|
|
467
|
-
} from "./index-
|
|
481
|
+
} from "./index-7ezv5j23.js";
|
|
468
482
|
import {
|
|
469
483
|
KNOWLEDGE_SCHEMA_VERSION,
|
|
470
484
|
OUTCOME_BLOCK_THRESHOLD,
|
|
@@ -484,7 +498,7 @@ import {
|
|
|
484
498
|
atomicWriteSwarmFileSync,
|
|
485
499
|
matchTempGrammar,
|
|
486
500
|
parseTargetBasename
|
|
487
|
-
} from "./index-
|
|
501
|
+
} from "./index-dh5q6z7y.js";
|
|
488
502
|
import {
|
|
489
503
|
invalidateCachedArtifact,
|
|
490
504
|
resetSwarmArtifactCache
|
|
@@ -6944,355 +6958,6 @@ import { readFileSync as readFileSync5, statSync as statSync5 } from "fs";
|
|
|
6944
6958
|
import * as fsp2 from "fs/promises";
|
|
6945
6959
|
import * as path12 from "path";
|
|
6946
6960
|
|
|
6947
|
-
// src/background/pr-review-contract.ts
|
|
6948
|
-
init_zod();
|
|
6949
|
-
var PR_REVIEW_REVIEWER_CLASSIFICATIONS = [
|
|
6950
|
-
"CONFIRMED",
|
|
6951
|
-
"DISPROVED",
|
|
6952
|
-
"UNVERIFIED",
|
|
6953
|
-
"PRE_EXISTING"
|
|
6954
|
-
];
|
|
6955
|
-
var PR_REVIEW_REVIEWER_EVIDENCE_TYPES = [
|
|
6956
|
-
"STRUCTURALLY_PROVEN",
|
|
6957
|
-
"EXECUTION_PROVEN",
|
|
6958
|
-
"STATIC_TRACE_PROVEN",
|
|
6959
|
-
"PLAUSIBLE_BUT_UNVERIFIED"
|
|
6960
|
-
];
|
|
6961
|
-
var PR_REVIEW_SEVERITIES = [
|
|
6962
|
-
"CRITICAL",
|
|
6963
|
-
"HIGH",
|
|
6964
|
-
"MEDIUM",
|
|
6965
|
-
"LOW",
|
|
6966
|
-
"INFO",
|
|
6967
|
-
"NONE"
|
|
6968
|
-
];
|
|
6969
|
-
var PR_REVIEW_CRITIC_STATUSES = [
|
|
6970
|
-
"UPHELD",
|
|
6971
|
-
"DOWNGRADED",
|
|
6972
|
-
"DISPROVED",
|
|
6973
|
-
"NEEDS_MORE_EVIDENCE"
|
|
6974
|
-
];
|
|
6975
|
-
var PR_REVIEW_FINDING_STATUSES = [
|
|
6976
|
-
"PENDING",
|
|
6977
|
-
"CONFIRMED",
|
|
6978
|
-
"DISPROVED",
|
|
6979
|
-
"PRE_EXISTING"
|
|
6980
|
-
];
|
|
6981
|
-
var PR_REVIEW_FINDING_ACTIONS = [
|
|
6982
|
-
"route_to_reviewer",
|
|
6983
|
-
"route_to_critic",
|
|
6984
|
-
"report",
|
|
6985
|
-
"suppress_with_reason",
|
|
6986
|
-
"handoff_to_feedback"
|
|
6987
|
-
];
|
|
6988
|
-
var PR_REVIEW_ARTIFACT_BOUNDARIES = [
|
|
6989
|
-
"post_explorer",
|
|
6990
|
-
"post_reviewer",
|
|
6991
|
-
"post_critic"
|
|
6992
|
-
];
|
|
6993
|
-
var PR_REVIEW_BASE_DIMENSION_IDS = [
|
|
6994
|
-
"intent-architecture",
|
|
6995
|
-
"correctness-state",
|
|
6996
|
-
"tests-falsifiability",
|
|
6997
|
-
"security-trust",
|
|
6998
|
-
"reliability-performance",
|
|
6999
|
-
"compatibility-delivery"
|
|
7000
|
-
];
|
|
7001
|
-
var PR_REVIEW_RISK_IMPACTS = [
|
|
7002
|
-
"ORDINARY",
|
|
7003
|
-
"HIGH_IMPACT",
|
|
7004
|
-
"UNKNOWN"
|
|
7005
|
-
];
|
|
7006
|
-
var PR_REVIEW_RISK_TAGS = [
|
|
7007
|
-
"SECURITY",
|
|
7008
|
-
"AUTH_PERMISSIONS",
|
|
7009
|
-
"STATE_INTEGRITY",
|
|
7010
|
-
"WRITE_PATH",
|
|
7011
|
-
"EVIDENCE_INTEGRITY",
|
|
7012
|
-
"GIT",
|
|
7013
|
-
"CONFIGURATION"
|
|
7014
|
-
];
|
|
7015
|
-
var PR_REVIEW_FINDINGS_MAX_BYTES = 10 * 1024 * 1024;
|
|
7016
|
-
var PR_REVIEW_FINDINGS_WRITE_MAX_BYTES = 3 * 1024 * 1024;
|
|
7017
|
-
var PR_REVIEW_HANDOFF_MAX_BYTES = 128 * 1024;
|
|
7018
|
-
var PR_REVIEW_HANDOFF_WRITE_MAX_BYTES = 120 * 1024;
|
|
7019
|
-
var PR_REVIEW_DISCARDED_EXAMPLE_ITEM_ID = "discarded-id";
|
|
7020
|
-
function serializedPrReviewArtifactInputBytes(value) {
|
|
7021
|
-
return new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
7022
|
-
}
|
|
7023
|
-
var PrReviewRunIdSchema = exports_external.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/, "run_id must be a safe relative identifier");
|
|
7024
|
-
var PrReviewFindingSchema = exports_external.object({
|
|
7025
|
-
finding_id: exports_external.string().trim().min(1).max(128),
|
|
7026
|
-
status: exports_external.enum(PR_REVIEW_FINDING_STATUSES),
|
|
7027
|
-
file_line: exports_external.string().trim().min(1).max(1000),
|
|
7028
|
-
evidence: exports_external.string().trim().min(1).max(20000),
|
|
7029
|
-
next_action: exports_external.enum(PR_REVIEW_FINDING_ACTIONS),
|
|
7030
|
-
severity: exports_external.enum(PR_REVIEW_SEVERITIES).optional(),
|
|
7031
|
-
category: exports_external.string().trim().min(1).max(128).optional(),
|
|
7032
|
-
risk_impact: exports_external.enum(PR_REVIEW_RISK_IMPACTS).optional(),
|
|
7033
|
-
risk_tags: exports_external.array(exports_external.enum(PR_REVIEW_RISK_TAGS)).max(PR_REVIEW_RISK_TAGS.length).optional()
|
|
7034
|
-
}).strict().superRefine((value, ctx) => {
|
|
7035
|
-
if (value.status !== "CONFIRMED")
|
|
7036
|
-
return;
|
|
7037
|
-
if (value.risk_impact === undefined) {
|
|
7038
|
-
ctx.addIssue({
|
|
7039
|
-
code: "custom",
|
|
7040
|
-
path: ["risk_impact"],
|
|
7041
|
-
message: "is required on every newly written CONFIRMED finding (issue #2383 typed critic routing)"
|
|
7042
|
-
});
|
|
7043
|
-
}
|
|
7044
|
-
if (value.risk_tags === undefined) {
|
|
7045
|
-
ctx.addIssue({
|
|
7046
|
-
code: "custom",
|
|
7047
|
-
path: ["risk_tags"],
|
|
7048
|
-
message: "is required on every newly written CONFIRMED finding (issue #2383 typed critic routing)"
|
|
7049
|
-
});
|
|
7050
|
-
}
|
|
7051
|
-
});
|
|
7052
|
-
function prReviewFindingRequiresCritic(input) {
|
|
7053
|
-
if (input.classification !== "CONFIRMED")
|
|
7054
|
-
return false;
|
|
7055
|
-
const impact = input.risk_impact ?? "UNKNOWN";
|
|
7056
|
-
const tags = input.risk_tags ?? [];
|
|
7057
|
-
if (impact === "UNKNOWN")
|
|
7058
|
-
return true;
|
|
7059
|
-
if (input.severity === undefined)
|
|
7060
|
-
return true;
|
|
7061
|
-
if (input.severity === "CRITICAL" || input.severity === "HIGH")
|
|
7062
|
-
return true;
|
|
7063
|
-
if (input.severity === "MEDIUM") {
|
|
7064
|
-
return impact === "HIGH_IMPACT" || tags.length > 0;
|
|
7065
|
-
}
|
|
7066
|
-
return false;
|
|
7067
|
-
}
|
|
7068
|
-
var PrReviewHandoffSchema = exports_external.object({
|
|
7069
|
-
pr_url: exports_external.string().url().max(2000),
|
|
7070
|
-
finding_ids: exports_external.array(exports_external.string().trim().min(1).max(128)).min(1).max(1000),
|
|
7071
|
-
summary: exports_external.string().trim().min(1).max(20000),
|
|
7072
|
-
provenance: exports_external.array(exports_external.string().trim().min(1).max(4000)).min(1).max(1000)
|
|
7073
|
-
}).strict();
|
|
7074
|
-
var PrReviewPartialBaseCoverageSchema = exports_external.object({
|
|
7075
|
-
unresolved_dimensions: exports_external.array(exports_external.enum(PR_REVIEW_BASE_DIMENSION_IDS)).min(1).max(PR_REVIEW_BASE_DIMENSION_IDS.length)
|
|
7076
|
-
}).strict().superRefine((value, ctx) => {
|
|
7077
|
-
const seen = new Set;
|
|
7078
|
-
for (const dimension of value.unresolved_dimensions) {
|
|
7079
|
-
if (seen.has(dimension)) {
|
|
7080
|
-
ctx.addIssue({
|
|
7081
|
-
code: "custom",
|
|
7082
|
-
path: ["unresolved_dimensions"],
|
|
7083
|
-
message: `must not contain duplicate dimension "${dimension}"`
|
|
7084
|
-
});
|
|
7085
|
-
return;
|
|
7086
|
-
}
|
|
7087
|
-
seen.add(dimension);
|
|
7088
|
-
}
|
|
7089
|
-
});
|
|
7090
|
-
var WritePrReviewArtifactArgsSchema = exports_external.discriminatedUnion("kind", [
|
|
7091
|
-
exports_external.object({
|
|
7092
|
-
kind: exports_external.literal("findings"),
|
|
7093
|
-
run_id: PrReviewRunIdSchema.optional(),
|
|
7094
|
-
pr_head_sha: exports_external.string().trim().regex(/^[0-9a-f]{6,64}$/i),
|
|
7095
|
-
boundary: exports_external.enum(PR_REVIEW_ARTIFACT_BOUNDARIES),
|
|
7096
|
-
records: exports_external.array(PrReviewFindingSchema).min(1).max(1000),
|
|
7097
|
-
partial_base_coverage: PrReviewPartialBaseCoverageSchema.optional()
|
|
7098
|
-
}).strict(),
|
|
7099
|
-
exports_external.object({
|
|
7100
|
-
kind: exports_external.literal("handoff"),
|
|
7101
|
-
run_id: PrReviewRunIdSchema.optional(),
|
|
7102
|
-
pr_head_sha: exports_external.string().trim().regex(/^[0-9a-f]{6,64}$/i),
|
|
7103
|
-
handoff: PrReviewHandoffSchema
|
|
7104
|
-
}).strict()
|
|
7105
|
-
]).superRefine((value, ctx) => {
|
|
7106
|
-
if (value.kind === "findings" && value.partial_base_coverage !== undefined && value.boundary !== "post_explorer") {
|
|
7107
|
-
ctx.addIssue({
|
|
7108
|
-
code: "custom",
|
|
7109
|
-
path: ["partial_base_coverage"],
|
|
7110
|
-
message: "is valid only for the post_explorer boundary"
|
|
7111
|
-
});
|
|
7112
|
-
}
|
|
7113
|
-
const bytes = serializedPrReviewArtifactInputBytes(value);
|
|
7114
|
-
const maxBytes = value.kind === "findings" ? PR_REVIEW_FINDINGS_WRITE_MAX_BYTES : PR_REVIEW_HANDOFF_WRITE_MAX_BYTES;
|
|
7115
|
-
if (bytes > maxBytes) {
|
|
7116
|
-
ctx.addIssue({
|
|
7117
|
-
code: "custom",
|
|
7118
|
-
path: [value.kind === "findings" ? "records" : "handoff"],
|
|
7119
|
-
message: `serialized UTF-8 payload must be at most ${maxBytes} bytes (got ${bytes})`
|
|
7120
|
-
});
|
|
7121
|
-
}
|
|
7122
|
-
});
|
|
7123
|
-
var introducedByPrSchema = exports_external.string().regex(/^(?:introduced_by_pr\s*:\s*)?(?:YES|NO|UNKNOWN)$/i);
|
|
7124
|
-
var PrReviewRiskTagsFieldPattern = new RegExp(`^(?:(?:${PR_REVIEW_RISK_TAGS.join("|")})(?:,(?:${PR_REVIEW_RISK_TAGS.join("|")}))*)?$`);
|
|
7125
|
-
var PrReviewRiskTagsFieldSchema = exports_external.string().regex(PrReviewRiskTagsFieldPattern, `must be a comma-separated subset of the canonical risk tags (${PR_REVIEW_RISK_TAGS.join(", ")}), or empty`);
|
|
7126
|
-
var PR_REVIEW_REVIEWER_LEGACY_FIELD_COUNT = 10;
|
|
7127
|
-
function parsePrReviewRiskTagsField(field) {
|
|
7128
|
-
const trimmed = field.trim();
|
|
7129
|
-
if (!trimmed)
|
|
7130
|
-
return [];
|
|
7131
|
-
return trimmed.split(",").map((tag) => tag.trim());
|
|
7132
|
-
}
|
|
7133
|
-
var PrReviewReviewerVerdictFieldsSchema = exports_external.tuple([
|
|
7134
|
-
exports_external.literal("[REVIEWED]"),
|
|
7135
|
-
exports_external.string().min(1),
|
|
7136
|
-
exports_external.enum(PR_REVIEW_REVIEWER_CLASSIFICATIONS),
|
|
7137
|
-
exports_external.enum(PR_REVIEW_REVIEWER_EVIDENCE_TYPES),
|
|
7138
|
-
exports_external.enum(PR_REVIEW_SEVERITIES),
|
|
7139
|
-
introducedByPrSchema,
|
|
7140
|
-
exports_external.string().min(1),
|
|
7141
|
-
exports_external.string().min(8),
|
|
7142
|
-
exports_external.string().min(5),
|
|
7143
|
-
exports_external.string().min(3),
|
|
7144
|
-
exports_external.enum(PR_REVIEW_RISK_IMPACTS),
|
|
7145
|
-
PrReviewRiskTagsFieldSchema
|
|
7146
|
-
]).superRefine((fields, ctx) => {
|
|
7147
|
-
if (fields[2] === "DISPROVED" && fields[4] !== "NONE") {
|
|
7148
|
-
ctx.addIssue({
|
|
7149
|
-
code: "custom",
|
|
7150
|
-
path: [4],
|
|
7151
|
-
message: "DISPROVED reviewer severity must be NONE"
|
|
7152
|
-
});
|
|
7153
|
-
}
|
|
7154
|
-
});
|
|
7155
|
-
var PrReviewCriticVerdictFieldsSchema = exports_external.tuple([
|
|
7156
|
-
exports_external.literal("[CRITIC]"),
|
|
7157
|
-
exports_external.string().min(1),
|
|
7158
|
-
exports_external.enum(PR_REVIEW_CRITIC_STATUSES),
|
|
7159
|
-
exports_external.enum(PR_REVIEW_SEVERITIES),
|
|
7160
|
-
exports_external.string().min(6),
|
|
7161
|
-
exports_external.string().min(6)
|
|
7162
|
-
]).superRefine((fields, ctx) => {
|
|
7163
|
-
const status = fields[2];
|
|
7164
|
-
const severity = fields[3];
|
|
7165
|
-
if (status === "NEEDS_MORE_EVIDENCE") {
|
|
7166
|
-
ctx.addIssue({
|
|
7167
|
-
code: "custom",
|
|
7168
|
-
path: [2],
|
|
7169
|
-
message: "NEEDS_MORE_EVIDENCE is not a terminal transport verdict"
|
|
7170
|
-
});
|
|
7171
|
-
}
|
|
7172
|
-
if (status === "DISPROVED" && severity !== "NONE") {
|
|
7173
|
-
ctx.addIssue({
|
|
7174
|
-
code: "custom",
|
|
7175
|
-
path: [3],
|
|
7176
|
-
message: "DISPROVED critic severity must be NONE"
|
|
7177
|
-
});
|
|
7178
|
-
}
|
|
7179
|
-
if (status === "UPHELD" && !["CRITICAL", "HIGH", "MEDIUM"].includes(severity)) {
|
|
7180
|
-
ctx.addIssue({
|
|
7181
|
-
code: "custom",
|
|
7182
|
-
path: [3],
|
|
7183
|
-
message: "UPHELD critic severity must be CRITICAL, HIGH, or MEDIUM"
|
|
7184
|
-
});
|
|
7185
|
-
}
|
|
7186
|
-
if (status === "DOWNGRADED" && severity === "CRITICAL") {
|
|
7187
|
-
ctx.addIssue({
|
|
7188
|
-
code: "custom",
|
|
7189
|
-
path: [3],
|
|
7190
|
-
message: "DOWNGRADED critic severity cannot be CRITICAL"
|
|
7191
|
-
});
|
|
7192
|
-
}
|
|
7193
|
-
});
|
|
7194
|
-
var PR_REVIEW_VERDICT_ROW_DESCRIPTORS = {
|
|
7195
|
-
reviewer: {
|
|
7196
|
-
marker: "[REVIEWED]",
|
|
7197
|
-
fieldCount: 12,
|
|
7198
|
-
fieldRoles: [
|
|
7199
|
-
"marker",
|
|
7200
|
-
"item_id",
|
|
7201
|
-
"classification",
|
|
7202
|
-
"evidence_type",
|
|
7203
|
-
"severity",
|
|
7204
|
-
"introduced_by_pr",
|
|
7205
|
-
"file:line",
|
|
7206
|
-
"rationale",
|
|
7207
|
-
"probe",
|
|
7208
|
-
"reviewer_notes",
|
|
7209
|
-
"risk_impact",
|
|
7210
|
-
"risk_tags"
|
|
7211
|
-
],
|
|
7212
|
-
schema: PrReviewReviewerVerdictFieldsSchema
|
|
7213
|
-
},
|
|
7214
|
-
critic: {
|
|
7215
|
-
marker: "[CRITIC]",
|
|
7216
|
-
fieldCount: 6,
|
|
7217
|
-
fieldRoles: [
|
|
7218
|
-
"marker",
|
|
7219
|
-
"item_id",
|
|
7220
|
-
"status",
|
|
7221
|
-
"severity",
|
|
7222
|
-
"rationale",
|
|
7223
|
-
"required_change"
|
|
7224
|
-
],
|
|
7225
|
-
schema: PrReviewCriticVerdictFieldsSchema
|
|
7226
|
-
}
|
|
7227
|
-
};
|
|
7228
|
-
function parsePrReviewVerdictRow(line, kind) {
|
|
7229
|
-
const descriptor = PR_REVIEW_VERDICT_ROW_DESCRIPTORS[kind];
|
|
7230
|
-
const fields = [];
|
|
7231
|
-
let current = "";
|
|
7232
|
-
let usedCanonicalEscape = false;
|
|
7233
|
-
for (let index = 0;index < line.length; index++) {
|
|
7234
|
-
const char = line[index];
|
|
7235
|
-
if (char === "\\") {
|
|
7236
|
-
const next = line[index + 1];
|
|
7237
|
-
if (next === "\\") {
|
|
7238
|
-
current += "\\";
|
|
7239
|
-
usedCanonicalEscape = true;
|
|
7240
|
-
index++;
|
|
7241
|
-
continue;
|
|
7242
|
-
}
|
|
7243
|
-
if (next === "|") {
|
|
7244
|
-
current += "|";
|
|
7245
|
-
usedCanonicalEscape = true;
|
|
7246
|
-
index++;
|
|
7247
|
-
continue;
|
|
7248
|
-
}
|
|
7249
|
-
if (next === "n") {
|
|
7250
|
-
current += `
|
|
7251
|
-
`;
|
|
7252
|
-
usedCanonicalEscape = true;
|
|
7253
|
-
index++;
|
|
7254
|
-
continue;
|
|
7255
|
-
}
|
|
7256
|
-
if (next === "r") {
|
|
7257
|
-
current += "\r";
|
|
7258
|
-
usedCanonicalEscape = true;
|
|
7259
|
-
index++;
|
|
7260
|
-
continue;
|
|
7261
|
-
}
|
|
7262
|
-
current += "\\";
|
|
7263
|
-
continue;
|
|
7264
|
-
}
|
|
7265
|
-
if (char === "|") {
|
|
7266
|
-
fields.push(current.trim());
|
|
7267
|
-
current = "";
|
|
7268
|
-
continue;
|
|
7269
|
-
}
|
|
7270
|
-
current += char;
|
|
7271
|
-
}
|
|
7272
|
-
fields.push(current.trim());
|
|
7273
|
-
if (fields[0] !== descriptor.marker)
|
|
7274
|
-
return null;
|
|
7275
|
-
if (kind === "reviewer" && fields.length === PR_REVIEW_REVIEWER_LEGACY_FIELD_COUNT) {
|
|
7276
|
-
fields.push("UNKNOWN", "");
|
|
7277
|
-
}
|
|
7278
|
-
if (fields.length > descriptor.fieldCount) {
|
|
7279
|
-
const retained = fields.slice(0, descriptor.fieldCount - 1);
|
|
7280
|
-
retained.push(fields.slice(descriptor.fieldCount - 1).join("|"));
|
|
7281
|
-
return {
|
|
7282
|
-
marker: descriptor.marker,
|
|
7283
|
-
fields: retained,
|
|
7284
|
-
recoveredOverflow: true,
|
|
7285
|
-
overflowClass: fields.length === descriptor.fieldCount + 1 && fields[fields.length - 1] === "" ? "legacy-fidelity-safe" : "legacy-lossy"
|
|
7286
|
-
};
|
|
7287
|
-
}
|
|
7288
|
-
return {
|
|
7289
|
-
marker: descriptor.marker,
|
|
7290
|
-
fields,
|
|
7291
|
-
recoveredOverflow: false,
|
|
7292
|
-
overflowClass: fields.length === descriptor.fieldCount ? usedCanonicalEscape ? "canonical" : "legacy-fidelity-safe" : "legacy-lossy"
|
|
7293
|
-
};
|
|
7294
|
-
}
|
|
7295
|
-
|
|
7296
6961
|
// src/background/candidate-contract.ts
|
|
7297
6962
|
var CANDIDATE_SEVERITIES = [
|
|
7298
6963
|
"INFO",
|
|
@@ -9461,6 +9126,7 @@ var MAX_PUBLICATION_HISTORY_GENERATIONS = 4;
|
|
|
9461
9126
|
var MAX_PUBLICATION_ATTEMPTS = 8;
|
|
9462
9127
|
var MAX_PUSH_ATTEMPT_DIAGNOSTIC_CHARS = 500;
|
|
9463
9128
|
var PUBLICATION_SCHEMA_VERSION = 1;
|
|
9129
|
+
var PUBLICATION_URL_CREDENTIALS_PATTERN = /\b([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^\s/@:]+:[^\s/@]+@/g;
|
|
9464
9130
|
var GATE_SCHEMA_VERSION = 1;
|
|
9465
9131
|
var MAX_TRACKED_SESSIONS3 = 200;
|
|
9466
9132
|
var MAX_WORKFLOW_BATCHES = 128;
|
|
@@ -10469,7 +10135,7 @@ function summarizePrReviewBaseDimensionAttempts(directory, state, revisionDigest
|
|
|
10469
10135
|
if (batchSuccessful.has(dimension))
|
|
10470
10136
|
dedicatedSuccessful.add(dimension);
|
|
10471
10137
|
}
|
|
10472
|
-
const semanticallyValidLaneIds = new Set(recordsPassingBatchIntegrity(directory, state, batch.batchId, batch.lanes, "swarm-pr-review:base", batch.validatedAt).filter((qualified) => hasRevisionIndependentDiscoverySemantics(directory, qualified)).map((qualified) => qualified.record.laneId));
|
|
10138
|
+
const semanticallyValidLaneIds = new Set(recordsPassingBatchIntegrity(directory, state, batch.batchId, batch.lanes, "swarm-pr-review:base", batch.validatedAt).filter((qualified) => hasRevisionIndependentDiscoverySemantics(directory, qualified, state)).map((qualified) => qualified.record.laneId));
|
|
10473
10139
|
const records = findByBatchId(directory, batch.batchId, {
|
|
10474
10140
|
parentSessionId: state.sessionID
|
|
10475
10141
|
});
|
|
@@ -10503,7 +10169,7 @@ function summarizePrReviewBaseDimensionAttempts(directory, state, revisionDigest
|
|
|
10503
10169
|
terminallyFailed
|
|
10504
10170
|
};
|
|
10505
10171
|
}
|
|
10506
|
-
function hasRevisionIndependentDiscoverySemantics(directory, qualified) {
|
|
10172
|
+
function hasRevisionIndependentDiscoverySemantics(directory, qualified, state) {
|
|
10507
10173
|
const ref = qualified.record.result?.outputRef?.trim();
|
|
10508
10174
|
if (!ref)
|
|
10509
10175
|
return false;
|
|
@@ -10518,10 +10184,13 @@ function hasRevisionIndependentDiscoverySemantics(directory, qualified) {
|
|
|
10518
10184
|
mode: "swarm-pr-review:base",
|
|
10519
10185
|
workflowLane: qualified.expectedWorkflowLane,
|
|
10520
10186
|
ownedWorkflowLanes: qualified.expectedOwnedLanes,
|
|
10521
|
-
prHeadSha:
|
|
10522
|
-
gitHead:
|
|
10187
|
+
prHeadSha: state.prHeadSha ?? "",
|
|
10188
|
+
gitHead: state.prHeadSha ?? "",
|
|
10523
10189
|
revisionDigest: artifact.revisionDigest,
|
|
10524
|
-
|
|
10190
|
+
workflowInstanceId: state.workflowInstanceId,
|
|
10191
|
+
workflowRevision: state.revision,
|
|
10192
|
+
baseSha: state.prReviewBaseSha,
|
|
10193
|
+
reviewScope: state.prReviewBaseSha && state.prHeadSha ? `complete PR diff ${state.prReviewBaseSha}...${state.prHeadSha}` : undefined
|
|
10525
10194
|
}
|
|
10526
10195
|
}).ok;
|
|
10527
10196
|
}
|
|
@@ -10555,6 +10224,86 @@ function latestTypedFailureForBaseDimension(directory, state, dimension) {
|
|
|
10555
10224
|
}
|
|
10556
10225
|
return latest;
|
|
10557
10226
|
}
|
|
10227
|
+
function failureClassFromStructuredUnresolvedReason(reason) {
|
|
10228
|
+
switch (reason) {
|
|
10229
|
+
case "RESOURCE_LIMIT":
|
|
10230
|
+
return "resource";
|
|
10231
|
+
case "DEADLINE_EXCEEDED":
|
|
10232
|
+
return "deadline";
|
|
10233
|
+
default:
|
|
10234
|
+
return "contract";
|
|
10235
|
+
}
|
|
10236
|
+
}
|
|
10237
|
+
function safeDetailFromStructuredUnresolvedReason(reason) {
|
|
10238
|
+
switch (reason) {
|
|
10239
|
+
case "NOT_EXECUTED":
|
|
10240
|
+
return "structured receipt reported this lane was never executed";
|
|
10241
|
+
case "PARTIAL_OUTPUT":
|
|
10242
|
+
return "structured receipt reported partial output that could not settle this lane";
|
|
10243
|
+
case "CONTRACT_FAILURE":
|
|
10244
|
+
return "structured receipt reported contract-invalid output for this lane";
|
|
10245
|
+
case "RESOURCE_LIMIT":
|
|
10246
|
+
return "structured receipt reported the lane exhausted its resource budget";
|
|
10247
|
+
case "DEADLINE_EXCEEDED":
|
|
10248
|
+
return "structured receipt reported the lane exceeded its collection deadline";
|
|
10249
|
+
case "STALE_BINDING":
|
|
10250
|
+
return "structured receipt reported stale workflow binding for this lane";
|
|
10251
|
+
case "PARENT_CANCELLED":
|
|
10252
|
+
return "structured receipt reported parent-side cancellation before settlement";
|
|
10253
|
+
}
|
|
10254
|
+
}
|
|
10255
|
+
function latestStructuredReceiptUnresolvedForBaseDimension(directory, state, revisionDigest, dimension) {
|
|
10256
|
+
let latest = null;
|
|
10257
|
+
const reviewScope = state.prReviewBaseSha && state.prHeadSha ? `complete PR diff ${state.prReviewBaseSha}...${state.prHeadSha}` : undefined;
|
|
10258
|
+
for (const batch of state.prReviewBaseDispatches ?? []) {
|
|
10259
|
+
const records = findByBatchId(directory, batch.batchId, {
|
|
10260
|
+
parentSessionId: state.sessionID
|
|
10261
|
+
});
|
|
10262
|
+
for (const lane of batch.lanes) {
|
|
10263
|
+
const ownedWorkflowLanes = lane.ownedWorkflowLanes?.length ? lane.ownedWorkflowLanes : [lane.workflowLane];
|
|
10264
|
+
if (!ownedWorkflowLanes.includes(dimension))
|
|
10265
|
+
continue;
|
|
10266
|
+
for (const record of records.filter((candidate) => candidate.laneId === lane.laneId)) {
|
|
10267
|
+
const result = record.result;
|
|
10268
|
+
if (!result)
|
|
10269
|
+
continue;
|
|
10270
|
+
const structured = validateExactStructuredReceiptCoverage({
|
|
10271
|
+
record,
|
|
10272
|
+
result,
|
|
10273
|
+
artifact: null,
|
|
10274
|
+
expected: {
|
|
10275
|
+
mode: "swarm-pr-review:base",
|
|
10276
|
+
workflowLane: lane.workflowLane,
|
|
10277
|
+
ownedWorkflowLanes,
|
|
10278
|
+
prHeadSha: state.prHeadSha ?? "",
|
|
10279
|
+
gitHead: state.prHeadSha ?? "",
|
|
10280
|
+
revisionDigest,
|
|
10281
|
+
workflowInstanceId: state.workflowInstanceId,
|
|
10282
|
+
workflowRevision: state.revision,
|
|
10283
|
+
baseSha: state.prReviewBaseSha,
|
|
10284
|
+
reviewScope
|
|
10285
|
+
}
|
|
10286
|
+
});
|
|
10287
|
+
if (structured.status !== "accepted")
|
|
10288
|
+
continue;
|
|
10289
|
+
const unresolved = structured.receipt.envelope.unresolved.find((entry) => entry.workflowLane === dimension);
|
|
10290
|
+
if (!unresolved)
|
|
10291
|
+
continue;
|
|
10292
|
+
const candidate = {
|
|
10293
|
+
failureClass: failureClassFromStructuredUnresolvedReason(unresolved.reason),
|
|
10294
|
+
recordedAt: record.updatedAt,
|
|
10295
|
+
batchId: batch.batchId,
|
|
10296
|
+
laneId: lane.laneId,
|
|
10297
|
+
safeDetail: safeDetailFromStructuredUnresolvedReason(unresolved.reason)
|
|
10298
|
+
};
|
|
10299
|
+
if (latest === null || candidate.recordedAt > latest.recordedAt || candidate.recordedAt === latest.recordedAt && `${candidate.batchId}\x00${candidate.laneId}`.localeCompare(`${latest.batchId}\x00${latest.laneId}`) > 0) {
|
|
10300
|
+
latest = candidate;
|
|
10301
|
+
}
|
|
10302
|
+
}
|
|
10303
|
+
}
|
|
10304
|
+
}
|
|
10305
|
+
return latest;
|
|
10306
|
+
}
|
|
10558
10307
|
var MAX_COVER_UNIVERSE_BITS = 12;
|
|
10559
10308
|
function minimumConsolidatedLaneCover(sets) {
|
|
10560
10309
|
const bitOf = new Map;
|
|
@@ -10647,16 +10396,18 @@ function derivePrReviewDimensionSettlement(directory, state, revisionDigest) {
|
|
|
10647
10396
|
continue;
|
|
10648
10397
|
}
|
|
10649
10398
|
const latestFailure = latestTypedFailureForBaseDimension(directory, state, dimension);
|
|
10650
|
-
|
|
10399
|
+
const latestStructuredUnresolved = latestStructuredReceiptUnresolvedForBaseDimension(directory, state, revisionDigest, dimension);
|
|
10400
|
+
if (attempts.terminallyFailed.has(dimension) || latestStructuredUnresolved) {
|
|
10401
|
+
const unresolvedFailure = latestStructuredUnresolved && (!latestFailure || latestStructuredUnresolved.recordedAt >= latestFailure.recordedAt) ? latestStructuredUnresolved : latestFailure;
|
|
10651
10402
|
unresolvedDimensions.push({
|
|
10652
10403
|
dimension,
|
|
10653
10404
|
terminalState: "FAILED",
|
|
10654
10405
|
reasonKind: "lane_failure",
|
|
10655
|
-
failureClass:
|
|
10656
|
-
terminalEventId:
|
|
10657
|
-
batchId:
|
|
10658
|
-
laneId:
|
|
10659
|
-
safeDetail:
|
|
10406
|
+
failureClass: unresolvedFailure?.failureClass,
|
|
10407
|
+
terminalEventId: unresolvedFailure && "terminalEventId" in unresolvedFailure ? unresolvedFailure.terminalEventId : undefined,
|
|
10408
|
+
batchId: unresolvedFailure?.batchId,
|
|
10409
|
+
laneId: unresolvedFailure?.laneId,
|
|
10410
|
+
safeDetail: unresolvedFailure && "safeDetail" in unresolvedFailure ? unresolvedFailure.safeDetail : unresolvedFailure ? PR_REVIEW_FAILURE_CLASS_SAFE_DETAILS[unresolvedFailure.failureClass] : "lane terminated without a typed failure class"
|
|
10660
10411
|
});
|
|
10661
10412
|
continue;
|
|
10662
10413
|
}
|
|
@@ -10936,7 +10687,7 @@ function appendPublicationEvent(directory, event) {
|
|
|
10936
10687
|
} catch {}
|
|
10937
10688
|
}
|
|
10938
10689
|
function boundPublicationDiagnostic(text) {
|
|
10939
|
-
const redacted = redactSecrets(text);
|
|
10690
|
+
const redacted = redactSecrets(text).replace(PUBLICATION_URL_CREDENTIALS_PATTERN, "$1[REDACTED:url_credentials]@");
|
|
10940
10691
|
return redacted.length > MAX_PUSH_ATTEMPT_DIAGNOSTIC_CHARS ? `${redacted.slice(0, MAX_PUSH_ATTEMPT_DIAGNOSTIC_CHARS - 3)}...` : redacted;
|
|
10941
10692
|
}
|
|
10942
10693
|
function nextPublicationContainer(previous, active, historyAppends = [], attempts = []) {
|
|
@@ -12144,6 +11895,7 @@ var _test_exports2 = {
|
|
|
12144
11895
|
parseCanonicalCandidateRows,
|
|
12145
11896
|
resolvePrReviewRowFamily,
|
|
12146
11897
|
pipeFieldsCapped,
|
|
11898
|
+
boundPublicationDiagnostic,
|
|
12147
11899
|
indexVerdictRows,
|
|
12148
11900
|
reviewerVerdictRowDigest,
|
|
12149
11901
|
workflowGateStateRelativePath,
|
|
@@ -12553,11 +12305,12 @@ function derivePrReviewCandidateInventory(directory, state, ctx) {
|
|
|
12553
12305
|
const ownedDimensions = lane.ownedWorkflowLanes?.length ? lane.ownedWorkflowLanes : [lane.workflowLane];
|
|
12554
12306
|
if (!laneIsInClass(ownedDimensions.length))
|
|
12555
12307
|
continue;
|
|
12556
|
-
|
|
12308
|
+
const creditedDimensions = ownedDimensions.filter((dimension) => successful.has(dimension));
|
|
12309
|
+
if (creditedDimensions.length === 0)
|
|
12557
12310
|
continue;
|
|
12558
12311
|
const key = `${batch.batchId}\x00${lane.laneId}`;
|
|
12559
12312
|
baseSourceFullOwnershipCount.set(key, ownedDimensions.length);
|
|
12560
|
-
for (const dimension of
|
|
12313
|
+
for (const dimension of creditedDimensions) {
|
|
12561
12314
|
if (!baseDimensionSources.has(dimension)) {
|
|
12562
12315
|
baseDimensionSources.set(dimension, {
|
|
12563
12316
|
batchId: batch.batchId,
|
|
@@ -12650,6 +12403,27 @@ function derivePrReviewCandidateInventory(directory, state, ctx) {
|
|
|
12650
12403
|
})) {
|
|
12651
12404
|
if (record.laneId !== source.laneId || record.mode !== source.mode || record.workspace?.prHeadSha !== state.prHeadSha || record.workspace?.gitHead !== state.prHeadSha)
|
|
12652
12405
|
continue;
|
|
12406
|
+
const structured = record.result?.prReviewResultReceipt;
|
|
12407
|
+
if (structured) {
|
|
12408
|
+
const credited = source.creditedLanes?.length ? structured.envelope.creditedLanes.filter((lane) => source.creditedLanes?.includes(lane)) : structured.envelope.creditedLanes;
|
|
12409
|
+
if (source.workflowLane && !credited.includes(source.workflowLane)) {
|
|
12410
|
+
continue;
|
|
12411
|
+
}
|
|
12412
|
+
resolvedArtifact = true;
|
|
12413
|
+
const laneKey2 = `${source.batchId}\x00${source.laneId}`;
|
|
12414
|
+
if (!extractedLaneKeys.has(laneKey2)) {
|
|
12415
|
+
extractedLaneKeys.add(laneKey2);
|
|
12416
|
+
for (const finding of structured.envelope.findings) {
|
|
12417
|
+
if (!credited.includes(finding.workflowLane))
|
|
12418
|
+
continue;
|
|
12419
|
+
candidateIds.push(finding.id);
|
|
12420
|
+
if (!candidateSeverities.has(finding.id)) {
|
|
12421
|
+
candidateSeverities.set(finding.id, finding.severity);
|
|
12422
|
+
}
|
|
12423
|
+
}
|
|
12424
|
+
}
|
|
12425
|
+
continue;
|
|
12426
|
+
}
|
|
12653
12427
|
const ref = record.result?.outputRef?.trim();
|
|
12654
12428
|
const artifact = ref ? readLaneOutput(directory, ref)?.artifact : undefined;
|
|
12655
12429
|
const recordOwnedLanes = record.ownedWorkflowLanes?.length ? record.ownedWorkflowLanes : record.workflowLane ? [record.workflowLane] : undefined;
|
|
@@ -13099,6 +12873,35 @@ function recordsPassingBatchIntegrity(directory, state, batchId, expectedLanes,
|
|
|
13099
12873
|
function successfulObligationsFromExactBatch(directory, state, batchId, expectedLanes, expectedMode, validatedAt, checkWorkflowLane = true, forbiddenSubagentSessionIds = new Set, expectedRevisionDigest, diagnostics, reviewerClaims) {
|
|
13100
12874
|
const successful = new Set;
|
|
13101
12875
|
for (const qualified of recordsPassingBatchIntegrity(directory, state, batchId, expectedLanes, expectedMode, validatedAt, checkWorkflowLane, forbiddenSubagentSessionIds, diagnostics)) {
|
|
12876
|
+
const structuredCoverage = validateExactStructuredReceiptCoverage({
|
|
12877
|
+
record: qualified.record,
|
|
12878
|
+
result: qualified.record.result,
|
|
12879
|
+
artifact: null,
|
|
12880
|
+
expected: {
|
|
12881
|
+
mode: expectedMode === "swarm-pr-review:base" || expectedMode === "swarm-pr-review:micro" ? expectedMode : "swarm-pr-review:base",
|
|
12882
|
+
workflowLane: qualified.expectedWorkflowLane,
|
|
12883
|
+
ownedWorkflowLanes: qualified.expectedOwnedLanes,
|
|
12884
|
+
prHeadSha: state.prHeadSha ?? "",
|
|
12885
|
+
gitHead: state.prHeadSha ?? "",
|
|
12886
|
+
revisionDigest: expectedRevisionDigest ?? "",
|
|
12887
|
+
workflowInstanceId: state.workflowInstanceId,
|
|
12888
|
+
workflowRevision: state.revision,
|
|
12889
|
+
baseSha: state.prReviewBaseSha,
|
|
12890
|
+
reviewScope: state.mode === "PR_REVIEW" && state.prReviewBaseSha && state.prHeadSha ? `complete PR diff ${state.prReviewBaseSha}...${state.prHeadSha}` : undefined
|
|
12891
|
+
}
|
|
12892
|
+
});
|
|
12893
|
+
if (structuredCoverage.status === "accepted") {
|
|
12894
|
+
for (const obligation of structuredCoverage.creditedWorkflowLanes) {
|
|
12895
|
+
successful.add(obligation);
|
|
12896
|
+
}
|
|
12897
|
+
continue;
|
|
12898
|
+
}
|
|
12899
|
+
if (structuredCoverage.status === "rejected") {
|
|
12900
|
+
if (diagnostics && diagnostics.length < MAX_BASE_COVERAGE_DIAGNOSTICS) {
|
|
12901
|
+
diagnostics.push(`batch=${batchId} lane=${qualified.expectedLane.laneId} workflow_lane=${qualified.expectedWorkflowLane}: ${formatPrReviewLaneValidationFailure(structuredCoverage.failure)}`.slice(0, MAX_BASE_COVERAGE_DIAGNOSTIC_CHARS));
|
|
12902
|
+
}
|
|
12903
|
+
continue;
|
|
12904
|
+
}
|
|
13102
12905
|
if (workflowArtifactHasContractMarker(directory, state, qualified.record, expectedMode, qualified.expectedWorkflowLane, qualified.expectedLane.reviewItemIds, expectedRevisionDigest, qualified.expectedOwnedLanes, diagnostics, reviewerClaims)) {
|
|
13103
12906
|
for (const obligation of qualified.expectedOwnedLanes) {
|
|
13104
12907
|
successful.add(obligation);
|
|
@@ -13118,6 +12921,40 @@ function ownedLaneSetsEqual(recordOwned, expectedOwned) {
|
|
|
13118
12921
|
}
|
|
13119
12922
|
return recordOwned.every((owned) => expectedSet.has(owned));
|
|
13120
12923
|
}
|
|
12924
|
+
function validateExactStructuredReceiptCoverage(input) {
|
|
12925
|
+
if (input.expected.mode !== "swarm-pr-review:base" && input.expected.mode !== "swarm-pr-review:micro") {
|
|
12926
|
+
return { status: "absent" };
|
|
12927
|
+
}
|
|
12928
|
+
const rawReceipt = input.result.prReviewResultReceipt;
|
|
12929
|
+
if (!rawReceipt)
|
|
12930
|
+
return { status: "absent" };
|
|
12931
|
+
const parsedReceipt2 = PrReviewResultReceiptSchema.safeParse(rawReceipt);
|
|
12932
|
+
if (!parsedReceipt2.success) {
|
|
12933
|
+
return {
|
|
12934
|
+
status: "rejected",
|
|
12935
|
+
failure: failedLaneValidation("discovery.coverage", "schema-valid exact child/workflow/revision-bound structured receipt", "invalid structured receipt").failure
|
|
12936
|
+
};
|
|
12937
|
+
}
|
|
12938
|
+
if (input.expected.workflowInstanceId === undefined || input.expected.workflowRevision === undefined || input.expected.baseSha === undefined) {
|
|
12939
|
+
return {
|
|
12940
|
+
status: "rejected",
|
|
12941
|
+
failure: failedLaneValidation("discovery.coverage", "live workflow instance/revision/base identity", "missing live workflow instance/revision/base identity").failure
|
|
12942
|
+
};
|
|
12943
|
+
}
|
|
12944
|
+
const receipt = parsedReceipt2.data;
|
|
12945
|
+
const ownedWorkflowLanes = input.expected.ownedWorkflowLanes?.length ? [...input.expected.ownedWorkflowLanes] : [input.expected.workflowLane];
|
|
12946
|
+
if (receipt.mode !== input.expected.mode || receipt.workflowInstanceId !== input.expected.workflowInstanceId || receipt.workflowRevision !== input.expected.workflowRevision || receipt.baseSha !== input.expected.baseSha || receipt.batchId !== input.record.batchId || receipt.laneId !== input.record.laneId || receipt.childSessionId !== input.record.subagentSessionId || receipt.workflowLane !== input.expected.workflowLane || !ownedLaneSetsEqual(receipt.ownedWorkflowLanes, ownedWorkflowLanes) || receipt.headSha !== input.expected.prHeadSha || receipt.dispatchRevisionDigest !== input.expected.revisionDigest) {
|
|
12947
|
+
return {
|
|
12948
|
+
status: "rejected",
|
|
12949
|
+
failure: failedLaneValidation("discovery.coverage", "exact child/workflow/revision-bound structured receipt", "mismatched structured receipt").failure
|
|
12950
|
+
};
|
|
12951
|
+
}
|
|
12952
|
+
return {
|
|
12953
|
+
status: "accepted",
|
|
12954
|
+
creditedWorkflowLanes: receipt.envelope.creditedLanes.filter((lane) => ownedWorkflowLanes.includes(lane)),
|
|
12955
|
+
receipt
|
|
12956
|
+
};
|
|
12957
|
+
}
|
|
13121
12958
|
function analyzeLaneArtifactIntegrity(args) {
|
|
13122
12959
|
const { record, result, artifact, expected } = args;
|
|
13123
12960
|
if (!artifact) {
|
|
@@ -13241,6 +13078,9 @@ function workflowArtifactHasContractMarker(directory, state, record, expectedMod
|
|
|
13241
13078
|
prHeadSha: state.prHeadSha ?? "",
|
|
13242
13079
|
gitHead: state.prHeadSha ?? "",
|
|
13243
13080
|
revisionDigest: expectedRevisionDigest ?? "",
|
|
13081
|
+
workflowInstanceId: state.workflowInstanceId,
|
|
13082
|
+
workflowRevision: state.revision,
|
|
13083
|
+
baseSha: state.prReviewBaseSha,
|
|
13244
13084
|
reviewScope
|
|
13245
13085
|
}
|
|
13246
13086
|
});
|
|
@@ -13416,6 +13256,16 @@ function validatePrReviewDiscoveryLaneCompletion(input) {
|
|
|
13416
13256
|
});
|
|
13417
13257
|
if (!recordIntegrity.ok)
|
|
13418
13258
|
return recordIntegrity;
|
|
13259
|
+
const structuredCoverage = validateExactStructuredReceiptCoverage(input);
|
|
13260
|
+
if (structuredCoverage.status === "accepted") {
|
|
13261
|
+
return { ok: true };
|
|
13262
|
+
}
|
|
13263
|
+
if (structuredCoverage.status === "rejected") {
|
|
13264
|
+
return { ok: false, failure: structuredCoverage.failure };
|
|
13265
|
+
}
|
|
13266
|
+
if ((input.expected.mode === "swarm-pr-review:base" || input.expected.mode === "swarm-pr-review:micro") && !prReviewLegacyTranscriptCompatibilityEnabled(input.record.prReviewLegacyTranscriptCompatibility)) {
|
|
13267
|
+
return failedLaneValidation("discovery.coverage", "child-bound structured receipt", "missing structured receipt (legacy transcript adapter disabled)");
|
|
13268
|
+
}
|
|
13419
13269
|
const artifactIntegrity = analyzeLaneArtifactIntegrity({
|
|
13420
13270
|
record: input.record,
|
|
13421
13271
|
result: input.result,
|
|
@@ -21474,7 +21324,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
|
|
|
21474
21324
|
};
|
|
21475
21325
|
}
|
|
21476
21326
|
async function sweepActiveNearDuplicates(directory, options = {}) {
|
|
21477
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
21327
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-k0qy284k.js");
|
|
21478
21328
|
const { config } = loadPluginConfigWithMeta2(directory);
|
|
21479
21329
|
const sweepConfig = config.learning?.dedup_sweep;
|
|
21480
21330
|
if (sweepConfig?.enabled === false)
|
|
@@ -22611,7 +22461,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
|
|
|
22611
22461
|
}
|
|
22612
22462
|
if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
|
|
22613
22463
|
try {
|
|
22614
|
-
const skillModule = await import("./skill-generator-
|
|
22464
|
+
const skillModule = await import("./skill-generator-jq20a09m.js");
|
|
22615
22465
|
for (const cand of skillCandidates) {
|
|
22616
22466
|
if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
|
|
22617
22467
|
continue;
|
|
@@ -23083,7 +22933,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
|
|
|
23083
22933
|
} catch {}
|
|
23084
22934
|
}
|
|
23085
22935
|
if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
|
|
23086
|
-
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-
|
|
22936
|
+
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-saekqp8t.js");
|
|
23087
22937
|
for (const { id } of contradictedEntries) {
|
|
23088
22938
|
try {
|
|
23089
22939
|
await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
|
|
@@ -23902,7 +23752,7 @@ async function runCuratorPostMortem(directory, options = {}) {
|
|
|
23902
23752
|
warnings.push("Failed to collect knowledge summary.");
|
|
23903
23753
|
}
|
|
23904
23754
|
try {
|
|
23905
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
23755
|
+
const { getScanStatus } = await import("./scan-cursor-1agr50f8.js");
|
|
23906
23756
|
const scanStatus = await getScanStatus(directory);
|
|
23907
23757
|
if (scanStatus.remaining_estimate > 0) {
|
|
23908
23758
|
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.`);
|
|
@@ -24074,9 +23924,9 @@ var _internals27 = {
|
|
|
24074
23924
|
verifyPostMortemKnowledgeActions,
|
|
24075
23925
|
repairPostMortemActions,
|
|
24076
23926
|
loadDefaultKnowledgeConfig: async (directory) => {
|
|
24077
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
23927
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-z0ygrqgy.js");
|
|
24078
23928
|
try {
|
|
24079
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
23929
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-k0qy284k.js");
|
|
24080
23930
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
24081
23931
|
return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
24082
23932
|
} catch {
|
|
@@ -24084,11 +23934,11 @@ var _internals27 = {
|
|
|
24084
23934
|
}
|
|
24085
23935
|
},
|
|
24086
23936
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
|
|
24087
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
23937
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-sgmynbpm.js");
|
|
24088
23938
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
|
|
24089
23939
|
},
|
|
24090
23940
|
checkHivePromotions: async (entries, knowledgeConfig, directory) => {
|
|
24091
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
23941
|
+
const { checkHivePromotions } = await import("./hive-promoter-r0ekyn5m.js");
|
|
24092
23942
|
return checkHivePromotions(entries, knowledgeConfig, directory);
|
|
24093
23943
|
},
|
|
24094
23944
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -24097,7 +23947,7 @@ var _internals27 = {
|
|
|
24097
23947
|
activateProposal,
|
|
24098
23948
|
listSkills: listSkills2,
|
|
24099
23949
|
sanitizeSlug
|
|
24100
|
-
} = await import("./skill-generator-
|
|
23950
|
+
} = await import("./skill-generator-jq20a09m.js");
|
|
24101
23951
|
const result = {
|
|
24102
23952
|
approved: [],
|
|
24103
23953
|
rejected: [],
|
|
@@ -25427,9 +25277,9 @@ function hashContent(content) {
|
|
|
25427
25277
|
return createHash13("sha1").update(content).digest("hex");
|
|
25428
25278
|
}
|
|
25429
25279
|
async function loadConfigForPolicyCurator(directory) {
|
|
25430
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
25280
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-z0ygrqgy.js");
|
|
25431
25281
|
try {
|
|
25432
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
25282
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-k0qy284k.js");
|
|
25433
25283
|
const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
|
|
25434
25284
|
return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
|
|
25435
25285
|
} catch {
|
|
@@ -37734,7 +37584,7 @@ async function runFinalizeStage(ctx) {
|
|
|
37734
37584
|
}
|
|
37735
37585
|
}
|
|
37736
37586
|
try {
|
|
37737
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
37587
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-z0ygrqgy.js");
|
|
37738
37588
|
const { config: pmLoadedConfig } = _internals41.loadPluginConfigWithMeta(ctx.directory);
|
|
37739
37589
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
37740
37590
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -39958,9 +39808,9 @@ var _internals45 = {
|
|
|
39958
39808
|
loadPluginConfigWithMeta,
|
|
39959
39809
|
loadCuratorDeps: async () => {
|
|
39960
39810
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
39961
|
-
import("./schema-
|
|
39962
|
-
import("./curator-
|
|
39963
|
-
import("./curator-llm-factory-
|
|
39811
|
+
import("./schema-z0ygrqgy.js"),
|
|
39812
|
+
import("./curator-sgmynbpm.js"),
|
|
39813
|
+
import("./curator-llm-factory-6mw01jx1.js")
|
|
39964
39814
|
]);
|
|
39965
39815
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
39966
39816
|
}
|
|
@@ -40969,7 +40819,7 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
40969
40819
|
let scanCompleted = false;
|
|
40970
40820
|
let scanRemaining = 0;
|
|
40971
40821
|
try {
|
|
40972
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
40822
|
+
const { getScanStatus } = await import("./scan-cursor-1agr50f8.js");
|
|
40973
40823
|
const status = await getScanStatus(directory);
|
|
40974
40824
|
scanGeneration = status.generation;
|
|
40975
40825
|
scanCompleted = status.completed;
|
|
@@ -40977,19 +40827,19 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
40977
40827
|
} catch {}
|
|
40978
40828
|
let configMatch = null;
|
|
40979
40829
|
try {
|
|
40980
|
-
const { isLinked: isLinked2 } = await import("./knowledge-link-
|
|
40830
|
+
const { isLinked: isLinked2 } = await import("./knowledge-link-xezm8hr3.js");
|
|
40981
40831
|
if (isLinked2(directory)) {
|
|
40982
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
40832
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-z0ygrqgy.js");
|
|
40983
40833
|
let config;
|
|
40984
40834
|
try {
|
|
40985
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
40835
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-k0qy284k.js");
|
|
40986
40836
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
40987
40837
|
config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
40988
40838
|
} catch {
|
|
40989
40839
|
config = KnowledgeConfigSchema2.parse({});
|
|
40990
40840
|
}
|
|
40991
40841
|
const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
|
|
40992
|
-
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-
|
|
40842
|
+
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-47przjwg.js");
|
|
40993
40843
|
const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
|
|
40994
40844
|
const cohortFp = await readCohortConfigFingerprint(directory);
|
|
40995
40845
|
configMatch = cohortFp === null ? null : currentFp === cohortFp;
|
|
@@ -42330,7 +42180,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
42330
42180
|
const result = runConfigDoctor(config, directory);
|
|
42331
42181
|
let output;
|
|
42332
42182
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
42333
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
42183
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-ancn1sj7.js");
|
|
42334
42184
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
|
|
42335
42185
|
applyLossy: true
|
|
42336
42186
|
});
|
|
@@ -42368,7 +42218,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
42368
42218
|
`;
|
|
42369
42219
|
}
|
|
42370
42220
|
try {
|
|
42371
|
-
const { runModelPreflight } = await import("./model-preflight-
|
|
42221
|
+
const { runModelPreflight } = await import("./model-preflight-yqqchzjn.js");
|
|
42372
42222
|
const preflight = await runModelPreflight(config, swarmState.opencodeClient);
|
|
42373
42223
|
if (preflight.catalogAvailable) {
|
|
42374
42224
|
const unresolved = preflight.resolutions.filter((resolution) => resolution.status === "unresolved");
|
|
@@ -43270,7 +43120,7 @@ async function handleEvidenceCommand(directory, args) {
|
|
|
43270
43120
|
return formatTaskEvidenceMarkdown(evidenceData);
|
|
43271
43121
|
}
|
|
43272
43122
|
async function handleEvidenceSummaryCommand(directory) {
|
|
43273
|
-
const { buildEvidenceSummary } = await import("./evidence-summary-service-
|
|
43123
|
+
const { buildEvidenceSummary } = await import("./evidence-summary-service-1pcfsqhv.js");
|
|
43274
43124
|
const artifact = await buildEvidenceSummary(directory);
|
|
43275
43125
|
if (!artifact) {
|
|
43276
43126
|
return "No plan found. Run `/swarm plan` to check plan status.";
|
|
@@ -48152,7 +48002,8 @@ function partitionAgainstBaseline(indexed, baselineFingerprints, baselineReflowK
|
|
|
48152
48002
|
reflowCounts.set(reflowKey, count - 1);
|
|
48153
48003
|
}
|
|
48154
48004
|
} else if (stable && reflowKey && (reflowCounts.get(reflowKey) ?? 0) > 0) {
|
|
48155
|
-
|
|
48005
|
+
const matchedCount = reflowCounts.get(reflowKey) ?? 0;
|
|
48006
|
+
reflowCounts.set(reflowKey, matchedCount - 1);
|
|
48156
48007
|
moved.push(finding);
|
|
48157
48008
|
} else {
|
|
48158
48009
|
newFindings.push(finding);
|
|
@@ -48297,7 +48148,8 @@ async function captureOrMergeBaseline(directory, phase, findings, engine, scanne
|
|
|
48297
48148
|
continue;
|
|
48298
48149
|
}
|
|
48299
48150
|
if (stable && reflowKey && (priorReflowCounts.get(reflowKey) ?? 0) > 0) {
|
|
48300
|
-
|
|
48151
|
+
const matchedCount = priorReflowCounts.get(reflowKey) ?? 0;
|
|
48152
|
+
priorReflowCounts.set(reflowKey, matchedCount - 1);
|
|
48301
48153
|
continue;
|
|
48302
48154
|
}
|
|
48303
48155
|
const relFile = normalizeFindingPath(directory, finding.location.file);
|
|
@@ -48361,8 +48213,10 @@ async function captureOrMergeBaseline(directory, phase, findings, engine, scanne
|
|
|
48361
48213
|
}
|
|
48362
48214
|
cappedFilesIndexed = Array.from(survivingFiles);
|
|
48363
48215
|
}
|
|
48216
|
+
const priorTriage = existing.triage_log ?? [];
|
|
48364
48217
|
const cappedFingerprintSet = new Set(cappedFingerprints2);
|
|
48365
|
-
const retainedTriage =
|
|
48218
|
+
const retainedTriage = priorTriage.filter((e) => cappedFingerprintSet.has(e.fingerprint));
|
|
48219
|
+
const droppedTriageCount = priorTriage.length - retainedTriage.length;
|
|
48366
48220
|
const mergedTriageLog = [...retainedTriage, ...triageEntries].slice(-MAX_BASELINE_FINDINGS);
|
|
48367
48221
|
const now3 = new Date().toISOString();
|
|
48368
48222
|
const bundle2 = {
|
|
@@ -48399,7 +48253,8 @@ async function captureOrMergeBaseline(directory, phase, findings, engine, scanne
|
|
|
48399
48253
|
status: "merged",
|
|
48400
48254
|
path: baselinePath,
|
|
48401
48255
|
fingerprint_count: cappedFingerprints2.length,
|
|
48402
|
-
absorbed_finding_count: triageEntries.length
|
|
48256
|
+
absorbed_finding_count: triageEntries.length,
|
|
48257
|
+
dropped_triage_count: droppedTriageCount
|
|
48403
48258
|
};
|
|
48404
48259
|
}
|
|
48405
48260
|
const newFingerprints = indexed.map((i) => i.fingerprint);
|
|
@@ -48480,7 +48335,7 @@ function loadBaseline(directory, phase) {
|
|
|
48480
48335
|
}
|
|
48481
48336
|
let reflowKeys = [];
|
|
48482
48337
|
if (parsed.schema_version === BASELINE_SCHEMA_VERSION) {
|
|
48483
|
-
if (parsed.reflow_keys === undefined) {
|
|
48338
|
+
if (parsed.reflow_keys === undefined || parsed.reflow_keys === null) {
|
|
48484
48339
|
reflowKeys = [];
|
|
48485
48340
|
} else if (!Array.isArray(parsed.reflow_keys) || parsed.reflow_keys.some((k) => typeof k !== "string") || parsed.reflow_keys.length !== parsed.fingerprints.length) {
|
|
48486
48341
|
return {
|
|
@@ -48863,8 +48718,17 @@ async function sastScan(input, directory, config) {
|
|
|
48863
48718
|
warn(`SAST Baseline: capture failed \u2014 ${captureResult.message}`);
|
|
48864
48719
|
} else if (captureResult.status === "absorption_blocked") {
|
|
48865
48720
|
warn(`SAST Baseline: ${captureResult.message}`);
|
|
48866
|
-
} else if (captureResult.status === "merged"
|
|
48867
|
-
|
|
48721
|
+
} else if (captureResult.status === "merged") {
|
|
48722
|
+
const notes = [];
|
|
48723
|
+
if (captureResult.absorbed_finding_count > 0) {
|
|
48724
|
+
notes.push(`absorbed ${captureResult.absorbed_finding_count} novel finding(s) ` + "under the supplied refresh rationale. If this capture ran after a " + "gate failure, those findings may be coder-introduced \u2014 verify " + "before proceeding.");
|
|
48725
|
+
}
|
|
48726
|
+
if (captureResult.dropped_triage_count > 0) {
|
|
48727
|
+
notes.push(`dropped ${captureResult.dropped_triage_count} stale triage ` + "entr(y/ies) whose fingerprints no longer survive this merge");
|
|
48728
|
+
}
|
|
48729
|
+
if (notes.length > 0) {
|
|
48730
|
+
warn(`SAST Baseline: merged and ${notes.join("; ")}.`);
|
|
48731
|
+
}
|
|
48868
48732
|
}
|
|
48869
48733
|
const finalFindings2 = allFindings.slice(0, MAX_FINDINGS);
|
|
48870
48734
|
const summary2 = {
|
|
@@ -48977,6 +48841,8 @@ async function sastScan(input, directory, config) {
|
|
|
48977
48841
|
new_findings: newFindings,
|
|
48978
48842
|
pre_existing_findings: preExistingFindings,
|
|
48979
48843
|
moved_findings: movedFindings,
|
|
48844
|
+
...truncatedPreExisting ? { truncated_pre_existing: true } : {},
|
|
48845
|
+
...truncatedMoved ? { truncated_moved_findings: true } : {},
|
|
48980
48846
|
baseline_used: true
|
|
48981
48847
|
}
|
|
48982
48848
|
}, abort_signal);
|
|
@@ -49001,12 +48867,12 @@ async function sastScan(input, directory, config) {
|
|
|
49001
48867
|
}
|
|
49002
48868
|
var sast_scan = createSwarmTool({
|
|
49003
48869
|
allowWorkingDirectoryOverride: true,
|
|
49004
|
-
description: "Static Application Security Testing (SAST) scan. Scans files for security vulnerabilities using built-in rules (Tier A) and optional Semgrep (Tier B). Supports phase-scoped baseline diffing: set capture_baseline:true before first coder delegation to snapshot pre-existing findings; subsequent scans with the same phase only fail on NEW findings.",
|
|
48870
|
+
description: "Static Application Security Testing (SAST) scan. Scans files for security vulnerabilities using built-in rules (Tier A) and optional Semgrep (Tier B). Supports phase-scoped baseline diffing: set capture_baseline:true before first coder delegation to snapshot pre-existing findings; subsequent scans with the same phase only fail on NEW findings. Baseline diff results partition into new_findings (gating), pre_existing_findings, and moved_findings (reflow-matched relocations of pre-existing findings \u2014 reported, never gating). A blocked baseline capture returns status baseline_absorption_blocked with the recovery hint.",
|
|
49005
48871
|
args: {
|
|
49006
48872
|
directory: exports_external.string().describe("Directory to scan for security vulnerabilities"),
|
|
49007
48873
|
changed_files: exports_external.array(exports_external.string()).optional().describe("List of files to scan (leave empty to scan none)"),
|
|
49008
48874
|
severity_threshold: exports_external.enum(["low", "medium", "high", "critical"]).optional().default("medium").describe("Minimum severity that causes failure"),
|
|
49009
|
-
capture_baseline: exports_external.boolean().optional().describe("When true, capture/merge a phase-scoped baseline of pre-existing findings. Requires phase. Subsequent scans with phase only fail on NEW findings. Merging findings not previously in the baseline (any file) is BLOCKED unless baseline_refresh_rationale is provided."),
|
|
48875
|
+
capture_baseline: exports_external.boolean().optional().describe("When true, capture/merge a phase-scoped baseline of pre-existing findings. Requires phase. Subsequent scans with phase only fail on NEW findings. Merging findings not previously in the baseline (any file) is BLOCKED unless baseline_refresh_rationale is provided; blocked captures return status baseline_absorption_blocked."),
|
|
49010
48876
|
phase: exports_external.number().int().min(1).optional().describe("Current phase number (positive integer >= 1). Required with capture_baseline. Enables baseline diff when provided on non-capture scans."),
|
|
49011
48877
|
baseline_refresh_rationale: exports_external.string().trim().min(1).max(500).optional().describe('Audited rationale required when capture_baseline would absorb findings not previously in the baseline \u2014 for already-indexed AND first-time files (e.g. "pre-delegation capture for task 2.1; findings verified pre-existing"). Recorded per finding in the baseline triage log. Only meaningful with capture_baseline: true.')
|
|
49012
48878
|
},
|
|
@@ -67755,7 +67621,7 @@ var DISPATCH_FRAMEWORK_MAP = {
|
|
|
67755
67621
|
};
|
|
67756
67622
|
async function detectTestFrameworkViaDispatch(cwd) {
|
|
67757
67623
|
try {
|
|
67758
|
-
const { pickBackend } = await import("./dispatch-
|
|
67624
|
+
const { pickBackend } = await import("./dispatch-q4v8x2pk.js");
|
|
67759
67625
|
const backend = await pickBackend(cwd);
|
|
67760
67626
|
if (!backend?.selectTestFramework)
|
|
67761
67627
|
return "none";
|
|
@@ -67771,7 +67637,7 @@ async function buildTestCommandViaDispatch(framework, scope, files, coverage, ba
|
|
|
67771
67637
|
if (framework === "none")
|
|
67772
67638
|
return null;
|
|
67773
67639
|
try {
|
|
67774
|
-
const { pickBackend } = await import("./dispatch-
|
|
67640
|
+
const { pickBackend } = await import("./dispatch-q4v8x2pk.js");
|
|
67775
67641
|
const backend = await pickBackend(baseDir);
|
|
67776
67642
|
if (backend?.buildTestCommand) {
|
|
67777
67643
|
const cmd = backend.buildTestCommand(framework, files, baseDir, {
|
|
@@ -67793,7 +67659,7 @@ async function parseTestOutputViaDispatch(framework, output, baseDir) {
|
|
|
67793
67659
|
if (framework === "none")
|
|
67794
67660
|
return null;
|
|
67795
67661
|
try {
|
|
67796
|
-
const { pickBackend } = await import("./dispatch-
|
|
67662
|
+
const { pickBackend } = await import("./dispatch-q4v8x2pk.js");
|
|
67797
67663
|
const backend = await pickBackend(baseDir);
|
|
67798
67664
|
if (!backend?.parseTestOutput)
|
|
67799
67665
|
return null;
|
|
@@ -68201,14 +68067,14 @@ function buildTestCommand(framework, scope, files, coverage, baseDir, bail, targ
|
|
|
68201
68067
|
return args;
|
|
68202
68068
|
}
|
|
68203
68069
|
case "vitest": {
|
|
68204
|
-
const args = [
|
|
68205
|
-
"npx",
|
|
68206
|
-
"vitest",
|
|
68070
|
+
const args = _internals80.resolveLocalNodeTool("vitest", [
|
|
68207
68071
|
"run",
|
|
68208
68072
|
"--reporter=json",
|
|
68209
68073
|
"--outputFile",
|
|
68210
68074
|
VITEST_JSON_OUTPUT_RELATIVE_PATH
|
|
68211
|
-
];
|
|
68075
|
+
], baseDir, process.platform, _internals80.isCommandAvailable);
|
|
68076
|
+
if (!args)
|
|
68077
|
+
return null;
|
|
68212
68078
|
if (coverage)
|
|
68213
68079
|
args.push("--coverage");
|
|
68214
68080
|
if (bail)
|
|
@@ -68219,7 +68085,9 @@ function buildTestCommand(framework, scope, files, coverage, baseDir, bail, targ
|
|
|
68219
68085
|
return args;
|
|
68220
68086
|
}
|
|
68221
68087
|
case "jest": {
|
|
68222
|
-
const args =
|
|
68088
|
+
const args = _internals80.resolveLocalNodeTool("jest", ["--json"], baseDir, process.platform, _internals80.isCommandAvailable);
|
|
68089
|
+
if (!args)
|
|
68090
|
+
return null;
|
|
68223
68091
|
if (coverage)
|
|
68224
68092
|
args.push("--coverage");
|
|
68225
68093
|
if (bail)
|
|
@@ -68230,7 +68098,9 @@ function buildTestCommand(framework, scope, files, coverage, baseDir, bail, targ
|
|
|
68230
68098
|
return args;
|
|
68231
68099
|
}
|
|
68232
68100
|
case "mocha": {
|
|
68233
|
-
const args =
|
|
68101
|
+
const args = _internals80.resolveLocalNodeTool("mocha", [], baseDir, process.platform, _internals80.isCommandAvailable);
|
|
68102
|
+
if (!args)
|
|
68103
|
+
return null;
|
|
68234
68104
|
if (bail)
|
|
68235
68105
|
args.push("--bail");
|
|
68236
68106
|
if (scope !== "all" && files.length > 0) {
|
|
@@ -69578,6 +69448,7 @@ var _internals80 = {
|
|
|
69578
69448
|
existsSync: fs37.existsSync,
|
|
69579
69449
|
readdirSync: fs37.readdirSync,
|
|
69580
69450
|
readFileSync: fs37.readFileSync,
|
|
69451
|
+
resolveLocalNodeTool,
|
|
69581
69452
|
bunSpawn,
|
|
69582
69453
|
buildNativeTargetCommand,
|
|
69583
69454
|
formatNativeHistoryTestFile,
|
|
@@ -78608,7 +78479,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
|
|
|
78608
78479
|
if (!input.dispatcher) {
|
|
78609
78480
|
throw new Error("no evaluation dispatcher available (cannot run validation)");
|
|
78610
78481
|
}
|
|
78611
|
-
const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-
|
|
78482
|
+
const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-wsdcy2d6.js");
|
|
78612
78483
|
const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
|
|
78613
78484
|
const result = await withProtectedSetIntegrity([evalInputRoot, ...protectedRoots(input.directory)], () => _internals98.evaluateCandidateV1({
|
|
78614
78485
|
projectRoot: input.directory,
|
|
@@ -80733,7 +80604,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
80733
80604
|
async function handleHelpCommand(ctx) {
|
|
80734
80605
|
const targetCommand = ctx.args.join(" ");
|
|
80735
80606
|
if (!targetCommand) {
|
|
80736
|
-
const { buildHelpText } = await import("./index-
|
|
80607
|
+
const { buildHelpText } = await import("./index-vsy942dt.js");
|
|
80737
80608
|
return buildHelpText();
|
|
80738
80609
|
}
|
|
80739
80610
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -80742,7 +80613,7 @@ async function handleHelpCommand(ctx) {
|
|
|
80742
80613
|
return _internals101.buildDetailedHelp(resolved.key, resolved.entry);
|
|
80743
80614
|
}
|
|
80744
80615
|
const similar = _internals101.findSimilarCommands(targetCommand);
|
|
80745
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
80616
|
+
const { buildHelpText: fullHelp } = await import("./index-vsy942dt.js");
|
|
80746
80617
|
if (similar.length > 0) {
|
|
80747
80618
|
return `Command '/swarm ${targetCommand}' not found.
|
|
80748
80619
|
|
|
@@ -81073,7 +80944,7 @@ var COMMAND_REGISTRY = {
|
|
|
81073
80944
|
},
|
|
81074
80945
|
"guardrail explain": {
|
|
81075
80946
|
handler: async (ctx) => {
|
|
81076
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
80947
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-k99eje1y.js");
|
|
81077
80948
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
81078
80949
|
},
|
|
81079
80950
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -81083,7 +80954,7 @@ var COMMAND_REGISTRY = {
|
|
|
81083
80954
|
},
|
|
81084
80955
|
"guardrail reset": {
|
|
81085
80956
|
handler: async (ctx) => {
|
|
81086
|
-
const { handleGuardrailReset } = await import("./guardrail-reset-
|
|
80957
|
+
const { handleGuardrailReset } = await import("./guardrail-reset-3385eqmq.js");
|
|
81087
80958
|
return handleGuardrailReset(ctx.args, ctx.sessionID);
|
|
81088
80959
|
},
|
|
81089
80960
|
description: "Reset one exact active invocation/action circuit after repair",
|
|
@@ -81092,7 +80963,7 @@ var COMMAND_REGISTRY = {
|
|
|
81092
80963
|
},
|
|
81093
80964
|
"guardrail-explain": {
|
|
81094
80965
|
handler: async (ctx) => {
|
|
81095
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
80966
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-k99eje1y.js");
|
|
81096
80967
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
81097
80968
|
},
|
|
81098
80969
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -81102,7 +80973,7 @@ var COMMAND_REGISTRY = {
|
|
|
81102
80973
|
},
|
|
81103
80974
|
"guardrail-reset": {
|
|
81104
80975
|
handler: async (ctx) => {
|
|
81105
|
-
const { handleGuardrailReset } = await import("./guardrail-reset-
|
|
80976
|
+
const { handleGuardrailReset } = await import("./guardrail-reset-3385eqmq.js");
|
|
81106
80977
|
return handleGuardrailReset(ctx.args, ctx.sessionID);
|
|
81107
80978
|
},
|
|
81108
80979
|
description: "Reset one exact active invocation/action circuit after repair",
|
|
@@ -81112,7 +80983,7 @@ var COMMAND_REGISTRY = {
|
|
|
81112
80983
|
},
|
|
81113
80984
|
"guardrail-log": {
|
|
81114
80985
|
handler: async (ctx) => {
|
|
81115
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
80986
|
+
const { handleGuardrailLog } = await import("./guardrail-log-md5gcpk7.js");
|
|
81116
80987
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
81117
80988
|
},
|
|
81118
80989
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -82438,6 +82309,7 @@ diff \u2192 syntax_check \u2192 placeholder_scan \u2192 imports \u2192 lint fix
|
|
|
82438
82309
|
Stage A tools return pass/fail. Fix failures by returning to coder.
|
|
82439
82310
|
Stage A passing means: code compiles, parses, no secrets, no placeholders, no lint errors.
|
|
82440
82311
|
Stage A passing does NOT mean: code is correct, secure, tested, or reviewed.
|
|
82312
|
+
placeholder_scan DIFF SCOPING: pass added_lines (workspace-relative file path \u2192 task-added line numbers from a git diff -U0 HEAD on the task files; the coder's edits are uncommitted, so a commit-range diff returns zero added lines here) so only task-added lines drive the verdict; omit a file from the map when its added lines are unknown or empty \u2014 the tool scans it unfiltered (fail-closed) \u2014 and cross-check that file's findings against the diff yourself before bouncing the coder. Never pass an empty line array or guess line numbers: either silently suppresses findings.
|
|
82441
82313
|
PREFERRED AGGREGATOR: pre_check_batch runs lint:check + secretscan + sast_scan + quality_budget in PARALLEL (up to 4 concurrent). Prefer calling pre_check_batch over running those four tools individually \u2014 it produces the same verdicts faster and is the recommended approach for post-implementation verification. NOTE: pre_check_batch does NOT expose capture_baseline, changed_files scoping, or per-tool severity_threshold parameters. When you need SAST baseline capture or file-scoped scanning, call sast_scan or secretscan directly.
|
|
82442
82314
|
|
|
82443
82315
|
VERIFICATION PROTOCOL: After the coder reports DONE, and before running Stage B gates:
|
|
@@ -83055,6 +82927,7 @@ HARD CONSTRAINTS (apply regardless of skill load success):
|
|
|
83055
82927
|
- CHECK OUT THE EXACT PR HEAD LOCALLY before dispatching explorer lanes: resolve the authoritative full PR head SHA, verify the working tree is clean (git status --porcelain), and if it is dirty call \`prepare_pr_workflow_checkout\` before checkout \u2014 either with no \`paths\` to auto-discover and preserve every dirty and untracked change in one auditable stash, or with an explicit exact dirty tracked path set. It returns the stash OID and recovery command; an already-clean tree is a no-op. Do NOT run \`git stash\` through shell. Then use standalone commands: fetch the PR head, verify it portably with \`git rev-parse --verify <full_pr_head_sha>^0\` followed by \`git cat-file -t <full_pr_head_sha>\` (which must print \`commit\`), run \`git switch --detach <full_pr_head_sha>\`, confirm HEAD equals that SHA, and bind it through the PR-review controller. Do not use \`--track FETCH_HEAD\`. Explorers read the working-tree filesystem (Read/Glob/Grep), so without this checkout they read the base branch and produce invalid candidates. Always pass the base..head commit range in explorer delegations. Under Profile A, do not create a scratch context-pack file after the gate activates: put bounded shared scope, obligations, and deterministic signals in \`common_prompt\`; every lane must inspect the exact bound diff itself.
|
|
83056
82928
|
- Treat the controller Git-state result as final for the attempt: \`clean\` proceeds; \`stashable\` permits one preparation call; \`recovery-required\` or \`indeterminate\` means report the typed \`required_action\`, abort/clear any already-active gate, and STOP unless \`retryable: true\`. Never loop on stash against an unmerged index or in-progress Git operation.
|
|
83057
82929
|
- RUN ALL BASE LANES: the default PR_REVIEW path covers all six repository-agnostic base dimensions from the skill on every PR. Use \`mode: "swarm-pr-review:base"\`, the exact \`workflow_lane\` identifiers, and the exact bound \`pr_head_sha\`. \`pr_review_resilience\` is DISABLED by default, so the legacy one-wave base dispatch is the default path at every depth tier \u2014 do not emit \`pr_review_wave_stage\` or \`pr_review_wave_attempt\` unless a project has explicitly enabled it. Only when a project explicitly sets \`pr_review_resilience.enabled: true\` must depth tier M/L stage attempt 0 as one singleton \`pr_review_wave_stage: "canary"\` batch followed by a \`"fanout"\` batch whose combined canary+fanout ownership partitions all six dimensions exactly once; tier L still requires six singleton combined lanes, and tier S keeps the legacy one-wave path regardless. The runtime rejects omitted stage metadata, partial, duplicate, mislabelled, or structurally invalid waves.
|
|
82930
|
+
- SETTLE DISCOVERY LANES STRUCTURED-FIRST: for Profile A base and micro discovery lanes, require exactly one \`submit_pr_review_result\` call and then stop. Deprecated transcript \`[CANDIDATE]\` / \`[CLEAN]\` rows are legacy-only compatibility for lanes whose snapped \`pr_review_legacy_transcript_compatibility\` contract explicitly enables them; they are OFF by default for new config and must never be duplicated after the structured submission.
|
|
83058
82931
|
- RETRY STRUCTURALLY: retry only unresolved failed base obligations in later \`swarm-pr-review:base\` async batches with the same exact \`pr_head_sha\`. Under staged resilience, attempts are numbered by \`pr_review_wave_attempt\`: attempt 0 plus at most two retry attempts (1 and 2), each with one singleton canary batch and then its matching fanout batch when obligations remain. Blocking \`dispatch_lanes\` and direct Task explorer/reviewer/critic dispatch are not provenance-equivalent and are rejected. If the runtime returns typed \`retry_exhausted\` or \`circuit_open\`, or if the second retry still cannot close coverage, collect every lane to settlement, do not probe downstream writers or micro lanes, call \`abort_pr_workflow\` with \`mode: "PR_REVIEW"\`, \`kind: "recovery"\`, and a non-empty one-line \`reason\` naming the failed lane or correlated failure and exhausted retries, then call \`prepare_pr_workflow_checkout\` with \`operation: "restore"\` before reporting the blocker.
|
|
83059
82932
|
- RECOVER CONTRACT FAILURES EXPLICITLY: when collection reports \`workflow_lane_failure_class: "contract"\`, retry that one singleton base dimension once with \`pr_review_contract_retry: true\`; this retry is outside staged \`pr_review_wave_attempt\` accounting and cannot be combined with stage metadata. When fewer than six base dimensions settle but every launched lane is terminal or explicitly cancelled, the \`post_explorer\` findings write may explicitly submit \`partial_base_coverage: { unresolved_dimensions: [<exactly the uncovered dimensions>] }\` (issue #2383 N-of-6 settlement). Never infer or omit dimensions from this disclosure: the runtime derives each dimension's terminal state from lane evidence, persists an immutable coverage receipt, and rejects any declaration that does not exactly match the derived settlement.
|
|
83060
82933
|
- USE ASYNC DISPATCH WITHOUT IDLING: each admissible base wave uses one \`dispatch_lanes_async\` call. With enabled tier-M/L staged resilience, this means one singleton canary call followed by one unresolved-only fanout call after canary admission; it never means one legacy call carrying the whole initial base wave. Record each \`batch_id\`, then keep doing non-dependent architect work while its lanes run. Poll with \`collect_lane_results\` without \`wait\` (or \`wait: false\`) to process settled lanes and continue independent work between polls; use \`wait: true\` only as the final join when no independent work remains.
|
|
@@ -87106,7 +86979,7 @@ function getDisplayFinalPromptPressure() {
|
|
|
87106
86979
|
async function rehydratePrSubscriptions(sessionID, directory) {
|
|
87107
86980
|
const map = new Map;
|
|
87108
86981
|
try {
|
|
87109
|
-
const { listActive: listActive2 } = await import("./pr-subscriptions-
|
|
86982
|
+
const { listActive: listActive2 } = await import("./pr-subscriptions-asjevc5p.js");
|
|
87110
86983
|
const records = await listActive2(directory);
|
|
87111
86984
|
for (const record of records) {
|
|
87112
86985
|
if (record.sessionID !== sessionID)
|
|
@@ -87552,7 +87425,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
|
|
|
87552
87425
|
return extracted === expectedSessionId;
|
|
87553
87426
|
}
|
|
87554
87427
|
async function inspectStandardWorktreeCollisionOwnership(identity) {
|
|
87555
|
-
const collisionOwnership = await import("./worktree-collision-ownership-
|
|
87428
|
+
const collisionOwnership = await import("./worktree-collision-ownership-b9cp9zvw.js");
|
|
87556
87429
|
return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
|
|
87557
87430
|
}
|
|
87558
87431
|
async function runRecoveryGit(directory, args, timeoutMs = 15000) {
|
|
@@ -87961,7 +87834,7 @@ async function precreateStandardWorktreeSession(args) {
|
|
|
87961
87834
|
const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
|
|
87962
87835
|
if (laneProfile) {
|
|
87963
87836
|
try {
|
|
87964
|
-
const { writeLaneProfileToDiskReal } = await import("./core-
|
|
87837
|
+
const { writeLaneProfileToDiskReal } = await import("./core-bhmqtxev.js");
|
|
87965
87838
|
await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
|
|
87966
87839
|
} catch {}
|
|
87967
87840
|
}
|
|
@@ -88886,7 +88759,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
|
|
|
88886
88759
|
}
|
|
88887
88760
|
clearWorktreeMergeStatus(statusKey);
|
|
88888
88761
|
try {
|
|
88889
|
-
const { removeLaneProfileFromDiskReal } = await import("./core-
|
|
88762
|
+
const { removeLaneProfileFromDiskReal } = await import("./core-bhmqtxev.js");
|
|
88890
88763
|
await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
|
|
88891
88764
|
} catch {}
|
|
88892
88765
|
const state = serializationStateBySessionID.get(dispatch.parentSessionID);
|
|
@@ -89089,4 +88962,4 @@ var _internals103 = {
|
|
|
89089
88962
|
resolveGitExecutable
|
|
89090
88963
|
};
|
|
89091
88964
|
|
|
89092
|
-
export {
|
|
88965
|
+
export { resetActionCircuitExternally, getBlockingActionCircuit, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcExtractRecursiveRmTargets, dcEvaluateRecursiveDeleteTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, getSharedClassifierGuardrailBlock, classifyCommand, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, getAgentSession, parseLeanLaneIndex, computeLaneRuntimeProfile, MAX_TRACKED_STANDARD_WORKTREE_CALLS, awaitingMergeByCallID, standardWorktreeByCallID, standardWorktreeSerializationSessions, getStandardWorktreeDegradationReason, resetStandardWorktreeIsolationState, checkStandardWorktreeSerializationRelease, sanitizeWorktreeTaskId, preProvisionCollisionCheck, isLaneOwnedByCurrentSession, precreateStandardWorktreeSession, preserveBackgroundWorktreeOwnershipForCallId, preserveDirtyWorktreeForCallId, preserveDirtyWorktreeAtPath, cleanupStandardWorktreeForCallId, abortStandardWorktreeDispatch, finishStandardWorktreeDispatch, readLaneEnvFileFromDisk, _internals103 as _internals, readPrReviewReentryBindingContext, prWorkflowSessionFileStem, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleApproveWriteCommand, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals26 as _internals1, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals30 as _internals2, createHivePromoterHook, promoteToHive, promoteFromSwarm, safeRealpathSync, 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, handleBlueprintValidateCommand, handleBlueprintCurrentCommand, handleBlueprintHistoryCommand, handleBlueprintDiffCommand, handleBlueprintExportCommand, handleHarnessCandidateValidateCommand, handleHarnessCandidateShowCommand, handleHarnessCandidateDiffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, 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, _internals101 as _internals3, resolveCommand };
|