@inerrata-corporation/errata 2.0.2-dev.288 → 2.0.2-dev.297

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.
@@ -15214,7 +15214,12 @@ var init_edge_rules = __esm({
15214
15214
  // ── Taxonomy (Track 4 Stream C: MITRE CWE `ChildOf` → `Weakness —IS_A→ Weakness`) ──
15215
15215
  IS_A: { from: ["Weakness"], to: ["Weakness"] },
15216
15216
  // ── Conceptual (v1 taxonomy.ts: instance → motif/pattern reference) ──
15217
- INSTANCE_OF: { to: ["Pattern", "Weakness", "Technique"] },
15217
+ // `AntiPattern` joined the target set 2026-08-02: it is one of the three motif
15218
+ // kinds (generalizer motifs.ts `layerOf`: pattern | technique | antipattern) and
15219
+ // the SUPPRESSED-close path mints `Problem ─INSTANCE_OF→ AntiPattern` as the
15220
+ // negative-knowledge binding ("silenced, not solved") — the original three-label
15221
+ // rule predates AntiPattern joining the motif layer and silently ate that edge.
15222
+ INSTANCE_OF: { to: ["Pattern", "AntiPattern", "Weakness", "Technique"] },
15218
15223
  IMPLEMENTS: { from: ["Solution", "Language", "Component"], to: ["Pattern", "Technique"] },
15219
15224
  MATCHES: { to: ["Pattern"] },
15220
15225
  // ── Artifact evidence (v1 taxonomy.ts artifact rows) ──
@@ -15772,7 +15777,15 @@ var LOCAL_RULE_OVERRIDES = {
15772
15777
  to: [...CODE_NODE_LABELS, "Symbol"]
15773
15778
  },
15774
15779
  REVEALED_BY: null,
15775
- PRODUCED: null
15780
+ PRODUCED: null,
15781
+ // FIXED_BY locally ALSO carries the fix-provenance sense: `resolveProblem`
15782
+ // attributes a closed Problem to the fixing `Episode` (PLAN_PLASTICITY §2.1)
15783
+ // alongside the cloud's Problem→Solution knowledge claim. Same shape as
15784
+ // PRODUCED/REVEALED_BY above — an Episode is code-layer and never drains, so
15785
+ // the cloud door's `to: [Solution]` rule is untouched. The `from` constraint
15786
+ // stays: the reversed (Solution)-FIXED_BY->(...) splash bug is the reason
15787
+ // this rule exists at all.
15788
+ FIXED_BY: { from: EDGE_RULES["FIXED_BY"]?.from, to: ["Solution", "Episode"] }
15776
15789
  };
15777
15790
  function localEdgeViolation(fromLabel, type, toLabel) {
15778
15791
  if (type in LOCAL_RULE_OVERRIDES) {
package/errata.mjs CHANGED
@@ -15389,7 +15389,12 @@ var init_edge_rules = __esm({
15389
15389
  // ── Taxonomy (Track 4 Stream C: MITRE CWE `ChildOf` → `Weakness —IS_A→ Weakness`) ──
15390
15390
  IS_A: { from: ["Weakness"], to: ["Weakness"] },
15391
15391
  // ── Conceptual (v1 taxonomy.ts: instance → motif/pattern reference) ──
15392
- INSTANCE_OF: { to: ["Pattern", "Weakness", "Technique"] },
15392
+ // `AntiPattern` joined the target set 2026-08-02: it is one of the three motif
15393
+ // kinds (generalizer motifs.ts `layerOf`: pattern | technique | antipattern) and
15394
+ // the SUPPRESSED-close path mints `Problem ─INSTANCE_OF→ AntiPattern` as the
15395
+ // negative-knowledge binding ("silenced, not solved") — the original three-label
15396
+ // rule predates AntiPattern joining the motif layer and silently ate that edge.
15397
+ INSTANCE_OF: { to: ["Pattern", "AntiPattern", "Weakness", "Technique"] },
15393
15398
  IMPLEMENTS: { from: ["Solution", "Language", "Component"], to: ["Pattern", "Technique"] },
15394
15399
  MATCHES: { to: ["Pattern"] },
15395
15400
  // ── Artifact evidence (v1 taxonomy.ts artifact rows) ──
@@ -16497,7 +16502,15 @@ var init_store = __esm({
16497
16502
  to: [...CODE_NODE_LABELS, "Symbol"]
16498
16503
  },
16499
16504
  REVEALED_BY: null,
16500
- PRODUCED: null
16505
+ PRODUCED: null,
16506
+ // FIXED_BY locally ALSO carries the fix-provenance sense: `resolveProblem`
16507
+ // attributes a closed Problem to the fixing `Episode` (PLAN_PLASTICITY §2.1)
16508
+ // alongside the cloud's Problem→Solution knowledge claim. Same shape as
16509
+ // PRODUCED/REVEALED_BY above — an Episode is code-layer and never drains, so
16510
+ // the cloud door's `to: [Solution]` rule is untouched. The `from` constraint
16511
+ // stays: the reversed (Solution)-FIXED_BY->(...) splash bug is the reason
16512
+ // this rule exists at all.
16513
+ FIXED_BY: { from: EDGE_RULES["FIXED_BY"]?.from, to: ["Solution", "Episode"] }
16501
16514
  };
16502
16515
  SCHEMA_VERSION = 6;
16503
16516
  SCHEMA_SQL = `
@@ -21283,13 +21296,10 @@ function renderSnapshot(s) {
21283
21296
  const lines = [];
21284
21297
  lines.push("## Errata context");
21285
21298
  lines.push("");
21286
- lines.push("### \u270D\uFE0F CAPTURE PROTOCOL \u2014 do this as you work, it IS the work");
21299
+ lines.push("### \u270D\uFE0F CAPTURE PROTOCOL \u2014 tags are the record");
21287
21300
  lines.push(
21288
- "errata auto-derives problems/fixes from your edits/commands. But two signals exist ONLY if you write them inline \u2014 and the tag is the ONLY thing recorded: a problem or fix you state in plain prose, a markdown list, or your own numbering is SILENTLY LOST. So the moment you state one, wrap it (no tool call, no fence):"
21301
+ "errata records ONLY inline tags: `[!one line]` for every problem you state, `(fix:[id])` when your edit fixed a shown problem. Untagged prose is silently lost \u2014 tag as you write (no fences), we filter downstream."
21289
21302
  );
21290
- lines.push("- `[!one line]` \u2014 EVERY problem you notice or report (a bug you read past, an audit/review finding, anything you call out)");
21291
- lines.push("- `(fix:[id])` \u2014 your edit fixed a problem errata showed you (ids appear in the priors below / in file priors)");
21292
- lines.push("Tag every one you state \u2014 we filter downstream, so don't self-censor or batch. This is the witness only you can give; untagged, it's lost.");
21293
21303
  lines.push("");
21294
21304
  lines.push(SEARCH_IMPERATIVE_HEADER);
21295
21305
  lines.push(SEARCH_IMPERATIVE_BODY);
@@ -25524,61 +25534,36 @@ function buildFileRecallInstruction(referent = "\u2026") {
25524
25534
  }
25525
25535
  function triageBullet(ref) {
25526
25536
  return [
25527
- " \u2022 you diagnosed a bug \u2014 write the CAUSAL CHAIN in one flag with `<-` (caused-by).",
25528
- " Don't split it into a second tag you'll skip under load; fold it the way you'd say it:",
25529
- " \xB7 [!the symptom <- the mechanism] \u2014 leftmost is what breaks observably (what a test",
25530
- " or user reports); the step right is what caused it. e.g. [!the runner deadlocks after",
25531
- " a task rejects <- await fn() has no try/finally, so a rejection never decrements running].",
25532
- " \xB7 chain it as deep as you actually diagnosed: [!symptom <- cause <- root cause] \u2014 every",
25533
- " ` <- ` is a link we record, and the RIGHTMOST is the reusable root cause (the node other",
25534
- " agents find). Stop at the deepest mechanism you're sure of; don't guess a link.",
25535
- " When symptom and cause turn up FAR APART \u2014 the cause lands turns later, several problems",
25536
- " in play \u2014 name the thread instead: [!#slug the symptom] once, then (cause:#slug the",
25537
- " mechanism) binds to it however far away (same slug, your choice of word). Explaining a",
25538
- ` problem we SHOWED you? bind by its handle/id: (cause:[${ref}] \u2026) / (cause:#dprob_\u2026 \u2026).`
25537
+ " \u2022 you diagnosed a cause \u2014 fold the chain into the flag with <- (caused-by), deepest",
25538
+ " sure mechanism rightmost: [!symptom <- cause <- root cause]. Symptom and cause far",
25539
+ " apart? open a thread [!#slug symptom] \u2026 later bind (cause:#slug mechanism);",
25540
+ ` explaining a problem we SHOWED you \u2192 (cause:[${ref}] \u2026)`
25539
25541
  ].join("\n");
25540
25542
  }
25541
25543
  function linkBullet(ref) {
25542
25544
  return [
25543
- // Lead-in states the trigger without the old "resembles prior knowledge"
25544
- // conditional (which gated the whole bullet on recognising a prior). Kept to ONE
25545
- // line on purpose: Cycle 13 measured this instruction at 55% of the 9,000-char
25546
- // passive-context budget, and every char here is paid for by evicting a prior the
25547
- // agent could have cited — so unproven framing is a net loss, however good it reads.
25548
- " \u2022 you flagged a problem \u2014 LINK it, ESPECIALLY when the finding feels novel to here:",
25549
- ` \xB7 (instance:[${ref}],[another-prior],\u2026) \u2014 the priors this problem is an instance of.`,
25550
- " Aim for ~3 DIFFERENT relevant priors; one link is weak, three triangulate it.",
25551
- ` \xB7 ${TAG_EXAMPLE.pattern()} \u2014 name the general shape it instantiates (e.g. (pattern: unbounded`,
25552
- " queue growth under backpressure)) \u2014 this works with NO code anchor, and two agents naming",
25553
- " the same pattern converge on one node. Cite a shown Pattern by handle: (pattern:[handle]).",
25554
- ` \xB7 ${TAG_EXAMPLE.package()} \u2014 the PUBLIC PACKAGE the problem is about, even when this`,
25555
- " workspace doesn't depend on it (e.g. (package: chokidar), (package: pypi/requests)) \u2014 a",
25556
- " public-registry anchor lets the knowledge cross to the collective; internal names stay private.",
25557
- ` \xB7 ${TAG_EXAMPLE.component()} \u2014 the framework/product-level UNIT it concerns when it's not a`,
25558
- " package or a language (e.g. (component: React Router), (component: V8 Isolate)).",
25559
- ` \xB7 (aids:[${ref}],\u2026) \u2014 your FIX could also help these other, even unrelated, problems.`,
25560
- " A hypothesis, not a claim \u2014 it's recorded as may-resolve and checked by whoever tries it.",
25561
- ` \xB7 when your fix relates to a PRIOR solution you were primed with (a problem's`,
25562
- ` "already solved by" line): (builds-on:[${ref}]) if you layer on it \xB7 (supersedes:[${ref}])`,
25563
- " if you replace it \xB7 (alternative:[h]) if it's a different approach \u2014 pick one. This is the",
25564
- " only way N solutions on one problem stop being a flat bag."
25545
+ " \u2022 link what you flag:",
25546
+ ` \xB7 (instance:[${ref}],[another],[a-third]) \u2014 priors it instantiates; ~3 DIFFERENT ones triangulate`,
25547
+ " \xB7 (pattern:[handle]) \u2014 cite a shown Pattern",
25548
+ ` \xB7 ${TAG_EXAMPLE.package()} \u2014 the PUBLIC package it's about, dependency or not`,
25549
+ ` \xB7 ${TAG_EXAMPLE.component()} \u2014 the framework/product unit`,
25550
+ ` \xB7 (aids:[${ref}],\u2026) \u2014 other problems your fix might also resolve (hypothesis)`,
25551
+ ` \xB7 your fix vs a shown solution: (builds-on:[${ref}]) \xB7 (supersedes:[${ref}]) \xB7 (alternative:[h]) \u2014 pick one`
25565
25552
  ].join("\n");
25566
25553
  }
25567
25554
  function attemptBullet() {
25568
25555
  return [
25569
- " \u2022 you're attempting an approach to a flagged problem, or an attempt didn't pan out:",
25570
- ` \xB7 ${TAG_EXAMPLE.tried()}`,
25571
- ` \xB7 ${TAG_EXAMPLE.failed()}`,
25572
- " Failed attempts are knowledge \u2014 they rule out a path. Add #slug to bind to a named",
25573
- " thread: (tried:#slug \u2026) / (failed:#slug \u2026)."
25556
+ ` \u2022 attempting an approach / an attempt failed \u2192 ${TAG_EXAMPLE.tried()} \xB7`,
25557
+ ` ${TAG_EXAMPLE.failed()} \u2014 a failed attempt is knowledge;`,
25558
+ " bind to a thread with (tried:#slug \u2026) / (failed:#slug \u2026)"
25574
25559
  ].join("\n");
25575
25560
  }
25576
25561
  function buildAgentInstruction(opts = {}) {
25577
25562
  const signals = opts.signals ?? ["prior", "problem", "domain", "fix", "constraint", "triage", "attempt", "link"];
25578
25563
  const ref = opts.referent ?? "its-handle";
25579
25564
  const token = (s) => s === "problem" ? TAG_EXAMPLE.problem() : s === "constraint" ? TAG_EXAMPLE.constraint() : s === "attempt" ? TAG_EXAMPLE.tried() : s === "domain" ? TAG_EXAMPLE.domain() : s === "link" ? TAG_EXAMPLE.pattern() : TAG_EXAMPLE[s](ref);
25580
- const head2 = `We tag the priors we show you with a short handle like [${opts.handleExample ?? "chokidar-glob"}]. This is a capture protocol, not optional notes: what you DON'T tag is silently lost \u2014 the tag is the ONLY thing recorded. Whenever one of these is true, wrap it inline in your prose (no fences, no extra calls). Tag every one you state; we filter downstream, so don't self-censor or batch:`;
25581
- const tail = "Mid-turn text (between tool calls) can be dropped by the harness \u2014 if a tag above appeared only mid-turn, RESTATE it in your final message of the turn; the final message always survives.";
25565
+ const head2 = `We tag the priors we show you with a short handle like [${opts.handleExample ?? "chokidar-glob"}]. Tags are the ONLY signal recorded \u2014 anything you state but don't tag is silently lost. Weave each tag inline in your prose as you state it (no fences or backticks, no extra calls); tag everything, we filter downstream:`;
25566
+ const tail = "Mid-turn text (between tool calls) can be dropped by the harness \u2014 RESTATE every tag in your turn-final message; the final message is what reliably survives.";
25582
25567
  return [
25583
25568
  head2,
25584
25569
  ...signals.map(
@@ -25636,12 +25621,12 @@ var init_agent_signals = __esm({
25636
25621
  aids: (ref) => `(aids:[${ref}])`
25637
25622
  };
25638
25623
  GLOSS = {
25639
- prior: "a prior we showed you helped \u2014 or this work sits in a primed language/package",
25640
- problem: "you hit a real problem \u2014 incidental, or the one you're fixing. About specific code? NAME the file in the tag: [!what's wrong @ src/file.ts:42] \u2014 we anchor to what you name, or to a file you edited this turn, never to one you merely read; a design/topic problem is fine with no @",
25641
- fix: "your edit fixes a problem \u2014 cite the one we showed you, or just say how you fixed one you found yourself: (fix: what you changed)",
25642
- constraint: "you made a design decision because requirements conflict or something's constrained \u2014 tag the tension, ESPECIALLY when your fix makes it 'only look' contradictory (a clean solution still hides a real trap the next agent needs)",
25643
- triage: "you diagnosed a bug \u2014 SPLIT the symptom (what breaks \u2192 [!\u2026]) from the cause (the mechanism you'd change \u2192 (cause:\u2026)); if the line says WHY it breaks, it's a cause, not a problem",
25644
- attempt: "you're attempting an approach, or an attempt didn't pan out \u2014 (tried: \u2026) / (failed: \u2026); a failed attempt rules out a path for the next agent",
25624
+ prior: "a shown prior helped, or you work in a primed language/package",
25625
+ problem: "a problem you notice or report \u2014 any bug, finding, or thing wrong; about specific code? name the file: [!what's wrong @ src/file.ts:42]",
25626
+ fix: "your edit fixed a PROBLEM we showed you; for one you flagged yourself: (fix: what you changed) \u2014 a fix resolves a stated problem, completing routine work is not a fix",
25627
+ constraint: "a design decision forced by conflicting requirements or constraints \u2014 tag the tension, especially when your fix makes it 'only look' resolved",
25628
+ triage: "you diagnosed a cause \u2014 fold the chain into the flag with <- (caused-by), deepest sure mechanism rightmost",
25629
+ attempt: "attempting an approach / an attempt failed \u2014 a failed attempt is knowledge, it rules out a path",
25645
25630
  // DOMAIN — promoted to a FIRST-CLASS signal (was nested inside linkBullet, whose
25646
25631
  // lead-in gates on "a problem you flagged resembles prior knowledge"). Naming the
25647
25632
  // area a problem is about is unconditional and has nothing to do with recognizing
@@ -25657,7 +25642,10 @@ var init_agent_signals = __esm({
25657
25642
  // contribution, so stating the general area reads as vague restatement — exactly
25658
25643
  // when it matters most, because precise wording is what makes a problem
25659
25644
  // unfindable to anyone who doesn't already share it.
25660
- domain: "you flagged a problem that isn't about one specific file \u2014 name the AREA it's about. The sharper your wording, the LESS anyone else will search for it; an abstract problem with no area is an invisible island. Title Case",
25645
+ // Sim note (2026-08-02 shrink): domain emission held 4/4 with just the trigger
25646
+ // clause; the pattern convergence hook now rides here too (it fell 0/4 when it
25647
+ // only appeared in the link bullet's tail).
25648
+ domain: "a problem with no single file \u2014 name the area it's about (Title Case). Also name the general shape it instantiates: (pattern: the shape) \u2014 needs no code anchor, and two agents naming the same shape converge on one node",
25661
25649
  link: "the problem you flagged is an instance of priors/abstractions you can name \u2014 (instance:[h1],[h2],\u2026) / (pattern: \u2026) / (aids:[h]); rendered whole via linkBullet"
25662
25650
  };
25663
25651
  }
@@ -26837,7 +26825,7 @@ function bindCanonicalNeighbors(store, opts) {
26837
26825
  let bound = 0;
26838
26826
  for (const p of problems) {
26839
26827
  const existing = new Set(
26840
- store.outEdges(p.id, ["MATCHES", "INSTANCE_OF"]).map((e) => e.to)
26828
+ store.outEdges(p.id, ["MATCHES", "INSTANCE_OF", "RELATES_TO"]).map((e) => e.to)
26841
26829
  );
26842
26830
  if (existing.size >= k) continue;
26843
26831
  const ranked = candidates.filter(
@@ -52906,7 +52894,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
52906
52894
  }
52907
52895
 
52908
52896
  // src/engine.ts
52909
- var DAEMON_VERSION = true ? "2.0.2-dev.288" : "2.0.0-alpha.0";
52897
+ var DAEMON_VERSION = true ? "2.0.2-dev.297" : "2.0.0-alpha.0";
52910
52898
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
52911
52899
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
52912
52900
  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.2-dev.288",
3
+ "version": "2.0.2-dev.297",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -15069,7 +15069,12 @@ var init_edge_rules = __esm({
15069
15069
  // ── Taxonomy (Track 4 Stream C: MITRE CWE `ChildOf` → `Weakness —IS_A→ Weakness`) ──
15070
15070
  IS_A: { from: ["Weakness"], to: ["Weakness"] },
15071
15071
  // ── Conceptual (v1 taxonomy.ts: instance → motif/pattern reference) ──
15072
- INSTANCE_OF: { to: ["Pattern", "Weakness", "Technique"] },
15072
+ // `AntiPattern` joined the target set 2026-08-02: it is one of the three motif
15073
+ // kinds (generalizer motifs.ts `layerOf`: pattern | technique | antipattern) and
15074
+ // the SUPPRESSED-close path mints `Problem ─INSTANCE_OF→ AntiPattern` as the
15075
+ // negative-knowledge binding ("silenced, not solved") — the original three-label
15076
+ // rule predates AntiPattern joining the motif layer and silently ate that edge.
15077
+ INSTANCE_OF: { to: ["Pattern", "AntiPattern", "Weakness", "Technique"] },
15073
15078
  IMPLEMENTS: { from: ["Solution", "Language", "Component"], to: ["Pattern", "Technique"] },
15074
15079
  MATCHES: { to: ["Pattern"] },
15075
15080
  // ── Artifact evidence (v1 taxonomy.ts artifact rows) ──
@@ -24079,7 +24084,15 @@ var LOCAL_RULE_OVERRIDES = {
24079
24084
  to: [...CODE_NODE_LABELS, "Symbol"]
24080
24085
  },
24081
24086
  REVEALED_BY: null,
24082
- PRODUCED: null
24087
+ PRODUCED: null,
24088
+ // FIXED_BY locally ALSO carries the fix-provenance sense: `resolveProblem`
24089
+ // attributes a closed Problem to the fixing `Episode` (PLAN_PLASTICITY §2.1)
24090
+ // alongside the cloud's Problem→Solution knowledge claim. Same shape as
24091
+ // PRODUCED/REVEALED_BY above — an Episode is code-layer and never drains, so
24092
+ // the cloud door's `to: [Solution]` rule is untouched. The `from` constraint
24093
+ // stays: the reversed (Solution)-FIXED_BY->(...) splash bug is the reason
24094
+ // this rule exists at all.
24095
+ FIXED_BY: { from: EDGE_RULES["FIXED_BY"]?.from, to: ["Solution", "Episode"] }
24083
24096
  };
24084
24097
  function localEdgeViolation(fromLabel, type, toLabel) {
24085
24098
  if (type in LOCAL_RULE_OVERRIDES) {