opencode-swarm 7.135.1 → 7.135.3

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.
Files changed (99) hide show
  1. package/.opencode/skills/critic-gate/SKILL.md +10 -0
  2. package/.opencode/skills/swarm-pr-feedback/SKILL.md +24 -21
  3. package/.opencode/skills/swarm-pr-review/SKILL.md +55 -42
  4. package/dist/agents/explorer.d.ts +1 -1
  5. package/dist/agents/index.d.ts +12 -0
  6. package/dist/background/candidate-contract.d.ts +113 -0
  7. package/dist/background/candidate-parser.d.ts +8 -29
  8. package/dist/background/pr-review-trigger-contract.d.ts +197 -0
  9. package/dist/background/workspace-snapshot.d.ts +26 -0
  10. package/dist/cli/{config-doctor-6398t3a6.js → config-doctor-4nznqeca.js} +3 -2
  11. package/dist/cli/{core-9876t6cs.js → core-4z1s2ak1.js} +3 -2
  12. package/dist/cli/{curation-policy-f7qz4tez.js → curation-policy-81m14519.js} +5 -5
  13. package/dist/cli/{curator-drift-9q6f85bm.js → curator-drift-jpap6hv4.js} +2 -2
  14. package/dist/cli/{curator-fjhyezyx.js → curator-e0z5gcww.js} +28 -27
  15. package/dist/cli/curator-llm-factory-fem13y9n.js +57 -0
  16. package/dist/cli/{dispatch-gxbeb2ps.js → dispatch-b1fge4xk.js} +2 -2
  17. package/dist/cli/{evidence-summary-service-0cczdmjv.js → evidence-summary-service-w006jnpg.js} +6 -6
  18. package/dist/cli/{explorer-jp0nen03.js → explorer-15gqzxh8.js} +1 -1
  19. package/dist/cli/{gate-evidence-8zrwdj69.js → gate-evidence-aenyz6vt.js} +4 -4
  20. package/dist/cli/guardrail-explain-wgaj23hd.js +58 -0
  21. package/dist/cli/{guardrail-log-bd45kw0x.js → guardrail-log-04p1z1vt.js} +5 -4
  22. package/dist/cli/{hive-promoter-f2yh22m1.js → hive-promoter-k345z42k.js} +28 -27
  23. package/dist/cli/{index-wdkkf3xg.js → index-168phrs7.js} +12 -10
  24. package/dist/cli/{index-xhpmagdm.js → index-30pg2rs3.js} +2 -2
  25. package/dist/cli/{index-bjrkg4tc.js → index-36v55ryg.js} +2 -2
  26. package/dist/cli/index-3jcyn8g6.js +1219 -0
  27. package/dist/cli/{index-7an2qn0s.js → index-45t7w06b.js} +2 -2
  28. package/dist/cli/{index-2ghkk9ve.js → index-4qzeef9h.js} +1 -1
  29. package/dist/cli/{index-4pdrmemy.js → index-5436jxnw.js} +2 -2
  30. package/dist/cli/{index-5vp9gka3.js → index-a01r818w.js} +5 -3
  31. package/dist/cli/{index-nbnqf4fj.js → index-bcmrg4t4.js} +1 -1
  32. package/dist/cli/{index-fwkqq9mq.js → index-c9ddxv4k.js} +57 -8
  33. package/dist/cli/{index-ens0gt38.js → index-cggqh2dz.js} +7 -7
  34. package/dist/cli/{index-vxv732ex.js → index-dg1njnms.js} +7 -4
  35. package/dist/cli/{index-aky90eqz.js → index-dwargd10.js} +11596 -10043
  36. package/dist/cli/{index-yhba8swx.js → index-dzyjb33e.js} +1 -1
  37. package/dist/cli/{index-xg9repnx.js → index-ey29aap6.js} +1 -1
  38. package/dist/cli/{index-5wx8wdxg.js → index-f52jt0am.js} +5 -5
  39. package/dist/cli/{index-2nqsr1dx.js → index-gxxxmajn.js} +4 -4
  40. package/dist/cli/{index-jtshf1pd.js → index-kb7qy7an.js} +4 -2
  41. package/dist/cli/{index-b7p0mp2q.js → index-mrtms113.js} +4 -4
  42. package/dist/cli/{index-dzaarxhg.js → index-p5kr35wh.js} +8 -1210
  43. package/dist/cli/{index-j89zmcpx.js → index-p9ngg568.js} +6 -6
  44. package/dist/cli/{index-g1drmgxe.js → index-rv7s2k9y.js} +3 -3
  45. package/dist/cli/{index-z085b4ka.js → index-tcn457d5.js} +1 -1
  46. package/dist/cli/{index-fpkb3mw1.js → index-vg3yx648.js} +1 -1
  47. package/dist/cli/{index-13xxjfhn.js → index-vm4xw9z3.js} +1 -1
  48. package/dist/cli/{index-jxchddjk.js → index-wygxzvtf.js} +6 -4
  49. package/dist/cli/{index-b4z7s917.js → index-x20cgr2q.js} +1 -1
  50. package/dist/cli/{index-qe3v54nb.js → index-y111zefa.js} +64 -23
  51. package/dist/cli/{index-w80r3axq.js → index-y47crdg9.js} +34 -32
  52. package/dist/cli/{index-3nasn371.js → index-y6a7gjtj.js} +126 -42
  53. package/dist/cli/{index-247b1c1m.js → index-yf30m841.js} +3 -3
  54. package/dist/cli/index.js +31 -29
  55. package/dist/cli/{knowledge-escalator-4tp3yy7e.js → knowledge-escalator-42ecv7m3.js} +6 -6
  56. package/dist/cli/{knowledge-events-7854gb3p.js → knowledge-events-zhna7v3g.js} +4 -4
  57. package/dist/cli/{knowledge-link-etrfntkd.js → knowledge-link-mm1w967j.js} +3 -3
  58. package/dist/cli/{knowledge-store-cxnr6v01.js → knowledge-store-56jcfc5k.js} +4 -4
  59. package/dist/cli/{knowledge-validator-3n5t55qy.js → knowledge-validator-8zk0pnb6.js} +7 -7
  60. package/dist/cli/{pending-delegations-4z3tkkct.js → pending-delegations-qajsxct0.js} +4 -4
  61. package/dist/cli/{pr-subscriptions-29j794kd.js → pr-subscriptions-qhr41epq.js} +4 -4
  62. package/dist/cli/{scan-cursor-0cexjh3b.js → scan-cursor-h3ndxd41.js} +5 -5
  63. package/dist/cli/{schema-rs5a7ywx.js → schema-r6wmd7zp.js} +2 -1
  64. package/dist/cli/{scope-persistence-1vsnkmm4.js → scope-persistence-h2fpgxww.js} +3 -3
  65. package/dist/cli/{skill-generator-n0h9n0zd.js → skill-generator-12cftsx4.js} +8 -8
  66. package/dist/cli/{workspace-snapshot-9h5za0s6.js → workspace-snapshot-jmyamqnv.js} +6 -1
  67. package/dist/cli/{worktree-collision-ownership-dtwr0xj4.js → worktree-collision-ownership-13btcj9g.js} +5 -5
  68. package/dist/commands/approve-plan-critic.d.ts +21 -0
  69. package/dist/commands/registry.d.ts +9 -1
  70. package/dist/config/cache-paths.d.ts +48 -0
  71. package/dist/config/constants.d.ts +18 -0
  72. package/dist/config/host-path.d.ts +95 -0
  73. package/dist/config/lane-context.d.ts +117 -0
  74. package/dist/config/lane-permissions.d.ts +277 -0
  75. package/dist/config/schema.d.ts +10 -0
  76. package/dist/config/swarm-branch.d.ts +130 -0
  77. package/dist/hooks/delegation-gate.d.ts +42 -1
  78. package/dist/hooks/pr-workflow-gate.d.ts +30 -4
  79. package/dist/hooks/repo-graph-builder.d.ts +18 -0
  80. package/dist/hooks/skill-propagation-gate.d.ts +10 -0
  81. package/dist/index.js +459 -443
  82. package/dist/memory/schema.d.ts +4 -4
  83. package/dist/tools/approve-plan-critic.d.ts +5 -0
  84. package/dist/tools/convene-council.d.ts +3 -3
  85. package/dist/tools/dispatch-lanes.d.ts +65 -7
  86. package/dist/tools/index.d.ts +1 -0
  87. package/dist/tools/manifest.d.ts +1 -0
  88. package/dist/tools/repo-graph/builder.d.ts +20 -2
  89. package/dist/tools/repo-graph/incremental.d.ts +18 -1
  90. package/dist/tools/repo-graph/ontology.d.ts +8 -0
  91. package/dist/tools/repo-graph/types.d.ts +62 -1
  92. package/dist/tools/repo-graph.d.ts +1 -1
  93. package/dist/tools/submit-phase-council-verdicts.d.ts +3 -3
  94. package/dist/tools/tool-metadata.d.ts +4 -0
  95. package/dist/tools/write-final-council-evidence.d.ts +3 -3
  96. package/dist/tools/write-pr-review-trigger-eval.d.ts +34 -63
  97. package/package.json +1 -1
  98. package/dist/cli/curator-llm-factory-wr3zmy2c.js +0 -56
  99. package/dist/cli/guardrail-explain-g1s89b3e.js +0 -57
@@ -1,8 +1,9 @@
1
1
  import * as fsp from 'node:fs/promises';
2
+ import { type PrReviewInlineTriggerRow } from '../background/pr-review-trigger-contract.js';
2
3
  import { resolveCommitCountSince, resolveCommitCountSinceAsync, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveCurrentUpstreamRemoteRef, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolvePrWorkflowRevisionDigest, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync } from '../background/workspace-snapshot.js';
3
4
  import { type PrWorkflowGitState } from '../git/pr-workflow-state.js';
4
5
  export declare const PR_REVIEW_BASE_DIMENSION_IDS: readonly ["intent-architecture", "correctness-state", "tests-falsifiability", "security-trust", "reliability-performance", "compatibility-delivery"];
5
- export declare const PR_REVIEW_REQUIRED_MICRO_LANE_IDS: readonly ["auth-identity-secrets", "untrusted-input-boundaries", "subprocess-platform", "concurrency-state", "dependencies-build-release", "api-schema-migrations", "test-infrastructure", "ui-accessibility-i18n", "privacy-observability", "generated-provenance", "unclassified-risk"];
6
+ export declare const PR_REVIEW_REQUIRED_MICRO_LANE_IDS: ("auth-identity-secrets" | "untrusted-input-boundaries" | "subprocess-platform" | "concurrency-state" | "dependencies-build-release" | "api-schema-migrations" | "test-infrastructure" | "ui-accessibility-i18n" | "privacy-observability" | "generated-provenance" | "unclassified-risk")[];
6
7
  export type PrReviewBaseDimensionId = (typeof PR_REVIEW_BASE_DIMENSION_IDS)[number];
7
8
  export type PrWorkflowMode = 'PR_REVIEW' | 'PR_FEEDBACK';
8
9
  export interface PrWorkflowCheckoutRecoveryRecord {
@@ -194,6 +195,8 @@ export interface PrWorkflowGateState {
194
195
  prReviewBaseDispatches?: PrReviewBaseDispatchRecord[];
195
196
  /** @deprecated Compatibility projection of the most recent base dispatch. */
196
197
  prReviewBaseDispatch?: PrReviewBaseDispatchRecord;
198
+ /** Canonical ordered semantic ledger frozen by the first micro dispatch. */
199
+ prReviewTriggerLedger?: PrReviewInlineTriggerRow[];
197
200
  prReviewTriggerEvalPath?: string;
198
201
  prReviewValidationBatches?: PrReviewValidationBatchRecord[];
199
202
  prReviewArtifactRunId?: string;
@@ -284,7 +287,7 @@ export declare function bindPrReviewBase(directory: string, sessionID: string, o
284
287
  * exact remediation command so callers can self-diagnose instead of
285
288
  * cascading into fictional root causes.
286
289
  */
287
- export declare function assertCurrentCheckoutHead(directory: string, expectedHead: string): Promise<string>;
290
+ export declare function assertCurrentCheckoutHead(directory: string, expectedHead: string, mode?: PrWorkflowMode): Promise<string>;
288
291
  /** Prove that every PR-review lane reads the immutable checked-out PR tree. */
289
292
  export declare function assertPrReviewCleanCheckout(directory: string, mode?: PrWorkflowMode): Promise<void>;
290
293
  export declare function enforcePrWorkflowDispatchLanesAsync(directory: string, sessionID: string, toolName: string): Promise<PrWorkflowGateState | null>;
@@ -335,6 +338,8 @@ export declare function assertPrFeedbackGatePhaseSettled(directory: string, sess
335
338
  /** Require every ordered feedback gate on one unchanged revision. */
336
339
  export declare function assertPrFeedbackReadyToPublish(directory: string, sessionID: string): Promise<PrWorkflowGateState>;
337
340
  export declare function markPrReviewTriggerEvaluationComplete(directory: string, sessionID: string, artifactPath: string): Promise<PrWorkflowGateState>;
341
+ /** Freeze one exact inline trigger ledger across every micro dispatch. */
342
+ export declare function bindPrReviewTriggerLedger(directory: string, sessionID: string, input: unknown): Promise<PrWorkflowGateState>;
338
343
  export declare function assertPrReviewArtifactBoundary(directory: string, sessionID: string, runId: string, boundary: PrReviewArtifactBoundary, findingIds: string[]): Promise<PrWorkflowGateState>;
339
344
  /**
340
345
  * Artifact records are a projection of lane receipts, never a caller-controlled
@@ -365,14 +370,23 @@ export declare function completePrWorkflow(directory: string, sessionID: string,
365
370
  export declare const _test_exports: {
366
371
  workflowGateStateRelativePath: typeof workflowGateStateRelativePath;
367
372
  workflowGateStateLockRelativePath: typeof workflowGateStateLockRelativePath;
373
+ workflowCheckoutMutationLockRelativePath: typeof workflowCheckoutMutationLockRelativePath;
374
+ withPrWorkflowCheckoutMutationLock: typeof withPrWorkflowCheckoutMutationLock;
368
375
  resetTrackedStateCache: () => void;
369
376
  beforeTerminalClear: (() => Promise<void>) | undefined;
370
377
  beforePrFeedbackTransitionLock: (() => Promise<void>) | undefined;
378
+ beforePrFeedbackTrackingSwitch: (() => Promise<void>) | undefined;
379
+ afterPrFeedbackTrackingSwitch: (() => Promise<void>) | undefined;
380
+ beforePrFeedbackTrackingPersist: (() => Promise<void>) | undefined;
371
381
  beforeBoundedSwarmFileOpen: (() => Promise<void>) | undefined;
372
382
  beforeSessionStateLockWrite: (() => Promise<void>) | undefined;
383
+ beforeCheckoutLockWrite: (() => Promise<void>) | undefined;
373
384
  beforeSafeDirectoryCreate: ((parentPath: string, nextPath: string) => Promise<void>) | undefined;
374
385
  beforeAtomicTempWrite: (() => Promise<void>) | undefined;
375
386
  beforeAtomicRename: (() => Promise<void>) | undefined;
387
+ openCheckoutLock: typeof openCheckoutLockFile;
388
+ removeCheckoutLock: typeof removeCheckoutLockFile;
389
+ checkoutMutationActionTimeoutMs: number;
376
390
  resolveCurrentGitHead: typeof resolveCurrentGitHead;
377
391
  resolveCurrentGitHeadAsync: typeof resolveCurrentGitHeadAsync;
378
392
  resolveCurrentUpstreamPushTarget: typeof resolveCurrentUpstreamPushTarget;
@@ -407,12 +421,24 @@ export declare function normalizePrWorkflowShellCommand(command: string): {
407
421
  strippedCdPrefix: boolean;
408
422
  };
409
423
  declare function isSafeStandaloneGitCommit(command: string): boolean;
410
- /** Require at least one real discovery row or a lane-bound CLEAN attestation. */
411
- export declare function prReviewDiscoveryArtifactCoversLane(text: string, expectedWorkflowLane: string): boolean;
424
+ /** Require at least one semantically valid discovery row or CLEAN attestation. */
425
+ export declare function prReviewDiscoveryArtifactCoversLane(text: string, expectedWorkflowLane: string, ownedWorkflowLanes?: readonly string[]): boolean;
412
426
  declare function parseCriticVerdict(text: string, itemId: string, reviewerSeverity?: string): {
413
427
  status: string;
414
428
  severity: string;
415
429
  } | null;
430
+ declare function workflowCheckoutMutationLockRelativePath(): string;
431
+ declare function openCheckoutLockFile(lockPath: string): Promise<fsp.FileHandle>;
432
+ declare function removeCheckoutLockFile(lockPath: string): Promise<void>;
433
+ /** A bounded checkout-mutation refusal that never permits unsafe late overlap. */
434
+ export declare class PrWorkflowCheckoutMutationTimeoutError extends Error {
435
+ readonly phase: 'queue' | 'action';
436
+ readonly code: "PR_WORKFLOW_CHECKOUT_MUTATION_TIMEOUT";
437
+ readonly retryable: false;
438
+ constructor(phase: 'queue' | 'action');
439
+ }
440
+ /** Serialize project-wide checkout mutations before any session state lock. */
441
+ export declare function withPrWorkflowCheckoutMutationLock<T>(directory: string, action: () => Promise<T>): Promise<T>;
416
442
  declare function isProcessAlive(pid: number): boolean;
417
443
  declare function workflowGateStateLockRelativePath(sessionID: string): string;
418
444
  declare function workflowGateStateRelativePath(sessionID: string): string;
@@ -44,6 +44,24 @@ export interface RepoGraphDeps {
44
44
  }) => Promise<RepoGraph>;
45
45
  safeRealpathSync?: typeof safeRealpathSync;
46
46
  }
47
+ /**
48
+ * Rebase a realpath'd file onto the lexical workspace root so the incremental
49
+ * update keys the same node the walk produced (issue #1985, defect A5). Exported
50
+ * for direct unit testing of the symlink-root rebase logic.
51
+ *
52
+ * The walk keys nodes lexically relative to `workspaceRoot` (realpath is used
53
+ * only as a cycle-break key). When the workspace root itself is a symlink
54
+ * (`workspaceRoot` → `realWorkspace`), a realpath'd file (`realFilePath`) lives
55
+ * under `realWorkspace` and would key a DIFFERENT node than the lexical path the
56
+ * walker would have produced — causing a duplicate node.
57
+ *
58
+ * If `realFilePath` is under `realWorkspace`, rebase its workspace-relative tail
59
+ * onto the lexical `workspaceRoot` (reconstructing the lexical absolute path the
60
+ * walker used). Otherwise (case-insensitive aliasing without a symlinked root,
61
+ * or an unexpected layout) return `realFilePath` so the case-folding benefit of
62
+ * the realpath is preserved.
63
+ */
64
+ export declare function rebaseOntoWorkspace(realFilePath: string, realWorkspace: string, workspaceRoot: string): string;
47
65
  export declare function createRepoGraphBuilderHook(workspaceRoot: string, deps?: Partial<RepoGraphDeps>, options?: {
48
66
  excludeDirs?: readonly string[];
49
67
  }): RepoGraphBuilderHook;
@@ -29,6 +29,16 @@ import { appendSkillUsageEntry, readSkillUsageEntries, readSkillUsageEntriesTail
29
29
  export declare function loadRoutingSkills(directory: string, targetAgent: string): string[];
30
30
  /** Agents that should receive skill context in delegations. */
31
31
  export declare const SKILL_CAPABLE_AGENTS: Set<string>;
32
+ /**
33
+ * Skill root directories to scan for SKILL.md files.
34
+ *
35
+ * Exported because `src/config/lane-permissions.ts` resolves these same
36
+ * project-relative roots to absolute directories when building the
37
+ * `external_directory` allowlist for a worktree-lane instance. Keeping one
38
+ * definition means a new skill root cannot be added here and silently become
39
+ * an unanswerable permission prompt inside a lane.
40
+ */
41
+ export declare const SKILL_SEARCH_ROOTS: string[];
32
42
  /**
33
43
  * Maximum number of session-scoped skill-usage tail entries to process for
34
44
  * skill scoring. This applies to the bounded tail-read window only.