opencode-swarm 7.140.3 → 7.140.4

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 (112) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +1 -1
  2. package/.opencode/skills/ci-failure-batching/SKILL.md +11 -1
  3. package/.opencode/skills/ci-fix-monitor/SKILL.md +6 -4
  4. package/.opencode/skills/discover/SKILL.md +1 -1
  5. package/.opencode/skills/durable-session-state/SKILL.md +82 -0
  6. package/.opencode/skills/engineering-conventions/SKILL.md +1 -1
  7. package/.opencode/skills/issue-ingest/SKILL.md +13 -7
  8. package/.opencode/skills/issue-tracer/SKILL.md +1 -1
  9. package/.opencode/skills/orchestrating-subagents/SKILL.md +113 -0
  10. package/.opencode/skills/parallel-work-check/SKILL.md +1 -1
  11. package/.opencode/skills/swarm-ci-monitor/SKILL.md +5 -3
  12. package/.opencode/skills/swarm-pr-feedback/SKILL.md +30 -4
  13. package/.opencode/skills/writing-tests/SKILL.md +1 -1
  14. package/dist/agents/reviewer-directive-compliance.d.ts +19 -5
  15. package/dist/cli/{config-doctor-fnmfd35x.js → config-doctor-qqe6172n.js} +3 -3
  16. package/dist/cli/{core-p5cyej3r.js → core-52k057mf.js} +2 -2
  17. package/dist/cli/{curation-policy-d52h4g8t.js → curation-policy-9291bdat.js} +5 -7
  18. package/dist/cli/{curator-3zpdqt9r.js → curator-04xqq68e.js} +28 -28
  19. package/dist/cli/{curator-llm-factory-2h0xb62t.js → curator-llm-factory-cfm8fhdw.js} +28 -28
  20. package/dist/cli/{evidence-summary-service-nfdc1ht9.js → evidence-summary-service-em58myd7.js} +8 -8
  21. package/dist/cli/{gate-evidence-46qeyfc1.js → gate-evidence-ezxfkb22.js} +4 -4
  22. package/dist/cli/{guardrail-explain-yktan15c.js → guardrail-explain-pn1bcgfz.js} +29 -29
  23. package/dist/cli/{guardrail-log-82da8y5a.js → guardrail-log-vb5zkegf.js} +4 -4
  24. package/dist/cli/{hive-promoter-af5yaxvt.js → hive-promoter-z09khawt.js} +28 -28
  25. package/dist/cli/index-2rb3x0fk.js +2554 -0
  26. package/dist/cli/{index-hfvxhk4z.js → index-35qep0v7.js} +1 -1
  27. package/dist/cli/{index-h2waehqq.js → index-4hp8nvwb.js} +1 -1
  28. package/dist/cli/{index-8n4c3vec.js → index-7begd9aq.js} +4 -4
  29. package/dist/cli/{index-q1q8b85k.js → index-a1fjhx4w.js} +822 -688
  30. package/dist/cli/{index-xz8f1n1a.js → index-arza4m4j.js} +2 -2
  31. package/dist/cli/{index-ry0hgg3m.js → index-bfhwtdsw.js} +34 -0
  32. package/dist/cli/{index-jfjnn408.js → index-bn17ycxn.js} +1 -1
  33. package/dist/cli/{index-1m1ksyqt.js → index-c5kr20nz.js} +1 -1
  34. package/dist/cli/{index-pj9h75cc.js → index-djbhe0yh.js} +30 -30
  35. package/dist/cli/{index-p9dsb0tw.js → index-dtam929z.js} +2 -19
  36. package/dist/cli/{index-n0pja0qs.js → index-dtyeabmj.js} +2 -2
  37. package/dist/cli/{index-7kdd75se.js → index-hfjvepk2.js} +11 -9
  38. package/dist/cli/{index-j1xmren9.js → index-hfwzxh3j.js} +3 -3
  39. package/dist/cli/{index-n408rw7n.js → index-hxvkfx6t.js} +12 -0
  40. package/dist/cli/{index-brh827g0.js → index-hz0refz4.js} +10 -10
  41. package/dist/cli/{index-gtbmabws.js → index-mpytsq6k.js} +2 -2
  42. package/dist/cli/{index-rs1f1bh0.js → index-mrpfd1jx.js} +1 -1
  43. package/dist/cli/{index-8bnzzv3b.js → index-pp5m7xga.js} +2 -2
  44. package/dist/cli/{index-b9rd29ge.js → index-rrb6cz2f.js} +1 -1
  45. package/dist/cli/{index-adyxbmt5.js → index-ryq97w1x.js} +2 -2
  46. package/dist/cli/{index-95bj4kaw.js → index-s8g7jh1k.js} +2 -2
  47. package/dist/cli/{index-7d5jseea.js → index-tj04dj06.js} +5 -2
  48. package/dist/cli/{index-jvk119ck.js → index-v1an91bq.js} +54 -19
  49. package/dist/cli/{index-898f16j9.js → index-v3x7j9ey.js} +2 -2
  50. package/dist/cli/{index-pg7n141e.js → index-v3xhc7kg.js} +1 -1
  51. package/dist/cli/{index-qksjaxpd.js → index-vrmkg8fm.js} +46 -15
  52. package/dist/cli/{index-yyyk63kk.js → index-w4etfamq.js} +2 -2
  53. package/dist/cli/{index-kbfsp07d.js → index-wk8s1m7b.js} +2 -2
  54. package/dist/cli/{index-wf35ka4z.js → index-ysa38bnr.js} +2 -2
  55. package/dist/cli/index.js +28 -28
  56. package/dist/cli/{knowledge-escalator-7q59skqg.js → knowledge-escalator-gdjnwszd.js} +19 -7
  57. package/dist/cli/{knowledge-events-3nwfdpq7.js → knowledge-events-581x4q7n.js} +18 -5
  58. package/dist/cli/{knowledge-link-q46k9adx.js → knowledge-link-axx45d1h.js} +4 -4
  59. package/dist/cli/{knowledge-store-0d83rhh3.js → knowledge-store-ttg33482.js} +5 -5
  60. package/dist/cli/{knowledge-validator-6mfx91a2.js → knowledge-validator-8kywqt8b.js} +7 -8
  61. package/dist/cli/{pending-delegations-qzrx38y9.js → pending-delegations-btwqsvz4.js} +3 -3
  62. package/dist/cli/{pr-subscriptions-5s59h4dd.js → pr-subscriptions-83y1cdwv.js} +3 -3
  63. package/dist/cli/{runner-y78d7ryb.js → runner-fh3r41nw.js} +5 -5
  64. package/dist/cli/{scan-cursor-rc8q12ss.js → scan-cursor-j8ytdpam.js} +6 -6
  65. package/dist/cli/{schema-n9eaxp3a.js → schema-6xfqtpvn.js} +2 -2
  66. package/dist/cli/{scope-persistence-dr1msqxw.js → scope-persistence-8c72jrgp.js} +4 -4
  67. package/dist/cli/{skill-generator-q7c6vadg.js → skill-generator-n8vm1yhn.js} +18 -9
  68. package/dist/cli/{telemetry-sc57xtb0.js → telemetry-fb44gpba.js} +1 -1
  69. package/dist/cli/{worktree-collision-ownership-7a8e6gr9.js → worktree-collision-ownership-f28r473k.js} +3 -3
  70. package/dist/commands/ci-simulate.d.ts +7 -3
  71. package/dist/commands/close.d.ts +8 -0
  72. package/dist/commands/registry.d.ts +2 -2
  73. package/dist/commands/sdd.d.ts +15 -0
  74. package/dist/config/bundled-skills.d.ts +1 -1
  75. package/dist/config/schema.d.ts +2 -0
  76. package/dist/git/branch.d.ts +1 -1
  77. package/dist/hooks/delegate-ack-collector.d.ts +5 -0
  78. package/dist/hooks/hive-promoter.d.ts +4 -4
  79. package/dist/hooks/issue-trace-reducer.d.ts +7 -1
  80. package/dist/hooks/issue-trace-state.d.ts +18 -0
  81. package/dist/hooks/issue-trace.d.ts +3 -1
  82. package/dist/hooks/knowledge-application-gate.d.ts +8 -3
  83. package/dist/hooks/knowledge-application.d.ts +8 -5
  84. package/dist/hooks/knowledge-escalator.d.ts +9 -5
  85. package/dist/hooks/knowledge-events.d.ts +21 -8
  86. package/dist/hooks/knowledge-injector.d.ts +9 -0
  87. package/dist/hooks/knowledge-receipt-ledger-storage.d.ts +49 -0
  88. package/dist/hooks/knowledge-receipt-ledger.d.ts +305 -0
  89. package/dist/hooks/knowledge-receipt-observability.d.ts +28 -0
  90. package/dist/hooks/knowledge-receipt-validator.d.ts +13 -50
  91. package/dist/hooks/knowledge-store.d.ts +6 -1
  92. package/dist/hooks/knowledge-types.d.ts +12 -0
  93. package/dist/hooks/phase-complete-directive-gate.d.ts +3 -1
  94. package/dist/hooks/phase-directives.d.ts +4 -4
  95. package/dist/hooks/pr-workflow-gate.d.ts +34 -1
  96. package/dist/hooks/promotion-evidence-store.d.ts +14 -8
  97. package/dist/hooks/reviewer-verdict-parser.d.ts +34 -10
  98. package/dist/index.js +550 -531
  99. package/dist/knowledge/curation-policy.d.ts +0 -2
  100. package/dist/observability/catalog.d.ts +5 -3
  101. package/dist/observability/legacy.d.ts +4 -3
  102. package/dist/telemetry.d.ts +1 -1
  103. package/dist/tools/index.d.ts +3 -0
  104. package/dist/tools/manifest.d.ts +3 -0
  105. package/dist/tools/phase-complete.d.ts +9 -0
  106. package/dist/tools/rebind-pr-feedback-head.d.ts +17 -0
  107. package/dist/tools/record-implementation-review.d.ts +19 -0
  108. package/dist/tools/record-recurrence-sweep.d.ts +17 -0
  109. package/dist/tools/run-pr-feedback-stage-a.d.ts +8 -0
  110. package/dist/tools/tool-metadata.d.ts +12 -0
  111. package/package.json +3 -1
  112. package/dist/cli/index-n8jncheh.js +0 -666
@@ -1,4 +1,9 @@
1
1
  // @bun
2
+ import {
3
+ queryHistoricalOutcomes,
4
+ readKnowledgeEvents,
5
+ recordKnowledgeEvent
6
+ } from "./index-2rb3x0fk.js";
2
7
  import {
3
8
  jaccardBigram,
4
9
  readKnowledge,
@@ -6,13 +11,7 @@ import {
6
11
  resolveSwarmKnowledgePath,
7
12
  transactKnowledge,
8
13
  wordBigrams
9
- } from "./index-qksjaxpd.js";
10
- import {
11
- countEntryContradictionsInWindow,
12
- countEntryViolationsInWindow,
13
- readKnowledgeEvents,
14
- recordKnowledgeEvent
15
- } from "./index-n8jncheh.js";
14
+ } from "./index-vrmkg8fm.js";
16
15
  import {
17
16
  init_knowledge_types,
18
17
  isActiveStatus
@@ -30,9 +29,41 @@ var ESCALATION_THRESHOLD = 2;
30
29
  function isFullyEscalated(e) {
31
30
  return e.directive_priority === "critical" && e.enforcement_mode === "enforce";
32
31
  }
32
+ function terminalHistory(membership) {
33
+ const compatible = membership;
34
+ return [
35
+ ...compatible.terminal_history ?? [],
36
+ ...compatible.historical_terminals ?? [],
37
+ ...membership.terminal ? [membership.terminal] : []
38
+ ];
39
+ }
40
+ function countTerminalOutcomesInWindow(memberships, entryIds, outcome, windowDays, now) {
41
+ const cutoff = now.getTime() - windowDays * 24 * 60 * 60 * 1000;
42
+ const upper = now.getTime();
43
+ const seenEvents = new Set;
44
+ let count = 0;
45
+ for (const membership of memberships) {
46
+ if (!entryIds.has(membership.entry_id))
47
+ continue;
48
+ for (const terminal of terminalHistory(membership)) {
49
+ if (terminal.outcome !== outcome || seenEvents.has(terminal.event_id)) {
50
+ continue;
51
+ }
52
+ const timestamp = Date.parse(terminal.committed_at);
53
+ if (!Number.isNaN(timestamp) && timestamp >= cutoff && timestamp <= upper) {
54
+ seenEvents.add(terminal.event_id);
55
+ count += 1;
56
+ }
57
+ }
58
+ }
59
+ return count;
60
+ }
33
61
  async function maybeEscalateOnViolation(directory, entryId, now = new Date) {
34
62
  try {
35
- let count = await countEntryViolationsInWindow(directory, entryId, ESCALATION_WINDOW_DAYS, now);
63
+ const history = await _internals.queryHistoricalOutcomes(directory);
64
+ if (!history.ok)
65
+ return { escalated: false, entryId };
66
+ let count = countTerminalOutcomesInWindow(history.memberships, new Set([entryId]), "violated", ESCALATION_WINDOW_DAYS, now);
36
67
  if (count < ESCALATION_THRESHOLD) {
37
68
  try {
38
69
  const allEntries = [];
@@ -43,18 +74,16 @@ async function maybeEscalateOnViolation(directory, entryId, now = new Date) {
43
74
  }
44
75
  const target = allEntries.find((e) => e.id === entryId);
45
76
  if (target) {
46
- const seen = new Set([entryId]);
77
+ const equivalentIds = new Set([entryId]);
47
78
  const targetBigrams = wordBigrams(target.lesson);
48
79
  for (const e of allEntries) {
49
- if (seen.has(e.id))
80
+ if (equivalentIds.has(e.id))
50
81
  continue;
51
- seen.add(e.id);
52
82
  if (jaccardBigram(targetBigrams, wordBigrams(e.lesson)) >= NEAR_DUPLICATE_THRESHOLD) {
53
- count += await countEntryViolationsInWindow(directory, e.id, ESCALATION_WINDOW_DAYS, now);
54
- if (count >= ESCALATION_THRESHOLD)
55
- break;
83
+ equivalentIds.add(e.id);
56
84
  }
57
85
  }
86
+ count = countTerminalOutcomesInWindow(history.memberships, equivalentIds, "violated", ESCALATION_WINDOW_DAYS, now);
58
87
  }
59
88
  } catch {}
60
89
  }
@@ -173,7 +202,12 @@ async function escalateViolatedEntries(directory, entryIds, now = new Date) {
173
202
  }
174
203
  async function maybeQuarantineOnContradiction(directory, entryId, threshold, windowDays, now = new Date) {
175
204
  try {
176
- const count = await countEntryContradictionsInWindow(directory, entryId, windowDays, now);
205
+ const history = await _internals.queryHistoricalOutcomes(directory, [
206
+ entryId
207
+ ]);
208
+ if (!history.ok)
209
+ return { quarantined: false, entryId };
210
+ const count = countTerminalOutcomesInWindow(history.memberships, new Set([entryId]), "contradicted", windowDays, now);
177
211
  if (count < threshold) {
178
212
  return { quarantined: false, entryId, contradictionsInWindow: count };
179
213
  }
@@ -190,11 +224,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
190
224
  alreadyInactive: true
191
225
  };
192
226
  }
193
- const { quarantineEntry } = await import("./knowledge-validator-6mfx91a2.js");
227
+ const { quarantineEntry } = await import("./knowledge-validator-8kywqt8b.js");
194
228
  let policyConfig;
195
229
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-n9eaxp3a.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-j1xmren9.js");
230
+ const { KnowledgeConfigSchema } = await import("./schema-6xfqtpvn.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-hfwzxh3j.js");
198
232
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
233
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
234
  } catch {
@@ -215,5 +249,6 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
215
249
  return { quarantined: false, entryId };
216
250
  }
217
251
  }
252
+ var _internals = { queryHistoricalOutcomes };
218
253
 
219
- export { ESCALATION_WINDOW_DAYS, ESCALATION_THRESHOLD, maybeEscalateOnViolation, ESCALATION_DISPLAY_WINDOW_DAYS, readRecentEscalations, buildEscalationBriefing, escalateViolatedEntries, maybeQuarantineOnContradiction };
254
+ export { ESCALATION_WINDOW_DAYS, ESCALATION_THRESHOLD, maybeEscalateOnViolation, ESCALATION_DISPLAY_WINDOW_DAYS, readRecentEscalations, buildEscalationBriefing, escalateViolatedEntries, maybeQuarantineOnContradiction, _internals };
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  SWARM_WORKTREE_DIR_NAME,
14
14
  init_constants
15
- } from "./index-n408rw7n.js";
15
+ } from "./index-hxvkfx6t.js";
16
16
  import {
17
17
  __require
18
18
  } from "./index-a76rekgs.js";
@@ -86,7 +86,7 @@ var _internals = {
86
86
  symlinkSync: fs.symlinkSync
87
87
  },
88
88
  writeScopeToDisk: async (directory, taskId, files) => {
89
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-dr1msqxw.js");
89
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-8c72jrgp.js");
90
90
  return realWrite(directory, taskId, files);
91
91
  },
92
92
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-wf35ka4z.js";
5
+ } from "./index-ysa38bnr.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -6,10 +6,10 @@ import {
6
6
  } from "./index-ae75rja9.js";
7
7
  import {
8
8
  resolveKnowledgeStoreDir
9
- } from "./index-rs1f1bh0.js";
9
+ } from "./index-mrpfd1jx.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-h2waehqq.js";
12
+ } from "./index-4hp8nvwb.js";
13
13
  import {
14
14
  readCachedParsedFile
15
15
  } from "./index-ed5ykebp.js";
@@ -32,7 +32,7 @@ import {
32
32
  // src/hooks/knowledge-store.ts
33
33
  var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
34
34
  import { createHash } from "crypto";
35
- import { existsSync } from "fs";
35
+ import { existsSync, realpathSync } from "fs";
36
36
  import { appendFile, mkdir, readFile } from "fs/promises";
37
37
  import * as os from "os";
38
38
  import * as path from "path";
@@ -672,23 +672,27 @@ var CONFIDENCE_FLOOR = 0.1;
672
672
  var CONFIDENCE_CEILING = 1;
673
673
  async function bumpKnowledgeConfidenceBatch(directory, deltas, options) {
674
674
  if (deltas.length === 0)
675
- return;
675
+ return 0;
676
676
  const swarmPath = resolveSwarmKnowledgePath(directory);
677
677
  const hivePath = resolveHiveKnowledgePath2();
678
678
  const touchedSwarm = [];
679
679
  const touchedHive = [];
680
680
  try {
681
- touchedSwarm.push(...await applyConfidenceDeltas(swarmPath, deltas));
681
+ const canonicalDirectory = realpathSync.native(directory);
682
+ const feedbackScope = createHash("sha256").update(process.platform === "win32" ? canonicalDirectory.toLowerCase() : canonicalDirectory).digest("hex").slice(0, 16);
683
+ touchedSwarm.push(...await applyConfidenceDeltas(swarmPath, deltas, feedbackScope));
682
684
  const swarmIds = new Set(touchedSwarm.map((e) => e.id));
683
685
  const hiveOnly = deltas.filter((d) => !swarmIds.has(d.id));
684
686
  if (hiveOnly.length > 0) {
685
- touchedHive.push(...await applyConfidenceDeltas(hivePath, hiveOnly));
687
+ touchedHive.push(...await applyConfidenceDeltas(hivePath, hiveOnly, feedbackScope));
686
688
  }
687
689
  await applyConfidenceFloorAction(directory, [...touchedSwarm, ...touchedHive], options).catch((err) => {
688
690
  log("[knowledge-store] confidence-floor action sweep failed (best-effort):", err instanceof Error ? err.message : String(err));
689
691
  });
692
+ return touchedSwarm.length + touchedHive.length;
690
693
  } catch (err) {
691
694
  log("[knowledge-store] bumpKnowledgeConfidenceBatch failed (fail-open):", err instanceof Error ? err.message : String(err));
695
+ return 0;
692
696
  }
693
697
  }
694
698
  async function applyConfidenceFloorAction(directory, touched, options) {
@@ -702,8 +706,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
702
706
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
703
707
  if (atFloor.length === 0 && recovered.length === 0)
704
708
  return;
705
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-3nwfdpq7.js");
706
- const rollups = await readKnowledgeCounterRollups(directory);
709
+ const {
710
+ readAuthoritativeKnowledgeCounterRollups,
711
+ effectiveRetrievalOutcomes
712
+ } = await import("./knowledge-events-581x4q7n.js");
713
+ const rollups = await readAuthoritativeKnowledgeCounterRollups(directory);
707
714
  const flagIds = new Set;
708
715
  for (const e of atFloor) {
709
716
  const outcomes = effectiveRetrievalOutcomes(e.retrieval_outcomes, rollups?.get(e.id));
@@ -769,11 +776,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
769
776
  });
770
777
  }
771
778
  if (action === "quarantine" && toQuarantine.length > 0) {
772
- const { quarantineEntry } = await import("./knowledge-validator-6mfx91a2.js");
773
- const { KnowledgeConfigSchema } = await import("./schema-n9eaxp3a.js");
779
+ const { quarantineEntry } = await import("./knowledge-validator-8kywqt8b.js");
780
+ const { KnowledgeConfigSchema } = await import("./schema-6xfqtpvn.js");
774
781
  let config;
775
782
  try {
776
- const { loadPluginConfigWithMeta } = await import("./index-j1xmren9.js");
783
+ const { loadPluginConfigWithMeta } = await import("./index-hfwzxh3j.js");
777
784
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
778
785
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
779
786
  } catch {
@@ -795,11 +802,17 @@ async function applyConfidenceFloorAction(directory, touched, options) {
795
802
  }
796
803
  }
797
804
  }
798
- async function applyConfidenceDeltas(filePath, deltas) {
805
+ async function applyConfidenceDeltas(filePath, deltas, feedbackScope) {
799
806
  const idDeltaMap = new Map;
800
807
  for (const d of deltas) {
801
808
  const existing = idDeltaMap.get(d.id);
802
- idDeltaMap.set(d.id, existing !== undefined ? existing + d.delta : d.delta);
809
+ idDeltaMap.set(d.id, {
810
+ delta: (existing?.delta ?? 0) + d.delta,
811
+ receipt_events: [
812
+ ...existing?.receipt_events ?? [],
813
+ ...d.receipt_events ?? []
814
+ ]
815
+ });
803
816
  }
804
817
  const touched = [];
805
818
  let release = null;
@@ -816,9 +829,27 @@ async function applyConfidenceDeltas(filePath, deltas) {
816
829
  const now = new Date().toISOString();
817
830
  let mutated = false;
818
831
  for (const entry of entries) {
819
- const delta = idDeltaMap.get(entry.id);
820
- if (delta === undefined)
832
+ const pending = idDeltaMap.get(entry.id);
833
+ if (!pending)
821
834
  continue;
835
+ let delta = pending.delta;
836
+ if (pending.receipt_events.length > 0) {
837
+ const cursor = entry.receipt_feedback_cursors?.[feedbackScope];
838
+ const afterCursor = pending.receipt_events.filter((event) => !cursor || event.timestamp > cursor.timestamp || event.timestamp === cursor.timestamp && event.event_id > cursor.event_id).sort((a, b) => a.timestamp === b.timestamp ? a.event_id.localeCompare(b.event_id) : a.timestamp.localeCompare(b.timestamp));
839
+ if (afterCursor.length === 0)
840
+ continue;
841
+ const positives = afterCursor.filter((event) => event.outcome === "applied").length;
842
+ const negatives = afterCursor.length - positives;
843
+ delta = positives > negatives ? 0.03 : -0.05;
844
+ const last = afterCursor[afterCursor.length - 1];
845
+ entry.receipt_feedback_cursors = {
846
+ ...entry.receipt_feedback_cursors ?? {},
847
+ [feedbackScope]: {
848
+ timestamp: last.timestamp,
849
+ event_id: last.event_id
850
+ }
851
+ };
852
+ }
822
853
  entry.confidence = Math.max(CONFIDENCE_FLOOR, Math.min(CONFIDENCE_CEILING, entry.confidence + delta));
823
854
  entry.updated_at = now;
824
855
  mutated = true;
@@ -9,11 +9,11 @@ import {
9
9
  } from "./index-y8552snf.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-h2waehqq.js";
12
+ } from "./index-4hp8nvwb.js";
13
13
  import {
14
14
  assertProjectRoot,
15
15
  withEvidenceLock
16
- } from "./index-hfvxhk4z.js";
16
+ } from "./index-35qep0v7.js";
17
17
  import {
18
18
  exports_external,
19
19
  init_zod
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  assertProjectRoot,
4
4
  withEvidenceLock
5
- } from "./index-hfvxhk4z.js";
5
+ } from "./index-35qep0v7.js";
6
6
  import {
7
7
  ExecutionProfileSchema,
8
8
  PlanSchema,
@@ -15,7 +15,7 @@ import {
15
15
  } from "./index-zgwm4ryv.js";
16
16
  import {
17
17
  emit
18
- } from "./index-ry0hgg3m.js";
18
+ } from "./index-bfhwtdsw.js";
19
19
 
20
20
  // src/plan/utils.ts
21
21
  import { createHash } from "crypto";
@@ -15,10 +15,10 @@ import {
15
15
  import {
16
16
  init_schema,
17
17
  stripKnownSwarmPrefix
18
- } from "./index-7d5jseea.js";
18
+ } from "./index-tj04dj06.js";
19
19
  import {
20
20
  init_constants
21
- } from "./index-n408rw7n.js";
21
+ } from "./index-hxvkfx6t.js";
22
22
  import {
23
23
  __commonJS,
24
24
  __toESM
package/dist/cli/index.js CHANGED
@@ -6,49 +6,49 @@ import {
6
6
  getPluginConfigDir,
7
7
  getPluginLockFilePaths,
8
8
  resolveCommand
9
- } from "./index-q1q8b85k.js";
9
+ } from "./index-a1fjhx4w.js";
10
10
  import"./index-41hkt36g.js";
11
- import"./index-1m1ksyqt.js";
12
- import"./index-wf35ka4z.js";
13
- import"./index-xz8f1n1a.js";
14
- import"./index-brh827g0.js";
15
- import"./index-yyyk63kk.js";
11
+ import"./index-c5kr20nz.js";
12
+ import"./index-ysa38bnr.js";
13
+ import"./index-arza4m4j.js";
14
+ import"./index-hz0refz4.js";
15
+ import"./index-w4etfamq.js";
16
16
  import"./index-y8552snf.js";
17
17
  import"./index-4905hd2m.js";
18
18
  import"./index-134d35c1.js";
19
- import"./index-7kdd75se.js";
20
- import"./index-jvk119ck.js";
21
- import"./index-gtbmabws.js";
19
+ import"./index-hfjvepk2.js";
20
+ import"./index-v1an91bq.js";
21
+ import"./index-mpytsq6k.js";
22
22
  import"./index-v2xrer41.js";
23
23
  import"./index-c8s9a3zh.js";
24
24
  import"./index-9ss2m4rs.js";
25
- import"./index-jfjnn408.js";
26
- import"./index-adyxbmt5.js";
25
+ import"./index-bn17ycxn.js";
26
+ import"./index-ryq97w1x.js";
27
27
  import"./index-556ja8an.js";
28
- import"./index-kbfsp07d.js";
28
+ import"./index-wk8s1m7b.js";
29
29
  import"./index-1kyex7z2.js";
30
30
  import"./index-b8zgtz81.js";
31
- import"./index-898f16j9.js";
32
- import"./index-b9rd29ge.js";
33
- import"./index-k46me75h.js";
34
- import"./index-ee3x66a5.js";
31
+ import"./index-v3x7j9ey.js";
32
+ import"./index-rrb6cz2f.js";
35
33
  import"./index-74hpm6sh.js";
36
- import"./index-n0pja0qs.js";
34
+ import"./index-dtyeabmj.js";
37
35
  import"./index-8fwhhayc.js";
38
36
  import"./index-q1exe2b3.js";
39
- import"./index-8n4c3vec.js";
40
- import"./index-p9dsb0tw.js";
37
+ import"./index-2rb3x0fk.js";
38
+ import"./index-k46me75h.js";
39
+ import"./index-ee3x66a5.js";
40
+ import"./index-7begd9aq.js";
41
+ import"./index-dtam929z.js";
41
42
  import"./index-rtry5xyf.js";
42
- import"./index-qksjaxpd.js";
43
- import"./index-n8jncheh.js";
43
+ import"./index-vrmkg8fm.js";
44
44
  import"./index-ae75rja9.js";
45
- import"./index-rs1f1bh0.js";
46
- import"./index-h2waehqq.js";
45
+ import"./index-mrpfd1jx.js";
46
+ import"./index-4hp8nvwb.js";
47
47
  import"./index-ed5ykebp.js";
48
- import"./index-hfvxhk4z.js";
48
+ import"./index-35qep0v7.js";
49
49
  import"./index-7g4c7s5r.js";
50
50
  import"./index-4nt52yr9.js";
51
- import"./index-8bnzzv3b.js";
51
+ import"./index-pp5m7xga.js";
52
52
  import"./index-gprxjmm7.js";
53
53
  import"./index-n832052r.js";
54
54
  import"./index-d181x9zr.js";
@@ -57,14 +57,14 @@ import"./index-zgwm4ryv.js";
57
57
  import {
58
58
  init_package,
59
59
  package_default
60
- } from "./index-7d5jseea.js";
60
+ } from "./index-tj04dj06.js";
61
61
  import {
62
62
  DEFAULT_AGENT_CONFIGS,
63
63
  init_constants
64
- } from "./index-n408rw7n.js";
64
+ } from "./index-hxvkfx6t.js";
65
65
  import"./index-zjygnfay.js";
66
66
  import"./index-bk5tah7q.js";
67
- import"./index-ry0hgg3m.js";
67
+ import"./index-bfhwtdsw.js";
68
68
  import"./index-bpmtbmy9.js";
69
69
  import"./index-a76rekgs.js";
70
70
 
@@ -3,24 +3,35 @@ import {
3
3
  ESCALATION_DISPLAY_WINDOW_DAYS,
4
4
  ESCALATION_THRESHOLD,
5
5
  ESCALATION_WINDOW_DAYS,
6
+ _internals,
6
7
  buildEscalationBriefing,
7
8
  escalateViolatedEntries,
8
9
  maybeEscalateOnViolation,
9
10
  maybeQuarantineOnContradiction,
10
11
  readRecentEscalations
11
- } from "./index-jvk119ck.js";
12
- import"./index-qksjaxpd.js";
13
- import"./index-n8jncheh.js";
12
+ } from "./index-v1an91bq.js";
13
+ import"./index-2rb3x0fk.js";
14
+ import"./index-k46me75h.js";
15
+ import"./index-ee3x66a5.js";
16
+ import"./index-vrmkg8fm.js";
14
17
  import"./index-ae75rja9.js";
15
- import"./index-rs1f1bh0.js";
16
- import"./index-h2waehqq.js";
18
+ import"./index-mrpfd1jx.js";
19
+ import"./index-4hp8nvwb.js";
17
20
  import"./index-ed5ykebp.js";
18
- import"./index-hfvxhk4z.js";
21
+ import"./index-35qep0v7.js";
19
22
  import"./index-7g4c7s5r.js";
20
23
  import"./index-4nt52yr9.js";
24
+ import"./index-pp5m7xga.js";
25
+ import"./index-gprxjmm7.js";
26
+ import"./index-n832052r.js";
27
+ import"./index-d181x9zr.js";
28
+ import"./index-4rhhvd1a.js";
21
29
  import"./index-zgwm4ryv.js";
30
+ import"./index-tj04dj06.js";
31
+ import"./index-hxvkfx6t.js";
32
+ import"./index-zjygnfay.js";
22
33
  import"./index-bk5tah7q.js";
23
- import"./index-ry0hgg3m.js";
34
+ import"./index-bfhwtdsw.js";
24
35
  import"./index-bpmtbmy9.js";
25
36
  import"./index-a76rekgs.js";
26
37
  export {
@@ -29,6 +40,7 @@ export {
29
40
  maybeEscalateOnViolation,
30
41
  escalateViolatedEntries,
31
42
  buildEscalationBriefing,
43
+ _internals,
32
44
  ESCALATION_WINDOW_DAYS,
33
45
  ESCALATION_THRESHOLD,
34
46
  ESCALATION_DISPLAY_WINDOW_DAYS
@@ -16,6 +16,7 @@ import {
16
16
  effectiveRetrievalOutcomes,
17
17
  newEventId,
18
18
  newTraceId,
19
+ readAuthoritativeKnowledgeCounterRollups,
19
20
  readHiveKnowledgeEvents,
20
21
  readKnowledgeCounterRollups,
21
22
  readKnowledgeEvents,
@@ -28,16 +29,27 @@ import {
28
29
  resolveKnowledgeCounterBaselinePath,
29
30
  resolveKnowledgeEventsPath,
30
31
  resolveLegacyApplicationLogPath
31
- } from "./index-n8jncheh.js";
32
+ } from "./index-2rb3x0fk.js";
33
+ import"./index-k46me75h.js";
34
+ import"./index-ee3x66a5.js";
32
35
  import"./index-ae75rja9.js";
33
- import"./index-rs1f1bh0.js";
34
- import"./index-h2waehqq.js";
36
+ import"./index-mrpfd1jx.js";
37
+ import"./index-4hp8nvwb.js";
35
38
  import"./index-ed5ykebp.js";
36
- import"./index-hfvxhk4z.js";
39
+ import"./index-35qep0v7.js";
37
40
  import"./index-7g4c7s5r.js";
38
41
  import"./index-4nt52yr9.js";
42
+ import"./index-pp5m7xga.js";
43
+ import"./index-gprxjmm7.js";
44
+ import"./index-n832052r.js";
45
+ import"./index-d181x9zr.js";
46
+ import"./index-4rhhvd1a.js";
39
47
  import"./index-zgwm4ryv.js";
40
- import"./index-ry0hgg3m.js";
48
+ import"./index-tj04dj06.js";
49
+ import"./index-hxvkfx6t.js";
50
+ import"./index-zjygnfay.js";
51
+ import"./index-bk5tah7q.js";
52
+ import"./index-bfhwtdsw.js";
41
53
  import"./index-bpmtbmy9.js";
42
54
  import"./index-a76rekgs.js";
43
55
  export {
@@ -53,6 +65,7 @@ export {
53
65
  readKnowledgeEvents,
54
66
  readKnowledgeCounterRollups,
55
67
  readHiveKnowledgeEvents,
68
+ readAuthoritativeKnowledgeCounterRollups,
56
69
  newTraceId,
57
70
  newEventId,
58
71
  effectiveRetrievalOutcomes,
@@ -12,14 +12,14 @@ import {
12
12
  resolveLinkDir,
13
13
  sanitizeLinkId,
14
14
  writeLinkPointer
15
- } from "./index-rs1f1bh0.js";
16
- import"./index-h2waehqq.js";
15
+ } from "./index-mrpfd1jx.js";
16
+ import"./index-4hp8nvwb.js";
17
17
  import"./index-ed5ykebp.js";
18
- import"./index-hfvxhk4z.js";
18
+ import"./index-35qep0v7.js";
19
19
  import"./index-7g4c7s5r.js";
20
20
  import"./index-4nt52yr9.js";
21
21
  import"./index-zgwm4ryv.js";
22
- import"./index-ry0hgg3m.js";
22
+ import"./index-bfhwtdsw.js";
23
23
  import"./index-bpmtbmy9.js";
24
24
  import"./index-a76rekgs.js";
25
25
  export {
@@ -41,19 +41,19 @@ import {
41
41
  transactKnowledge,
42
42
  transactKnowledgeWithCas,
43
43
  wordBigrams
44
- } from "./index-qksjaxpd.js";
44
+ } from "./index-vrmkg8fm.js";
45
45
  import {
46
46
  resolveHiveDataDir
47
47
  } from "./index-ae75rja9.js";
48
- import"./index-rs1f1bh0.js";
49
- import"./index-h2waehqq.js";
48
+ import"./index-mrpfd1jx.js";
49
+ import"./index-4hp8nvwb.js";
50
50
  import"./index-ed5ykebp.js";
51
- import"./index-hfvxhk4z.js";
51
+ import"./index-35qep0v7.js";
52
52
  import"./index-7g4c7s5r.js";
53
53
  import"./index-4nt52yr9.js";
54
54
  import"./index-zgwm4ryv.js";
55
55
  import"./index-bk5tah7q.js";
56
- import"./index-ry0hgg3m.js";
56
+ import"./index-bfhwtdsw.js";
57
57
  import"./index-bpmtbmy9.js";
58
58
  import"./index-a76rekgs.js";
59
59
  export {
@@ -23,21 +23,20 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-8n4c3vec.js";
27
- import"./index-p9dsb0tw.js";
26
+ } from "./index-7begd9aq.js";
27
+ import"./index-dtam929z.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-qksjaxpd.js";
30
- import"./index-n8jncheh.js";
29
+ import"./index-vrmkg8fm.js";
31
30
  import"./index-ae75rja9.js";
32
- import"./index-rs1f1bh0.js";
33
- import"./index-h2waehqq.js";
31
+ import"./index-mrpfd1jx.js";
32
+ import"./index-4hp8nvwb.js";
34
33
  import"./index-ed5ykebp.js";
35
- import"./index-hfvxhk4z.js";
34
+ import"./index-35qep0v7.js";
36
35
  import"./index-7g4c7s5r.js";
37
36
  import"./index-4nt52yr9.js";
38
37
  import"./index-zgwm4ryv.js";
39
38
  import"./index-bk5tah7q.js";
40
- import"./index-ry0hgg3m.js";
39
+ import"./index-bfhwtdsw.js";
41
40
  import"./index-bpmtbmy9.js";
42
41
  import"./index-a76rekgs.js";
43
42
  export {
@@ -41,16 +41,16 @@ import {
41
41
  sweepStaleDelegations,
42
42
  updateCoderSettlement,
43
43
  writeDelegationFallback
44
- } from "./index-b9rd29ge.js";
44
+ } from "./index-rrb6cz2f.js";
45
45
  import"./index-k46me75h.js";
46
46
  import"./index-ee3x66a5.js";
47
47
  import"./index-ed5ykebp.js";
48
- import"./index-hfvxhk4z.js";
48
+ import"./index-35qep0v7.js";
49
49
  import"./index-7g4c7s5r.js";
50
50
  import"./index-4nt52yr9.js";
51
51
  import"./index-zgwm4ryv.js";
52
52
  import"./index-zjygnfay.js";
53
- import"./index-ry0hgg3m.js";
53
+ import"./index-bfhwtdsw.js";
54
54
  import"./index-bpmtbmy9.js";
55
55
  import"./index-a76rekgs.js";
56
56
  export {
@@ -9,16 +9,16 @@ import {
9
9
  sweepStale,
10
10
  unsubscribe,
11
11
  updateSnapshot
12
- } from "./index-jfjnn408.js";
12
+ } from "./index-bn17ycxn.js";
13
13
  import"./index-k46me75h.js";
14
14
  import"./index-ee3x66a5.js";
15
15
  import"./index-ed5ykebp.js";
16
- import"./index-hfvxhk4z.js";
16
+ import"./index-35qep0v7.js";
17
17
  import"./index-7g4c7s5r.js";
18
18
  import"./index-4nt52yr9.js";
19
19
  import"./index-zgwm4ryv.js";
20
20
  import"./index-zjygnfay.js";
21
- import"./index-ry0hgg3m.js";
21
+ import"./index-bfhwtdsw.js";
22
22
  import"./index-bpmtbmy9.js";
23
23
  import"./index-a76rekgs.js";
24
24
  export {
@@ -3,16 +3,16 @@ import {
3
3
  _internals,
4
4
  createModelEvaluationExecutor,
5
5
  runEvaluation
6
- } from "./index-1m1ksyqt.js";
7
- import"./index-yyyk63kk.js";
6
+ } from "./index-c5kr20nz.js";
7
+ import"./index-w4etfamq.js";
8
8
  import"./index-y8552snf.js";
9
- import"./index-h2waehqq.js";
9
+ import"./index-4hp8nvwb.js";
10
10
  import"./index-ed5ykebp.js";
11
- import"./index-hfvxhk4z.js";
11
+ import"./index-35qep0v7.js";
12
12
  import"./index-7g4c7s5r.js";
13
13
  import"./index-4nt52yr9.js";
14
14
  import"./index-zgwm4ryv.js";
15
- import"./index-ry0hgg3m.js";
15
+ import"./index-bfhwtdsw.js";
16
16
  import"./index-bpmtbmy9.js";
17
17
  import"./index-a76rekgs.js";
18
18
  export {