opencode-swarm 7.178.1 → 7.179.0

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 (96) hide show
  1. package/.opencode/skills/deep-dive/SKILL.md +1 -1
  2. package/.opencode/skills/running-tests/SKILL.md +30 -24
  3. package/.opencode/skills/swarm-plan/SKILL.md +1 -1
  4. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  5. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  6. package/dist/agents/critic.d.ts +6 -6
  7. package/dist/agents/explorer.d.ts +1 -1
  8. package/dist/cli/{coder-settlement-m03dfyec.js → coder-settlement-7pt3a0y0.js} +8 -8
  9. package/dist/cli/{config-doctor-x8b260sh.js → config-doctor-82w4bp4b.js} +3 -3
  10. package/dist/cli/{core-2d0xcyby.js → core-9rqzs794.js} +2 -2
  11. package/dist/cli/{curation-policy-7am15ht9.js → curation-policy-c7mdsf7m.js} +4 -4
  12. package/dist/cli/{curator-llm-factory-rgdb2ee5.js → curator-llm-factory-cbm1ny30.js} +33 -33
  13. package/dist/cli/{curator-5kfkqzc9.js → curator-m8act07j.js} +33 -33
  14. package/dist/cli/{dispatch-9yqqqfr6.js → dispatch-3rwdxpp2.js} +1 -1
  15. package/dist/cli/{evidence-summary-service-959pwbwb.js → evidence-summary-service-a99bgje1.js} +13 -13
  16. package/dist/cli/{explorer-2cv64zfj.js → explorer-z0cf5cz0.js} +1 -1
  17. package/dist/cli/{gate-evidence-66kjx6zj.js → gate-evidence-yssmxba5.js} +5 -5
  18. package/dist/cli/{guardrail-explain-rre9ntq3.js → guardrail-explain-ffwmhf7s.js} +34 -34
  19. package/dist/cli/{guardrail-log-t0ydqz5s.js → guardrail-log-j2wtq7p2.js} +7 -7
  20. package/dist/cli/{guardrail-reset-6gad352a.js → guardrail-reset-07byr7nr.js} +33 -33
  21. package/dist/cli/{hive-promoter-zgnagx67.js → hive-promoter-ewrz7vh1.js} +33 -33
  22. package/dist/cli/{index-ksq6cqg0.js → index-09wm3963.js} +5 -5
  23. package/dist/cli/{index-6e8fpjdg.js → index-0bc8jdnv.js} +2 -2
  24. package/dist/cli/{index-xr9n0vjv.js → index-0h3cr7pn.js} +1 -1
  25. package/dist/cli/{index-fyfbpz4f.js → index-1c1dbwze.js} +1 -0
  26. package/dist/cli/{index-1zrrerev.js → index-1rwyfvq2.js} +2 -2
  27. package/dist/cli/{index-qbs49vge.js → index-1sz02k85.js} +1 -1
  28. package/dist/cli/{index-t8dqe4ns.js → index-34bwqcea.js} +1 -1
  29. package/dist/cli/{index-7kty6f59.js → index-3hne91yd.js} +5 -5
  30. package/dist/cli/{index-yew23624.js → index-6r92fw88.js} +4 -4
  31. package/dist/cli/{index-j7w16s92.js → index-6tnkvqr9.js} +2 -2
  32. package/dist/cli/{index-x1m1nnry.js → index-7zmbtxw1.js} +4 -4
  33. package/dist/cli/{index-kj599831.js → index-80q47hpw.js} +2 -2
  34. package/dist/cli/{index-r78kphsr.js → index-8815e95e.js} +3 -3
  35. package/dist/cli/{index-pyxs697r.js → index-9p1pqykb.js} +5 -5
  36. package/dist/cli/{index-whjrhatw.js → index-a11ztzs5.js} +18 -1
  37. package/dist/cli/{index-eq1n57tg.js → index-amf88k1e.js} +1 -1
  38. package/dist/cli/{index-bb148vht.js → index-cvg402ha.js} +1 -1
  39. package/dist/cli/{index-wajcx84s.js → index-d66zb40k.js} +651 -179
  40. package/dist/cli/{index-1jcy4gc6.js → index-etmwjgre.js} +33 -33
  41. package/dist/cli/{index-kz9pcqn9.js → index-f2v90gfc.js} +1 -1
  42. package/dist/cli/{index-7n4dtzk4.js → index-g6nyk713.js} +1 -1
  43. package/dist/cli/{index-w1b5qqnp.js → index-h59vsbch.js} +2 -2
  44. package/dist/cli/{index-xr3eye3f.js → index-hwcra3y9.js} +7 -7
  45. package/dist/cli/{index-2e6txjp7.js → index-kanxpgf8.js} +3 -3
  46. package/dist/cli/{index-1hgqs8j8.js → index-kmhnkn6t.js} +3 -3
  47. package/dist/cli/{index-2pyba37z.js → index-ndwbb3xm.js} +6 -6
  48. package/dist/cli/{index-nrfjjqm4.js → index-pskba939.js} +1 -1
  49. package/dist/cli/{index-1qnykdaw.js → index-pxtye2ng.js} +35 -35
  50. package/dist/cli/{index-pk97v7b8.js → index-qt0793qm.js} +4 -4
  51. package/dist/cli/{index-x54339yd.js → index-qxk5qkfh.js} +5 -5
  52. package/dist/cli/{index-4e4zsj2g.js → index-sv4y1cma.js} +5 -5
  53. package/dist/cli/{index-byfrearz.js → index-tmy46dtd.js} +4 -4
  54. package/dist/cli/{index-zv3j0v08.js → index-twtez316.js} +2 -2
  55. package/dist/cli/{index-m2n1rhgv.js → index-w872yykk.js} +1 -1
  56. package/dist/cli/{index-h0kyy9rd.js → index-wvpsm8ja.js} +9 -9
  57. package/dist/cli/{index-b50qevsm.js → index-yagqxt2p.js} +4 -4
  58. package/dist/cli/{index-0pmh1kks.js → index-yfpswnjt.js} +1 -1
  59. package/dist/cli/{index-hnvmj9wx.js → index-zgvzbz48.js} +14 -4
  60. package/dist/cli/index.js +34 -34
  61. package/dist/cli/{knowledge-escalator-5r6mww64.js → knowledge-escalator-yx97q9c1.js} +11 -11
  62. package/dist/cli/{knowledge-events-typjw0sd.js → knowledge-events-p269fyvv.js} +9 -9
  63. package/dist/cli/{knowledge-link-mvykydxg.js → knowledge-link-gfz47ves.js} +3 -3
  64. package/dist/cli/{knowledge-store-9qcf3emn.js → knowledge-store-36zemyqa.js} +4 -4
  65. package/dist/cli/{knowledge-validator-k6ydsxzy.js → knowledge-validator-rd20yq41.js} +6 -6
  66. package/dist/cli/{mcp-tedxsgey.js → mcp-sg9zrkz2.js} +1 -1
  67. package/dist/cli/{model-preflight-kh9dwts2.js → model-preflight-61xgqwcs.js} +1 -1
  68. package/dist/cli/{pending-delegations-d20fnrzv.js → pending-delegations-8p2gf4kt.js} +8 -8
  69. package/dist/cli/{pr-subscriptions-awwhg139.js → pr-subscriptions-4dj9r71h.js} +8 -8
  70. package/dist/cli/{pr-workflow-gate-ke79bb9c.js → pr-workflow-gate-8dgz5z1h.js} +35 -33
  71. package/dist/cli/{runner-y3sydwtj.js → runner-16b691ba.js} +4 -4
  72. package/dist/cli/{scan-cursor-16s6dp7f.js → scan-cursor-nx0jv9ya.js} +5 -5
  73. package/dist/cli/{schema-nqjp43vq.js → schema-q6gsrxwz.js} +2 -2
  74. package/dist/cli/{scope-persistence-8z1hwdr2.js → scope-persistence-1k4xsyh7.js} +13 -13
  75. package/dist/cli/{server-x16hp9aq.js → server-shhxq34t.js} +33 -33
  76. package/dist/cli/{skill-generator-xadg43ph.js → skill-generator-6j7tq2tb.js} +13 -13
  77. package/dist/cli/{snapshot-coordination-init-3yyzb2c4.js → snapshot-coordination-init-h8n8w1cm.js} +33 -33
  78. package/dist/cli/{telemetry-c9wv2cfw.js → telemetry-qxav5cdk.js} +1 -1
  79. package/dist/cli/{worktree-collision-ownership-drqhmmtd.js → worktree-collision-ownership-97jzh4ra.js} +8 -8
  80. package/dist/cli/{worktree-isolation-aebdyb1m.js → worktree-isolation-g4w74ccb.js} +33 -33
  81. package/dist/commands/registry.d.ts +3 -3
  82. package/dist/db/coordination-store.d.ts +10 -0
  83. package/dist/hooks/pr-workflow-gate.d.ts +15 -6
  84. package/dist/index.js +77 -64
  85. package/dist/mutation/engine.d.ts +6 -0
  86. package/dist/mutation/equivalence.d.ts +12 -1
  87. package/dist/pr-review/circuit.d.ts +3 -3
  88. package/dist/pr-review/legacy-transcript-adapter.d.ts +7 -10
  89. package/dist/pr-review/persistence.d.ts +36 -0
  90. package/dist/retention/sweep.d.ts +4 -0
  91. package/dist/tools/mutation-test.d.ts +6 -0
  92. package/dist/tools/prepare-pr-workflow-checkout.d.ts +19 -0
  93. package/dist/tools/repo-map-action-dispositions.d.ts +23 -0
  94. package/dist/tools/test-runner.d.ts +17 -2
  95. package/package.json +1 -1
  96. package/dist/pr-review/guardrails.d.ts +0 -67
@@ -98,5 +98,11 @@ export declare const _internals: {
98
98
  };
99
99
  export declare function executeMutation(patch: MutationPatch, testCommand: string[], testFiles: string[], workingDir: string, options?: MutationExecutionOptions): Promise<MutationResult>;
100
100
  export declare function computeReport(results: MutationResult[], durationMs: number, budgetMs?: number): MutationReport;
101
+ /**
102
+ * Apply a unified diff's hunks to the original file text, producing the full
103
+ * mutated file. Returns null when the diff does not parse or does not apply
104
+ * cleanly to the original (context mismatch), so callers can fall back.
105
+ */
106
+ export declare function applyUnifiedDiff(originalCode: string, patchText: string): string | null;
101
107
  export declare function executeMutationSuite(patches: MutationPatch[], testCommand: string[], testFiles: string[], workingDir: string, budgetMs?: number, onProgress?: (completed: number, total: number, result: MutationResult) => void, sourceFiles?: Map<string, string>, options?: MutationExecutionOptions): Promise<MutationReport>;
102
108
  export {};
@@ -18,7 +18,17 @@ export type LLMJudgeCallback = (original: string, mutated: string, context: stri
18
18
  * Strips comments (single-line // and multi-line /* *\/), console.log/debugger statements,
19
19
  * trailing whitespace, and blank lines. Returns true if the stripped versions are identical.
20
20
  */
21
- export declare function isStaticallyEquivalent(originalCode: string, mutatedCode: string): boolean;
21
+ /**
22
+ * Comment syntax family for a language hint (a file path or language id).
23
+ * The default family preserves the historical 2-argument behavior exactly:
24
+ * // line comments plus slash-star block comments (TS/JS/Go/PHP/Java/Kotlin/C/C++/Rust).
25
+ */
26
+ interface CommentSyntaxFamily {
27
+ lineTokens: string[];
28
+ blockComments: boolean;
29
+ }
30
+ export declare function commentFamilyForLanguage(languageHint?: string): CommentSyntaxFamily;
31
+ export declare function isStaticallyEquivalent(originalCode: string, mutatedCode: string, languageHint?: string): boolean;
22
32
  export declare const _internals: {
23
33
  isStaticallyEquivalent: typeof isStaticallyEquivalent;
24
34
  checkEquivalence: typeof checkEquivalence;
@@ -38,3 +48,4 @@ export declare function batchCheckEquivalence(patches: Array<{
38
48
  originalCode: string;
39
49
  mutatedCode: string;
40
50
  }>, llmJudge?: LLMJudgeCallback): Promise<EquivalenceResult[]>;
51
+ export {};
@@ -22,9 +22,9 @@
22
22
  * Issue #2385 additionally makes this module the ONLY authority that may
23
23
  * construct or transition circuit records: policy snapshot resolution, the
24
24
  * re-enable reset, and the rolled-back-probe transition live here (previously
25
- * inline record constructions in the gate). The parallel-rule guardrail
26
- * (`src/pr-review/guardrails.ts`) enforces that no circuit record is built
27
- * outside `src/pr-review/`.
25
+ * inline record constructions in the gate). The source-tree regression tests
26
+ * enforce that no circuit record is built outside `src/pr-review/`; this pure
27
+ * state-machine module remains the production construction authority.
28
28
  */
29
29
  import { z } from 'zod';
30
30
  import type { BackgroundDelegationRecord } from '../background/pending-delegations.js';
@@ -4,12 +4,10 @@
4
4
  *
5
5
  * This is the ONLY module allowed to convert raw transcript / artifact text
6
6
  * into canonical PR-review data (verdict rows, per-item verdicts, feedback
7
- * classifications). The locality contract is enforced mechanically by
8
- * `scanTranscriptParsingOutsideAdapter` in `src/pr-review/guardrails.ts`:
9
- * every identifier in `TRANSCRIPT_CONVERSION_SYMBOLS` may appear only in this
10
- * file across `src/`. The gate therefore consumes this boundary through the
11
- * `legacy*`-prefixed aliases and the test surface exported below — never
12
- * through the conversion identifiers themselves.
7
+ * classifications). This module is the sole owner of the transcript
8
+ * conversion identifiers across `src/`; the gate therefore consumes this
9
+ * boundary through the `legacy*`-prefixed aliases and the test surface
10
+ * exported below never through the conversion identifiers themselves.
13
11
  *
14
12
  * Compat gating: the settlement path that accepts legacy (pre-structured-
15
13
  * receipt) transcript text is governed by the delegation record's
@@ -252,10 +250,9 @@ export declare function feedbackArtifactTextCoversItems(text: string, itemIds: r
252
250
  */
253
251
  export declare function readSettledFeedbackClassifications(directory: string, state: PrReviewTranscriptState): Map<string, string>;
254
252
  /**
255
- * Issue #2385 guardrail aliases: the transcript-conversion identifiers may
256
- * appear only in this module (`scanTranscriptParsingOutsideAdapter` in
257
- * `src/pr-review/guardrails.ts`), so the owning gate imports these aliases
258
- * instead of the canonical names.
253
+ * Issue #2385 guardrail aliases: transcript-conversion identifiers are owned
254
+ * only by this module, so the owning gate imports these aliases instead of
255
+ * the canonical names.
259
256
  */
260
257
  export declare const analyzeLegacyVerdictRowContract: typeof analyzePrReviewVerdictRowContract;
261
258
  export declare const legacyArtifactHasExactPositiveVerdictRow: typeof artifactHasExactPositiveVerdictRow;
@@ -55,6 +55,10 @@ export interface PrReviewPersistenceHooks {
55
55
  beforeSafeDirectoryCreate?: (parentPath: string, nextPath: string) => Promise<void>;
56
56
  beforeAtomicTempWrite?: () => Promise<void>;
57
57
  beforeAtomicRename?: () => Promise<void>;
58
+ /** Test-only interleave point immediately before terminal CAS deletion. */
59
+ beforeTerminalizationDelete?: () => Promise<void>;
60
+ /** Test-only unlink seam for partial-shadow cleanup recovery tests. */
61
+ removeShadowProjection?: (filePath: string) => Promise<void>;
58
62
  }
59
63
  export declare const defaultPersistenceHooks: PrReviewPersistenceHooks;
60
64
  /**
@@ -94,6 +98,28 @@ export declare function readPrWorkflowGateStateFromDisk<S extends PrWorkflowPers
94
98
  export declare function readPrWorkflowGateStateFileRawFromDisk<S extends PrWorkflowPersistedStateBase>(filePath: string, stateLabel: string): Promise<S | null>;
95
99
  export declare function readPrWorkflowGateStateFileFromDisk<S extends PrWorkflowPersistedStateBase>(filePath: string, stateLabel: string): Promise<S | null>;
96
100
  export declare function readPrWorkflowGateStateFromCoordination<S extends PrWorkflowPersistedStateBase>(directory: string, sessionID: string): Promise<S | null>;
101
+ export type PrWorkflowGateCoordinationRecovery<S extends PrWorkflowPersistedStateBase> = {
102
+ kind: 'absent';
103
+ } | {
104
+ kind: 'valid';
105
+ rowRevision: number;
106
+ generation: number;
107
+ state: S;
108
+ } | {
109
+ kind: 'corrupt';
110
+ rowRevision: number;
111
+ generation: number;
112
+ reason: string;
113
+ } | {
114
+ kind: 'invalid';
115
+ reason: string;
116
+ };
117
+ /**
118
+ * Inspect one workflow coordination row for recovery without trusting payload
119
+ * bytes. Only payload JSON/codec/generation failures are recoverable with a
120
+ * matching shadow projection. Database open/query errors intentionally escape.
121
+ */
122
+ export declare function readPrWorkflowGateStateCoordinationForRecovery<S extends PrWorkflowPersistedStateBase>(directory: string, sessionID: string): PrWorkflowGateCoordinationRecovery<S>;
97
123
  /** Persist one CAS-checked state replacement while the session lock is held. */
98
124
  export declare function writeStateWhileLocked<S extends PrWorkflowPersistedStateBase>(directory: string, state: S, options?: {
99
125
  replaceWorkflowInstanceId?: string;
@@ -103,6 +129,16 @@ export declare function deleteStateWhileLocked(directory: string, sessionID: str
103
129
  expectedStateRevision?: number;
104
130
  allowSalvagedRead?: boolean;
105
131
  }): Promise<void>;
132
+ /**
133
+ * Terminalize one session's gate on exact owner lifecycle deletion.
134
+ *
135
+ * This is deliberately independent of abort policy: it serializes the exact
136
+ * normalized session, removes that session's shadow projection before its
137
+ * CAS-delete, then forgets the cache entry. A missing row/projection is an
138
+ * idempotent successful terminal; retaining the row across partial cleanup
139
+ * prevents a legacy shadow from being imported as resurrected state.
140
+ */
141
+ export declare function terminalizePrWorkflowGateForSession(directory: string, sessionID: string): Promise<void>;
106
142
  /** A bounded checkout-mutation refusal that never permits unsafe late overlap. */
107
143
  export declare class PrWorkflowCheckoutMutationTimeoutError extends Error {
108
144
  readonly phase: 'queue' | 'action';
@@ -23,6 +23,10 @@
23
23
  * - authoritative streams (plan ledger, knowledge store, council, evidence,
24
24
  * scopes, swarm.db, telemetry) are NOT in any family and are never
25
25
  * touched (negative test).
26
+ * - checkout-preparation receipts remain recovery material: the checkout
27
+ * family only removes old, strictly validated applied+verified receipts
28
+ * (and abandoned atomic-write temporary files), never a pending receipt or
29
+ * its stash.
26
30
  */
27
31
  /** Default age horizon for keyspace families (30 days). */
28
32
  export declare const DEFAULT_FAMILY_AGE_DAYS = 30;
@@ -1,2 +1,8 @@
1
+ import { analyzeImpact } from '../test-impact/analyzer.js';
1
2
  import { createSwarmTool } from './create-tool';
2
3
  export declare const mutation_test: ReturnType<typeof createSwarmTool>;
4
+ export declare const _internals: {
5
+ mutationInternals: {
6
+ analyzeImpact: typeof analyzeImpact;
7
+ };
8
+ };
@@ -1,9 +1,26 @@
1
+ import { appendCoreEventSync } from '../events/core-events.js';
1
2
  import { classifyPrWorkflowGitState } from '../git/pr-workflow-state.js';
2
3
  import { createSwarmTool } from './create-tool.js';
3
4
  export interface PrWorkflowCheckoutRestoreInventoryItem {
4
5
  stash_oid: string;
5
6
  stash_present: boolean | null;
6
7
  }
8
+ export interface PrWorkflowCheckoutReconciliationSummary {
9
+ /** The exact owner session whose receipt directory was inspected. */
10
+ sessionID: string;
11
+ /** Number of validated receipt files considered in this bounded pass. */
12
+ inspectedReceiptCount: number;
13
+ /** Verified receipt OIDs whose marked stash was collected and verified absent. */
14
+ collectedStashOids: string[];
15
+ /** Missing-stash receipt OIDs with bounded core-event evidence and receipt retirement. */
16
+ retiredMissingStashOids: string[];
17
+ /** Receipt/stash OIDs deliberately preserved (pending, unknown, or failed cleanup). */
18
+ preservedStashOids: string[];
19
+ /** Cleanup failures; no corresponding receipt is retired when this is non-empty. */
20
+ failures: string[];
21
+ /** True when all inspected inventory stayed within the hard bounds. */
22
+ bounded: boolean;
23
+ }
7
24
  /**
8
25
  * Preserve explicit dirty tracked files before the unbound PR checkout.
9
26
  *
@@ -27,6 +44,7 @@ declare function runGit(directory: string, args: string[], options?: {
27
44
  declare function readBoundedGitStdout(stream: {
28
45
  getReader(): ReadableStreamDefaultReader<Uint8Array>;
29
46
  }, onOverflow: () => void): Promise<string>;
47
+ export declare function reconcilePrWorkflowCheckoutReceipts(directory: string, rawSessionID: string): Promise<PrWorkflowCheckoutReconciliationSummary>;
30
48
  declare function removeCheckoutRestoreReceipt(receiptPath: string): Promise<void>;
31
49
  export declare function listPendingPrWorkflowCheckoutRestores(directory: string, sessionID: string): Promise<PrWorkflowCheckoutRestoreInventoryItem[]>;
32
50
  /**
@@ -40,6 +58,7 @@ export declare const _internals: {
40
58
  readBoundedGitStdout: typeof readBoundedGitStdout;
41
59
  classifyGitState: typeof classifyPrWorkflowGitState;
42
60
  removeCheckoutRestoreReceipt: typeof removeCheckoutRestoreReceipt;
61
+ appendCoreEventSync: typeof appendCoreEventSync;
43
62
  };
44
63
  export declare const prepare_pr_workflow_checkout: ReturnType<typeof createSwarmTool>;
45
64
  export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Disposition registry for repo_map actions audited as unreferenced (issue #2540).
3
+ *
4
+ * Every entry in VALID_ACTIONS must be reachable from a real workflow surface
5
+ * (agent prompt, skill, or command) or be deliberately retired. This registry
6
+ * records the per-action disposition for the six audit actions from
7
+ * REPOGRAPH-11 (docs/audits/swarm-plugin-review-2026-09.md): each is retained
8
+ * and wired to the listed consumers. The controls wired by #2516
9
+ * (route_trace, test_pack) and the two additional contextually-unreferenced
10
+ * entries the ratchet surfaced (callers, retrieve) are intentionally NOT
11
+ * subjects here — they already had, or gained independently, their own
12
+ * consumers and are enforced by the VALID_ACTIONS↔consumer ratchet test
13
+ * (tests/unit/config/repo-map-action-consumer-ratchet.test.ts).
14
+ */
15
+ export interface RepoMapActionDisposition {
16
+ /** retained = wired to real consumers; retired = removed from the advertised surface */
17
+ disposition: 'retained' | 'retired';
18
+ /** repo-relative workflow-surface files containing a repo_map-contextual reference (required when retained) */
19
+ consumers?: string[];
20
+ /** surfaces scrubbed of the action (required when retired: schema, help, prompts, inventory) */
21
+ removedFrom?: string[];
22
+ }
23
+ export declare const REPO_MAP_ACTION_DISPOSITIONS: Record<string, RepoMapActionDisposition>;
@@ -12,7 +12,6 @@ export declare const MAX_COMMAND_LENGTH = 500;
12
12
  export declare const DEFAULT_TIMEOUT_MS = 60000;
13
13
  export declare const MAX_TIMEOUT_MS = 300000;
14
14
  export declare const MAX_SAFE_TEST_FILES = 50;
15
- export declare const MAX_SAFE_SOURCE_FILES = 1;
16
15
  /**
17
16
  * Estimate the fan-out (number of unique test files) for given source files
18
17
  * by reading the cached impact map without spawning a subprocess.
@@ -35,7 +34,14 @@ export interface TestRunnerArgs {
35
34
  timeout_ms?: number;
36
35
  bail?: boolean;
37
36
  }
38
- export type RegressionOutcome = 'pass' | 'skip' | 'regression' | 'scope_exceeded' | 'error';
37
+ export type RegressionOutcome = 'pass' | 'skip' | 'no_impacted_tests' | 'regression' | 'scope_exceeded' | 'error';
38
+ /** Binding cap decision reported on every discovery-scope test_runner response. */
39
+ export interface CapDecision {
40
+ decision: 'within_cap' | 'cap_exceeded';
41
+ resolved_test_count: number;
42
+ limit: number;
43
+ source_file_count?: number;
44
+ }
39
45
  export interface TestTotals {
40
46
  passed: number;
41
47
  failed: number;
@@ -64,6 +70,12 @@ export interface TestSuccessResult {
64
70
  testCases?: ParsedTestCaseResult[];
65
71
  message?: string;
66
72
  outcome?: RegressionOutcome;
73
+ /** Post-resolution deduplicated test-file set (discovery scopes only). */
74
+ resolved_test_files?: string[];
75
+ /** Binding cap decision — the post-resolution count, never an estimate. */
76
+ cap_decision?: CapDecision;
77
+ /** Non-empty exactly when resolution fell back to a narrower discovery scope. */
78
+ fallback_reason?: string;
67
79
  }
68
80
  export interface TestErrorResult {
69
81
  success: false;
@@ -80,6 +92,9 @@ export interface TestErrorResult {
80
92
  message?: string;
81
93
  outcome?: RegressionOutcome;
82
94
  attempted_scope?: 'graph';
95
+ resolved_test_files?: string[];
96
+ cap_decision?: CapDecision;
97
+ fallback_reason?: string;
83
98
  }
84
99
  export type TestResult = TestSuccessResult | TestErrorResult;
85
100
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.178.1",
3
+ "version": "7.179.0",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,67 +0,0 @@
1
- /**
2
- * PR-review recurrence guardrails (issue #2385).
3
- *
4
- * Exported source scanners implementing the mechanical guardrails the issue
5
- * requires. Each scanner is a PURE function over `{ path, content }` source
6
- * maps; unit tests prove each scanner flags a synthetic violating snippet
7
- * (the guardrail "biting") and then apply it over the real `src/` tree.
8
- *
9
- * 1. `scanObserverTerminalization` — (a) the historical wait-deadline/no-client
10
- * terminalizer may never reappear by name; (b) in
11
- * `src/tools/dispatch-lanes.ts`, durable delegation-transition writes are
12
- * allowed only inside the sanctioned settlement functions.
13
- * 2. `scanParallelCircuitRuleConstruction` — circuit-record construction may
14
- * exist only under `src/pr-review/` (the inline-construction recurrence
15
- * class G-1).
16
- *
17
- * Issue #2385 originally specified a third scanner for transcript-parsing
18
- * locality (the 13 conversion symbols restricted to the legacy adapter),
19
- * but its only test consumer was a synthetic-input bite demo with no
20
- * production caller. The boundary is already enforced structurally
21
- * (the legacy-transcript-adapter is the sole module that owns those symbols,
22
- * and the two retained scanners cover the real recurrence classes). A
23
- * scanner with no caller would create the appearance of a guardrail where
24
- * there is none — per the issue's "no unwired functionality" bar, it was
25
- * removed instead.
26
- */
27
- export interface GuardrailSource {
28
- path: string;
29
- content: string;
30
- }
31
- export interface GuardrailHit {
32
- path: string;
33
- line: number;
34
- rule: string;
35
- excerpt: string;
36
- }
37
- /**
38
- * The historical PR-review wait-deadline terminalizer (issue #2381 deleted
39
- * it). Any reappearance of these names in `src/` is the exact recurrence
40
- * class the issue forbids: a collection wait budget or an unavailable host
41
- * messages client must never write a terminal delegation transition.
42
- */
43
- export declare const FORBIDDEN_OBSERVER_TERMINALIZER_SYMBOLS: readonly string[];
44
- /**
45
- * Enclosing functions in `src/tools/dispatch-lanes.ts` that are allowed to
46
- * write delegation transitions. Every entry is child-evidence-driven
47
- * settlement (typed terminal error, explicit caller cancellation, or the
48
- * age+liveness presumed-stale backstop) — never observer-deadline evidence:
49
- * - `startAsyncLanePrompt`: `running` transition after a successful launch.
50
- * - `appendAsyncLaneLaunchError`: typed `error` for a failed child launch.
51
- * - `collectOnce`: explicit caller `cancelled` transition.
52
- * - `settleCollectedLane`: `completed`/`error` settlement from child evidence.
53
- * - `sweepStaleAsyncLaneRecords`: the presumed-stale `stale` backstop.
54
- * Additions must document their evidence source here.
55
- */
56
- export declare const DELEGATION_WRITE_ALLOWED_FUNCTIONS: ReadonlySet<string>;
57
- /**
58
- * Guardrail 2. (a) flags any forbidden historical-terminalizer symbol;
59
- * (b) for `src/tools/dispatch-lanes.ts`, flags delegation-transition writes
60
- * inside any enclosing function outside the sanctioned allowlist. This
61
- * module itself is exempt from rule (a): it DEFINES the forbidden names
62
- * (the definition site is not a recurrence, same reasoning as the adapter
63
- * allowlist in guardrail 1).
64
- */
65
- export declare function scanObserverTerminalization(sources: readonly GuardrailSource[]): GuardrailHit[];
66
- /** Guardrail 3 (issue #2385 recurrence class G-1). */
67
- export declare function scanParallelCircuitRuleConstruction(sources: readonly GuardrailSource[]): GuardrailHit[];