opencode-swarm 7.140.6 → 7.141.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/.opencode/skills/deep-dive/SKILL.md +7 -6
  2. package/.opencode/skills/running-tests/SKILL.md +7 -0
  3. package/dist/agents/explorer.d.ts +1 -1
  4. package/dist/background/lane-delivery-store.d.ts +43 -0
  5. package/dist/background/lane-output-store.d.ts +6 -0
  6. package/dist/cli/{config-doctor-y5qeh18c.js → config-doctor-xs2p0xy3.js} +2 -2
  7. package/dist/cli/{core-pwd9604e.js → core-znrxk8gw.js} +1 -1
  8. package/dist/cli/{curation-policy-avvb56x2.js → curation-policy-j1fbc3ry.js} +5 -5
  9. package/dist/cli/{curator-q1nchgpg.js → curator-a95x81ek.js} +28 -28
  10. package/dist/cli/{curator-llm-factory-96pnc23w.js → curator-llm-factory-ak7p0scv.js} +28 -28
  11. package/dist/cli/{dispatch-2s23fbcs.js → dispatch-rd10kdk1.js} +1 -1
  12. package/dist/cli/{evidence-summary-service-18142mr3.js → evidence-summary-service-2gk48s5s.js} +9 -9
  13. package/dist/cli/{explorer-e9h66egs.js → explorer-18353rhn.js} +1 -1
  14. package/dist/cli/{gate-evidence-smn2wqft.js → gate-evidence-rt9034ft.js} +4 -4
  15. package/dist/cli/{guardrail-explain-kyd89z8z.js → guardrail-explain-4st3vc3d.js} +29 -29
  16. package/dist/cli/{guardrail-log-cahp1ews.js → guardrail-log-vjexgpfm.js} +3 -3
  17. package/dist/cli/{hive-promoter-vcbcvcsh.js → hive-promoter-g9ad9vad.js} +28 -28
  18. package/dist/cli/{index-z0z9pe7b.js → index-2ygp3pnx.js} +5 -5
  19. package/dist/cli/{index-1p72dtym.js → index-39xs96mk.js} +1 -1
  20. package/dist/cli/{index-tjqzr3jc.js → index-3d13jkzq.js} +2 -2
  21. package/dist/cli/{index-p2ty3eee.js → index-3gfdb0t9.js} +1 -1
  22. package/dist/cli/{index-4s7xgzbm.js → index-44nf5s90.js} +1 -1
  23. package/dist/cli/{index-2778hhh7.js → index-5ykn39wq.js} +2 -2
  24. package/dist/cli/{index-bjqpdr83.js → index-8056f16v.js} +3 -3
  25. package/dist/cli/{index-y9q9f6ms.js → index-8s4vnqts.js} +4 -4
  26. package/dist/cli/{index-epvhf50h.js → index-9d4gck4e.js} +2 -1
  27. package/dist/cli/{index-p8kk34am.js → index-c2hczjhp.js} +1 -1
  28. package/dist/cli/{index-56rqw2hs.js → index-c6m3t5n2.js} +6 -6
  29. package/dist/cli/{index-nakkgkkt.js → index-dx1mdsrj.js} +1294 -934
  30. package/dist/cli/{index-41hkt36g.js → index-ebwznsfy.js} +90 -19
  31. package/dist/cli/{index-c432knmy.js → index-f1hsrgw1.js} +1 -1
  32. package/dist/cli/{index-5qd5vt2d.js → index-g29r600w.js} +30 -30
  33. package/dist/cli/{index-z3s0a44b.js → index-hjf8pjd4.js} +3 -3
  34. package/dist/cli/{index-vh05t3w5.js → index-kq5p3nm3.js} +1 -1
  35. package/dist/cli/{index-h01wb18g.js → index-mr397tze.js} +2 -2
  36. package/dist/cli/{index-s1v0wza5.js → index-nse60anv.js} +1 -1
  37. package/dist/cli/{index-thp186x0.js → index-pkxt2rg2.js} +1 -1
  38. package/dist/cli/{index-t5pytnca.js → index-q4vaar2b.js} +2 -2
  39. package/dist/cli/{index-m9xrdjn0.js → index-qskz8j2z.js} +1 -1
  40. package/dist/cli/{index-92n3d5ky.js → index-ry609ctr.js} +40 -9
  41. package/dist/cli/{index-qy1nq52t.js → index-v250345n.js} +1 -1
  42. package/dist/cli/{index-e58e3v0v.js → index-vnr917xf.js} +3 -3
  43. package/dist/cli/{index-fejfzy2j.js → index-w9613ace.js} +6 -6
  44. package/dist/cli/{index-dtqjxfw9.js → index-wbf8sv70.js} +1 -1
  45. package/dist/cli/{index-v2xrer41.js → index-xmzmeknp.js} +3 -1
  46. package/dist/cli/{index-p04qrwck.js → index-ysapwztd.js} +2 -2
  47. package/dist/cli/{index-zd4qhnr7.js → index-z8yr1yra.js} +1 -1
  48. package/dist/cli/{index-912qz4y0.js → index-zbj3yrrd.js} +1 -1
  49. package/dist/cli/{index-4zxrkk1h.js → index-zqshpey0.js} +3 -3
  50. package/dist/cli/index.js +28 -28
  51. package/dist/cli/{knowledge-escalator-gj58za4g.js → knowledge-escalator-5xg6vmr4.js} +10 -10
  52. package/dist/cli/{knowledge-events-3m5jnnv6.js → knowledge-events-qvzpqt5b.js} +8 -8
  53. package/dist/cli/{knowledge-link-m9p80f4r.js → knowledge-link-x86ebng8.js} +4 -4
  54. package/dist/cli/{knowledge-store-0vy8wbzd.js → knowledge-store-k5td1vqx.js} +5 -5
  55. package/dist/cli/{knowledge-validator-mvcs8wf6.js → knowledge-validator-zz26gk5d.js} +7 -7
  56. package/dist/cli/{pending-delegations-cxx9tezp.js → pending-delegations-7xsagjy5.js} +3 -3
  57. package/dist/cli/{pr-subscriptions-2sfnb599.js → pr-subscriptions-r6cdsa3t.js} +3 -3
  58. package/dist/cli/{runner-mky3vvht.js → runner-nm3baddf.js} +5 -5
  59. package/dist/cli/{scan-cursor-wznc7p7p.js → scan-cursor-nhcpebh5.js} +6 -6
  60. package/dist/cli/{schema-k596bhds.js → schema-6ecb0xhn.js} +1 -1
  61. package/dist/cli/{scope-persistence-0ny5fn07.js → scope-persistence-yet1hvmq.js} +6 -6
  62. package/dist/cli/{skill-generator-vrks0jjj.js → skill-generator-j0mbd2pp.js} +12 -12
  63. package/dist/cli/{telemetry-0x6kszvk.js → telemetry-zex3zv3v.js} +1 -1
  64. package/dist/cli/{worktree-collision-ownership-wm5pse49.js → worktree-collision-ownership-n41qw3n8.js} +3 -3
  65. package/dist/cli/{worktree-isolation-zgk7314k.js → worktree-isolation-445zjngp.js} +28 -28
  66. package/dist/hooks/delegation-gate.d.ts +6 -0
  67. package/dist/hooks/knowledge-application-gate.d.ts +1 -1
  68. package/dist/hooks/knowledge-events.d.ts +5 -2
  69. package/dist/hooks/knowledge-receipt-ledger.d.ts +38 -0
  70. package/dist/hooks/knowledge-receipt-observability.d.ts +24 -1
  71. package/dist/hooks/knowledge-receipt-validator.d.ts +19 -3
  72. package/dist/hooks/knowledge-types.d.ts +9 -0
  73. package/dist/hooks/repo-graph-injection.d.ts +52 -0
  74. package/dist/index.js +224 -213
  75. package/dist/lang/backend.d.ts +8 -1
  76. package/dist/lang/default-backend.d.ts +2 -1
  77. package/dist/tools/create-tool.d.ts +5 -2
  78. package/dist/tools/dispatch-lanes.d.ts +45 -5
  79. package/dist/tools/knowledge-receipt.d.ts +40 -0
  80. package/dist/tools/test-runner.d.ts +14 -5
  81. package/package.json +1 -1
@@ -4,6 +4,23 @@
4
4
  */
5
5
  import { emit } from '../telemetry.js';
6
6
  import type { ReceiptOutcome } from './knowledge-receipt-validator.js';
7
+ /**
8
+ * Semantic version of the outcome/source MEANING contract (issue #2032).
9
+ * 1 = pre-#2032 producer semantics (outcome words meant different things per
10
+ * producer; delegate terminals carried no source). 2 = the #2032 atomic
11
+ * semantics: one typed outcome/source vocabulary, delegate terminals stamped
12
+ * `source: 'delegate'`, `n_a` neutral everywhere, legacy ambiguity `unknown`.
13
+ * Distinct from the journal `RECEIPT_SCHEMA_VERSION` (a hard format gate).
14
+ * Bump this whenever a producer or consumer changes what an outcome or source
15
+ * MEANS, so health/reports consumers can distinguish producer behavior and
16
+ * migration uncertainty.
17
+ */
18
+ export declare const RECEIPT_SEMANTICS_VERSION = 2;
19
+ /**
20
+ * Outcomes observable on a transition. Terminal outcomes plus the trace-level
21
+ * `no_relevant` tombstone that closes an empty retrieval (not a terminal).
22
+ */
23
+ export type ReceiptObservationOutcome = ReceiptOutcome | 'no_relevant';
7
24
  export type KnowledgeReceiptObservedTransition = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'phase_close_intent' | 'phase_closed' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
8
25
  export type KnowledgeReceiptObservationReasonCode = 'committed' | 'idempotent' | 'trace_not_found' | 'id_not_in_trace' | 'wrong_session' | 'wrong_phase' | 'wrong_task' | 'duplicate_conflicting_terminal' | 'event_id_conflict' | 'invalid_outcome' | 'empty_receipt' | 'lock_timeout' | 'store_unavailable' | 'store_corrupt' | 'legacy_unverifiable' | 'unauthorized_transition';
9
26
  export interface KnowledgeReceiptTransitionObservation {
@@ -16,9 +33,15 @@ export interface KnowledgeReceiptTransitionObservation {
16
33
  taskId?: string;
17
34
  phase?: string;
18
35
  /** Domain value only; never projected to the generic observability outcome. */
19
- receiptOutcome?: ReceiptOutcome;
36
+ receiptOutcome?: ReceiptObservationOutcome;
20
37
  /** Bounded domain code only; arbitrary prose is deliberately rejected. */
21
38
  receiptSource?: string;
39
+ /**
40
+ * Outcome/source semantics contract version. Optional so existing ledger
41
+ * observation constructors need no churn; the emitter defaults it to
42
+ * {@link RECEIPT_SEMANTICS_VERSION}.
43
+ */
44
+ receiptSemantics?: number;
22
45
  }
23
46
  /** Emit bounded diagnostics fail-open after an authoritative transition. */
24
47
  export declare function emitKnowledgeReceiptTransition(observation: KnowledgeReceiptTransitionObservation): void;
@@ -7,10 +7,17 @@
7
7
  * diagnostic or promotion projection is written.
8
8
  */
9
9
  import type { KnowledgeEvent, RetrievedEvent } from './knowledge-events.js';
10
- export type ReceiptOutcome = 'applied' | 'ignored' | 'contradicted' | 'violated' | 'n_a' | 'no_relevant';
10
+ import { type ReceiptOutcome } from './knowledge-receipt-ledger.js';
11
+ /**
12
+ * Canonical terminal outcome — single declaration lives in the authoritative
13
+ * ledger (issue #2032). Re-exported here for existing import sites; do NOT
14
+ * redeclare. The trace-level `no_relevant` tombstone is NOT a terminal
15
+ * outcome and never appears on a `ReceiptItem`.
16
+ */
17
+ export type { ReceiptOutcome };
11
18
  export interface ReceiptItem {
12
19
  id: string;
13
- outcome: Exclude<ReceiptOutcome, 'no_relevant'>;
20
+ outcome: ReceiptOutcome;
14
21
  reason?: string;
15
22
  }
16
23
  export interface ReceiptValidationContext {
@@ -20,6 +27,16 @@ export interface ReceiptValidationContext {
20
27
  task_id?: string;
21
28
  phase?: string;
22
29
  agent: string;
30
+ /**
31
+ * Provenance class for the committed terminals (issue #2032): who is
32
+ * reporting, e.g. 'delegate' for the delegate-ack collector or the
33
+ * agent-class value for the knowledge_receipt tool. This is deliberately
34
+ * NOT derived from `agent` — agent identity and source are different
35
+ * facts, and conflating them is how delegate terminals lost their
36
+ * provenance. Type-required, but fail-open at runtime: a falsy value
37
+ * stamps the honest 'unknown' class rather than rejecting the receipt.
38
+ */
39
+ source: string;
23
40
  cohort_id?: string;
24
41
  source_link_id?: string;
25
42
  grace_days?: number;
@@ -58,4 +75,3 @@ export declare const _internals: {
58
75
  isTerminalReceipt: typeof isTerminalReceipt;
59
76
  VALID_OUTCOMES: ReadonlySet<string>;
60
77
  };
61
- export {};
@@ -352,6 +352,15 @@ export interface PromotionEvidenceRecord {
352
352
  retrieval_trace_id: string;
353
353
  /** Terminal receipt outcome. */
354
354
  receipt_outcome: 'applied' | 'violated' | 'contradicted';
355
+ /**
356
+ * Provenance class of the terminal this evidence was derived from
357
+ * (#2032 review F-003). `'delegate'` evidence is a self-report and stays
358
+ * non-independent: the promotion gate only counts evidence whose source is
359
+ * present and not `'delegate'` toward `promotion_min_terminal_applications`.
360
+ * Absent on records written before #2032 — such records fail closed (they
361
+ * do not count as independent).
362
+ */
363
+ receipt_source?: string;
355
364
  /** Id of the ReceiptEvent this evidence was derived from. */
356
365
  receipt_event_id: string;
357
366
  phase?: string;
@@ -17,6 +17,7 @@
17
17
  * complete drift above the configured refresh cap are suppressed;
18
18
  * inconclusive probes remain usable as freshness-unknown, without mutation.
19
19
  */
20
+ import { loadPluginConfigWithMetaAsync } from '../config/loader';
20
21
  import { type FreshnessOptions, probeFreshness, type RepoGraph } from '../tools/repo-graph';
21
22
  export interface RepoGraphInjectionOptions extends FreshnessOptions {
22
23
  enabled?: boolean;
@@ -25,6 +26,9 @@ export interface RepoGraphInjectionOptions extends FreshnessOptions {
25
26
  export declare const _internals: {
26
27
  probeFreshness: typeof probeFreshness;
27
28
  cacheSize: () => number;
29
+ renderLaneOrientationBlock: typeof renderLaneOrientationBlock;
30
+ orientationFreshnessLine: typeof orientationFreshnessLine;
31
+ loadPluginConfigWithMetaAsync: typeof loadPluginConfigWithMetaAsync;
28
32
  };
29
33
  /**
30
34
  * Load the repo graph for `directory`, using a bounded per-directory cache that
@@ -54,3 +58,51 @@ export declare function buildCoderLocalizationBlock(directory: string, targetFil
54
58
  * the per-block context budget.
55
59
  */
56
60
  export declare function buildReviewerBlastRadiusBlock(directory: string, changedFiles: string[], options?: RepoGraphInjectionOptions): Promise<string | null>;
61
+ /**
62
+ * Options for {@link buildLaneOrientationBlock}.
63
+ *
64
+ * `sessionID` scopes the novelty dedupe so two controller sessions never
65
+ * suppress each other's orientation blocks (invariant 8).
66
+ */
67
+ export interface LaneOrientationOptions extends RepoGraphInjectionOptions {
68
+ sessionID?: string;
69
+ }
70
+ /** Test-only: clear the per-session orientation dedupe state. */
71
+ export declare function resetLaneOrientationDedupe(): void;
72
+ interface OrientationAskFile {
73
+ file: string;
74
+ score: number;
75
+ exports: string[];
76
+ }
77
+ /**
78
+ * Pure render for the lane orientation block. Deterministic: a pure function
79
+ * of its arguments — no timestamps, no randomness, no probe timing fields.
80
+ * Exported only through {@link _internals} for tests.
81
+ */
82
+ declare function renderLaneOrientationBlock(askFiles: OrientationAskFile[], hubFiles: string[], freshnessLine: string): string;
83
+ /**
84
+ * Deterministic freshness statement for the orientation block. Only probe
85
+ * state and drift counts feed the text — never elapsedMs, probedFiles, or
86
+ * truncated, which would break the block's determinism contract.
87
+ */
88
+ declare function orientationFreshnessLine(state: string, changedCount: number, removedCount: number): string;
89
+ /**
90
+ * Build a bounded, relevance-gated repo-graph orientation block for a lane
91
+ * dispatch batch (issue #1988 C2/C6). The block is appended to the shared
92
+ * `common_prompt` prefix by the dispatch caller.
93
+ *
94
+ * Gating policy — the block is emitted only when ALL hold:
95
+ * - a usable graph exists (fresh, or drifted within the refresh cap);
96
+ * - the top `ask` hit for the concatenated mission texts clears
97
+ * LANE_ORIENTATION_SCORE_FLOOR;
98
+ * - at least one file pointer is novel for this session (per-session
99
+ * novelty dedupe, bounded FIFO — suppressed repeats emit NOTHING);
100
+ * - the rendered block fits LANE_ORIENTATION_MAX_TOKENS.
101
+ *
102
+ * Determinism contract: a pure function of (graph state, mission texts,
103
+ * empty dedupe state) — the same dispatch replayed from a reset dedupe
104
+ * state produces a byte-identical block. Returns null on every gate
105
+ * failure or error; never throws into the dispatch path.
106
+ */
107
+ export declare function buildLaneOrientationBlock(directory: string, lanePrompts: string[], options?: LaneOrientationOptions): Promise<string | null>;
108
+ export {};