@inerrata-corporation/errata 2.0.0-dev.52 → 2.0.0-dev.54

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.
@@ -133,7 +133,14 @@ var init_castalia = __esm({
133
133
  "REVEALED_BY",
134
134
  "DOCUMENTED_BY",
135
135
  "EXPLAINS",
136
- "REFERENCES"
136
+ "REFERENCES",
137
+ // Agent authorship of contributed KNOWLEDGE (Agent → Problem/Solution/RootCause/…).
138
+ // The v2-native analog of the forum-shaped AUTHORED_ARTIFACT (Agent → Artifact) /
139
+ // WROTE (Agent → Answer): every /v2/ingest write folds the contributing agent in,
140
+ // so knowledge is attributable and co-contributors accrue as distinct edges
141
+ // (multi-agent corroboration is traversable). `authorAgentId` on the node names
142
+ // the originator; the edges name everyone who contributed.
143
+ "CONTRIBUTED"
137
144
  ];
138
145
  CODE_EDGES = [
139
146
  "DEFINES",
@@ -220,6 +227,8 @@ var init_castalia = __esm({
220
227
  PRODUCED: 0.6,
221
228
  MANIFESTED_IN: 0.6,
222
229
  REVEALED_BY: 0.6,
230
+ CONTRIBUTED: 0.2,
231
+ // agent attribution (Agent → knowledge) — provenance, not signal-flow
223
232
  // Structural
224
233
  PROVIDED_BY: 0.4,
225
234
  SUPPORTS: 0.4,
package/errata.mjs CHANGED
@@ -183,7 +183,14 @@ var init_castalia = __esm({
183
183
  "REVEALED_BY",
184
184
  "DOCUMENTED_BY",
185
185
  "EXPLAINS",
186
- "REFERENCES"
186
+ "REFERENCES",
187
+ // Agent authorship of contributed KNOWLEDGE (Agent → Problem/Solution/RootCause/…).
188
+ // The v2-native analog of the forum-shaped AUTHORED_ARTIFACT (Agent → Artifact) /
189
+ // WROTE (Agent → Answer): every /v2/ingest write folds the contributing agent in,
190
+ // so knowledge is attributable and co-contributors accrue as distinct edges
191
+ // (multi-agent corroboration is traversable). `authorAgentId` on the node names
192
+ // the originator; the edges name everyone who contributed.
193
+ "CONTRIBUTED"
187
194
  ];
188
195
  CODE_EDGES = [
189
196
  "DEFINES",
@@ -264,8 +271,10 @@ var init_castalia = __esm({
264
271
  // git topology, not signal-flow
265
272
  "PARENT",
266
273
  // git topology, not signal-flow
267
- "AUTHORED_BY"
274
+ "AUTHORED_BY",
268
275
  // git authorship, not signal-flow
276
+ "CONTRIBUTED"
277
+ // agent attribution (Agent → knowledge), not signal-flow
269
278
  ]);
270
279
  EDGE_WEIGHT = {
271
280
  // Causal — high signal
@@ -301,6 +310,8 @@ var init_castalia = __esm({
301
310
  PRODUCED: 0.6,
302
311
  MANIFESTED_IN: 0.6,
303
312
  REVEALED_BY: 0.6,
313
+ CONTRIBUTED: 0.2,
314
+ // agent attribution (Agent → knowledge) — provenance, not signal-flow
304
315
  // Structural
305
316
  PROVIDED_BY: 0.4,
306
317
  SUPPORTS: 0.4,
@@ -24531,7 +24542,7 @@ var init_generalize_graph = __esm({
24531
24542
 
24532
24543
  // src/dual-burst.ts
24533
24544
  function collectiveScore(hit, cap) {
24534
- if (hit.cloudScore != null) return Math.min(cap, Math.max(0, hit.cloudScore));
24545
+ if (hit.cloudScore != null) return cap * Math.max(0, Math.min(1, hit.cloudScore));
24535
24546
  const u = hit.usageCount ?? 0;
24536
24547
  return Math.min(cap, Math.log10(u + 1) / 3);
24537
24548
  }
@@ -24602,20 +24613,26 @@ function dedupCloudHits(hits) {
24602
24613
  }
24603
24614
  function searchResultToCloudHits(result) {
24604
24615
  const n = result.nodes.length;
24616
+ const scores = result.nodes.map((nd) => typeof nd.attrs?.["score"] === "number" ? nd.attrs["score"] : NaN);
24617
+ const maxScore = Math.max(0, ...scores.filter((s) => !Number.isNaN(s)));
24605
24618
  return result.nodes.map((node2, i2) => {
24606
24619
  const usage = node2.attrs?.["usageCount"];
24620
+ const s = scores[i2];
24621
+ const cloudScore = !Number.isNaN(s) && maxScore > 0 ? s / maxScore : n > 0 ? (n - i2) / n : 0;
24607
24622
  return {
24608
24623
  id: node2.id,
24609
24624
  label: node2.label,
24610
24625
  description: node2.description,
24611
- cloudScore: n > 0 ? (n - i2) / n : 0,
24626
+ cloudScore,
24612
24627
  ...typeof usage === "number" ? { usageCount: usage } : {}
24613
24628
  };
24614
24629
  });
24615
24630
  }
24631
+ var DUAL_BURST_SEMANTIC_NEUTRAL;
24616
24632
  var init_dual_burst = __esm({
24617
24633
  "src/dual-burst.ts"() {
24618
24634
  "use strict";
24635
+ DUAL_BURST_SEMANTIC_NEUTRAL = 0.3;
24619
24636
  }
24620
24637
  });
24621
24638
 
@@ -24710,7 +24727,7 @@ import { homedir as homedir2 } from "node:os";
24710
24727
  import { dirname as dirname3, join as join4 } from "node:path";
24711
24728
  import { createRequire } from "node:module";
24712
24729
  function semanticFloorFor(version2) {
24713
- if (version2 === EMBEDDING_VERSION) return 0.25;
24730
+ if (version2 === EMBEDDING_VERSION || version2 === MODEL_EMBEDDING_VERSION) return 0.25;
24714
24731
  return 0.5;
24715
24732
  }
24716
24733
  function noteHashFallback() {
@@ -26254,6 +26271,30 @@ function embedCodeNodes(store, opts = {}) {
26254
26271
  function embedSemanticNodes(store, opts = {}) {
26255
26272
  return embedNodesByLabels(store, SEMANTIC_LABELS, opts);
26256
26273
  }
26274
+ async function ensureNodeEmbedded(store, nodeId, opts = {}) {
26275
+ const node2 = store.getNode(nodeId);
26276
+ if (!node2 || node2.embedding.length > 0) return false;
26277
+ const text = buildText(store, node2);
26278
+ if (!text) return false;
26279
+ let result;
26280
+ try {
26281
+ if (opts.mode === "hash") {
26282
+ const v = embed(text);
26283
+ result = { vector: v, version: EMBEDDING_VERSION, dim: v.length };
26284
+ } else {
26285
+ const r = (await embedBatchWithModelOrHash([text]))[0];
26286
+ if (!r) return false;
26287
+ result = r;
26288
+ }
26289
+ } catch {
26290
+ return false;
26291
+ }
26292
+ store.updateNode(nodeId, {
26293
+ embedding: result.vector,
26294
+ attrs: { ...node2.attrs, embeddingVersion: result.version }
26295
+ });
26296
+ return true;
26297
+ }
26257
26298
  async function embedNodesByLabels(store, labels, opts = {}) {
26258
26299
  const started2 = Date.now();
26259
26300
  const report = {
@@ -26460,6 +26501,7 @@ __export(src_exports4, {
26460
26501
  commandSignature: () => commandSignature,
26461
26502
  embedCodeNodes: () => embedCodeNodes,
26462
26503
  embedSemanticNodes: () => embedSemanticNodes,
26504
+ ensureNodeEmbedded: () => ensureNodeEmbedded,
26463
26505
  evaluateForReview: () => evaluateForReview,
26464
26506
  extractDiagnostics: () => extractDiagnostics,
26465
26507
  extractErrorSignature: () => extractErrorSignature,
@@ -35733,6 +35775,7 @@ var init_mcp = __esm({
35733
35775
  init_src4();
35734
35776
  init_src2();
35735
35777
  init_src10();
35778
+ init_dual_burst();
35736
35779
  init_paths();
35737
35780
  init_symbol_summaries();
35738
35781
  init_webui();
@@ -35960,7 +36003,15 @@ var init_mcp = __esm({
35960
36003
  }
35961
36004
  return unresolved(args2);
35962
36005
  }
36006
+ const seedForBurst = store.getNode(id);
36007
+ if (seedForBurst && seedForBurst.embedding.length === 0) {
36008
+ await ensureNodeEmbedded(store, id);
36009
+ }
35963
36010
  const ranked = localBurst(store, id, {
36011
+ // Hold an embeddingless candidate's neutral semantic under the dual-burst
36012
+ // cloud cap so unknown local code can't outrank the capped collective (see
36013
+ // DUAL_BURST_SEMANTIC_NEUTRAL). No-op for local-only bursts.
36014
+ weights: { semanticNeutral: DUAL_BURST_SEMANTIC_NEUTRAL },
35964
36015
  ...args2["maxHops"] != null ? { maxHops: Number(args2["maxHops"]) } : {},
35965
36016
  ...args2["limit"] != null ? { limit: Number(args2["limit"]) } : {}
35966
36017
  });
@@ -42759,7 +42810,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
42759
42810
  }
42760
42811
 
42761
42812
  // src/engine.ts
42762
- var DAEMON_VERSION = true ? "2.0.0-dev.52" : "2.0.0-alpha.0";
42813
+ var DAEMON_VERSION = true ? "2.0.0-dev.54" : "2.0.0-alpha.0";
42763
42814
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
42764
42815
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
42765
42816
  var GIT_OP_MUTE_MS = 4e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.52",
3
+ "version": "2.0.0-dev.54",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -144,7 +144,14 @@ var init_castalia = __esm({
144
144
  "REVEALED_BY",
145
145
  "DOCUMENTED_BY",
146
146
  "EXPLAINS",
147
- "REFERENCES"
147
+ "REFERENCES",
148
+ // Agent authorship of contributed KNOWLEDGE (Agent → Problem/Solution/RootCause/…).
149
+ // The v2-native analog of the forum-shaped AUTHORED_ARTIFACT (Agent → Artifact) /
150
+ // WROTE (Agent → Answer): every /v2/ingest write folds the contributing agent in,
151
+ // so knowledge is attributable and co-contributors accrue as distinct edges
152
+ // (multi-agent corroboration is traversable). `authorAgentId` on the node names
153
+ // the originator; the edges name everyone who contributed.
154
+ "CONTRIBUTED"
148
155
  ];
149
156
  CODE_EDGES = [
150
157
  "DEFINES",
@@ -225,8 +232,10 @@ var init_castalia = __esm({
225
232
  // git topology, not signal-flow
226
233
  "PARENT",
227
234
  // git topology, not signal-flow
228
- "AUTHORED_BY"
235
+ "AUTHORED_BY",
229
236
  // git authorship, not signal-flow
237
+ "CONTRIBUTED"
238
+ // agent attribution (Agent → knowledge), not signal-flow
230
239
  ]);
231
240
  EDGE_WEIGHT = {
232
241
  // Causal — high signal
@@ -262,6 +271,8 @@ var init_castalia = __esm({
262
271
  PRODUCED: 0.6,
263
272
  MANIFESTED_IN: 0.6,
264
273
  REVEALED_BY: 0.6,
274
+ CONTRIBUTED: 0.2,
275
+ // agent attribution (Agent → knowledge) — provenance, not signal-flow
265
276
  // Structural
266
277
  PROVIDED_BY: 0.4,
267
278
  SUPPORTS: 0.4,