opencode-swarm 7.160.0 → 7.160.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/skills/swarm-pr-review/SKILL.md +28 -29
- package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +21 -5
- package/dist/background/pending-delegations.d.ts +46 -1
- package/dist/background/pr-review-contract.d.ts +245 -2
- package/dist/cli/{coder-settlement-zn552sp9.js → coder-settlement-678ccmnf.js} +9 -9
- package/dist/cli/{config-doctor-ddtdz2g0.js → config-doctor-fr8dfrt2.js} +3 -3
- package/dist/cli/{core-embasn2j.js → core-4j1hbhey.js} +2 -2
- package/dist/cli/{curation-policy-agr6ga1s.js → curation-policy-47przjwg.js} +4 -4
- package/dist/cli/{curator-dgp6dxxn.js → curator-85d97240.js} +31 -31
- package/dist/cli/{curator-llm-factory-7cwvmc46.js → curator-llm-factory-s9s4s0q3.js} +31 -31
- package/dist/cli/{evidence-summary-service-sbnyann4.js → evidence-summary-service-9dyt2kzh.js} +13 -13
- package/dist/cli/{gate-evidence-5v67a1dz.js → gate-evidence-a6paafg8.js} +5 -5
- package/dist/cli/{guardrail-explain-2gwarnca.js → guardrail-explain-4a2xdtew.js} +32 -32
- package/dist/cli/{guardrail-log-zbnbff1y.js → guardrail-log-27nkntrx.js} +7 -7
- package/dist/cli/{guardrail-reset-3cnz54hx.js → guardrail-reset-xn7k3hn8.js} +31 -31
- package/dist/cli/{hive-promoter-7cr7t2kg.js → hive-promoter-k57j3kp6.js} +31 -31
- package/dist/cli/{index-q6gjwy7m.js → index-497a3hhj.js} +2 -2
- package/dist/cli/{index-sy5aeegg.js → index-61c3d769.js} +866 -37
- 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-1f4n43yz.js → index-7npz9n4s.js} +5 -4
- package/dist/cli/{index-gt8cxfbp.js → index-7v0ex0jt.js} +2 -2
- package/dist/cli/{index-ebz97mks.js → index-8c9qzpy7.js} +1 -0
- package/dist/cli/{index-5m7qjj29.js → index-98jmggma.js} +6 -6
- package/dist/cli/{index-cn233hsy.js → index-awjx0wgk.js} +1 -1
- package/dist/cli/{index-962jgzdq.js → index-bqxffayb.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-7qv869f0.js → index-dq93ar40.js} +5 -5
- package/dist/cli/{index-3055dgzp.js → index-drqvph47.js} +4 -4
- package/dist/cli/{index-jmths6jj.js → index-e1ygmd4q.js} +33 -33
- package/dist/cli/{index-py6bqwnb.js → index-f72612zc.js} +16 -2
- package/dist/cli/{index-9q6w7kke.js → index-gjx53y3c.js} +1 -1
- package/dist/cli/{index-xs15netk.js → index-j3ss86kf.js} +1 -1
- package/dist/cli/{index-kkfgygvn.js → index-jszabr0r.js} +4 -4
- package/dist/cli/{index-9k3zc2t8.js → index-m1cw9fsh.js} +6 -6
- package/dist/cli/{index-wzx6atbv.js → index-m84z3aa8.js} +3 -3
- 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-3yh737hc.js → index-nnzdayvk.js} +6 -6
- package/dist/cli/{index-va1edd2n.js → index-ny0g8fdg.js} +5 -5
- package/dist/cli/{index-yrar1ask.js → index-pkz91fwm.js} +3 -3
- package/dist/cli/{index-zjvf7edj.js → index-pqjcyj0p.js} +1 -1
- package/dist/cli/{index-9fspg1xw.js → index-prv20xq6.js} +1 -1
- package/dist/cli/{index-fzkx24q5.js → index-qc53dfzh.js} +2 -2
- package/dist/cli/{index-8bjv01t8.js → index-v8dsmee1.js} +4 -4
- package/dist/cli/{index-d9s5hb0m.js → index-wccdm7jv.js} +5 -5
- package/dist/cli/{index-w699ekk9.js → index-z0bxbb9g.js} +2 -2
- package/dist/cli/{index-rnyt2z5r.js → index-zdv914xa.js} +304 -438
- package/dist/cli/{index-s7w428r3.js → index-znf683sm.js} +1 -1
- package/dist/cli/{index-rhc8jve7.js → index-zpzvpybn.js} +2 -2
- package/dist/cli/index.js +31 -31
- package/dist/cli/{knowledge-escalator-zksm9833.js → knowledge-escalator-3q2x34cg.js} +12 -12
- package/dist/cli/{knowledge-events-ayta750w.js → knowledge-events-5y34w84b.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-fqv89q5k.js} +4 -4
- package/dist/cli/{knowledge-validator-3rrbva2p.js → knowledge-validator-fsdx14tk.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-6ae7wy5q.js} +5 -3
- package/dist/cli/{pr-review-reentry-authorization-vag5gh50.js → pr-review-reentry-authorization-986tk381.js} +33 -32
- 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-shn926r6.js} +5 -5
- package/dist/cli/{schema-d0nbzj5k.js → schema-98tdb9h0.js} +4 -2
- package/dist/cli/{scope-persistence-bckcbc8h.js → scope-persistence-cn34xnwr.js} +8 -8
- package/dist/cli/{skill-generator-kebhevet.js → skill-generator-kck7087c.js} +14 -14
- package/dist/cli/{worktree-collision-ownership-h8qswnrp.js → worktree-collision-ownership-6b3kshcv.js} +4 -4
- package/dist/cli/{worktree-isolation-q0kbmadz.js → worktree-isolation-he01qhss.js} +31 -31
- package/dist/config/constants.d.ts +8 -0
- package/dist/config/evidence-schema.d.ts +3 -0
- package/dist/config/schema.d.ts +8 -0
- package/dist/hooks/pr-workflow-gate.d.ts +25 -1
- package/dist/index.js +124 -111
- 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/tool-metadata.d.ts +8 -0
- package/opencode-swarm.schema.json +4 -0
- package/package.json +1 -1
|
@@ -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-m84z3aa8.js";
|
|
19
19
|
import {
|
|
20
20
|
detectStraySwarmDirs,
|
|
21
21
|
readDoctorArtifact,
|
|
22
22
|
removeStraySwarmDir,
|
|
23
23
|
runConfigDoctor
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-f72612zc.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-m1cw9fsh.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,
|
|
@@ -129,15 +129,15 @@ import {
|
|
|
129
129
|
retireSkill,
|
|
130
130
|
selectCandidateEntries,
|
|
131
131
|
syncBundledProjectSkillsIfMissingAsync
|
|
132
|
-
} from "./index-
|
|
132
|
+
} from "./index-v8dsmee1.js";
|
|
133
133
|
import {
|
|
134
134
|
readRecentEscalations
|
|
135
|
-
} from "./index-
|
|
135
|
+
} from "./index-ny0g8fdg.js";
|
|
136
136
|
import {
|
|
137
137
|
alreadyCuratedThisGeneration,
|
|
138
138
|
claimNextScanBatch,
|
|
139
139
|
resolveCohortId
|
|
140
|
-
} from "./index-
|
|
140
|
+
} from "./index-7v0ex0jt.js";
|
|
141
141
|
import {
|
|
142
142
|
CURATOR_INIT_PROMPT,
|
|
143
143
|
CURATOR_PHASE_PROMPT,
|
|
@@ -161,7 +161,7 @@ import {
|
|
|
161
161
|
listActive,
|
|
162
162
|
subscribe,
|
|
163
163
|
unsubscribe
|
|
164
|
-
} from "./index-
|
|
164
|
+
} from "./index-497a3hhj.js";
|
|
165
165
|
import {
|
|
166
166
|
clearWorktreeMergeStatus,
|
|
167
167
|
getAllWorktreeMergeFailures,
|
|
@@ -173,7 +173,7 @@ import {
|
|
|
173
173
|
listCoderSettlementWalStates,
|
|
174
174
|
recoverCoderSettlement,
|
|
175
175
|
recoverStaleCoderSettlements
|
|
176
|
-
} from "./index-
|
|
176
|
+
} from "./index-dq93ar40.js";
|
|
177
177
|
import {
|
|
178
178
|
parsePorcelainV2Snapshot,
|
|
179
179
|
resolveCommitCountSince,
|
|
@@ -206,7 +206,7 @@ import {
|
|
|
206
206
|
WORKTREE_LIFECYCLE_LOCK_FILE,
|
|
207
207
|
recordWorktreeProvisioningOwner,
|
|
208
208
|
removeWorktreeProvisioningOwner
|
|
209
|
-
} from "./index-
|
|
209
|
+
} from "./index-awjx0wgk.js";
|
|
210
210
|
import {
|
|
211
211
|
appendUnactionable,
|
|
212
212
|
quarantineEntry,
|
|
@@ -217,11 +217,11 @@ import {
|
|
|
217
217
|
validateActionableFields,
|
|
218
218
|
validateLesson,
|
|
219
219
|
validateSkillPath
|
|
220
|
-
} from "./index-
|
|
220
|
+
} from "./index-jszabr0r.js";
|
|
221
221
|
import {
|
|
222
222
|
authorizeCuration,
|
|
223
223
|
buildConfigFingerprintInput
|
|
224
|
-
} from "./index-
|
|
224
|
+
} from "./index-znf683sm.js";
|
|
225
225
|
import {
|
|
226
226
|
cohortConfigFingerprint
|
|
227
227
|
} from "./index-rtry5xyf.js";
|
|
@@ -252,27 +252,40 @@ import {
|
|
|
252
252
|
transitionTaskWorkflowEvidence,
|
|
253
253
|
withTaskEvidenceTransaction,
|
|
254
254
|
writeWorkflowWalFile
|
|
255
|
-
} from "./index-
|
|
255
|
+
} from "./index-z0bxbb9g.js";
|
|
256
256
|
import {
|
|
257
257
|
makeWorktreeBranchName,
|
|
258
258
|
provisionWorktree,
|
|
259
259
|
removeWorktree
|
|
260
|
-
} from "./index-
|
|
260
|
+
} from "./index-qc53dfzh.js";
|
|
261
261
|
import {
|
|
262
262
|
DEFAULT_STALE_DELEGATION_TIMEOUT_MS,
|
|
263
263
|
DELEGATION_COMPACTION_HIGH_WATER_BYTES,
|
|
264
264
|
DELEGATION_COMPACTION_LOW_WATER_BYTES,
|
|
265
265
|
MAX_PR_REVIEW_COLLECTION_RECEIPT_ITEM_IDS,
|
|
266
266
|
MAX_RECOVERY_LEDGER_BYTES,
|
|
267
|
+
PR_REVIEW_BASE_DIMENSION_IDS,
|
|
268
|
+
PR_REVIEW_DISCARDED_EXAMPLE_ITEM_ID,
|
|
269
|
+
PR_REVIEW_FINDINGS_MAX_BYTES,
|
|
270
|
+
PR_REVIEW_HANDOFF_MAX_BYTES,
|
|
271
|
+
PR_REVIEW_RISK_IMPACTS,
|
|
272
|
+
PR_REVIEW_RISK_TAGS,
|
|
273
|
+
PrReviewCriticVerdictFieldsSchema,
|
|
274
|
+
PrReviewResultReceiptSchema,
|
|
275
|
+
PrReviewReviewerVerdictFieldsSchema,
|
|
267
276
|
collectDelegationLedgerHealth,
|
|
268
277
|
findByBatchId,
|
|
269
278
|
maintainBackgroundDelegations,
|
|
279
|
+
parsePrReviewRiskTagsField,
|
|
280
|
+
parsePrReviewVerdictRow,
|
|
281
|
+
prReviewFindingRequiresCritic,
|
|
282
|
+
prReviewLegacyTranscriptCompatibilityEnabled,
|
|
270
283
|
readDelegationHealthArtifact,
|
|
271
284
|
readDelegations,
|
|
272
285
|
scanBackgroundCoderReservationsForAdmission,
|
|
273
286
|
scanDelegationsForRecovery,
|
|
274
287
|
sweepStaleDelegations
|
|
275
|
-
} from "./index-
|
|
288
|
+
} from "./index-61c3d769.js";
|
|
276
289
|
import {
|
|
277
290
|
compositeSessionKey,
|
|
278
291
|
sessionKeySuffix
|
|
@@ -283,7 +296,7 @@ import {
|
|
|
283
296
|
clearAllScopes,
|
|
284
297
|
clearScopeBindingFromDisk,
|
|
285
298
|
clearScopeBindings
|
|
286
|
-
} from "./index-
|
|
299
|
+
} from "./index-drqvph47.js";
|
|
287
300
|
import {
|
|
288
301
|
appendLedgerEvent,
|
|
289
302
|
computePlanHash,
|
|
@@ -298,7 +311,7 @@ import {
|
|
|
298
311
|
readPlanEpochIdentity,
|
|
299
312
|
replayFromLedgerWithStatus,
|
|
300
313
|
takeSnapshotEvent
|
|
301
|
-
} from "./index-
|
|
314
|
+
} from "./index-pqjcyj0p.js";
|
|
302
315
|
import {
|
|
303
316
|
CORE_EVENT_LOCKED,
|
|
304
317
|
appendCoreEventSync,
|
|
@@ -308,7 +321,7 @@ import {
|
|
|
308
321
|
hasSpecDriftAuditEvent,
|
|
309
322
|
hasTaskRepairAuditEvent,
|
|
310
323
|
readCoreEvents
|
|
311
|
-
} from "./index-
|
|
324
|
+
} from "./index-7h2armwf.js";
|
|
312
325
|
import {
|
|
313
326
|
sanitizeDiagnosticText
|
|
314
327
|
} from "./index-556ja8an.js";
|
|
@@ -357,7 +370,7 @@ import {
|
|
|
357
370
|
transactFile,
|
|
358
371
|
transactKnowledge,
|
|
359
372
|
wordBigrams
|
|
360
|
-
} from "./index-
|
|
373
|
+
} from "./index-nnzdayvk.js";
|
|
361
374
|
import {
|
|
362
375
|
MAX_EVENT_LOG_ENTRIES,
|
|
363
376
|
_internals as _internals2,
|
|
@@ -373,13 +386,13 @@ import {
|
|
|
373
386
|
recordKnowledgeEvent,
|
|
374
387
|
recordPhaseCloseIntent,
|
|
375
388
|
resolveKnowledgeEventsPath
|
|
376
|
-
} from "./index-
|
|
389
|
+
} from "./index-98jmggma.js";
|
|
377
390
|
import {
|
|
378
391
|
resolveWorktreeIsolationConfig
|
|
379
|
-
} from "./index-
|
|
392
|
+
} from "./index-pkz91fwm.js";
|
|
380
393
|
import {
|
|
381
394
|
RetrospectiveEvidenceSchema
|
|
382
|
-
} from "./index-
|
|
395
|
+
} from "./index-8c9qzpy7.js";
|
|
383
396
|
import {
|
|
384
397
|
estimateTokens,
|
|
385
398
|
readSwarmFileAsync,
|
|
@@ -399,7 +412,7 @@ import {
|
|
|
399
412
|
init_loader,
|
|
400
413
|
loadPluginConfig,
|
|
401
414
|
loadPluginConfigWithMeta
|
|
402
|
-
} from "./index-
|
|
415
|
+
} from "./index-bqxffayb.js";
|
|
403
416
|
import {
|
|
404
417
|
DEFAULT_HARNESS_EVOLUTION_CONFIG,
|
|
405
418
|
DEFAULT_PR_REVIEW_RESILIENCE_CONFIG,
|
|
@@ -415,7 +428,7 @@ import {
|
|
|
415
428
|
package_default,
|
|
416
429
|
resolveAutoReviewConfig,
|
|
417
430
|
stripKnownSwarmPrefix
|
|
418
|
-
} from "./index-
|
|
431
|
+
} from "./index-7npz9n4s.js";
|
|
419
432
|
import {
|
|
420
433
|
init_git_executable,
|
|
421
434
|
resolveGitExecutable,
|
|
@@ -431,7 +444,7 @@ import {
|
|
|
431
444
|
observeCuratorCompliance,
|
|
432
445
|
observeStoreHealth,
|
|
433
446
|
readLearningHealth
|
|
434
|
-
} from "./index-
|
|
447
|
+
} from "./index-mmr96pwr.js";
|
|
435
448
|
import {
|
|
436
449
|
AGENT_TOOL_MAP,
|
|
437
450
|
ALL_AGENT_NAMES,
|
|
@@ -445,7 +458,7 @@ import {
|
|
|
445
458
|
init_agent_names,
|
|
446
459
|
init_constants,
|
|
447
460
|
init_tool_metadata
|
|
448
|
-
} from "./index-
|
|
461
|
+
} from "./index-c9zp4xwc.js";
|
|
449
462
|
import {
|
|
450
463
|
resolveHiveDataDir,
|
|
451
464
|
resolveHiveEventsPath,
|
|
@@ -461,10 +474,10 @@ import {
|
|
|
461
474
|
resolveLinkDir,
|
|
462
475
|
sanitizeLinkId,
|
|
463
476
|
writeLinkPointer
|
|
464
|
-
} from "./index-
|
|
477
|
+
} from "./index-prv20xq6.js";
|
|
465
478
|
import {
|
|
466
479
|
atomicWriteFile
|
|
467
|
-
} from "./index-
|
|
480
|
+
} from "./index-7ezv5j23.js";
|
|
468
481
|
import {
|
|
469
482
|
KNOWLEDGE_SCHEMA_VERSION,
|
|
470
483
|
OUTCOME_BLOCK_THRESHOLD,
|
|
@@ -484,7 +497,7 @@ import {
|
|
|
484
497
|
atomicWriteSwarmFileSync,
|
|
485
498
|
matchTempGrammar,
|
|
486
499
|
parseTargetBasename
|
|
487
|
-
} from "./index-
|
|
500
|
+
} from "./index-dh5q6z7y.js";
|
|
488
501
|
import {
|
|
489
502
|
invalidateCachedArtifact,
|
|
490
503
|
resetSwarmArtifactCache
|
|
@@ -6944,355 +6957,6 @@ import { readFileSync as readFileSync5, statSync as statSync5 } from "fs";
|
|
|
6944
6957
|
import * as fsp2 from "fs/promises";
|
|
6945
6958
|
import * as path12 from "path";
|
|
6946
6959
|
|
|
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
6960
|
// src/background/candidate-contract.ts
|
|
7297
6961
|
var CANDIDATE_SEVERITIES = [
|
|
7298
6962
|
"INFO",
|
|
@@ -9461,6 +9125,7 @@ var MAX_PUBLICATION_HISTORY_GENERATIONS = 4;
|
|
|
9461
9125
|
var MAX_PUBLICATION_ATTEMPTS = 8;
|
|
9462
9126
|
var MAX_PUSH_ATTEMPT_DIAGNOSTIC_CHARS = 500;
|
|
9463
9127
|
var PUBLICATION_SCHEMA_VERSION = 1;
|
|
9128
|
+
var PUBLICATION_URL_CREDENTIALS_PATTERN = /\b([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^\s/@:]+:[^\s/@]+@/g;
|
|
9464
9129
|
var GATE_SCHEMA_VERSION = 1;
|
|
9465
9130
|
var MAX_TRACKED_SESSIONS3 = 200;
|
|
9466
9131
|
var MAX_WORKFLOW_BATCHES = 128;
|
|
@@ -10469,7 +10134,7 @@ function summarizePrReviewBaseDimensionAttempts(directory, state, revisionDigest
|
|
|
10469
10134
|
if (batchSuccessful.has(dimension))
|
|
10470
10135
|
dedicatedSuccessful.add(dimension);
|
|
10471
10136
|
}
|
|
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));
|
|
10137
|
+
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
10138
|
const records = findByBatchId(directory, batch.batchId, {
|
|
10474
10139
|
parentSessionId: state.sessionID
|
|
10475
10140
|
});
|
|
@@ -10503,7 +10168,7 @@ function summarizePrReviewBaseDimensionAttempts(directory, state, revisionDigest
|
|
|
10503
10168
|
terminallyFailed
|
|
10504
10169
|
};
|
|
10505
10170
|
}
|
|
10506
|
-
function hasRevisionIndependentDiscoverySemantics(directory, qualified) {
|
|
10171
|
+
function hasRevisionIndependentDiscoverySemantics(directory, qualified, state) {
|
|
10507
10172
|
const ref = qualified.record.result?.outputRef?.trim();
|
|
10508
10173
|
if (!ref)
|
|
10509
10174
|
return false;
|
|
@@ -10518,10 +10183,13 @@ function hasRevisionIndependentDiscoverySemantics(directory, qualified) {
|
|
|
10518
10183
|
mode: "swarm-pr-review:base",
|
|
10519
10184
|
workflowLane: qualified.expectedWorkflowLane,
|
|
10520
10185
|
ownedWorkflowLanes: qualified.expectedOwnedLanes,
|
|
10521
|
-
prHeadSha:
|
|
10522
|
-
gitHead:
|
|
10186
|
+
prHeadSha: state.prHeadSha ?? "",
|
|
10187
|
+
gitHead: state.prHeadSha ?? "",
|
|
10523
10188
|
revisionDigest: artifact.revisionDigest,
|
|
10524
|
-
|
|
10189
|
+
workflowInstanceId: state.workflowInstanceId,
|
|
10190
|
+
workflowRevision: state.revision,
|
|
10191
|
+
baseSha: state.prReviewBaseSha,
|
|
10192
|
+
reviewScope: state.prReviewBaseSha && state.prHeadSha ? `complete PR diff ${state.prReviewBaseSha}...${state.prHeadSha}` : undefined
|
|
10525
10193
|
}
|
|
10526
10194
|
}).ok;
|
|
10527
10195
|
}
|
|
@@ -10555,6 +10223,86 @@ function latestTypedFailureForBaseDimension(directory, state, dimension) {
|
|
|
10555
10223
|
}
|
|
10556
10224
|
return latest;
|
|
10557
10225
|
}
|
|
10226
|
+
function failureClassFromStructuredUnresolvedReason(reason) {
|
|
10227
|
+
switch (reason) {
|
|
10228
|
+
case "RESOURCE_LIMIT":
|
|
10229
|
+
return "resource";
|
|
10230
|
+
case "DEADLINE_EXCEEDED":
|
|
10231
|
+
return "deadline";
|
|
10232
|
+
default:
|
|
10233
|
+
return "contract";
|
|
10234
|
+
}
|
|
10235
|
+
}
|
|
10236
|
+
function safeDetailFromStructuredUnresolvedReason(reason) {
|
|
10237
|
+
switch (reason) {
|
|
10238
|
+
case "NOT_EXECUTED":
|
|
10239
|
+
return "structured receipt reported this lane was never executed";
|
|
10240
|
+
case "PARTIAL_OUTPUT":
|
|
10241
|
+
return "structured receipt reported partial output that could not settle this lane";
|
|
10242
|
+
case "CONTRACT_FAILURE":
|
|
10243
|
+
return "structured receipt reported contract-invalid output for this lane";
|
|
10244
|
+
case "RESOURCE_LIMIT":
|
|
10245
|
+
return "structured receipt reported the lane exhausted its resource budget";
|
|
10246
|
+
case "DEADLINE_EXCEEDED":
|
|
10247
|
+
return "structured receipt reported the lane exceeded its collection deadline";
|
|
10248
|
+
case "STALE_BINDING":
|
|
10249
|
+
return "structured receipt reported stale workflow binding for this lane";
|
|
10250
|
+
case "PARENT_CANCELLED":
|
|
10251
|
+
return "structured receipt reported parent-side cancellation before settlement";
|
|
10252
|
+
}
|
|
10253
|
+
}
|
|
10254
|
+
function latestStructuredReceiptUnresolvedForBaseDimension(directory, state, revisionDigest, dimension) {
|
|
10255
|
+
let latest = null;
|
|
10256
|
+
const reviewScope = state.prReviewBaseSha && state.prHeadSha ? `complete PR diff ${state.prReviewBaseSha}...${state.prHeadSha}` : undefined;
|
|
10257
|
+
for (const batch of state.prReviewBaseDispatches ?? []) {
|
|
10258
|
+
const records = findByBatchId(directory, batch.batchId, {
|
|
10259
|
+
parentSessionId: state.sessionID
|
|
10260
|
+
});
|
|
10261
|
+
for (const lane of batch.lanes) {
|
|
10262
|
+
const ownedWorkflowLanes = lane.ownedWorkflowLanes?.length ? lane.ownedWorkflowLanes : [lane.workflowLane];
|
|
10263
|
+
if (!ownedWorkflowLanes.includes(dimension))
|
|
10264
|
+
continue;
|
|
10265
|
+
for (const record of records.filter((candidate) => candidate.laneId === lane.laneId)) {
|
|
10266
|
+
const result = record.result;
|
|
10267
|
+
if (!result)
|
|
10268
|
+
continue;
|
|
10269
|
+
const structured = validateExactStructuredReceiptCoverage({
|
|
10270
|
+
record,
|
|
10271
|
+
result,
|
|
10272
|
+
artifact: null,
|
|
10273
|
+
expected: {
|
|
10274
|
+
mode: "swarm-pr-review:base",
|
|
10275
|
+
workflowLane: lane.workflowLane,
|
|
10276
|
+
ownedWorkflowLanes,
|
|
10277
|
+
prHeadSha: state.prHeadSha ?? "",
|
|
10278
|
+
gitHead: state.prHeadSha ?? "",
|
|
10279
|
+
revisionDigest,
|
|
10280
|
+
workflowInstanceId: state.workflowInstanceId,
|
|
10281
|
+
workflowRevision: state.revision,
|
|
10282
|
+
baseSha: state.prReviewBaseSha,
|
|
10283
|
+
reviewScope
|
|
10284
|
+
}
|
|
10285
|
+
});
|
|
10286
|
+
if (structured.status !== "accepted")
|
|
10287
|
+
continue;
|
|
10288
|
+
const unresolved = structured.receipt.envelope.unresolved.find((entry) => entry.workflowLane === dimension);
|
|
10289
|
+
if (!unresolved)
|
|
10290
|
+
continue;
|
|
10291
|
+
const candidate = {
|
|
10292
|
+
failureClass: failureClassFromStructuredUnresolvedReason(unresolved.reason),
|
|
10293
|
+
recordedAt: record.updatedAt,
|
|
10294
|
+
batchId: batch.batchId,
|
|
10295
|
+
laneId: lane.laneId,
|
|
10296
|
+
safeDetail: safeDetailFromStructuredUnresolvedReason(unresolved.reason)
|
|
10297
|
+
};
|
|
10298
|
+
if (latest === null || candidate.recordedAt > latest.recordedAt || candidate.recordedAt === latest.recordedAt && `${candidate.batchId}\x00${candidate.laneId}`.localeCompare(`${latest.batchId}\x00${latest.laneId}`) > 0) {
|
|
10299
|
+
latest = candidate;
|
|
10300
|
+
}
|
|
10301
|
+
}
|
|
10302
|
+
}
|
|
10303
|
+
}
|
|
10304
|
+
return latest;
|
|
10305
|
+
}
|
|
10558
10306
|
var MAX_COVER_UNIVERSE_BITS = 12;
|
|
10559
10307
|
function minimumConsolidatedLaneCover(sets) {
|
|
10560
10308
|
const bitOf = new Map;
|
|
@@ -10647,16 +10395,18 @@ function derivePrReviewDimensionSettlement(directory, state, revisionDigest) {
|
|
|
10647
10395
|
continue;
|
|
10648
10396
|
}
|
|
10649
10397
|
const latestFailure = latestTypedFailureForBaseDimension(directory, state, dimension);
|
|
10650
|
-
|
|
10398
|
+
const latestStructuredUnresolved = latestStructuredReceiptUnresolvedForBaseDimension(directory, state, revisionDigest, dimension);
|
|
10399
|
+
if (attempts.terminallyFailed.has(dimension) || latestStructuredUnresolved) {
|
|
10400
|
+
const unresolvedFailure = latestStructuredUnresolved && (!latestFailure || latestStructuredUnresolved.recordedAt >= latestFailure.recordedAt) ? latestStructuredUnresolved : latestFailure;
|
|
10651
10401
|
unresolvedDimensions.push({
|
|
10652
10402
|
dimension,
|
|
10653
10403
|
terminalState: "FAILED",
|
|
10654
10404
|
reasonKind: "lane_failure",
|
|
10655
|
-
failureClass:
|
|
10656
|
-
terminalEventId:
|
|
10657
|
-
batchId:
|
|
10658
|
-
laneId:
|
|
10659
|
-
safeDetail:
|
|
10405
|
+
failureClass: unresolvedFailure?.failureClass,
|
|
10406
|
+
terminalEventId: unresolvedFailure && "terminalEventId" in unresolvedFailure ? unresolvedFailure.terminalEventId : undefined,
|
|
10407
|
+
batchId: unresolvedFailure?.batchId,
|
|
10408
|
+
laneId: unresolvedFailure?.laneId,
|
|
10409
|
+
safeDetail: unresolvedFailure && "safeDetail" in unresolvedFailure ? unresolvedFailure.safeDetail : unresolvedFailure ? PR_REVIEW_FAILURE_CLASS_SAFE_DETAILS[unresolvedFailure.failureClass] : "lane terminated without a typed failure class"
|
|
10660
10410
|
});
|
|
10661
10411
|
continue;
|
|
10662
10412
|
}
|
|
@@ -10936,7 +10686,7 @@ function appendPublicationEvent(directory, event) {
|
|
|
10936
10686
|
} catch {}
|
|
10937
10687
|
}
|
|
10938
10688
|
function boundPublicationDiagnostic(text) {
|
|
10939
|
-
const redacted = redactSecrets(text);
|
|
10689
|
+
const redacted = redactSecrets(text).replace(PUBLICATION_URL_CREDENTIALS_PATTERN, "$1[REDACTED:url_credentials]@");
|
|
10940
10690
|
return redacted.length > MAX_PUSH_ATTEMPT_DIAGNOSTIC_CHARS ? `${redacted.slice(0, MAX_PUSH_ATTEMPT_DIAGNOSTIC_CHARS - 3)}...` : redacted;
|
|
10941
10691
|
}
|
|
10942
10692
|
function nextPublicationContainer(previous, active, historyAppends = [], attempts = []) {
|
|
@@ -12144,6 +11894,7 @@ var _test_exports2 = {
|
|
|
12144
11894
|
parseCanonicalCandidateRows,
|
|
12145
11895
|
resolvePrReviewRowFamily,
|
|
12146
11896
|
pipeFieldsCapped,
|
|
11897
|
+
boundPublicationDiagnostic,
|
|
12147
11898
|
indexVerdictRows,
|
|
12148
11899
|
reviewerVerdictRowDigest,
|
|
12149
11900
|
workflowGateStateRelativePath,
|
|
@@ -12553,11 +12304,12 @@ function derivePrReviewCandidateInventory(directory, state, ctx) {
|
|
|
12553
12304
|
const ownedDimensions = lane.ownedWorkflowLanes?.length ? lane.ownedWorkflowLanes : [lane.workflowLane];
|
|
12554
12305
|
if (!laneIsInClass(ownedDimensions.length))
|
|
12555
12306
|
continue;
|
|
12556
|
-
|
|
12307
|
+
const creditedDimensions = ownedDimensions.filter((dimension) => successful.has(dimension));
|
|
12308
|
+
if (creditedDimensions.length === 0)
|
|
12557
12309
|
continue;
|
|
12558
12310
|
const key = `${batch.batchId}\x00${lane.laneId}`;
|
|
12559
12311
|
baseSourceFullOwnershipCount.set(key, ownedDimensions.length);
|
|
12560
|
-
for (const dimension of
|
|
12312
|
+
for (const dimension of creditedDimensions) {
|
|
12561
12313
|
if (!baseDimensionSources.has(dimension)) {
|
|
12562
12314
|
baseDimensionSources.set(dimension, {
|
|
12563
12315
|
batchId: batch.batchId,
|
|
@@ -12650,6 +12402,27 @@ function derivePrReviewCandidateInventory(directory, state, ctx) {
|
|
|
12650
12402
|
})) {
|
|
12651
12403
|
if (record.laneId !== source.laneId || record.mode !== source.mode || record.workspace?.prHeadSha !== state.prHeadSha || record.workspace?.gitHead !== state.prHeadSha)
|
|
12652
12404
|
continue;
|
|
12405
|
+
const structured = record.result?.prReviewResultReceipt;
|
|
12406
|
+
if (structured) {
|
|
12407
|
+
const credited = source.creditedLanes?.length ? structured.envelope.creditedLanes.filter((lane) => source.creditedLanes?.includes(lane)) : structured.envelope.creditedLanes;
|
|
12408
|
+
if (source.workflowLane && !credited.includes(source.workflowLane)) {
|
|
12409
|
+
continue;
|
|
12410
|
+
}
|
|
12411
|
+
resolvedArtifact = true;
|
|
12412
|
+
const laneKey2 = `${source.batchId}\x00${source.laneId}`;
|
|
12413
|
+
if (!extractedLaneKeys.has(laneKey2)) {
|
|
12414
|
+
extractedLaneKeys.add(laneKey2);
|
|
12415
|
+
for (const finding of structured.envelope.findings) {
|
|
12416
|
+
if (!credited.includes(finding.workflowLane))
|
|
12417
|
+
continue;
|
|
12418
|
+
candidateIds.push(finding.id);
|
|
12419
|
+
if (!candidateSeverities.has(finding.id)) {
|
|
12420
|
+
candidateSeverities.set(finding.id, finding.severity);
|
|
12421
|
+
}
|
|
12422
|
+
}
|
|
12423
|
+
}
|
|
12424
|
+
continue;
|
|
12425
|
+
}
|
|
12653
12426
|
const ref = record.result?.outputRef?.trim();
|
|
12654
12427
|
const artifact = ref ? readLaneOutput(directory, ref)?.artifact : undefined;
|
|
12655
12428
|
const recordOwnedLanes = record.ownedWorkflowLanes?.length ? record.ownedWorkflowLanes : record.workflowLane ? [record.workflowLane] : undefined;
|
|
@@ -13099,6 +12872,35 @@ function recordsPassingBatchIntegrity(directory, state, batchId, expectedLanes,
|
|
|
13099
12872
|
function successfulObligationsFromExactBatch(directory, state, batchId, expectedLanes, expectedMode, validatedAt, checkWorkflowLane = true, forbiddenSubagentSessionIds = new Set, expectedRevisionDigest, diagnostics, reviewerClaims) {
|
|
13100
12873
|
const successful = new Set;
|
|
13101
12874
|
for (const qualified of recordsPassingBatchIntegrity(directory, state, batchId, expectedLanes, expectedMode, validatedAt, checkWorkflowLane, forbiddenSubagentSessionIds, diagnostics)) {
|
|
12875
|
+
const structuredCoverage = validateExactStructuredReceiptCoverage({
|
|
12876
|
+
record: qualified.record,
|
|
12877
|
+
result: qualified.record.result,
|
|
12878
|
+
artifact: null,
|
|
12879
|
+
expected: {
|
|
12880
|
+
mode: expectedMode === "swarm-pr-review:base" || expectedMode === "swarm-pr-review:micro" ? expectedMode : "swarm-pr-review:base",
|
|
12881
|
+
workflowLane: qualified.expectedWorkflowLane,
|
|
12882
|
+
ownedWorkflowLanes: qualified.expectedOwnedLanes,
|
|
12883
|
+
prHeadSha: state.prHeadSha ?? "",
|
|
12884
|
+
gitHead: state.prHeadSha ?? "",
|
|
12885
|
+
revisionDigest: expectedRevisionDigest ?? "",
|
|
12886
|
+
workflowInstanceId: state.workflowInstanceId,
|
|
12887
|
+
workflowRevision: state.revision,
|
|
12888
|
+
baseSha: state.prReviewBaseSha,
|
|
12889
|
+
reviewScope: state.mode === "PR_REVIEW" && state.prReviewBaseSha && state.prHeadSha ? `complete PR diff ${state.prReviewBaseSha}...${state.prHeadSha}` : undefined
|
|
12890
|
+
}
|
|
12891
|
+
});
|
|
12892
|
+
if (structuredCoverage.status === "accepted") {
|
|
12893
|
+
for (const obligation of structuredCoverage.creditedWorkflowLanes) {
|
|
12894
|
+
successful.add(obligation);
|
|
12895
|
+
}
|
|
12896
|
+
continue;
|
|
12897
|
+
}
|
|
12898
|
+
if (structuredCoverage.status === "rejected") {
|
|
12899
|
+
if (diagnostics && diagnostics.length < MAX_BASE_COVERAGE_DIAGNOSTICS) {
|
|
12900
|
+
diagnostics.push(`batch=${batchId} lane=${qualified.expectedLane.laneId} workflow_lane=${qualified.expectedWorkflowLane}: ${formatPrReviewLaneValidationFailure(structuredCoverage.failure)}`.slice(0, MAX_BASE_COVERAGE_DIAGNOSTIC_CHARS));
|
|
12901
|
+
}
|
|
12902
|
+
continue;
|
|
12903
|
+
}
|
|
13102
12904
|
if (workflowArtifactHasContractMarker(directory, state, qualified.record, expectedMode, qualified.expectedWorkflowLane, qualified.expectedLane.reviewItemIds, expectedRevisionDigest, qualified.expectedOwnedLanes, diagnostics, reviewerClaims)) {
|
|
13103
12905
|
for (const obligation of qualified.expectedOwnedLanes) {
|
|
13104
12906
|
successful.add(obligation);
|
|
@@ -13118,6 +12920,40 @@ function ownedLaneSetsEqual(recordOwned, expectedOwned) {
|
|
|
13118
12920
|
}
|
|
13119
12921
|
return recordOwned.every((owned) => expectedSet.has(owned));
|
|
13120
12922
|
}
|
|
12923
|
+
function validateExactStructuredReceiptCoverage(input) {
|
|
12924
|
+
if (input.expected.mode !== "swarm-pr-review:base" && input.expected.mode !== "swarm-pr-review:micro") {
|
|
12925
|
+
return { status: "absent" };
|
|
12926
|
+
}
|
|
12927
|
+
const rawReceipt = input.result.prReviewResultReceipt;
|
|
12928
|
+
if (!rawReceipt)
|
|
12929
|
+
return { status: "absent" };
|
|
12930
|
+
const parsedReceipt2 = PrReviewResultReceiptSchema.safeParse(rawReceipt);
|
|
12931
|
+
if (!parsedReceipt2.success) {
|
|
12932
|
+
return {
|
|
12933
|
+
status: "rejected",
|
|
12934
|
+
failure: failedLaneValidation("discovery.coverage", "schema-valid exact child/workflow/revision-bound structured receipt", "invalid structured receipt").failure
|
|
12935
|
+
};
|
|
12936
|
+
}
|
|
12937
|
+
if (input.expected.workflowInstanceId === undefined || input.expected.workflowRevision === undefined || input.expected.baseSha === undefined) {
|
|
12938
|
+
return {
|
|
12939
|
+
status: "rejected",
|
|
12940
|
+
failure: failedLaneValidation("discovery.coverage", "live workflow instance/revision/base identity", "missing live workflow instance/revision/base identity").failure
|
|
12941
|
+
};
|
|
12942
|
+
}
|
|
12943
|
+
const receipt = parsedReceipt2.data;
|
|
12944
|
+
const ownedWorkflowLanes = input.expected.ownedWorkflowLanes?.length ? [...input.expected.ownedWorkflowLanes] : [input.expected.workflowLane];
|
|
12945
|
+
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) {
|
|
12946
|
+
return {
|
|
12947
|
+
status: "rejected",
|
|
12948
|
+
failure: failedLaneValidation("discovery.coverage", "exact child/workflow/revision-bound structured receipt", "mismatched structured receipt").failure
|
|
12949
|
+
};
|
|
12950
|
+
}
|
|
12951
|
+
return {
|
|
12952
|
+
status: "accepted",
|
|
12953
|
+
creditedWorkflowLanes: receipt.envelope.creditedLanes.filter((lane) => ownedWorkflowLanes.includes(lane)),
|
|
12954
|
+
receipt
|
|
12955
|
+
};
|
|
12956
|
+
}
|
|
13121
12957
|
function analyzeLaneArtifactIntegrity(args) {
|
|
13122
12958
|
const { record, result, artifact, expected } = args;
|
|
13123
12959
|
if (!artifact) {
|
|
@@ -13241,6 +13077,9 @@ function workflowArtifactHasContractMarker(directory, state, record, expectedMod
|
|
|
13241
13077
|
prHeadSha: state.prHeadSha ?? "",
|
|
13242
13078
|
gitHead: state.prHeadSha ?? "",
|
|
13243
13079
|
revisionDigest: expectedRevisionDigest ?? "",
|
|
13080
|
+
workflowInstanceId: state.workflowInstanceId,
|
|
13081
|
+
workflowRevision: state.revision,
|
|
13082
|
+
baseSha: state.prReviewBaseSha,
|
|
13244
13083
|
reviewScope
|
|
13245
13084
|
}
|
|
13246
13085
|
});
|
|
@@ -13416,6 +13255,16 @@ function validatePrReviewDiscoveryLaneCompletion(input) {
|
|
|
13416
13255
|
});
|
|
13417
13256
|
if (!recordIntegrity.ok)
|
|
13418
13257
|
return recordIntegrity;
|
|
13258
|
+
const structuredCoverage = validateExactStructuredReceiptCoverage(input);
|
|
13259
|
+
if (structuredCoverage.status === "accepted") {
|
|
13260
|
+
return { ok: true };
|
|
13261
|
+
}
|
|
13262
|
+
if (structuredCoverage.status === "rejected") {
|
|
13263
|
+
return { ok: false, failure: structuredCoverage.failure };
|
|
13264
|
+
}
|
|
13265
|
+
if ((input.expected.mode === "swarm-pr-review:base" || input.expected.mode === "swarm-pr-review:micro") && !prReviewLegacyTranscriptCompatibilityEnabled(input.record.prReviewLegacyTranscriptCompatibility)) {
|
|
13266
|
+
return failedLaneValidation("discovery.coverage", "child-bound structured receipt", "missing structured receipt (legacy transcript adapter disabled)");
|
|
13267
|
+
}
|
|
13419
13268
|
const artifactIntegrity = analyzeLaneArtifactIntegrity({
|
|
13420
13269
|
record: input.record,
|
|
13421
13270
|
result: input.result,
|
|
@@ -21474,7 +21323,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
|
|
|
21474
21323
|
};
|
|
21475
21324
|
}
|
|
21476
21325
|
async function sweepActiveNearDuplicates(directory, options = {}) {
|
|
21477
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
21326
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-wccdm7jv.js");
|
|
21478
21327
|
const { config } = loadPluginConfigWithMeta2(directory);
|
|
21479
21328
|
const sweepConfig = config.learning?.dedup_sweep;
|
|
21480
21329
|
if (sweepConfig?.enabled === false)
|
|
@@ -22611,7 +22460,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
|
|
|
22611
22460
|
}
|
|
22612
22461
|
if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
|
|
22613
22462
|
try {
|
|
22614
|
-
const skillModule = await import("./skill-generator-
|
|
22463
|
+
const skillModule = await import("./skill-generator-kck7087c.js");
|
|
22615
22464
|
for (const cand of skillCandidates) {
|
|
22616
22465
|
if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
|
|
22617
22466
|
continue;
|
|
@@ -23083,7 +22932,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
|
|
|
23083
22932
|
} catch {}
|
|
23084
22933
|
}
|
|
23085
22934
|
if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
|
|
23086
|
-
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-
|
|
22935
|
+
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-3q2x34cg.js");
|
|
23087
22936
|
for (const { id } of contradictedEntries) {
|
|
23088
22937
|
try {
|
|
23089
22938
|
await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
|
|
@@ -23902,7 +23751,7 @@ async function runCuratorPostMortem(directory, options = {}) {
|
|
|
23902
23751
|
warnings.push("Failed to collect knowledge summary.");
|
|
23903
23752
|
}
|
|
23904
23753
|
try {
|
|
23905
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
23754
|
+
const { getScanStatus } = await import("./scan-cursor-shn926r6.js");
|
|
23906
23755
|
const scanStatus = await getScanStatus(directory);
|
|
23907
23756
|
if (scanStatus.remaining_estimate > 0) {
|
|
23908
23757
|
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 +23923,9 @@ var _internals27 = {
|
|
|
24074
23923
|
verifyPostMortemKnowledgeActions,
|
|
24075
23924
|
repairPostMortemActions,
|
|
24076
23925
|
loadDefaultKnowledgeConfig: async (directory) => {
|
|
24077
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
23926
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-98tdb9h0.js");
|
|
24078
23927
|
try {
|
|
24079
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
23928
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-wccdm7jv.js");
|
|
24080
23929
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
24081
23930
|
return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
24082
23931
|
} catch {
|
|
@@ -24084,11 +23933,11 @@ var _internals27 = {
|
|
|
24084
23933
|
}
|
|
24085
23934
|
},
|
|
24086
23935
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
|
|
24087
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
23936
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-85d97240.js");
|
|
24088
23937
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
|
|
24089
23938
|
},
|
|
24090
23939
|
checkHivePromotions: async (entries, knowledgeConfig, directory) => {
|
|
24091
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
23940
|
+
const { checkHivePromotions } = await import("./hive-promoter-k57j3kp6.js");
|
|
24092
23941
|
return checkHivePromotions(entries, knowledgeConfig, directory);
|
|
24093
23942
|
},
|
|
24094
23943
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -24097,7 +23946,7 @@ var _internals27 = {
|
|
|
24097
23946
|
activateProposal,
|
|
24098
23947
|
listSkills: listSkills2,
|
|
24099
23948
|
sanitizeSlug
|
|
24100
|
-
} = await import("./skill-generator-
|
|
23949
|
+
} = await import("./skill-generator-kck7087c.js");
|
|
24101
23950
|
const result = {
|
|
24102
23951
|
approved: [],
|
|
24103
23952
|
rejected: [],
|
|
@@ -25427,9 +25276,9 @@ function hashContent(content) {
|
|
|
25427
25276
|
return createHash13("sha1").update(content).digest("hex");
|
|
25428
25277
|
}
|
|
25429
25278
|
async function loadConfigForPolicyCurator(directory) {
|
|
25430
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
25279
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-98tdb9h0.js");
|
|
25431
25280
|
try {
|
|
25432
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
25281
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-wccdm7jv.js");
|
|
25433
25282
|
const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
|
|
25434
25283
|
return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
|
|
25435
25284
|
} catch {
|
|
@@ -37734,7 +37583,7 @@ async function runFinalizeStage(ctx) {
|
|
|
37734
37583
|
}
|
|
37735
37584
|
}
|
|
37736
37585
|
try {
|
|
37737
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
37586
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-98tdb9h0.js");
|
|
37738
37587
|
const { config: pmLoadedConfig } = _internals41.loadPluginConfigWithMeta(ctx.directory);
|
|
37739
37588
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
37740
37589
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -39958,9 +39807,9 @@ var _internals45 = {
|
|
|
39958
39807
|
loadPluginConfigWithMeta,
|
|
39959
39808
|
loadCuratorDeps: async () => {
|
|
39960
39809
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
39961
|
-
import("./schema-
|
|
39962
|
-
import("./curator-
|
|
39963
|
-
import("./curator-llm-factory-
|
|
39810
|
+
import("./schema-98tdb9h0.js"),
|
|
39811
|
+
import("./curator-85d97240.js"),
|
|
39812
|
+
import("./curator-llm-factory-s9s4s0q3.js")
|
|
39964
39813
|
]);
|
|
39965
39814
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
39966
39815
|
}
|
|
@@ -40969,7 +40818,7 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
40969
40818
|
let scanCompleted = false;
|
|
40970
40819
|
let scanRemaining = 0;
|
|
40971
40820
|
try {
|
|
40972
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
40821
|
+
const { getScanStatus } = await import("./scan-cursor-shn926r6.js");
|
|
40973
40822
|
const status = await getScanStatus(directory);
|
|
40974
40823
|
scanGeneration = status.generation;
|
|
40975
40824
|
scanCompleted = status.completed;
|
|
@@ -40977,19 +40826,19 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
40977
40826
|
} catch {}
|
|
40978
40827
|
let configMatch = null;
|
|
40979
40828
|
try {
|
|
40980
|
-
const { isLinked: isLinked2 } = await import("./knowledge-link-
|
|
40829
|
+
const { isLinked: isLinked2 } = await import("./knowledge-link-xezm8hr3.js");
|
|
40981
40830
|
if (isLinked2(directory)) {
|
|
40982
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
40831
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-98tdb9h0.js");
|
|
40983
40832
|
let config;
|
|
40984
40833
|
try {
|
|
40985
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
40834
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-wccdm7jv.js");
|
|
40986
40835
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
40987
40836
|
config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
40988
40837
|
} catch {
|
|
40989
40838
|
config = KnowledgeConfigSchema2.parse({});
|
|
40990
40839
|
}
|
|
40991
40840
|
const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
|
|
40992
|
-
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-
|
|
40841
|
+
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-47przjwg.js");
|
|
40993
40842
|
const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
|
|
40994
40843
|
const cohortFp = await readCohortConfigFingerprint(directory);
|
|
40995
40844
|
configMatch = cohortFp === null ? null : currentFp === cohortFp;
|
|
@@ -42330,7 +42179,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
42330
42179
|
const result = runConfigDoctor(config, directory);
|
|
42331
42180
|
let output;
|
|
42332
42181
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
42333
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
42182
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-fr8dfrt2.js");
|
|
42334
42183
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
|
|
42335
42184
|
applyLossy: true
|
|
42336
42185
|
});
|
|
@@ -42368,7 +42217,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
42368
42217
|
`;
|
|
42369
42218
|
}
|
|
42370
42219
|
try {
|
|
42371
|
-
const { runModelPreflight } = await import("./model-preflight-
|
|
42220
|
+
const { runModelPreflight } = await import("./model-preflight-yqqchzjn.js");
|
|
42372
42221
|
const preflight = await runModelPreflight(config, swarmState.opencodeClient);
|
|
42373
42222
|
if (preflight.catalogAvailable) {
|
|
42374
42223
|
const unresolved = preflight.resolutions.filter((resolution) => resolution.status === "unresolved");
|
|
@@ -43270,7 +43119,7 @@ async function handleEvidenceCommand(directory, args) {
|
|
|
43270
43119
|
return formatTaskEvidenceMarkdown(evidenceData);
|
|
43271
43120
|
}
|
|
43272
43121
|
async function handleEvidenceSummaryCommand(directory) {
|
|
43273
|
-
const { buildEvidenceSummary } = await import("./evidence-summary-service-
|
|
43122
|
+
const { buildEvidenceSummary } = await import("./evidence-summary-service-9dyt2kzh.js");
|
|
43274
43123
|
const artifact = await buildEvidenceSummary(directory);
|
|
43275
43124
|
if (!artifact) {
|
|
43276
43125
|
return "No plan found. Run `/swarm plan` to check plan status.";
|
|
@@ -48152,7 +48001,8 @@ function partitionAgainstBaseline(indexed, baselineFingerprints, baselineReflowK
|
|
|
48152
48001
|
reflowCounts.set(reflowKey, count - 1);
|
|
48153
48002
|
}
|
|
48154
48003
|
} else if (stable && reflowKey && (reflowCounts.get(reflowKey) ?? 0) > 0) {
|
|
48155
|
-
|
|
48004
|
+
const matchedCount = reflowCounts.get(reflowKey) ?? 0;
|
|
48005
|
+
reflowCounts.set(reflowKey, matchedCount - 1);
|
|
48156
48006
|
moved.push(finding);
|
|
48157
48007
|
} else {
|
|
48158
48008
|
newFindings.push(finding);
|
|
@@ -48297,7 +48147,8 @@ async function captureOrMergeBaseline(directory, phase, findings, engine, scanne
|
|
|
48297
48147
|
continue;
|
|
48298
48148
|
}
|
|
48299
48149
|
if (stable && reflowKey && (priorReflowCounts.get(reflowKey) ?? 0) > 0) {
|
|
48300
|
-
|
|
48150
|
+
const matchedCount = priorReflowCounts.get(reflowKey) ?? 0;
|
|
48151
|
+
priorReflowCounts.set(reflowKey, matchedCount - 1);
|
|
48301
48152
|
continue;
|
|
48302
48153
|
}
|
|
48303
48154
|
const relFile = normalizeFindingPath(directory, finding.location.file);
|
|
@@ -48361,8 +48212,10 @@ async function captureOrMergeBaseline(directory, phase, findings, engine, scanne
|
|
|
48361
48212
|
}
|
|
48362
48213
|
cappedFilesIndexed = Array.from(survivingFiles);
|
|
48363
48214
|
}
|
|
48215
|
+
const priorTriage = existing.triage_log ?? [];
|
|
48364
48216
|
const cappedFingerprintSet = new Set(cappedFingerprints2);
|
|
48365
|
-
const retainedTriage =
|
|
48217
|
+
const retainedTriage = priorTriage.filter((e) => cappedFingerprintSet.has(e.fingerprint));
|
|
48218
|
+
const droppedTriageCount = priorTriage.length - retainedTriage.length;
|
|
48366
48219
|
const mergedTriageLog = [...retainedTriage, ...triageEntries].slice(-MAX_BASELINE_FINDINGS);
|
|
48367
48220
|
const now3 = new Date().toISOString();
|
|
48368
48221
|
const bundle2 = {
|
|
@@ -48399,7 +48252,8 @@ async function captureOrMergeBaseline(directory, phase, findings, engine, scanne
|
|
|
48399
48252
|
status: "merged",
|
|
48400
48253
|
path: baselinePath,
|
|
48401
48254
|
fingerprint_count: cappedFingerprints2.length,
|
|
48402
|
-
absorbed_finding_count: triageEntries.length
|
|
48255
|
+
absorbed_finding_count: triageEntries.length,
|
|
48256
|
+
dropped_triage_count: droppedTriageCount
|
|
48403
48257
|
};
|
|
48404
48258
|
}
|
|
48405
48259
|
const newFingerprints = indexed.map((i) => i.fingerprint);
|
|
@@ -48480,7 +48334,7 @@ function loadBaseline(directory, phase) {
|
|
|
48480
48334
|
}
|
|
48481
48335
|
let reflowKeys = [];
|
|
48482
48336
|
if (parsed.schema_version === BASELINE_SCHEMA_VERSION) {
|
|
48483
|
-
if (parsed.reflow_keys === undefined) {
|
|
48337
|
+
if (parsed.reflow_keys === undefined || parsed.reflow_keys === null) {
|
|
48484
48338
|
reflowKeys = [];
|
|
48485
48339
|
} else if (!Array.isArray(parsed.reflow_keys) || parsed.reflow_keys.some((k) => typeof k !== "string") || parsed.reflow_keys.length !== parsed.fingerprints.length) {
|
|
48486
48340
|
return {
|
|
@@ -48863,8 +48717,17 @@ async function sastScan(input, directory, config) {
|
|
|
48863
48717
|
warn(`SAST Baseline: capture failed \u2014 ${captureResult.message}`);
|
|
48864
48718
|
} else if (captureResult.status === "absorption_blocked") {
|
|
48865
48719
|
warn(`SAST Baseline: ${captureResult.message}`);
|
|
48866
|
-
} else if (captureResult.status === "merged"
|
|
48867
|
-
|
|
48720
|
+
} else if (captureResult.status === "merged") {
|
|
48721
|
+
const notes = [];
|
|
48722
|
+
if (captureResult.absorbed_finding_count > 0) {
|
|
48723
|
+
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.");
|
|
48724
|
+
}
|
|
48725
|
+
if (captureResult.dropped_triage_count > 0) {
|
|
48726
|
+
notes.push(`dropped ${captureResult.dropped_triage_count} stale triage ` + "entr(y/ies) whose fingerprints no longer survive this merge");
|
|
48727
|
+
}
|
|
48728
|
+
if (notes.length > 0) {
|
|
48729
|
+
warn(`SAST Baseline: merged and ${notes.join("; ")}.`);
|
|
48730
|
+
}
|
|
48868
48731
|
}
|
|
48869
48732
|
const finalFindings2 = allFindings.slice(0, MAX_FINDINGS);
|
|
48870
48733
|
const summary2 = {
|
|
@@ -48977,6 +48840,8 @@ async function sastScan(input, directory, config) {
|
|
|
48977
48840
|
new_findings: newFindings,
|
|
48978
48841
|
pre_existing_findings: preExistingFindings,
|
|
48979
48842
|
moved_findings: movedFindings,
|
|
48843
|
+
...truncatedPreExisting ? { truncated_pre_existing: true } : {},
|
|
48844
|
+
...truncatedMoved ? { truncated_moved_findings: true } : {},
|
|
48980
48845
|
baseline_used: true
|
|
48981
48846
|
}
|
|
48982
48847
|
}, abort_signal);
|
|
@@ -49001,12 +48866,12 @@ async function sastScan(input, directory, config) {
|
|
|
49001
48866
|
}
|
|
49002
48867
|
var sast_scan = createSwarmTool({
|
|
49003
48868
|
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.",
|
|
48869
|
+
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
48870
|
args: {
|
|
49006
48871
|
directory: exports_external.string().describe("Directory to scan for security vulnerabilities"),
|
|
49007
48872
|
changed_files: exports_external.array(exports_external.string()).optional().describe("List of files to scan (leave empty to scan none)"),
|
|
49008
48873
|
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."),
|
|
48874
|
+
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
48875
|
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
48876
|
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
48877
|
},
|
|
@@ -78608,7 +78473,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
|
|
|
78608
78473
|
if (!input.dispatcher) {
|
|
78609
78474
|
throw new Error("no evaluation dispatcher available (cannot run validation)");
|
|
78610
78475
|
}
|
|
78611
|
-
const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-
|
|
78476
|
+
const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-wsdcy2d6.js");
|
|
78612
78477
|
const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
|
|
78613
78478
|
const result = await withProtectedSetIntegrity([evalInputRoot, ...protectedRoots(input.directory)], () => _internals98.evaluateCandidateV1({
|
|
78614
78479
|
projectRoot: input.directory,
|
|
@@ -80733,7 +80598,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
80733
80598
|
async function handleHelpCommand(ctx) {
|
|
80734
80599
|
const targetCommand = ctx.args.join(" ");
|
|
80735
80600
|
if (!targetCommand) {
|
|
80736
|
-
const { buildHelpText } = await import("./index-
|
|
80601
|
+
const { buildHelpText } = await import("./index-e1ygmd4q.js");
|
|
80737
80602
|
return buildHelpText();
|
|
80738
80603
|
}
|
|
80739
80604
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -80742,7 +80607,7 @@ async function handleHelpCommand(ctx) {
|
|
|
80742
80607
|
return _internals101.buildDetailedHelp(resolved.key, resolved.entry);
|
|
80743
80608
|
}
|
|
80744
80609
|
const similar = _internals101.findSimilarCommands(targetCommand);
|
|
80745
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
80610
|
+
const { buildHelpText: fullHelp } = await import("./index-e1ygmd4q.js");
|
|
80746
80611
|
if (similar.length > 0) {
|
|
80747
80612
|
return `Command '/swarm ${targetCommand}' not found.
|
|
80748
80613
|
|
|
@@ -81073,7 +80938,7 @@ var COMMAND_REGISTRY = {
|
|
|
81073
80938
|
},
|
|
81074
80939
|
"guardrail explain": {
|
|
81075
80940
|
handler: async (ctx) => {
|
|
81076
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
80941
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-4a2xdtew.js");
|
|
81077
80942
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
81078
80943
|
},
|
|
81079
80944
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -81083,7 +80948,7 @@ var COMMAND_REGISTRY = {
|
|
|
81083
80948
|
},
|
|
81084
80949
|
"guardrail reset": {
|
|
81085
80950
|
handler: async (ctx) => {
|
|
81086
|
-
const { handleGuardrailReset } = await import("./guardrail-reset-
|
|
80951
|
+
const { handleGuardrailReset } = await import("./guardrail-reset-xn7k3hn8.js");
|
|
81087
80952
|
return handleGuardrailReset(ctx.args, ctx.sessionID);
|
|
81088
80953
|
},
|
|
81089
80954
|
description: "Reset one exact active invocation/action circuit after repair",
|
|
@@ -81092,7 +80957,7 @@ var COMMAND_REGISTRY = {
|
|
|
81092
80957
|
},
|
|
81093
80958
|
"guardrail-explain": {
|
|
81094
80959
|
handler: async (ctx) => {
|
|
81095
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
80960
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-4a2xdtew.js");
|
|
81096
80961
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
81097
80962
|
},
|
|
81098
80963
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -81102,7 +80967,7 @@ var COMMAND_REGISTRY = {
|
|
|
81102
80967
|
},
|
|
81103
80968
|
"guardrail-reset": {
|
|
81104
80969
|
handler: async (ctx) => {
|
|
81105
|
-
const { handleGuardrailReset } = await import("./guardrail-reset-
|
|
80970
|
+
const { handleGuardrailReset } = await import("./guardrail-reset-xn7k3hn8.js");
|
|
81106
80971
|
return handleGuardrailReset(ctx.args, ctx.sessionID);
|
|
81107
80972
|
},
|
|
81108
80973
|
description: "Reset one exact active invocation/action circuit after repair",
|
|
@@ -81112,7 +80977,7 @@ var COMMAND_REGISTRY = {
|
|
|
81112
80977
|
},
|
|
81113
80978
|
"guardrail-log": {
|
|
81114
80979
|
handler: async (ctx) => {
|
|
81115
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
80980
|
+
const { handleGuardrailLog } = await import("./guardrail-log-27nkntrx.js");
|
|
81116
80981
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
81117
80982
|
},
|
|
81118
80983
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -83055,6 +82920,7 @@ HARD CONSTRAINTS (apply regardless of skill load success):
|
|
|
83055
82920
|
- 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
82921
|
- 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
82922
|
- 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.
|
|
82923
|
+
- 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
82924
|
- 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
82925
|
- 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
82926
|
- 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 +86972,7 @@ function getDisplayFinalPromptPressure() {
|
|
|
87106
86972
|
async function rehydratePrSubscriptions(sessionID, directory) {
|
|
87107
86973
|
const map = new Map;
|
|
87108
86974
|
try {
|
|
87109
|
-
const { listActive: listActive2 } = await import("./pr-subscriptions-
|
|
86975
|
+
const { listActive: listActive2 } = await import("./pr-subscriptions-asjevc5p.js");
|
|
87110
86976
|
const records = await listActive2(directory);
|
|
87111
86977
|
for (const record of records) {
|
|
87112
86978
|
if (record.sessionID !== sessionID)
|
|
@@ -87552,7 +87418,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
|
|
|
87552
87418
|
return extracted === expectedSessionId;
|
|
87553
87419
|
}
|
|
87554
87420
|
async function inspectStandardWorktreeCollisionOwnership(identity) {
|
|
87555
|
-
const collisionOwnership = await import("./worktree-collision-ownership-
|
|
87421
|
+
const collisionOwnership = await import("./worktree-collision-ownership-6b3kshcv.js");
|
|
87556
87422
|
return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
|
|
87557
87423
|
}
|
|
87558
87424
|
async function runRecoveryGit(directory, args, timeoutMs = 15000) {
|
|
@@ -87961,7 +87827,7 @@ async function precreateStandardWorktreeSession(args) {
|
|
|
87961
87827
|
const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
|
|
87962
87828
|
if (laneProfile) {
|
|
87963
87829
|
try {
|
|
87964
|
-
const { writeLaneProfileToDiskReal } = await import("./core-
|
|
87830
|
+
const { writeLaneProfileToDiskReal } = await import("./core-4j1hbhey.js");
|
|
87965
87831
|
await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
|
|
87966
87832
|
} catch {}
|
|
87967
87833
|
}
|
|
@@ -88886,7 +88752,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
|
|
|
88886
88752
|
}
|
|
88887
88753
|
clearWorktreeMergeStatus(statusKey);
|
|
88888
88754
|
try {
|
|
88889
|
-
const { removeLaneProfileFromDiskReal } = await import("./core-
|
|
88755
|
+
const { removeLaneProfileFromDiskReal } = await import("./core-4j1hbhey.js");
|
|
88890
88756
|
await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
|
|
88891
88757
|
} catch {}
|
|
88892
88758
|
const state = serializationStateBySessionID.get(dispatch.parentSessionID);
|
|
@@ -89089,4 +88955,4 @@ var _internals103 = {
|
|
|
89089
88955
|
resolveGitExecutable
|
|
89090
88956
|
};
|
|
89091
88957
|
|
|
89092
|
-
export {
|
|
88958
|
+
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 };
|