opencode-swarm 7.199.1 → 7.199.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/swarm-pr-feedback/SKILL.md +9 -9
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/agents/architect.d.ts +1 -1
- package/dist/background/workspace-snapshot.d.ts +51 -0
- package/dist/cli/{auto-checkpoint-x13d1g1t.js → auto-checkpoint-0ajspw7n.js} +5 -5
- package/dist/cli/{checkpoint-68nb8k3t.js → checkpoint-1dsrg3ft.js} +9 -9
- package/dist/cli/{coder-settlement-kmdmdpyy.js → coder-settlement-189074m3.js} +5 -5
- package/dist/cli/{config-doctor-4b0jb15n.js → config-doctor-20pd12nw.js} +8 -8
- package/dist/cli/{core-6kkm2vrz.js → core-5bqceeft.js} +2 -2
- package/dist/cli/{curator-z8xzxh9f.js → curator-b3zn9w9q.js} +28 -28
- package/dist/cli/{curator-drift-axcgdjy4.js → curator-drift-ka477rrz.js} +6 -6
- package/dist/cli/{curator-llm-factory-58ec737y.js → curator-llm-factory-nbprwszt.js} +28 -28
- package/dist/cli/{doctor-knowledge-receipt-phase-id-hkjt6hv4.js → doctor-knowledge-receipt-phase-id-nrk52ak6.js} +5 -5
- package/dist/cli/{evidence-summary-service-981cx8wa.js → evidence-summary-service-qrr8zjhj.js} +10 -10
- package/dist/cli/{gate-evidence-zyvwsp7a.js → gate-evidence-cbs5xh1n.js} +3 -3
- package/dist/cli/{guardrail-explain-23b0amne.js → guardrail-explain-6xd6r3f5.js} +29 -29
- package/dist/cli/{guardrail-log-s2gxszvm.js → guardrail-log-qn1sqjs9.js} +4 -4
- package/dist/cli/{guardrail-reset-kt18vr45.js → guardrail-reset-ha3w0nby.js} +28 -28
- package/dist/cli/{hive-promoter-fz7ep8h4.js → hive-promoter-2dnv2xrg.js} +28 -28
- package/dist/cli/{index-3zzxrwaf.js → index-46sgm9rd.js} +1 -1
- package/dist/cli/{index-bb2rx8k2.js → index-4py6w3hy.js} +3 -3
- package/dist/cli/{index-t1t93qm0.js → index-5mbpybdm.js} +2 -2
- package/dist/cli/{index-14vhp87b.js → index-5v0wkcd9.js} +2 -2
- package/dist/cli/{index-vj0zede7.js → index-67ad9qbe.js} +1 -1
- package/dist/cli/{index-w9f2jbwe.js → index-7d3ft7by.js} +1 -1
- package/dist/cli/{index-n9ry04hw.js → index-9qc7d3q2.js} +15 -11
- package/dist/cli/{index-m4s5a2sp.js → index-bz5h9ttt.js} +4 -4
- package/dist/cli/{index-61fa8hg7.js → index-c2eqtpk1.js} +2 -2
- package/dist/cli/{index-61m1jw7p.js → index-cpdcscwt.js} +2 -2
- package/dist/cli/{index-fmbqyqqw.js → index-djtqb6b7.js} +2 -2
- package/dist/cli/{index-jccs3fgn.js → index-dyp5807d.js} +13 -1
- package/dist/cli/{index-f900029m.js → index-eyt9ryhd.js} +4 -4
- package/dist/cli/{index-p35gw2x7.js → index-gfdz460m.js} +1 -1
- package/dist/cli/{index-nacmcvc4.js → index-hfsyvkn0.js} +4 -4
- package/dist/cli/{index-jhk4000q.js → index-hj76n215.js} +1 -1
- package/dist/cli/{index-9ztsfved.js → index-hz2609qt.js} +117 -2
- package/dist/cli/{index-ge7vn1vz.js → index-jrdepg4w.js} +1 -1
- package/dist/cli/{index-4rrff8k6.js → index-km9tjdgw.js} +3 -3
- package/dist/cli/{index-408tpd21.js → index-kwh4b9cm.js} +2 -2
- package/dist/cli/{index-mzx33w6e.js → index-mb3y5cgy.js} +5 -5
- package/dist/cli/{index-r7ayh42s.js → index-mbygjbj8.js} +4 -4
- package/dist/cli/{index-795vmpe6.js → index-qksw8p51.js} +28 -28
- package/dist/cli/{index-w4624tpw.js → index-r9s68beh.js} +1 -1
- package/dist/cli/{index-pf0xrx9w.js → index-skg220qc.js} +423 -117
- package/dist/cli/{index-8pyg2qnw.js → index-t6gsqe10.js} +2 -2
- package/dist/cli/{index-weewx5nx.js → index-vd6s2mxq.js} +1 -1
- package/dist/cli/{index-npy15m50.js → index-ve0ncsnc.js} +1 -1
- package/dist/cli/{index-xj9260dh.js → index-wz8zc7w3.js} +6 -6
- package/dist/cli/{index-nreezgrd.js → index-xapmt05a.js} +3 -3
- package/dist/cli/{index-hqrkr9ag.js → index-xfzkq1k4.js} +5 -5
- package/dist/cli/{index-px1dnna2.js → index-y4kjbf12.js} +1 -1
- package/dist/cli/{index-qqv9rr8k.js → index-zvjrymp9.js} +30 -30
- package/dist/cli/index.js +29 -29
- package/dist/cli/{knowledge-escalator-cf6m9y0s.js → knowledge-escalator-k1mssp9r.js} +8 -8
- package/dist/cli/{knowledge-events-hn5hymam.js → knowledge-events-f7c0z8rb.js} +6 -6
- package/dist/cli/{knowledge-store-mgqk4hvy.js → knowledge-store-50vj5db0.js} +1 -1
- package/dist/cli/{knowledge-validator-x9yrte9q.js → knowledge-validator-afxk6dvk.js} +2 -2
- package/dist/cli/{mcp-hpmh4d6d.js → mcp-j0grf8gt.js} +1 -1
- package/dist/cli/{model-preflight-ry5jjnx4.js → model-preflight-ks9j40t5.js} +28 -28
- package/dist/cli/{pending-delegations-j850kj5p.js → pending-delegations-e42yvvj0.js} +2 -2
- package/dist/cli/{pr-subscriptions-mme9gb5e.js → pr-subscriptions-e92eg4ts.js} +1 -1
- package/dist/cli/{pr-workflow-gate-n6bj3dnn.js → pr-workflow-gate-zqwde6r6.js} +28 -28
- package/dist/cli/{runner-qe3fkzx5.js → runner-7sd43gan.js} +1 -1
- package/dist/cli/{scan-cursor-fdpxbx4f.js → scan-cursor-yehnf9jt.js} +2 -2
- package/dist/cli/{schema-amcjvk8a.js → schema-jw861rj0.js} +2 -2
- package/dist/cli/{scope-persistence-mp4kqpk2.js → scope-persistence-p778xbbq.js} +6 -6
- package/dist/cli/{server-ptdvpwyd.js → server-nkhvbbc5.js} +101 -39
- package/dist/cli/{skill-generator-v59hhybn.js → skill-generator-dd1w9p3t.js} +9 -9
- package/dist/cli/{snapshot-coordination-init-nv6e4svp.js → snapshot-coordination-init-11qb0jbs.js} +28 -28
- package/dist/cli/{speckit-checkoff-me8kd3wd.js → speckit-checkoff-d92ej93g.js} +4 -4
- package/dist/cli/{workspace-snapshot-vhvrkbbb.js → workspace-snapshot-4zfj5wnd.js} +13 -1
- package/dist/cli/{worktree-collision-ownership-84qyqars.js → worktree-collision-ownership-81wpkagz.js} +2 -2
- package/dist/cli/{worktree-isolation-99qvz8ap.js → worktree-isolation-zw3ydg49.js} +28 -28
- package/dist/config/skill-contract-digest.d.ts +8 -0
- package/dist/hooks/pr-workflow-gate.d.ts +32 -23
- package/dist/host/v2/events.d.ts +19 -1
- package/dist/host/v2/hooks.d.ts +25 -0
- package/dist/index.js +61 -59
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/prepare-pr-feedback-commit-message.d.ts +30 -0
- package/dist/tools/tool-metadata.d.ts +4 -4
- package/package.json +1 -1
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
protectedRoots,
|
|
9
9
|
redactDecisionLineForArchive,
|
|
10
10
|
stableCanonicalStringify
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-kwh4b9cm.js";
|
|
12
12
|
import {
|
|
13
13
|
detectStraySwarmDirs,
|
|
14
14
|
readDoctorArtifact,
|
|
15
15
|
removeStraySwarmDir,
|
|
16
16
|
resolvePlanParallelizationFlag,
|
|
17
17
|
runConfigDoctor
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-hfsyvkn0.js";
|
|
19
19
|
import {
|
|
20
20
|
archiveEvidence,
|
|
21
21
|
checkRequirementCoverage,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
sanitizeTaskId,
|
|
28
28
|
saveEvidence,
|
|
29
29
|
validateProjectRoot
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-y4kjbf12.js";
|
|
31
31
|
import {
|
|
32
32
|
JAVA_SYMBOL_GRAMMAR,
|
|
33
33
|
LANGUAGE_REGISTRY,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
runEvaluation,
|
|
57
57
|
runExternalTool,
|
|
58
58
|
withDisposableWorktree
|
|
59
|
-
} from "./index-
|
|
59
|
+
} from "./index-dyp5807d.js";
|
|
60
60
|
import {
|
|
61
61
|
EvaluationTaskV1Schema,
|
|
62
62
|
GateAuditManifestV1Schema,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
alreadyCuratedThisGeneration,
|
|
90
90
|
claimNextScanBatch,
|
|
91
91
|
resolveCohortId
|
|
92
|
-
} from "./index-
|
|
92
|
+
} from "./index-r9s68beh.js";
|
|
93
93
|
import {
|
|
94
94
|
CURATOR_CONSOLIDATION_PROMPT,
|
|
95
95
|
CURATOR_INIT_PROMPT,
|
|
@@ -108,13 +108,13 @@ import {
|
|
|
108
108
|
getGroupCommitWriter,
|
|
109
109
|
importLegacyJsonl,
|
|
110
110
|
readPriorDriftReports
|
|
111
|
-
} from "./index-
|
|
111
|
+
} from "./index-ve0ncsnc.js";
|
|
112
112
|
import {
|
|
113
113
|
assertNoUnsettledCoderDispatch,
|
|
114
114
|
listCoderSettlementWalStates,
|
|
115
115
|
recoverCoderSettlement,
|
|
116
116
|
recoverStaleCoderSettlements
|
|
117
|
-
} from "./index-
|
|
117
|
+
} from "./index-bz5h9ttt.js";
|
|
118
118
|
import {
|
|
119
119
|
BUNDLED_PROJECT_SKILL_ROOT,
|
|
120
120
|
DEFAULT_SKILL_MIN_CONFIDENCE,
|
|
@@ -137,12 +137,13 @@ import {
|
|
|
137
137
|
skillContractDigest,
|
|
138
138
|
splitSkillFrontmatter,
|
|
139
139
|
syncBundledProjectSkillsIfMissingAsync
|
|
140
|
-
} from "./index-
|
|
140
|
+
} from "./index-9qc7d3q2.js";
|
|
141
141
|
import {
|
|
142
142
|
buildEscalationBriefing,
|
|
143
143
|
readRecentEscalations
|
|
144
|
-
} from "./index-
|
|
144
|
+
} from "./index-wz8zc7w3.js";
|
|
145
145
|
import {
|
|
146
|
+
fastForwardToRefAsync,
|
|
146
147
|
parsePorcelainV2Snapshot,
|
|
147
148
|
resolveCommitCountSince,
|
|
148
149
|
resolveCommitCountSinceAsync,
|
|
@@ -154,13 +155,16 @@ import {
|
|
|
154
155
|
resolveCurrentUpstreamRemoteRef,
|
|
155
156
|
resolveExactRemoteBranchHead,
|
|
156
157
|
resolveExactRemoteBranchHeadAsync,
|
|
158
|
+
resolveIsAncestorAsync,
|
|
157
159
|
resolveIsExactSingleChildCommit,
|
|
158
160
|
resolveIsExactSingleChildCommitAsync,
|
|
159
161
|
resolveIsWorkingTreeClean,
|
|
160
162
|
resolveIsWorkingTreeCleanAsync,
|
|
163
|
+
resolveLocalRefHeadAsync,
|
|
161
164
|
resolvePrFeedbackTrackingCandidatesAsync,
|
|
162
165
|
resolvePrReviewDiffStats,
|
|
163
166
|
resolvePrReviewDiffStatsAsync,
|
|
167
|
+
resolvePrWorkflowChangedPathSetAsync,
|
|
164
168
|
resolvePrWorkflowRevisionDigest,
|
|
165
169
|
resolvePrWorkflowRevisionDigestDetailed,
|
|
166
170
|
resolvePrWorkflowRevisionDigestDetailedAsync,
|
|
@@ -168,8 +172,10 @@ import {
|
|
|
168
172
|
resolveRemoteRefsContainingHeadAsync,
|
|
169
173
|
resolveRemoteUrlIdentity,
|
|
170
174
|
resolveRemoteUrlIdentityAsync,
|
|
175
|
+
resolveRepoTopLevelAsync,
|
|
176
|
+
resolveWorkingTreeDirtyPathsAsync,
|
|
171
177
|
switchPrFeedbackTrackingCandidateAsync
|
|
172
|
-
} from "./index-
|
|
178
|
+
} from "./index-hz2609qt.js";
|
|
173
179
|
import {
|
|
174
180
|
buildCorrelationId,
|
|
175
181
|
buildIssueUrl,
|
|
@@ -225,7 +231,7 @@ import {
|
|
|
225
231
|
swarmOverwriteCandidates,
|
|
226
232
|
trackedDirtyCandidates,
|
|
227
233
|
transientBackoff
|
|
228
|
-
} from "./index-
|
|
234
|
+
} from "./index-4py6w3hy.js";
|
|
229
235
|
import {
|
|
230
236
|
EPIC_MODE_CONFIG_DISABLED_MESSAGE,
|
|
231
237
|
PlanRecoverySupersededError,
|
|
@@ -257,7 +263,7 @@ import {
|
|
|
257
263
|
updateEpicRecord,
|
|
258
264
|
updateTaskStatus,
|
|
259
265
|
withPlanLifecycleLock
|
|
260
|
-
} from "./index-
|
|
266
|
+
} from "./index-mb3y5cgy.js";
|
|
261
267
|
import {
|
|
262
268
|
containsControlChars,
|
|
263
269
|
containsPathTraversal,
|
|
@@ -274,7 +280,7 @@ import {
|
|
|
274
280
|
resolveSpeckitProjection,
|
|
275
281
|
validateSpeckit,
|
|
276
282
|
writeProjectedSpecSync
|
|
277
|
-
} from "./index-
|
|
283
|
+
} from "./index-xapmt05a.js";
|
|
278
284
|
import {
|
|
279
285
|
clearWorktreeMergeStatus,
|
|
280
286
|
getAllWorktreeMergeFailures,
|
|
@@ -306,7 +312,7 @@ import {
|
|
|
306
312
|
transitionTaskWorkflowEvidenceWithStatus,
|
|
307
313
|
withTaskEvidenceTransaction,
|
|
308
314
|
writeWorkflowWalFile
|
|
309
|
-
} from "./index-
|
|
315
|
+
} from "./index-46sgm9rd.js";
|
|
310
316
|
import {
|
|
311
317
|
isPathUnderSwarmWorktreeBase,
|
|
312
318
|
listLiveLaneOwners,
|
|
@@ -315,7 +321,7 @@ import {
|
|
|
315
321
|
recordLiveLaneOwner,
|
|
316
322
|
removeWorktree,
|
|
317
323
|
resolveWorktreeBaseDir
|
|
318
|
-
} from "./index-
|
|
324
|
+
} from "./index-cpdcscwt.js";
|
|
319
325
|
import {
|
|
320
326
|
GitBinaryMissingError,
|
|
321
327
|
GitSpawnCwdError,
|
|
@@ -358,7 +364,7 @@ import {
|
|
|
358
364
|
scanBackgroundCoderReservationsForAdmission,
|
|
359
365
|
scanDelegationsForRecovery,
|
|
360
366
|
sweepStaleDelegations
|
|
361
|
-
} from "./index-
|
|
367
|
+
} from "./index-hj76n215.js";
|
|
362
368
|
import {
|
|
363
369
|
MAX_EVENT_LOG_ENTRIES,
|
|
364
370
|
_internals,
|
|
@@ -370,7 +376,7 @@ import {
|
|
|
370
376
|
recordHiveKnowledgeEvent,
|
|
371
377
|
recordKnowledgeEvent,
|
|
372
378
|
resolveKnowledgeEventsPath
|
|
373
|
-
} from "./index-
|
|
379
|
+
} from "./index-t6gsqe10.js";
|
|
374
380
|
import {
|
|
375
381
|
commitDisplayedMembership,
|
|
376
382
|
commitEmptyRetrieval,
|
|
@@ -383,7 +389,7 @@ import {
|
|
|
383
389
|
queryLiveMemberships,
|
|
384
390
|
reconcilePhaseClose,
|
|
385
391
|
recordPhaseCloseIntent
|
|
386
|
-
} from "./index-
|
|
392
|
+
} from "./index-c2eqtpk1.js";
|
|
387
393
|
import {
|
|
388
394
|
sanitizeContextText
|
|
389
395
|
} from "./index-m9zzj4ee.js";
|
|
@@ -414,7 +420,7 @@ import {
|
|
|
414
420
|
validateActionableFields,
|
|
415
421
|
validateLesson,
|
|
416
422
|
validateSkillPath
|
|
417
|
-
} from "./index-
|
|
423
|
+
} from "./index-67ad9qbe.js";
|
|
418
424
|
import {
|
|
419
425
|
MAX_CURATION_PROPOSALS,
|
|
420
426
|
authorizeCuration,
|
|
@@ -425,7 +431,7 @@ import {
|
|
|
425
431
|
} from "./index-rtry5xyf.js";
|
|
426
432
|
import {
|
|
427
433
|
resolveWorktreeIsolationConfig
|
|
428
|
-
} from "./index-
|
|
434
|
+
} from "./index-km9tjdgw.js";
|
|
429
435
|
import {
|
|
430
436
|
RetrospectiveEvidenceSchema
|
|
431
437
|
} from "./index-g22dps7x.js";
|
|
@@ -437,7 +443,7 @@ import {
|
|
|
437
443
|
clearScopeBindings,
|
|
438
444
|
readAuthoritativeScopeBindingSet,
|
|
439
445
|
readDeclaredScopeFilesFromBindings
|
|
440
|
-
} from "./index-
|
|
446
|
+
} from "./index-jrdepg4w.js";
|
|
441
447
|
import {
|
|
442
448
|
approvedSnapshotCoversPlan,
|
|
443
449
|
clearPlanLedgerForReset,
|
|
@@ -454,7 +460,7 @@ import {
|
|
|
454
460
|
replayFromLedgerWithStatus,
|
|
455
461
|
resolvePlanningProfile,
|
|
456
462
|
takeSnapshotEvent
|
|
457
|
-
} from "./index-
|
|
463
|
+
} from "./index-djtqb6b7.js";
|
|
458
464
|
import {
|
|
459
465
|
CORE_EVENT_LOCKED,
|
|
460
466
|
appendCoreEventSync,
|
|
@@ -544,7 +550,7 @@ import {
|
|
|
544
550
|
transactFile,
|
|
545
551
|
transactKnowledge,
|
|
546
552
|
wordBigrams
|
|
547
|
-
} from "./index-
|
|
553
|
+
} from "./index-eyt9ryhd.js";
|
|
548
554
|
import {
|
|
549
555
|
readTailJsonl,
|
|
550
556
|
readTailJsonlDetailed,
|
|
@@ -629,7 +635,7 @@ import {
|
|
|
629
635
|
loadPluginConfig,
|
|
630
636
|
loadPluginConfigWithMeta,
|
|
631
637
|
resolveEpicConfig
|
|
632
|
-
} from "./index-
|
|
638
|
+
} from "./index-vd6s2mxq.js";
|
|
633
639
|
import {
|
|
634
640
|
GIT_BINARY_ENV_VAR,
|
|
635
641
|
addDeferredWarning,
|
|
@@ -662,7 +668,7 @@ import {
|
|
|
662
668
|
resolveContextWindow,
|
|
663
669
|
resolveGeneratedAgentRole,
|
|
664
670
|
stripKnownSwarmPrefix
|
|
665
|
-
} from "./index-
|
|
671
|
+
} from "./index-5mbpybdm.js";
|
|
666
672
|
import {
|
|
667
673
|
AGENT_TOOL_MAP,
|
|
668
674
|
ALL_AGENT_NAMES,
|
|
@@ -688,7 +694,7 @@ import {
|
|
|
688
694
|
init_agent_names,
|
|
689
695
|
init_constants,
|
|
690
696
|
init_tool_metadata
|
|
691
|
-
} from "./index-
|
|
697
|
+
} from "./index-xfzkq1k4.js";
|
|
692
698
|
import {
|
|
693
699
|
KNOWLEDGE_SCHEMA_VERSION,
|
|
694
700
|
OUTCOME_BLOCK_THRESHOLD,
|
|
@@ -836,6 +842,7 @@ init_loader();
|
|
|
836
842
|
// src/hooks/pr-workflow-gate.ts
|
|
837
843
|
init_zod();
|
|
838
844
|
import { createHash as createHash25, randomUUID as randomUUID6 } from "crypto";
|
|
845
|
+
import { realpathSync as realpathSync5 } from "fs";
|
|
839
846
|
import * as fsp5 from "fs/promises";
|
|
840
847
|
import * as path34 from "path";
|
|
841
848
|
|
|
@@ -3464,7 +3471,7 @@ async function importLegacyPrWorkflowGateStateIfNeeded(directory, sessionID, all
|
|
|
3464
3471
|
return null;
|
|
3465
3472
|
throw error2;
|
|
3466
3473
|
}
|
|
3467
|
-
const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-
|
|
3474
|
+
const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-zqwde6r6.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
|
|
3468
3475
|
if (!legacy)
|
|
3469
3476
|
return null;
|
|
3470
3477
|
const namespace = workflowGateStateCoordinationNamespace(sessionID);
|
|
@@ -3598,7 +3605,7 @@ async function deleteStateWhileLocked(directory, sessionID, options = {}) {
|
|
|
3598
3605
|
let recoveryState = null;
|
|
3599
3606
|
if (!currentAuthoritative) {
|
|
3600
3607
|
if (options.allowSalvagedRead) {
|
|
3601
|
-
const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-
|
|
3608
|
+
const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-zqwde6r6.js");
|
|
3602
3609
|
recoveryState = (await readPrWorkflowGateStateForRecovery(directory, normalizedSessionID))?.state ?? null;
|
|
3603
3610
|
}
|
|
3604
3611
|
if (!recoveryState) {
|
|
@@ -11477,7 +11484,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
|
|
|
11477
11484
|
return extracted === expectedSessionId;
|
|
11478
11485
|
}
|
|
11479
11486
|
async function inspectStandardWorktreeCollisionOwnership(identity) {
|
|
11480
|
-
const collisionOwnership = await import("./worktree-collision-ownership-
|
|
11487
|
+
const collisionOwnership = await import("./worktree-collision-ownership-81wpkagz.js");
|
|
11481
11488
|
return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
|
|
11482
11489
|
}
|
|
11483
11490
|
async function runRecoveryGit(directory, args, timeoutMs = 15000) {
|
|
@@ -11905,7 +11912,7 @@ async function precreateStandardWorktreeSession(args) {
|
|
|
11905
11912
|
const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
|
|
11906
11913
|
if (laneProfile) {
|
|
11907
11914
|
try {
|
|
11908
|
-
const { writeLaneProfileToDiskReal } = await import("./core-
|
|
11915
|
+
const { writeLaneProfileToDiskReal } = await import("./core-5bqceeft.js");
|
|
11909
11916
|
await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
|
|
11910
11917
|
} catch {}
|
|
11911
11918
|
}
|
|
@@ -12899,7 +12906,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
|
|
|
12899
12906
|
}
|
|
12900
12907
|
clearWorktreeMergeStatus(statusKey);
|
|
12901
12908
|
try {
|
|
12902
|
-
const { removeLaneProfileFromDiskReal } = await import("./core-
|
|
12909
|
+
const { removeLaneProfileFromDiskReal } = await import("./core-5bqceeft.js");
|
|
12903
12910
|
await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
|
|
12904
12911
|
} catch {}
|
|
12905
12912
|
const state = serializationStateBySessionID.get(dispatch.parentSessionID);
|
|
@@ -29601,7 +29608,7 @@ function clearCriticalShownIds(sessionID) {
|
|
|
29601
29608
|
async function rehydratePrSubscriptions(sessionID, directory) {
|
|
29602
29609
|
const map = new Map;
|
|
29603
29610
|
try {
|
|
29604
|
-
const { listActive: listActive2 } = await import("./pr-subscriptions-
|
|
29611
|
+
const { listActive: listActive2 } = await import("./pr-subscriptions-e92eg4ts.js");
|
|
29605
29612
|
const records = await listActive2(directory);
|
|
29606
29613
|
for (const record of records) {
|
|
29607
29614
|
if (record.sessionID !== sessionID)
|
|
@@ -29829,6 +29836,9 @@ var PrFeedbackStageARecordSchema = exports_external.object({
|
|
|
29829
29836
|
source: exports_external.string().min(1),
|
|
29830
29837
|
validatorContract: exports_external.object({ path: exports_external.string().min(1), id: exports_external.string().min(1) }).strict().optional()
|
|
29831
29838
|
}).strict()).max(256).optional(),
|
|
29839
|
+
baseRef: exports_external.string().min(1).max(256).optional(),
|
|
29840
|
+
baseSha: exports_external.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/).optional(),
|
|
29841
|
+
baseVerification: exports_external.enum(["caller-asserted", "none"]).optional(),
|
|
29832
29842
|
validatedAt: exports_external.string().min(1)
|
|
29833
29843
|
}).strict();
|
|
29834
29844
|
var PrFeedbackGateBatchRecordSchema = exports_external.object({
|
|
@@ -31471,45 +31481,87 @@ async function bindPrWorkflowHeadWhileLocked(directory, normalizedSessionID, prH
|
|
|
31471
31481
|
throw error2;
|
|
31472
31482
|
}
|
|
31473
31483
|
}
|
|
31474
|
-
async function
|
|
31475
|
-
const
|
|
31476
|
-
|
|
31477
|
-
|
|
31478
|
-
|
|
31484
|
+
async function maybeFastForwardRebindHead(directory, normalizedHead) {
|
|
31485
|
+
const tracking = await _test_exports2.resolveCurrentUpstreamPushTargetAsync(directory).catch(() => null);
|
|
31486
|
+
if (!tracking?.remoteTrackingRef)
|
|
31487
|
+
return;
|
|
31488
|
+
const trackingHead = await _test_exports2.resolveLocalRefHeadAsync(directory, tracking.remoteTrackingRef);
|
|
31489
|
+
if (!trackingHead || trackingHead !== normalizedHead.toLowerCase())
|
|
31490
|
+
return;
|
|
31491
|
+
const currentHead = (await _test_exports2.resolveCurrentGitHeadAsync(directory))?.trim().toLowerCase();
|
|
31492
|
+
if (!currentHead)
|
|
31493
|
+
return;
|
|
31494
|
+
if (currentHead === normalizedHead.toLowerCase())
|
|
31495
|
+
return;
|
|
31496
|
+
const ancestry = await _test_exports2.resolveIsAncestorAsync(directory, currentHead, normalizedHead);
|
|
31497
|
+
if (ancestry === null) {
|
|
31498
|
+
throw new Error(`BLOCKED: PR_FEEDBACK rebind fast-forward could not verify whether "${normalizedHead}" is a descendant of the current HEAD "${currentHead}" (the ancestry probe timed out or its output was truncated); nothing moved \u2014 retry the rebind`);
|
|
31479
31499
|
}
|
|
31480
|
-
|
|
31481
|
-
|
|
31482
|
-
throw new Error(`BLOCKED: PR_FEEDBACK rebind refused while the delegation store is unreadable after ${rebindRead.attempts} attempts (${rebindRead.reason}); in-flight lanes are UNKNOWN. Restore the store before rebinding.`);
|
|
31500
|
+
if (!ancestry) {
|
|
31501
|
+
throw new Error(`BLOCKED: PR_FEEDBACK rebind fast-forward refused: the bound tracking ref ${tracking.remoteTrackingRef} points at "${normalizedHead}", which is not a descendant of the current HEAD "${currentHead}"; resolve the divergence manually (push the repair, then rebind) \u2014 the gate never merges or rebases`);
|
|
31483
31502
|
}
|
|
31484
|
-
|
|
31485
|
-
|
|
31486
|
-
throw new Error(`BLOCKED: PR_FEEDBACK rebind refused while ${openLanes.length} PR workflow lane(s) are still in flight; collect their results first.`);
|
|
31503
|
+
if (await _test_exports2.resolveIsWorkingTreeCleanAsync(directory) !== true) {
|
|
31504
|
+
throw new Error("BLOCKED: PR_FEEDBACK rebind fast-forward requires a clean index and working tree; clean the tree first, then rebind");
|
|
31487
31505
|
}
|
|
31488
|
-
|
|
31489
|
-
|
|
31506
|
+
const moved = await _test_exports2.fastForwardToRefAsync(directory, tracking.remoteTrackingRef);
|
|
31507
|
+
if (!moved) {
|
|
31508
|
+
throw new Error(`BLOCKED: PR_FEEDBACK rebind fast-forward to ${tracking.remoteTrackingRef} failed or timed out; if git left an index.lock or a partially updated tree, remove the lock / restore the tree manually before retrying \u2014 otherwise a plain retry of the rebind completes it`);
|
|
31490
31509
|
}
|
|
31491
|
-
|
|
31492
|
-
|
|
31493
|
-
|
|
31494
|
-
|
|
31495
|
-
|
|
31496
|
-
|
|
31497
|
-
|
|
31498
|
-
|
|
31499
|
-
|
|
31500
|
-
|
|
31501
|
-
|
|
31502
|
-
|
|
31503
|
-
|
|
31504
|
-
|
|
31505
|
-
|
|
31506
|
-
|
|
31507
|
-
|
|
31510
|
+
}
|
|
31511
|
+
async function rebindPrFeedbackHead(directory, sessionID, prHeadSha) {
|
|
31512
|
+
return withPrWorkflowCheckoutMutationLock(directory, async () => {
|
|
31513
|
+
const state = await requireBoundState2(directory, sessionID, "PR_FEEDBACK");
|
|
31514
|
+
const normalizedHead = normalizePrHeadSha(prHeadSha).toLowerCase();
|
|
31515
|
+
if (state.prFeedbackReadyToPublish) {
|
|
31516
|
+
throw new Error("BLOCKED: PR_FEEDBACK rebind is refused while publication is armed; complete the workflow (or push the bound commit) before rebinding.");
|
|
31517
|
+
}
|
|
31518
|
+
const rebindRead = readDelegationsDetailed(directory);
|
|
31519
|
+
if (rebindRead.status === "uncertain") {
|
|
31520
|
+
throw new Error(`BLOCKED: PR_FEEDBACK rebind refused while the delegation store is unreadable after ${rebindRead.attempts} attempts (${rebindRead.reason}); in-flight lanes are UNKNOWN. Restore the store before rebinding.`);
|
|
31521
|
+
}
|
|
31522
|
+
const openLanes = rebindRead.records.filter((record) => record.parentSessionId === state.sessionID && record.mode?.startsWith("swarm-pr-") && (record.status === "pending" || record.status === "running"));
|
|
31523
|
+
if (openLanes.length > 0) {
|
|
31524
|
+
throw new Error(`BLOCKED: PR_FEEDBACK rebind refused while ${openLanes.length} PR workflow lane(s) are still in flight; collect their results first.`);
|
|
31525
|
+
}
|
|
31526
|
+
if (normalizedHead === state.prHeadSha) {
|
|
31527
|
+
throw new Error(`BLOCKED: PR_FEEDBACK rebind to the current intake head "${normalizedHead}" is a no-op; a rebind must move to a genuinely new verified PR head after merge/rebase repair.`);
|
|
31528
|
+
}
|
|
31529
|
+
try {
|
|
31530
|
+
await maybeFastForwardRebindHead(directory, normalizedHead);
|
|
31531
|
+
await assertCurrentCheckoutHead(directory, normalizedHead, state.mode);
|
|
31532
|
+
await assertPrFeedbackTrackingCheckout(directory, normalizedHead);
|
|
31533
|
+
} catch (error2) {
|
|
31534
|
+
const currentHead = (await _test_exports2.resolveCurrentGitHeadAsync(directory).catch(() => null))?.trim().toLowerCase();
|
|
31535
|
+
if (currentHead !== undefined && currentHead !== null && currentHead !== (state.prHeadSha ?? "").toLowerCase() && error2 instanceof Error) {
|
|
31536
|
+
throw new Error(`BLOCKED: ${error2.message} NOTE: the checkout HEAD is "${currentHead}" while the bound intake head is still "${state.prHeadSha}" \u2014 the fast-forward already moved HEAD; a plain retry of the same rebind completes it`, { cause: error2 });
|
|
31537
|
+
}
|
|
31538
|
+
throw error2;
|
|
31539
|
+
}
|
|
31540
|
+
const nextState = {
|
|
31541
|
+
...state,
|
|
31508
31542
|
prHeadSha: normalizedHead,
|
|
31509
|
-
|
|
31510
|
-
|
|
31511
|
-
|
|
31512
|
-
|
|
31543
|
+
prFeedbackStageA: undefined,
|
|
31544
|
+
prFeedbackVerifications: undefined,
|
|
31545
|
+
prFeedbackGateBatches: undefined,
|
|
31546
|
+
prFeedbackRebindCount: (state.prFeedbackRebindCount ?? 0) + 1,
|
|
31547
|
+
updatedAt: isoNow()
|
|
31548
|
+
};
|
|
31549
|
+
try {
|
|
31550
|
+
appendCoreEventSync(directory, {
|
|
31551
|
+
type: "pr_feedback_rebound",
|
|
31552
|
+
timestamp: isoNow(),
|
|
31553
|
+
sessionID: state.sessionID,
|
|
31554
|
+
previousPrHeadSha: state.prHeadSha,
|
|
31555
|
+
prHeadSha: normalizedHead,
|
|
31556
|
+
rebindCount: nextState.prFeedbackRebindCount
|
|
31557
|
+
});
|
|
31558
|
+
} catch {}
|
|
31559
|
+
try {
|
|
31560
|
+
return await withSessionStateMutation(directory, state.sessionID, async () => writeStateWhileLocked(directory, nextState));
|
|
31561
|
+
} catch (error2) {
|
|
31562
|
+
throw new Error(`BLOCKED: PR_FEEDBACK rebind moved the checkout toward "${normalizedHead}" but could not persist the rebind state (${error2 instanceof Error ? error2.message : String(error2)}); HEAD is already at the new head \u2014 retry the same rebind to complete it`, { cause: error2 });
|
|
31563
|
+
}
|
|
31564
|
+
});
|
|
31513
31565
|
}
|
|
31514
31566
|
async function bindPrReviewBase(directory, sessionID, options) {
|
|
31515
31567
|
let state = await bindPrWorkflowHead(directory, sessionID, options.prHeadSha);
|
|
@@ -31553,7 +31605,12 @@ async function assertCurrentCheckoutHead(directory, expectedHead, mode = "PR_REV
|
|
|
31553
31605
|
}
|
|
31554
31606
|
async function assertPrReviewCleanCheckout(directory, mode = "PR_REVIEW") {
|
|
31555
31607
|
if (await _test_exports2.resolveIsWorkingTreeCleanAsync(directory) !== true) {
|
|
31556
|
-
|
|
31608
|
+
const dirtyPaths = await _test_exports2.resolveWorkingTreeDirtyPathsAsync(directory);
|
|
31609
|
+
const sanitizePath = (value) => value.replace(/[\p{Cc}]/gu, (ch) => `\\u${ch.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
31610
|
+
const shown = dirtyPaths ? dirtyPaths.slice(0, PR_WORKFLOW_DIRTY_PATH_DISCLOSURE_LIMIT).map(sanitizePath) : [];
|
|
31611
|
+
const total = dirtyPaths ? dirtyPaths.length : 0;
|
|
31612
|
+
const detail = shown.length > 0 ? ` Dirty paths (first ${shown.length} of ${total}): ${shown.join(", ")}.` : "";
|
|
31613
|
+
throw new Error(`BLOCKED: ${mode} requires a clean index and working tree at the exact PR head.${detail}`);
|
|
31557
31614
|
}
|
|
31558
31615
|
}
|
|
31559
31616
|
async function assertPrFeedbackTrackingCheckout(directory, prHeadSha) {
|
|
@@ -33063,6 +33120,11 @@ async function recordPrFeedbackStageA(directory, sessionID, revisionDigest, chec
|
|
|
33063
33120
|
feedbackItemIds: reproductionFeedbackItemIds,
|
|
33064
33121
|
applicableCategories: normalizedCategories,
|
|
33065
33122
|
applicableObligations,
|
|
33123
|
+
...options.baseIdentity !== undefined ? {
|
|
33124
|
+
baseRef: options.baseIdentity.baseRef,
|
|
33125
|
+
baseSha: options.baseIdentity.baseSha
|
|
33126
|
+
} : {},
|
|
33127
|
+
baseVerification: options.baseIdentity?.baseVerification,
|
|
33066
33128
|
validatedAt: isoNow()
|
|
33067
33129
|
},
|
|
33068
33130
|
prFeedbackGateBatches: retainsGateBatches ? [...state.prFeedbackGateBatches ?? []] : [],
|
|
@@ -35347,11 +35409,19 @@ async function enforcePrWorkflowToolBefore(directory, sessionID, toolName, args,
|
|
|
35347
35409
|
const isDetachedFeedbackCheckout = Boolean(detachedFeedbackSwitchMatch?.[1] && isSafeGitRefToken(detachedFeedbackSwitchMatch[1])) || /^gh\s+pr\s+checkout\b.*\s--detach(?:\s|$)/i.test(command);
|
|
35348
35410
|
const containsGitCommitShell = isShellCommandRequiringVerification && /\bgit\b(?:(?![;&|]).){0,200}\bcommit\b/i.test(command);
|
|
35349
35411
|
const isStandaloneGitCommitShell = containsGitCommitShell && isSafeStandaloneGitCommit(command);
|
|
35412
|
+
const isStandaloneGitAddShell = isShellCommandRequiringVerification && isSafeStandaloneGitAdd(command);
|
|
35350
35413
|
const isPublicationShell = isShellCommandRequiringVerification && (/\bgit\b(?:(?![;&|]).){0,200}\bpush\b/i.test(command) || /\bgh\s+(?:api|pr|issue|run)\b/i.test(command));
|
|
35351
|
-
const
|
|
35414
|
+
const isTrustedObserveTool = trustedCapability === "observe" && isTrustedWorkflowTool;
|
|
35415
|
+
const isPublicationTool = !isInternalWorkflowTool && !isTrustedObserveTool && isRemoteMutationTool;
|
|
35352
35416
|
const isCoderTask = isDirectAgentTask && requestedRoles.length > 0 && requestedRoles.every((role) => role === "coder");
|
|
35353
35417
|
const blockedShellDiagnosis = isShellTool && command && !isReadOnlyShell && shellPermissionEnvelope ? ` ${describeBlockedPrReviewShellCommand(command, shellPermissionEnvelope)}` : "";
|
|
35354
35418
|
if (state.mode === "PR_REVIEW") {
|
|
35419
|
+
if (normalizedTool === "test_runner" && state.prHeadSha) {
|
|
35420
|
+
throw new Error("BLOCKED: PR_REVIEW test_runner would execute inside the bound checkout at the exact PR head and its outputs (snapshot files, fixtures) would dirty the tree; run validation through dispatch_lanes_async lanes or PR_FEEDBACK Stage A");
|
|
35421
|
+
}
|
|
35422
|
+
if (normalizedTool === "swarm_command" && isPrWorkflowRecoverySwarmCommandArgs(args)) {
|
|
35423
|
+
return;
|
|
35424
|
+
}
|
|
35355
35425
|
let hasAuthorizedDirectReentry = false;
|
|
35356
35426
|
if (isDirectAgentTask && requestedAgentFields.length === 1 && requestedAgentFields[0] === "subagent_type" && requestedRoles.length === 1 && (requestedRoles[0] === "reviewer" || requestedRoles[0] === "test_engineer") && callID) {
|
|
35357
35427
|
hasAuthorizedDirectReentry = await hasActivePrReviewReentryAuthorization(directory, sessionID, {
|
|
@@ -35370,6 +35440,9 @@ async function enforcePrWorkflowToolBefore(directory, sessionID, toolName, args,
|
|
|
35370
35440
|
if (isDirectAgentTask && !isCoderTask) {
|
|
35371
35441
|
throw new Error("BLOCKED: PR_FEEDBACK reviewer, test, critic, explorer, and unknown agent lanes require structured dispatch_lanes_async provenance");
|
|
35372
35442
|
}
|
|
35443
|
+
if (normalizedTool === "swarm_command" && isPrWorkflowRecoverySwarmCommandArgs(args)) {
|
|
35444
|
+
return;
|
|
35445
|
+
}
|
|
35373
35446
|
if (!isInternalWorkflowTool && !isDirectAgentTask && !isDirectWrite && !isShellTool && !isNamedReadOnlyTool) {
|
|
35374
35447
|
throw new Error("BLOCKED: PR_FEEDBACK rejects unclassified plugin/MCP tools; use positively classified observation tools, built-in structured write tools after verification, or the workflow controller" + describePrWorkflowControllerToolNames(state.mode));
|
|
35375
35448
|
}
|
|
@@ -35421,9 +35494,43 @@ async function enforcePrWorkflowToolBefore(directory, sessionID, toolName, args,
|
|
|
35421
35494
|
if (!state.prHeadSha && isCanonicalReviewCheckout)
|
|
35422
35495
|
return;
|
|
35423
35496
|
if (isStandaloneGitCommitShell) {
|
|
35497
|
+
const messageFile = extractStandaloneGitCommitMessageFile(command);
|
|
35498
|
+
if (messageFile !== null) {
|
|
35499
|
+
const cwdBase = resolveStandaloneGitCommandCwd(command, directory);
|
|
35500
|
+
const resolvedFile = path34.resolve(cwdBase, messageFile);
|
|
35501
|
+
const containmentRoot = await _test_exports2.resolveRepoTopLevelAsync(directory);
|
|
35502
|
+
if (isPathInsideRepository(resolvedFile, directory) || containmentRoot !== null && isPathInsideRepository(resolvedFile, containmentRoot)) {
|
|
35503
|
+
throw new Error(`BLOCKED: PR_FEEDBACK commit -F message file "${messageFile}" resolves inside the repository; an in-repo message file would dirty the clean-tree arming check. The message file must live outside the repository; author it with the prepare_pr_feedback_commit_message tool and pass the returned path`);
|
|
35504
|
+
}
|
|
35505
|
+
}
|
|
35424
35506
|
await assertPrFeedbackReadyToPublish(directory, sessionID);
|
|
35425
35507
|
return;
|
|
35426
35508
|
}
|
|
35509
|
+
if (isStandaloneGitAddShell) {
|
|
35510
|
+
const stagedPaths2 = extractStandaloneGitAddPaths(command);
|
|
35511
|
+
const changedPaths = state.prHeadSha ? await _test_exports2.resolvePrWorkflowChangedPathSetAsync(directory, state.prHeadSha) : null;
|
|
35512
|
+
const foldToken = (token) => token.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
35513
|
+
const tokenAdmitted = (token) => {
|
|
35514
|
+
if (changedPaths === null)
|
|
35515
|
+
return false;
|
|
35516
|
+
const folded = foldToken(token);
|
|
35517
|
+
if (changedPaths.has(folded))
|
|
35518
|
+
return true;
|
|
35519
|
+
let foldedMatches = 0;
|
|
35520
|
+
for (const member of changedPaths) {
|
|
35521
|
+
if (member.toLowerCase() === folded.toLowerCase()) {
|
|
35522
|
+
foldedMatches += 1;
|
|
35523
|
+
if (foldedMatches > 1)
|
|
35524
|
+
return false;
|
|
35525
|
+
}
|
|
35526
|
+
}
|
|
35527
|
+
return foldedMatches === 1;
|
|
35528
|
+
};
|
|
35529
|
+
if (changedPaths !== null && stagedPaths2.length > 0 && stagedPaths2.every(tokenAdmitted)) {
|
|
35530
|
+
await assertPrFeedbackReadyToPublish(directory, sessionID);
|
|
35531
|
+
return;
|
|
35532
|
+
}
|
|
35533
|
+
}
|
|
35427
35534
|
if (isPublicationShell || isPublicationTool) {
|
|
35428
35535
|
throw new Error("BLOCKED: PR_FEEDBACK publication is not armed; finish every ordered gate, create the one approved commit, and call complete_pr_workflow before publishing");
|
|
35429
35536
|
}
|
|
@@ -35437,6 +35544,8 @@ async function enforcePrWorkflowToolBefore(directory, sessionID, toolName, args,
|
|
|
35437
35544
|
return;
|
|
35438
35545
|
if (normalizedTool === "abort_pr_workflow")
|
|
35439
35546
|
return;
|
|
35547
|
+
if (normalizedTool === "rebind_pr_feedback_head" || isTrustedObserveTool)
|
|
35548
|
+
return;
|
|
35440
35549
|
await assertPrFeedbackVerificationSettled(directory, sessionID);
|
|
35441
35550
|
}
|
|
35442
35551
|
async function readPrReviewReentryBindingContext(directory, sessionID) {
|
|
@@ -35887,6 +35996,12 @@ var _test_exports2 = {
|
|
|
35887
35996
|
resolveCommitCountSinceAsync,
|
|
35888
35997
|
resolveIsWorkingTreeClean,
|
|
35889
35998
|
resolveIsWorkingTreeCleanAsync,
|
|
35999
|
+
resolveLocalRefHeadAsync,
|
|
36000
|
+
resolveIsAncestorAsync,
|
|
36001
|
+
fastForwardToRefAsync,
|
|
36002
|
+
resolveRepoTopLevelAsync,
|
|
36003
|
+
resolvePrWorkflowChangedPathSetAsync,
|
|
36004
|
+
resolveWorkingTreeDirtyPathsAsync,
|
|
35890
36005
|
resolveIsExactSingleChildCommit,
|
|
35891
36006
|
resolveIsExactSingleChildCommitAsync,
|
|
35892
36007
|
resolvePrReviewDiffStats,
|
|
@@ -36076,9 +36191,12 @@ var PR_REVIEW_CONTROLLER_TOOLS = new Set([
|
|
|
36076
36191
|
"write_pr_review_artifact",
|
|
36077
36192
|
"write_pr_review_trigger_eval"
|
|
36078
36193
|
]);
|
|
36194
|
+
var PR_WORKFLOW_DIRTY_PATH_DISCLOSURE_LIMIT = 5;
|
|
36079
36195
|
var PR_FEEDBACK_CONTROLLER_TOOLS = new Set([
|
|
36080
36196
|
"invalidate_pr_feedback_publication",
|
|
36197
|
+
"prepare_pr_feedback_commit_message",
|
|
36081
36198
|
"prepare_pr_feedback_scope",
|
|
36199
|
+
"rebind_pr_feedback_head",
|
|
36082
36200
|
"run_pr_feedback_stage_a"
|
|
36083
36201
|
]);
|
|
36084
36202
|
function isPrWorkflowControllerTool(mode, toolName) {
|
|
@@ -36457,6 +36575,194 @@ function describeShellSyntaxViolation(command) {
|
|
|
36457
36575
|
return "Reason: compound-syntax (;, &&, |, <, >, backtick, or $()/@()). Run ONE command per call; a single leading `cd <dir> &&` and a trailing `2>&1` are tolerated for reads only.";
|
|
36458
36576
|
}
|
|
36459
36577
|
}
|
|
36578
|
+
function isPrWorkflowRecoverySwarmCommandArgs(args) {
|
|
36579
|
+
const raw = typeof args?.command === "string" ? args.command : typeof args?.subcommand === "string" ? args.subcommand : "";
|
|
36580
|
+
const parts = raw.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
36581
|
+
if (parts.length === 0)
|
|
36582
|
+
return false;
|
|
36583
|
+
if (parts[0] === "diagnose")
|
|
36584
|
+
return true;
|
|
36585
|
+
return parts[0] === "guardrail" && parts[1] === "reset";
|
|
36586
|
+
}
|
|
36587
|
+
function isSafeStandaloneGitAdd(command) {
|
|
36588
|
+
if (hasUnsafeShellControlSyntax(command))
|
|
36589
|
+
return false;
|
|
36590
|
+
const match = /^git\s+add\s+--\s+(.+)$/i.exec(command.trim());
|
|
36591
|
+
if (!match)
|
|
36592
|
+
return false;
|
|
36593
|
+
const paths = extractStandaloneGitAddPaths(command);
|
|
36594
|
+
return paths.length > 0 && paths.every((token) => isSanctionedAddPath(token));
|
|
36595
|
+
}
|
|
36596
|
+
function isSanctionedAddPath(token) {
|
|
36597
|
+
if (token.length === 0)
|
|
36598
|
+
return false;
|
|
36599
|
+
if (/["'`\\]/.test(token))
|
|
36600
|
+
return false;
|
|
36601
|
+
if (/[*?[\]]/.test(token))
|
|
36602
|
+
return false;
|
|
36603
|
+
if (token.includes(":"))
|
|
36604
|
+
return false;
|
|
36605
|
+
if (token.startsWith("-"))
|
|
36606
|
+
return false;
|
|
36607
|
+
return true;
|
|
36608
|
+
}
|
|
36609
|
+
function extractStandaloneGitAddPaths(command) {
|
|
36610
|
+
const tokens = tokenizeStandaloneGitCommand(command);
|
|
36611
|
+
if (tokens.length < 3)
|
|
36612
|
+
return [];
|
|
36613
|
+
if (tokens[0].quoted || tokens[0].text.toLowerCase() !== "git")
|
|
36614
|
+
return [];
|
|
36615
|
+
if (tokens[1].quoted || tokens[1].text.toLowerCase() !== "add")
|
|
36616
|
+
return [];
|
|
36617
|
+
const separator = tokens[2];
|
|
36618
|
+
if (!separator || separator.text !== "--")
|
|
36619
|
+
return [];
|
|
36620
|
+
return tokens.slice(3).map((token) => token.text).filter(Boolean);
|
|
36621
|
+
}
|
|
36622
|
+
function tokenizeStandaloneGitCommand(command) {
|
|
36623
|
+
const tokens = [];
|
|
36624
|
+
let current = "";
|
|
36625
|
+
let started = false;
|
|
36626
|
+
let beganQuoted = false;
|
|
36627
|
+
let inQuotes = false;
|
|
36628
|
+
const flush = () => {
|
|
36629
|
+
if (started) {
|
|
36630
|
+
tokens.push({ text: current, quoted: beganQuoted });
|
|
36631
|
+
}
|
|
36632
|
+
current = "";
|
|
36633
|
+
started = false;
|
|
36634
|
+
beganQuoted = false;
|
|
36635
|
+
};
|
|
36636
|
+
for (const ch of command) {
|
|
36637
|
+
if (ch === '"') {
|
|
36638
|
+
if (!started) {
|
|
36639
|
+
started = true;
|
|
36640
|
+
beganQuoted = true;
|
|
36641
|
+
}
|
|
36642
|
+
inQuotes = !inQuotes;
|
|
36643
|
+
continue;
|
|
36644
|
+
}
|
|
36645
|
+
if (!inQuotes && (ch === " " || ch === "\t" || ch === `
|
|
36646
|
+
`)) {
|
|
36647
|
+
flush();
|
|
36648
|
+
continue;
|
|
36649
|
+
}
|
|
36650
|
+
started = true;
|
|
36651
|
+
current += ch;
|
|
36652
|
+
}
|
|
36653
|
+
flush();
|
|
36654
|
+
return tokens;
|
|
36655
|
+
}
|
|
36656
|
+
function standaloneGitCommitSubcommandIndex(tokens) {
|
|
36657
|
+
for (let i = 0;i < tokens.length; i += 1) {
|
|
36658
|
+
if (!tokens[i].quoted && tokens[i].text === "commit")
|
|
36659
|
+
return i;
|
|
36660
|
+
}
|
|
36661
|
+
return -1;
|
|
36662
|
+
}
|
|
36663
|
+
function extractStandaloneGitCommitMessageFile(command) {
|
|
36664
|
+
const tokens = tokenizeStandaloneGitCommand(command);
|
|
36665
|
+
const subcommand = standaloneGitCommitSubcommandIndex(tokens);
|
|
36666
|
+
if (subcommand < 0)
|
|
36667
|
+
return null;
|
|
36668
|
+
let lastMessageFile = null;
|
|
36669
|
+
for (let i = subcommand + 1;i < tokens.length; i += 1) {
|
|
36670
|
+
const token = tokens[i];
|
|
36671
|
+
const text = token.text.replace(/^\^+/, "");
|
|
36672
|
+
if (text === "--")
|
|
36673
|
+
break;
|
|
36674
|
+
if (text === "-F" || text === "--file") {
|
|
36675
|
+
const value = tokens[i + 1];
|
|
36676
|
+
lastMessageFile = value === undefined ? null : value.text;
|
|
36677
|
+
continue;
|
|
36678
|
+
}
|
|
36679
|
+
if (GIT_COMMIT_VALUE_TAKING_OPTIONS.has(text)) {
|
|
36680
|
+
i += 1;
|
|
36681
|
+
continue;
|
|
36682
|
+
}
|
|
36683
|
+
if (text.startsWith("--")) {
|
|
36684
|
+
const eq = text.indexOf("=");
|
|
36685
|
+
if (eq < 0) {
|
|
36686
|
+
if (/^--fil$/i.test(text)) {
|
|
36687
|
+
const value = tokens[i + 1];
|
|
36688
|
+
lastMessageFile = value === undefined ? null : value.text;
|
|
36689
|
+
i += 1;
|
|
36690
|
+
}
|
|
36691
|
+
continue;
|
|
36692
|
+
}
|
|
36693
|
+
const name = text.slice(2, eq).toLowerCase();
|
|
36694
|
+
if (name === "file" || name === "fil") {
|
|
36695
|
+
lastMessageFile = text.slice(eq + 1);
|
|
36696
|
+
}
|
|
36697
|
+
continue;
|
|
36698
|
+
}
|
|
36699
|
+
if (text.startsWith("-") && text.length > 1) {
|
|
36700
|
+
let consumedNext = false;
|
|
36701
|
+
for (let p = 1;p < text.length; p += 1) {
|
|
36702
|
+
const c = text[p];
|
|
36703
|
+
if (c === "F") {
|
|
36704
|
+
const rest = text.slice(p + 1);
|
|
36705
|
+
if (rest.length > 0) {
|
|
36706
|
+
lastMessageFile = rest;
|
|
36707
|
+
} else {
|
|
36708
|
+
lastMessageFile = tokens[i + 1]?.text ?? null;
|
|
36709
|
+
consumedNext = true;
|
|
36710
|
+
}
|
|
36711
|
+
break;
|
|
36712
|
+
}
|
|
36713
|
+
if ("cCmt".includes(c)) {
|
|
36714
|
+
if (p + 1 >= text.length)
|
|
36715
|
+
consumedNext = true;
|
|
36716
|
+
break;
|
|
36717
|
+
}
|
|
36718
|
+
}
|
|
36719
|
+
if (consumedNext)
|
|
36720
|
+
i += 1;
|
|
36721
|
+
}
|
|
36722
|
+
}
|
|
36723
|
+
return lastMessageFile;
|
|
36724
|
+
}
|
|
36725
|
+
var GIT_COMMIT_VALUE_TAKING_OPTIONS = new Set([
|
|
36726
|
+
"-m",
|
|
36727
|
+
"--message",
|
|
36728
|
+
"-c",
|
|
36729
|
+
"--reedit-message",
|
|
36730
|
+
"-C",
|
|
36731
|
+
"--reuse-message",
|
|
36732
|
+
"-t",
|
|
36733
|
+
"--template",
|
|
36734
|
+
"--fixup",
|
|
36735
|
+
"--squash",
|
|
36736
|
+
"--author",
|
|
36737
|
+
"--date",
|
|
36738
|
+
"--cleanup",
|
|
36739
|
+
"--trailer",
|
|
36740
|
+
"--pathspec-from-file"
|
|
36741
|
+
]);
|
|
36742
|
+
function resolveStandaloneGitCommandCwd(command, directory) {
|
|
36743
|
+
const tokens = tokenizeStandaloneGitCommand(command);
|
|
36744
|
+
const subcommand = standaloneGitCommitSubcommandIndex(tokens);
|
|
36745
|
+
const limit = subcommand >= 0 ? subcommand : tokens.length;
|
|
36746
|
+
for (let i = 0;i < limit; i += 1) {
|
|
36747
|
+
if (!tokens[i].quoted && tokens[i].text === "-C" && tokens[i + 1]) {
|
|
36748
|
+
return path34.resolve(directory, tokens[i + 1].text);
|
|
36749
|
+
}
|
|
36750
|
+
}
|
|
36751
|
+
return directory;
|
|
36752
|
+
}
|
|
36753
|
+
function isPathInsideRepository(target, repoRoot) {
|
|
36754
|
+
const lexicalInside = (value, root) => {
|
|
36755
|
+
const rel = path34.relative(root, value);
|
|
36756
|
+
return rel === "" || !rel.startsWith("..") && !path34.isAbsolute(rel);
|
|
36757
|
+
};
|
|
36758
|
+
if (lexicalInside(target, repoRoot))
|
|
36759
|
+
return true;
|
|
36760
|
+
try {
|
|
36761
|
+
return lexicalInside(realpathSync5(target), realpathSync5(repoRoot));
|
|
36762
|
+
} catch {
|
|
36763
|
+
return false;
|
|
36764
|
+
}
|
|
36765
|
+
}
|
|
36460
36766
|
function isSafeStandaloneGitCommit(command) {
|
|
36461
36767
|
if (hasUnsafeShellControlSyntax(command))
|
|
36462
36768
|
return false;
|
|
@@ -42675,8 +42981,8 @@ init_schema();
|
|
|
42675
42981
|
init_logger();
|
|
42676
42982
|
|
|
42677
42983
|
// src/tools/repo-graph/safe-realpath.ts
|
|
42678
|
-
import { realpathSync as
|
|
42679
|
-
function safeRealpathSync(targetPath, fallback, realpathResolver =
|
|
42984
|
+
import { realpathSync as realpathSync7 } from "fs";
|
|
42985
|
+
function safeRealpathSync(targetPath, fallback, realpathResolver = realpathSync7) {
|
|
42680
42986
|
try {
|
|
42681
42987
|
return realpathResolver(targetPath);
|
|
42682
42988
|
} catch (error2) {
|
|
@@ -46673,9 +46979,9 @@ function hashContent(content) {
|
|
|
46673
46979
|
return createHash29("sha1").update(content).digest("hex");
|
|
46674
46980
|
}
|
|
46675
46981
|
async function loadConfigForPolicyCurator(directory) {
|
|
46676
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
46982
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jw861rj0.js");
|
|
46677
46983
|
try {
|
|
46678
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
46984
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mbygjbj8.js");
|
|
46679
46985
|
const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
|
|
46680
46986
|
return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
|
|
46681
46987
|
} catch {
|
|
@@ -49733,7 +50039,7 @@ async function resolveCuratorLLMDelegate(directory, mode, sessionId) {
|
|
|
49733
50039
|
const seam = _internals50.createCuratorLLMDelegate;
|
|
49734
50040
|
if (seam)
|
|
49735
50041
|
return seam(directory, mode, sessionId);
|
|
49736
|
-
const { createCuratorLLMDelegate } = await import("./curator-llm-factory-
|
|
50042
|
+
const { createCuratorLLMDelegate } = await import("./curator-llm-factory-nbprwszt.js");
|
|
49737
50043
|
return createCuratorLLMDelegate(directory, mode, sessionId);
|
|
49738
50044
|
}
|
|
49739
50045
|
async function reconcileCloseTerminalStateForPlan(directory, targetPlan, options) {
|
|
@@ -50128,7 +50434,7 @@ async function runFinalizeStage(ctx) {
|
|
|
50128
50434
|
}
|
|
50129
50435
|
}
|
|
50130
50436
|
try {
|
|
50131
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
50437
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-jw861rj0.js");
|
|
50132
50438
|
const { config: pmLoadedConfig } = _internals50.loadPluginConfigWithMeta(ctx.directory);
|
|
50133
50439
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
50134
50440
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -54161,7 +54467,7 @@ function serializeAgentSession(s) {
|
|
|
54161
54467
|
}
|
|
54162
54468
|
async function writeSnapshot(directory, state) {
|
|
54163
54469
|
try {
|
|
54164
|
-
const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-
|
|
54470
|
+
const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-11qb0jbs.js");
|
|
54165
54471
|
await ensureSnapshotCoordinationReady(directory);
|
|
54166
54472
|
const snapshot = {
|
|
54167
54473
|
version: 3,
|
|
@@ -57301,7 +57607,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
|
|
|
57301
57607
|
};
|
|
57302
57608
|
}
|
|
57303
57609
|
async function sweepActiveNearDuplicates(directory, options = {}) {
|
|
57304
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
57610
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mbygjbj8.js");
|
|
57305
57611
|
const { config } = loadPluginConfigWithMeta2(directory);
|
|
57306
57612
|
const sweepConfig = config.learning?.dedup_sweep;
|
|
57307
57613
|
if (sweepConfig?.enabled === false)
|
|
@@ -58425,7 +58731,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
|
|
|
58425
58731
|
}
|
|
58426
58732
|
if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
|
|
58427
58733
|
try {
|
|
58428
|
-
const skillModule = await import("./skill-generator-
|
|
58734
|
+
const skillModule = await import("./skill-generator-dd1w9p3t.js");
|
|
58429
58735
|
for (const cand of skillCandidates) {
|
|
58430
58736
|
if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
|
|
58431
58737
|
continue;
|
|
@@ -58897,7 +59203,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
|
|
|
58897
59203
|
} catch {}
|
|
58898
59204
|
}
|
|
58899
59205
|
if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
|
|
58900
|
-
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-
|
|
59206
|
+
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-k1mssp9r.js");
|
|
58901
59207
|
for (const { id } of contradictedEntries) {
|
|
58902
59208
|
try {
|
|
58903
59209
|
await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
|
|
@@ -59729,7 +60035,7 @@ async function runCuratorPostMortem(directory, options = {}) {
|
|
|
59729
60035
|
warnings.push("Failed to collect knowledge summary.");
|
|
59730
60036
|
}
|
|
59731
60037
|
try {
|
|
59732
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
60038
|
+
const { getScanStatus } = await import("./scan-cursor-yehnf9jt.js");
|
|
59733
60039
|
const scanStatus = await getScanStatus(directory);
|
|
59734
60040
|
if (scanStatus.remaining_estimate > 0) {
|
|
59735
60041
|
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.`);
|
|
@@ -59901,9 +60207,9 @@ var _internals72 = {
|
|
|
59901
60207
|
verifyPostMortemKnowledgeActions,
|
|
59902
60208
|
repairPostMortemActions,
|
|
59903
60209
|
loadDefaultKnowledgeConfig: async (directory) => {
|
|
59904
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
60210
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jw861rj0.js");
|
|
59905
60211
|
try {
|
|
59906
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
60212
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mbygjbj8.js");
|
|
59907
60213
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
59908
60214
|
return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
59909
60215
|
} catch {
|
|
@@ -59911,11 +60217,11 @@ var _internals72 = {
|
|
|
59911
60217
|
}
|
|
59912
60218
|
},
|
|
59913
60219
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
|
|
59914
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
60220
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-b3zn9w9q.js");
|
|
59915
60221
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
|
|
59916
60222
|
},
|
|
59917
60223
|
checkHivePromotions: async (entries2, knowledgeConfig, directory) => {
|
|
59918
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
60224
|
+
const { checkHivePromotions } = await import("./hive-promoter-2dnv2xrg.js");
|
|
59919
60225
|
return checkHivePromotions(entries2, knowledgeConfig, directory);
|
|
59920
60226
|
},
|
|
59921
60227
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -59924,7 +60230,7 @@ var _internals72 = {
|
|
|
59924
60230
|
activateProposal,
|
|
59925
60231
|
listSkills: listSkills2,
|
|
59926
60232
|
sanitizeSlug
|
|
59927
|
-
} = await import("./skill-generator-
|
|
60233
|
+
} = await import("./skill-generator-dd1w9p3t.js");
|
|
59928
60234
|
const result = {
|
|
59929
60235
|
approved: [],
|
|
59930
60236
|
rejected: [],
|
|
@@ -59966,7 +60272,7 @@ var _internals72 = {
|
|
|
59966
60272
|
return result;
|
|
59967
60273
|
},
|
|
59968
60274
|
readPriorDriftReports: async (directory) => {
|
|
59969
|
-
const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-
|
|
60275
|
+
const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-ka477rrz.js");
|
|
59970
60276
|
return readPriorDriftReports2(directory);
|
|
59971
60277
|
},
|
|
59972
60278
|
readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
|
|
@@ -70236,9 +70542,9 @@ var _internals80 = {
|
|
|
70236
70542
|
loadPluginConfigWithMeta,
|
|
70237
70543
|
loadCuratorDeps: async () => {
|
|
70238
70544
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate }] = await Promise.all([
|
|
70239
|
-
import("./schema-
|
|
70240
|
-
import("./curator-
|
|
70241
|
-
import("./curator-llm-factory-
|
|
70545
|
+
import("./schema-jw861rj0.js"),
|
|
70546
|
+
import("./curator-b3zn9w9q.js"),
|
|
70547
|
+
import("./curator-llm-factory-nbprwszt.js")
|
|
70242
70548
|
]);
|
|
70243
70549
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate };
|
|
70244
70550
|
}
|
|
@@ -72688,7 +72994,7 @@ async function computeCurationDiagnostics(directory, entries2) {
|
|
|
72688
72994
|
let scanCompleted = false;
|
|
72689
72995
|
let scanRemaining = 0;
|
|
72690
72996
|
try {
|
|
72691
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
72997
|
+
const { getScanStatus } = await import("./scan-cursor-yehnf9jt.js");
|
|
72692
72998
|
const status = await getScanStatus(directory);
|
|
72693
72999
|
scanGeneration = status.generation;
|
|
72694
73000
|
scanCompleted = status.completed;
|
|
@@ -72698,10 +73004,10 @@ async function computeCurationDiagnostics(directory, entries2) {
|
|
|
72698
73004
|
try {
|
|
72699
73005
|
const { isLinked: isLinked2 } = await import("./knowledge-link-1f91bzcc.js");
|
|
72700
73006
|
if (isLinked2(directory)) {
|
|
72701
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
73007
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jw861rj0.js");
|
|
72702
73008
|
let config;
|
|
72703
73009
|
try {
|
|
72704
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
73010
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mbygjbj8.js");
|
|
72705
73011
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
72706
73012
|
config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
72707
73013
|
} catch {
|
|
@@ -74157,7 +74463,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
74157
74463
|
const result = runConfigDoctor(config, directory, planParallelizationEnabled);
|
|
74158
74464
|
let output;
|
|
74159
74465
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
74160
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
74466
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-20pd12nw.js");
|
|
74161
74467
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
|
|
74162
74468
|
applyLossy: true
|
|
74163
74469
|
});
|
|
@@ -74195,7 +74501,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
74195
74501
|
`;
|
|
74196
74502
|
}
|
|
74197
74503
|
try {
|
|
74198
|
-
const { runModelPreflight } = await import("./model-preflight-
|
|
74504
|
+
const { runModelPreflight } = await import("./model-preflight-ks9j40t5.js");
|
|
74199
74505
|
const preflight = await runModelPreflight(config, swarmState.opencodeClient, { generatedAgentNames: swarmState.generatedAgentNames });
|
|
74200
74506
|
const missingSelection = preflight.resolutions.filter((resolution) => resolution.status === "missing-selection");
|
|
74201
74507
|
const unresolved = preflight.catalogAvailable ? preflight.resolutions.filter((resolution) => resolution.status === "unresolved") : [];
|
|
@@ -74229,7 +74535,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
74229
74535
|
}
|
|
74230
74536
|
} catch {}
|
|
74231
74537
|
try {
|
|
74232
|
-
const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-
|
|
74538
|
+
const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-nrk52ak6.js");
|
|
74233
74539
|
output += await renderKnowledgeReceiptPhaseIdSection(directory, enableAutoFix);
|
|
74234
74540
|
} catch {}
|
|
74235
74541
|
const strayDirs = detectStraySwarmDirs(directory);
|
|
@@ -76246,7 +76552,7 @@ async function handleEvidenceCommand(directory, args) {
|
|
|
76246
76552
|
return formatTaskEvidenceMarkdown(evidenceData);
|
|
76247
76553
|
}
|
|
76248
76554
|
async function handleEvidenceSummaryCommand(directory) {
|
|
76249
|
-
const { buildEvidenceSummary } = await import("./evidence-summary-service-
|
|
76555
|
+
const { buildEvidenceSummary } = await import("./evidence-summary-service-qrr8zjhj.js");
|
|
76250
76556
|
const artifact = await buildEvidenceSummary(directory);
|
|
76251
76557
|
if (!artifact) {
|
|
76252
76558
|
return "No plan found. Run `/swarm plan` to check plan status.";
|
|
@@ -77541,7 +77847,7 @@ import { spawnSync as spawnSync5 } from "child_process";
|
|
|
77541
77847
|
import * as fs55 from "fs";
|
|
77542
77848
|
import {
|
|
77543
77849
|
readFileSync as readFileSync44,
|
|
77544
|
-
realpathSync as
|
|
77850
|
+
realpathSync as realpathSync11,
|
|
77545
77851
|
statSync as statSync34,
|
|
77546
77852
|
unlinkSync as unlinkSync17,
|
|
77547
77853
|
writeFileSync as writeFileSync16
|
|
@@ -77818,8 +78124,8 @@ function isMissingExecutableFailure(message) {
|
|
|
77818
78124
|
}
|
|
77819
78125
|
function resolveContainedRegularFile(workingDir, filePath) {
|
|
77820
78126
|
try {
|
|
77821
|
-
const realWorkingDir =
|
|
77822
|
-
const realFilePath =
|
|
78127
|
+
const realWorkingDir = realpathSync11(path100.resolve(workingDir));
|
|
78128
|
+
const realFilePath = realpathSync11(path100.resolve(realWorkingDir, filePath));
|
|
77823
78129
|
const relativePath2 = path100.relative(realWorkingDir, realFilePath);
|
|
77824
78130
|
if (relativePath2 === "" || relativePath2 === ".." || relativePath2.startsWith(`..${path100.sep}`) || path100.isAbsolute(relativePath2)) {
|
|
77825
78131
|
return;
|
|
@@ -90953,7 +91259,7 @@ ${USAGE14}`;
|
|
|
90953
91259
|
|
|
90954
91260
|
// src/commands/memory.ts
|
|
90955
91261
|
init_loader();
|
|
90956
|
-
import { existsSync as existsSync66, readFileSync as readFileSync60, realpathSync as
|
|
91262
|
+
import { existsSync as existsSync66, readFileSync as readFileSync60, realpathSync as realpathSync16, statSync as statSync42 } from "fs";
|
|
90957
91263
|
import * as path132 from "path";
|
|
90958
91264
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
90959
91265
|
// src/memory/evaluation.ts
|
|
@@ -94454,7 +94760,7 @@ import {
|
|
|
94454
94760
|
fstatSync as fstatSync8,
|
|
94455
94761
|
openSync as openSync21,
|
|
94456
94762
|
readSync as readSync14,
|
|
94457
|
-
realpathSync as
|
|
94763
|
+
realpathSync as realpathSync15,
|
|
94458
94764
|
statSync as statSync41
|
|
94459
94765
|
} from "fs";
|
|
94460
94766
|
var import_proper_lockfile12 = __toESM(require_proper_lockfile(), 1);
|
|
@@ -99990,7 +100296,7 @@ function parseEvaluateArgs(directory, args) {
|
|
|
99990
100296
|
}
|
|
99991
100297
|
let realFixtures;
|
|
99992
100298
|
try {
|
|
99993
|
-
realFixtures =
|
|
100299
|
+
realFixtures = realpathSync16(resolvedFixtures);
|
|
99994
100300
|
} catch {
|
|
99995
100301
|
return {
|
|
99996
100302
|
error: "--fixtures <directory> must be an existing directory inside the project or the bundled fixtures directory (path could not be resolved)"
|
|
@@ -100001,7 +100307,7 @@ function parseEvaluateArgs(directory, args) {
|
|
|
100001
100307
|
path132.join(PACKAGE_ROOT, "tests", "fixtures", "memory-recall")
|
|
100002
100308
|
].map((root) => {
|
|
100003
100309
|
try {
|
|
100004
|
-
return
|
|
100310
|
+
return realpathSync16(root);
|
|
100005
100311
|
} catch {
|
|
100006
100312
|
return null;
|
|
100007
100313
|
}
|
|
@@ -100052,7 +100358,7 @@ function parseEvaluateArgs(directory, args) {
|
|
|
100052
100358
|
};
|
|
100053
100359
|
}
|
|
100054
100360
|
try {
|
|
100055
|
-
manifestPath =
|
|
100361
|
+
manifestPath = realpathSync16(resolvedManifest);
|
|
100056
100362
|
if (statSync42(manifestPath).size > MAX_HELDOUT_MANIFEST_BYTES) {
|
|
100057
100363
|
return {
|
|
100058
100364
|
error: `--manifest <file> exceeds the ${MAX_HELDOUT_MANIFEST_BYTES}-byte limit`
|
|
@@ -100060,7 +100366,7 @@ function parseEvaluateArgs(directory, args) {
|
|
|
100060
100366
|
}
|
|
100061
100367
|
const realRoots = [projectRoot, bundledRoot].map((root) => {
|
|
100062
100368
|
try {
|
|
100063
|
-
return
|
|
100369
|
+
return realpathSync16(root);
|
|
100064
100370
|
} catch {
|
|
100065
100371
|
return null;
|
|
100066
100372
|
}
|
|
@@ -100673,7 +100979,7 @@ function createCuratorLLMDelegate(directory, mode = "init", sessionId) {
|
|
|
100673
100979
|
}
|
|
100674
100980
|
const sdkOpts = signal ? { signal } : {};
|
|
100675
100981
|
try {
|
|
100676
|
-
const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-
|
|
100982
|
+
const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-qksw8p51.js");
|
|
100677
100983
|
const createResult = await client.session.create({
|
|
100678
100984
|
...sessionId ? {
|
|
100679
100985
|
body: {
|
|
@@ -102771,7 +103077,7 @@ async function cancelPrFeedbackLoopUnlocked(directory, sessionID, reason) {
|
|
|
102771
103077
|
clearedEvents: []
|
|
102772
103078
|
};
|
|
102773
103079
|
try {
|
|
102774
|
-
const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-
|
|
103080
|
+
const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-zqwde6r6.js");
|
|
102775
103081
|
await cancelPrFeedbackPublication2(directory, sessionID, reason);
|
|
102776
103082
|
} catch (err) {
|
|
102777
103083
|
warn(`[pr-feedback-loop] cancelPrFeedbackPublication failed (fail-open): ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -116204,7 +116510,7 @@ async function deterministicSeed(input) {
|
|
|
116204
116510
|
}
|
|
116205
116511
|
|
|
116206
116512
|
// src/services/skill-optimizer/smoke.ts
|
|
116207
|
-
import { existsSync as existsSync77, lstatSync as lstatSync16, readFileSync as readFileSync71, realpathSync as
|
|
116513
|
+
import { existsSync as existsSync77, lstatSync as lstatSync16, readFileSync as readFileSync71, realpathSync as realpathSync24 } from "fs";
|
|
116208
116514
|
import * as path155 from "path";
|
|
116209
116515
|
|
|
116210
116516
|
// src/hooks/spawn-helper.ts
|
|
@@ -116297,7 +116603,7 @@ var _internals143 = {
|
|
|
116297
116603
|
const rel = path155.relative(path155.resolve(root), path155.resolve(target));
|
|
116298
116604
|
return rel.startsWith("..") || path155.isAbsolute(rel);
|
|
116299
116605
|
},
|
|
116300
|
-
realpath: (p) =>
|
|
116606
|
+
realpath: (p) => realpathSync24(p),
|
|
116301
116607
|
evaluateSkillChange,
|
|
116302
116608
|
isRejectedSkillContent,
|
|
116303
116609
|
spawnAsync
|
|
@@ -116663,7 +116969,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
|
|
|
116663
116969
|
if (!input.dispatcher) {
|
|
116664
116970
|
throw new Error("no evaluation dispatcher available (cannot run validation)");
|
|
116665
116971
|
}
|
|
116666
|
-
const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-
|
|
116972
|
+
const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-7sd43gan.js");
|
|
116667
116973
|
const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
|
|
116668
116974
|
const result = await withProtectedSetIntegrity([evalInputRoot, ...protectedRoots(input.directory)], () => _internals144.evaluateCandidateV1({
|
|
116669
116975
|
projectRoot: input.directory,
|
|
@@ -119256,7 +119562,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
119256
119562
|
async function handleHelpCommand(ctx) {
|
|
119257
119563
|
const targetCommand = ctx.args.join(" ");
|
|
119258
119564
|
if (!targetCommand) {
|
|
119259
|
-
const { buildHelpText } = await import("./index-
|
|
119565
|
+
const { buildHelpText } = await import("./index-zvjrymp9.js");
|
|
119260
119566
|
return buildHelpText();
|
|
119261
119567
|
}
|
|
119262
119568
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -119270,7 +119576,7 @@ async function handleHelpCommand(ctx) {
|
|
|
119270
119576
|
> Note: \`/swarm ${resolved.key}\` is a deprecated alias for \`/swarm ${aliasTarget}\`.` : detailed;
|
|
119271
119577
|
}
|
|
119272
119578
|
const similar = _internals39.findSimilarCommands(targetCommand);
|
|
119273
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
119579
|
+
const { buildHelpText: fullHelp } = await import("./index-zvjrymp9.js");
|
|
119274
119580
|
if (similar.length > 0) {
|
|
119275
119581
|
return `Command '/swarm ${targetCommand}' not found.
|
|
119276
119582
|
|
|
@@ -119598,7 +119904,7 @@ var COMMAND_REGISTRY = {
|
|
|
119598
119904
|
},
|
|
119599
119905
|
"guardrail explain": {
|
|
119600
119906
|
handler: async (ctx) => {
|
|
119601
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
119907
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-6xd6r3f5.js");
|
|
119602
119908
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
119603
119909
|
},
|
|
119604
119910
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -119608,7 +119914,7 @@ var COMMAND_REGISTRY = {
|
|
|
119608
119914
|
},
|
|
119609
119915
|
"guardrail reset": {
|
|
119610
119916
|
handler: async (ctx) => {
|
|
119611
|
-
const { handleGuardrailReset } = await import("./guardrail-reset-
|
|
119917
|
+
const { handleGuardrailReset } = await import("./guardrail-reset-ha3w0nby.js");
|
|
119612
119918
|
return handleGuardrailReset(ctx.args, ctx.sessionID);
|
|
119613
119919
|
},
|
|
119614
119920
|
description: "Reset one exact active invocation/action circuit after repair",
|
|
@@ -119629,7 +119935,7 @@ var COMMAND_REGISTRY = {
|
|
|
119629
119935
|
},
|
|
119630
119936
|
"guardrail-log": {
|
|
119631
119937
|
handler: async (ctx) => {
|
|
119632
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
119938
|
+
const { handleGuardrailLog } = await import("./guardrail-log-qn1sqjs9.js");
|
|
119633
119939
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
119634
119940
|
},
|
|
119635
119941
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -120831,7 +121137,7 @@ function resolveRegistryEntry(key) {
|
|
|
120831
121137
|
init_constants();
|
|
120832
121138
|
init_warning_buffer();
|
|
120833
121139
|
var ARCHITECT_MEMORY_OUTCOME_GUIDANCE = `After using recalled memory or a graph answer, call \`swarm_memory_outcome\` to record whether it was \`useful\`, a \`dead_end\`, or \`corrected\`, with the relevant file/symbol anchors. If you correct a memory-backed claim, record \`corrected\` and include the corrected explanation in \`correction\`.`;
|
|
120834
|
-
var ARCHITECT_PROMPT_BUDGET_CHARS =
|
|
121140
|
+
var ARCHITECT_PROMPT_BUDGET_CHARS = 164000;
|
|
120835
121141
|
var ARCHITECT_TOOL_DESCRIPTION_PROMPT_CAP_CHARS = 240;
|
|
120836
121142
|
function estimateModelTokens(text) {
|
|
120837
121143
|
return Math.ceil(text.length / 4);
|
|
@@ -121802,8 +122108,8 @@ HARD CONSTRAINTS (apply regardless of skill load success):
|
|
|
121802
122108
|
- RUN THE MECHANICAL GATES: after fixes, call \`run_pr_feedback_stage_a\` with distinct repository-valid array-form build, typecheck, lint, exact \`["git", "diff", "--check"]\`, and reproduction commands; the reproduction declares exact selected test/package/path \`targets\`. Arbitrary/no-op, mutating, publishing, fix/update, wrapper/eval, selector-free, or duplicate commands fail closed, and content plus HEAD/index/refs/upstream/Git-config state must remain unchanged around every command. Then dispatch exactly one fresh lane at a time, in order, with \`max_concurrent: 1\`: \`swarm-pr-feedback:stage-b-reviewer\`, \`:stage-b-test\`, \`:closeout-reviewer\`, and \`:closeout-critic\`. Every lane owns the complete immutable \`feedback_item_ids\` and uses the matching \`workflow_lane\`. Free-form verdicts, direct Task calls, parallel or out-of-order lanes, stale digests, missing or duplicate item rows, and speed/time rationalizations do not satisfy the gate.
|
|
121803
122109
|
- RESTART AFTER EDITS: any content change after Stage A invalidates Stage A and all later verdicts. Restart the entire mechanical gate sequence; do not reuse a prior reviewer or critic conversation.
|
|
121804
122110
|
- DO NOT PUBLISH EARLY: commits, pushes, PR comments/updates, review-thread mutations, and other remote writes remain blocked until every ordered feedback gate settles positively on the same revision digest.
|
|
121805
|
-
- After every local gate passes, EITHER path terminates: (a) content changes \u2014
|
|
121806
|
-
- BASE-SYNC REBIND: when base drift or merge conflicts force a merge/rebase, do NOT abort ad-hoc \u2014 finish the repair, fetch
|
|
122111
|
+
- After every local gate passes, EITHER path terminates: (a) content changes \u2014 stage exact changed-set paths with \`git add -- <paths>\`, commit with one standalone \`git commit\` (a trailer-bearing message goes via \`prepare_pr_feedback_commit_message\` + \`git commit -F <path>\`), then call \`complete_pr_workflow\` once. It requires a clean index/worktree and a non-merge direct child whose sole parent is the immutable intake head before binding that post-commit HEAD and arming publication. Push only with \`git push <bound-remote> <bound-commit>:refs/heads/<bound-branch>\`; the literal bound commit and exact bound branch are required, and force flags, wrappers, aliases, fetch-based local-ref forgery, extra refspecs, \`git -C\`, and other remote writes fail closed. Perform read-only remote checks, then call \`complete_pr_workflow\` a second time with the same immutable verification \`pr_head_sha\`; the second call clears only after both the actual remote ref and its local tracking ref resolve to the exact bound commit. Only then perform any explicitly authorized PR comment/body/thread writes. (b) verified no-change \u2014 when EVERY ledger item is verified DISPROVED, PRE_EXISTING, NEEDS_MORE_EVIDENCE, or NEEDS_USER_DECISION in the settled verification lanes, call \`complete_pr_workflow\` with the intake head while HEAD equals it and the tree is clean; it returns \`verified-no-change\` and clears the gate terminally with no commit and no push (an empty commit is still forbidden).
|
|
122112
|
+
- BASE-SYNC REBIND: when base drift or merge conflicts force a merge/rebase, do NOT abort ad-hoc \u2014 finish the repair, fetch the advanced remote head, then call \`rebind_pr_feedback_head\` with the new full SHA; it fast-forwards the branch when the bound tracking ref already points at that head over a clean ancestor checkout. It moves the immutable intake head, keeps the inventory, and invalidates Stage A plus every gate receipt; re-run the entire mechanical ladder on the new ancestry. It refuses a no-op rebind, an armed gate, a diverged ref, and in-flight lanes.
|
|
121807
122113
|
- Patch only confirmed items plus the tests/docs they require; report closure status for every ledger item including disproved ones.
|
|
121808
122114
|
- ABORT/CANCEL IF UNRECOVERABLE: before arming, if checkout/bind or recovery fails, call \`abort_pr_workflow\` with \`mode: "PR_FEEDBACK"\`, \`kind: "recovery"\`, and a one-line \`reason\`. Plain aborts refuse while armed. To cancel armed publication, call \`abort_pr_workflow\` with \`kind: "cancel-publication"\`, \`cancel_publication: true\`, and a non-empty \`reason\`; it records \`cancelled_without_publication\` with observed head; never grants push authority. Do not substitute a plain abort. To change content, call \`invalidate_pr_feedback_publication\` and rerun the ladder. A published generation is never cleared by abort; use \`complete_pr_workflow\` for remote verification. Do NOT abort/cancel while recovery remains.
|
|
121809
122115
|
- Do NOT resolve or mark GitHub review threads resolved unless the user explicitly instructs it.
|