@inerrata-corporation/errata 2.0.0-dev.41 → 2.0.0-dev.43

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.
package/errata.mjs CHANGED
@@ -64,7 +64,7 @@ function toCloudAttrs(attrs) {
64
64
  }
65
65
  return rest2;
66
66
  }
67
- var SEMANTIC_NODE_LABELS, CONTEXT_NODE_LABELS, CODE_NODE_LABELS, ALL_NODE_LABELS, STRUCTURAL_EDGES, CAUSAL_EDGES, RESOLUTION_EDGES, CONCEPTUAL_EDGES, EVIDENCE_EDGES, CODE_EDGES, BRIDGE_EDGES, IDENTITY_EDGES, JUSTIFICATION_EDGES, BELIEF_EDGES, ABSTRACTION_EDGES, DECOMPOSITION_EDGES, TRANSFER_EDGES, TAXONOMY_EDGES, TRIAGE_EDGES, GIT_EDGES, ALL_EDGE_TYPES, PAGERANK_EXCLUSIONS, EDGE_WEIGHT, CAUSAL_PROTECT_EDGES, VALIDATION_SOURCES, TRUTH_KIND, ABSTRACTION_LEVEL, PROBLEM_RESOLUTION, DRIFT_KIND, TEST_PATH_RE, TEST_SCOPE_RE;
67
+ var SEMANTIC_NODE_LABELS, CONTEXT_NODE_LABELS, CODE_NODE_LABELS, ALL_NODE_LABELS, STRUCTURAL_EDGES, CAUSAL_EDGES, RESOLUTION_EDGES, CONCEPTUAL_EDGES, EVIDENCE_EDGES, CODE_EDGES, BRIDGE_EDGES, IDENTITY_EDGES, JUSTIFICATION_EDGES, BELIEF_EDGES, ABSTRACTION_EDGES, DECOMPOSITION_EDGES, TRANSFER_EDGES, TAXONOMY_EDGES, TRIAGE_EDGES, GIT_EDGES, ALL_EDGE_TYPES, PAGERANK_EXCLUSIONS, EDGE_WEIGHT, EDGE_CONDUCTANCE_OVERRIDES, CAUSAL_PROTECT_EDGES, VALIDATION_SOURCES, TRUTH_KIND, ABSTRACTION_LEVEL, PROBLEM_RESOLUTION, DRIFT_KIND, TEST_PATH_RE, TEST_SCOPE_RE;
68
68
  var init_castalia = __esm({
69
69
  "../../packages/shared/src/castalia.ts"() {
70
70
  "use strict";
@@ -365,6 +365,12 @@ var init_castalia = __esm({
365
365
  PARENT: 0,
366
366
  AUTHORED_BY: 0
367
367
  };
368
+ EDGE_CONDUCTANCE_OVERRIDES = {
369
+ // 0.5 ⇒ a 3-hop dependency path scores 0.125 — survives burst's cut — while
370
+ // the weight-derived floor (≈0.1) buried the local lockfile graph's ~7k
371
+ // DEPENDS_ON edges at 0.001 for the same walk.
372
+ DEPENDS_ON: 0.5
373
+ };
368
374
  CAUSAL_PROTECT_EDGES = ["CAUSED_BY", "FIXED_BY", "SOLVED_BY"];
369
375
  VALIDATION_SOURCES = [
370
376
  "human-explicit",
@@ -15525,6 +15531,7 @@ __export(src_exports, {
15525
15531
  CastaliaIngestPayloadSchema: () => CastaliaIngestPayloadSchema,
15526
15532
  DECOMPOSITION_EDGES: () => DECOMPOSITION_EDGES,
15527
15533
  DRIFT_KIND: () => DRIFT_KIND,
15534
+ EDGE_CONDUCTANCE_OVERRIDES: () => EDGE_CONDUCTANCE_OVERRIDES,
15528
15535
  EDGE_RULES: () => EDGE_RULES,
15529
15536
  EDGE_WEIGHT: () => EDGE_WEIGHT,
15530
15537
  EVIDENCE_EDGES: () => EVIDENCE_EDGES,
@@ -16618,6 +16625,8 @@ var init_types = __esm({
16618
16625
 
16619
16626
  // ../../packages/local-graph/src/traversal.ts
16620
16627
  function staticConductance(edgeType) {
16628
+ const override = EDGE_CONDUCTANCE_OVERRIDES[edgeType];
16629
+ if (override != null) return override;
16621
16630
  const w = EDGE_WEIGHT[edgeType];
16622
16631
  if (w == null) return UNKNOWN_CONDUCTANCE;
16623
16632
  return Math.max(UNKNOWN_CONDUCTANCE, Math.min(1, w / MAX_EDGE_WEIGHT));
@@ -20368,12 +20377,17 @@ _${dropped} lower-priority item${dropped === 1 ? "" : "s"} omitted to fit the pa
20368
20377
  }
20369
20378
  return { body: body2, snapshot, dropped };
20370
20379
  }
20371
- var SEARCH_IMPERATIVE_HEADER, SEARCH_IMPERATIVE_BODY, EVICTION_ORDER, DEFAULT_AGENT_CONTEXT_BUDGET;
20380
+ var RECALL_FIRST_HEADER, RECALL_FIRST_BODY, RECALL_FIRST_BLOCK, SEARCH_IMPERATIVE_HEADER, SEARCH_IMPERATIVE_BODY, EVICTION_ORDER, DEFAULT_AGENT_CONTEXT_BUDGET;
20372
20381
  var init_render = __esm({
20373
20382
  "../../packages/context-writer/src/render.ts"() {
20374
20383
  "use strict";
20375
20384
  init_src4();
20376
20385
  init_src2();
20386
+ RECALL_FIRST_HEADER = "## errata \u2014 recall before you work";
20387
+ RECALL_FIRST_BODY = "Before investigating any bug or error, your FIRST tool call must be `mcp__errata__errata_search` with a few words describing the problem. This machine's knowledge graph records previously solved problems \u2014 the answer may already be recorded. Read what it returns before touching any files.";
20388
+ RECALL_FIRST_BLOCK = `${RECALL_FIRST_HEADER}
20389
+
20390
+ ${RECALL_FIRST_BODY}`;
20377
20391
  SEARCH_IMPERATIVE_HEADER = "### \u{1F50E} PRIORS ARE SEEDS \u2014 a sample, not the whole graph";
20378
20392
  SEARCH_IMPERATIVE_BODY = "Everything below is a budgeted, top-of-head slice of a much larger graph. Any prior id below is a live burst seed: `errata.burst` it (or read `.errata/g/burst/<id>`) to pull its wider neighborhood \u2014 causes, fixes, siblings. When a prior is adjacent-but-not-quite, or none fit, that gap is exactly when to search deeper before solving cold: a stuck search is itself a signal that routes help to you.";
20379
20393
  EVICTION_ORDER = [
@@ -37017,7 +37031,7 @@ function resolvePath(rawPath) {
37017
37031
  const rest2 = segs.slice(1);
37018
37032
  if (verb === "index" || verb === "README" || verb === "help") return { kind: "index" };
37019
37033
  if (verb === "search") {
37020
- const query = rest2.join(" ").trim();
37034
+ const query = rest2.join(" ").replace(/[-_]+/g, " ").trim();
37021
37035
  if (!query) return null;
37022
37036
  return { kind: "tool", tool: "errata.search", args: { query } };
37023
37037
  }
@@ -42549,7 +42563,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
42549
42563
  }
42550
42564
 
42551
42565
  // src/engine.ts
42552
- var DAEMON_VERSION = true ? "2.0.0-dev.41" : "2.0.0-alpha.0";
42566
+ var DAEMON_VERSION = true ? "2.0.0-dev.43" : "2.0.0-alpha.0";
42553
42567
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
42554
42568
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
42555
42569
  var GIT_OP_MUTE_MS = 4e3;
@@ -47088,6 +47102,7 @@ async function installClaudeHooks(port) {
47088
47102
  }
47089
47103
  }
47090
47104
  const matcher = "Read|Edit|Write|Grep|Glob|NotebookEdit|Bash";
47105
+ const postMatcher = `${matcher}|ToolSearch|mcp__errata__.*`;
47091
47106
  const preCmd = `${hookCurlCommand(port)} ${ERRATA_TAG}`;
47092
47107
  const postCmd = `${hookRelayCommand(port, "/api/hook")} ${ERRATA_TAG}`;
47093
47108
  settings.hooks ??= {};
@@ -47096,13 +47111,13 @@ async function installClaudeHooks(port) {
47096
47111
  if (list[i2].hooks.some((h) => h.command.includes(ERRATA_TAG))) list.splice(i2, 1);
47097
47112
  }
47098
47113
  };
47099
- for (const [event, command] of [
47100
- ["PreToolUse", preCmd],
47101
- ["PostToolUse", postCmd]
47114
+ for (const [event, command, eventMatcher] of [
47115
+ ["PreToolUse", preCmd, matcher],
47116
+ ["PostToolUse", postCmd, postMatcher]
47102
47117
  ]) {
47103
47118
  const list = settings.hooks[event] ??= [];
47104
47119
  dropErrata(list);
47105
- list.push({ matcher, hooks: [{ type: "command", command }] });
47120
+ list.push({ matcher: eventMatcher, hooks: [{ type: "command", command }] });
47106
47121
  }
47107
47122
  const turnCmd = `${hookCurlCommand(port, "/api/turn")} ${ERRATA_TAG}`;
47108
47123
  for (const event of ["Stop", "SubagentStop"]) {
@@ -47129,6 +47144,15 @@ async function installClaudeHooks(port) {
47129
47144
  writeFileSync16(file2, JSON.stringify(settings, null, 2) + "\n", "utf8");
47130
47145
  console.log(`installed Claude Code hooks \u2192 ${file2}`);
47131
47146
  await installClaudeMcpConfig();
47147
+ const claudeMd = join24(ROOT, "CLAUDE.md");
47148
+ const recall = writeManagedBlock(claudeMd, { body: RECALL_FIRST_BLOCK });
47149
+ if (recall.kind === "collision") {
47150
+ console.warn(
47151
+ ` \u26A0\uFE0F CLAUDE.md errata block was hand-edited \u2014 leaving it alone (expected ${recall.expectedHash}, found ${recall.actualHash})`
47152
+ );
47153
+ } else {
47154
+ console.log(`installed recall-first block \u2192 ${claudeMd}`);
47155
+ }
47132
47156
  console.log(` endpoint: http://127.0.0.1:${port}/api/hook`);
47133
47157
  }
47134
47158
  async function installClaudeMcpConfig() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.41",
3
+ "version": "2.0.0-dev.43",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -25760,6 +25760,11 @@ function fileOf(store2, nodeId) {
25760
25760
  }
25761
25761
  return null;
25762
25762
  }
25763
+ var RECALL_FIRST_HEADER = "## errata \u2014 recall before you work";
25764
+ var RECALL_FIRST_BODY = "Before investigating any bug or error, your FIRST tool call must be `mcp__errata__errata_search` with a few words describing the problem. This machine's knowledge graph records previously solved problems \u2014 the answer may already be recorded. Read what it returns before touching any files.";
25765
+ var RECALL_FIRST_BLOCK = `${RECALL_FIRST_HEADER}
25766
+
25767
+ ${RECALL_FIRST_BODY}`;
25763
25768
 
25764
25769
  // ../../packages/context-writer/src/select-durable-memory.ts
25765
25770
  init_src2();