@inerrata-corporation/errata 2.0.2-dev.81 → 2.0.2-dev.85

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.
@@ -15194,7 +15194,10 @@ var init_edge_rules = __esm({
15194
15194
  // NOT ruled here — the type pre-exists with broader extractor senses, and a
15195
15195
  // new rule on an old type would reject legitimate live flows (reject-never-flip
15196
15196
  // cuts both ways: only rule types you introduce or senses that are documented).
15197
- CONCERNS: { from: ["Problem", "Solution", "RootCause", "Claim", "Pattern"], to: ["Tool"] },
15197
+ // `Component` joined the target set with OM-agent-anchors: an agent-named
15198
+ // component ("React Router") is the same knowledge→named-unit anchor shape as
15199
+ // a Tool — the knowledge is ABOUT it, not dependent on it.
15200
+ CONCERNS: { from: ["Problem", "Solution", "RootCause", "Claim", "Pattern"], to: ["Tool", "Component"] },
15198
15201
  OPERATES_ON: { from: ["Algorithm"], to: ["DataStructure"] },
15199
15202
  INVOLVES: { from: ["Problem", "Solution"], to: ["DataStructure"] },
15200
15203
  // ── Taxonomy (Track 4 Stream C: MITRE CWE `ChildOf` → `Weakness —IS_A→ Weakness`) ──
package/errata.mjs CHANGED
@@ -15369,7 +15369,10 @@ var init_edge_rules = __esm({
15369
15369
  // NOT ruled here — the type pre-exists with broader extractor senses, and a
15370
15370
  // new rule on an old type would reject legitimate live flows (reject-never-flip
15371
15371
  // cuts both ways: only rule types you introduce or senses that are documented).
15372
- CONCERNS: { from: ["Problem", "Solution", "RootCause", "Claim", "Pattern"], to: ["Tool"] },
15372
+ // `Component` joined the target set with OM-agent-anchors: an agent-named
15373
+ // component ("React Router") is the same knowledge→named-unit anchor shape as
15374
+ // a Tool — the knowledge is ABOUT it, not dependent on it.
15375
+ CONCERNS: { from: ["Problem", "Solution", "RootCause", "Claim", "Pattern"], to: ["Tool", "Component"] },
15373
15376
  OPERATES_ON: { from: ["Algorithm"], to: ["DataStructure"] },
15374
15377
  INVOLVES: { from: ["Problem", "Solution"], to: ["DataStructure"] },
15375
15378
  // ── Taxonomy (Track 4 Stream C: MITRE CWE `ChildOf` → `Weakness —IS_A→ Weakness`) ──
@@ -18342,6 +18345,55 @@ function mintDomainNode(store, name2, ts) {
18342
18345
  }
18343
18346
  return id;
18344
18347
  }
18348
+ function mintCitedPackageNode(store, ref, ts) {
18349
+ const cleaned = ref.replace(/\s+/g, " ").trim();
18350
+ const slash = /^([a-z0-9-]+)\/(.+)$/i.exec(cleaned);
18351
+ const hasEco = slash != null && !cleaned.startsWith("@");
18352
+ const name2 = (hasEco ? slash[2] : cleaned).trim();
18353
+ const nameLc = name2.toLowerCase();
18354
+ const existing = store.findNodesByLabel("Package").find((n) => String(n.attrs["name"] ?? "").toLowerCase() === nameLc);
18355
+ if (existing) return existing.id;
18356
+ let eco = hasEco ? slash[1].toLowerCase() : "";
18357
+ if (!eco && cleaned.startsWith("@")) eco = "npm";
18358
+ if (!eco) {
18359
+ const counts = /* @__PURE__ */ new Map();
18360
+ for (const p of store.findNodesByLabel("Package")) {
18361
+ const e = String(p.attrs["ecosystem"] ?? "").toLowerCase();
18362
+ if (e) counts.set(e, (counts.get(e) ?? 0) + 1);
18363
+ }
18364
+ eco = [...counts.entries()].sort((a, b) => b[1] - a[1])[0]?.[0] ?? "npm";
18365
+ }
18366
+ const purlName = eco === "npm" ? nameLc : name2;
18367
+ const purl = `pkg:${eco}/${purlName}`;
18368
+ if (!store.getNode(purl)) {
18369
+ store.mergeNode(
18370
+ buildNode(purl, "Package", name2, ts, {
18371
+ purl,
18372
+ name: name2,
18373
+ ecosystem: eco,
18374
+ resolved: false,
18375
+ // agent-cited, no lockfile resolution
18376
+ source: "convo",
18377
+ provisional: true
18378
+ })
18379
+ );
18380
+ }
18381
+ return purl;
18382
+ }
18383
+ function mintComponentNode(store, name2, ts) {
18384
+ const display = name2.replace(/\s+/g, " ").trim();
18385
+ const slug2 = display.toLowerCase();
18386
+ if (!store.getNode(slug2)) {
18387
+ store.mergeNode(
18388
+ buildNode(slug2, "Component", display, ts, {
18389
+ name: display,
18390
+ source: "convo",
18391
+ provisional: true
18392
+ })
18393
+ );
18394
+ }
18395
+ return slug2;
18396
+ }
18345
18397
  function resolveFileNode(store, path2, workspaceId2) {
18346
18398
  const want = path2.trim().replace(/^\.?\//, "");
18347
18399
  for (const n of store.findNodesByLabel("File")) {
@@ -20792,6 +20844,8 @@ __export(src_exports2, {
20792
20844
  matchSymbolsInText: () => matchSymbolsInText,
20793
20845
  mergeCloudCounts: () => mergeCloudCounts,
20794
20846
  mergeDuplicateProblems: () => mergeDuplicateProblems,
20847
+ mintCitedPackageNode: () => mintCitedPackageNode,
20848
+ mintComponentNode: () => mintComponentNode,
20795
20849
  mintDomainNode: () => mintDomainNode,
20796
20850
  mintPatternNode: () => mintPatternNode,
20797
20851
  openGraphStore: () => openGraphStore,
@@ -25156,6 +25210,11 @@ function linkBullet(ref) {
25156
25210
  ` \xB7 ${TAG_EXAMPLE.domain()} \u2014 name the ABSTRACT AREA it's about (e.g. (domain: Observability),`,
25157
25211
  " (domain: Community Detection)). An abstract problem with no code anchor NEEDS this or it's",
25158
25212
  " an invisible island: the Domain is the topic other problems in the area cluster on. Title Case.",
25213
+ ` \xB7 ${TAG_EXAMPLE.package()} \u2014 the PUBLIC PACKAGE the problem is about, even when this`,
25214
+ " workspace doesn't depend on it (e.g. (package: chokidar), (package: pypi/requests)) \u2014 a",
25215
+ " public-registry anchor lets the knowledge cross to the collective; internal names stay private.",
25216
+ ` \xB7 ${TAG_EXAMPLE.component()} \u2014 the framework/product-level UNIT it concerns when it's not a`,
25217
+ " package or a language (e.g. (component: React Router), (component: V8 Isolate)).",
25159
25218
  ` \xB7 (aids:[${ref}],\u2026) \u2014 your FIX could also help these other, even unrelated, problems.`,
25160
25219
  " A hypothesis, not a claim \u2014 it's recorded as may-resolve and checked by whoever tries it.",
25161
25220
  ` \xB7 when your fix relates to a PRIOR solution you were primed with (a problem's`,
@@ -25227,6 +25286,12 @@ var init_agent_signals = __esm({
25227
25286
  // DOMAIN — the abstract area a problem is about; the concept layer an
25228
25287
  // anchor-less problem clusters on. Mints/resolves a Domain by name.
25229
25288
  domain: () => `(domain: The Area)`,
25289
+ // PACKAGE/COMPONENT — agent-named public anchors (OM-agent-anchors): the
25290
+ // package a problem is ABOUT (even when not a dependency) and the
25291
+ // framework/product-level unit it concerns. Public spine anchors → the
25292
+ // knowledge can cross to the collective.
25293
+ package: () => `(package: the-package-name)`,
25294
+ component: () => `(component: The Component)`,
25230
25295
  aids: (ref) => `(aids:[${ref}])`
25231
25296
  };
25232
25297
  GLOSS = {
@@ -49625,6 +49690,8 @@ var ALTERNATIVE_PREFIX = /^\s*alternative:(?:#([a-z][\w-]{0,63}))?\s*/i;
49625
49690
  var INSTANCE_PREFIX = /^\s*instance:\s*/i;
49626
49691
  var PATTERN_RE = /\(\s*pattern:\s*([^()\n]{3,}?)\s*\)/gi;
49627
49692
  var DOMAIN_RE = /\(\s*domain:\s*([^()\n]{3,}?)\s*\)/gi;
49693
+ var PACKAGE_RE = /\(\s*package:\s*([^()\n]{2,}?)\s*\)/gi;
49694
+ var COMPONENT_RE = /\(\s*component:\s*([^()\n]{2,}?)\s*\)/gi;
49628
49695
  var CAUSE_TEXT_MIN = 8;
49629
49696
  var FLAG_RE = /\[([!?])(?:#([a-z][\w-]{0,63})\s+)?\s*([^\]\n]{8,}?)\s*(?:@\s*([^\s\]]+?)(?::(\d+))?\s*)?\]/g;
49630
49697
  var CONSTRAINT_MIN = 8;
@@ -49820,6 +49887,18 @@ function parseInlineTags(text) {
49820
49887
  const raw3 = dm[1].replace(/\s+/g, " ").trim();
49821
49888
  if (raw3.length >= 3) out2.push({ kind: "domain", domainText: raw3, sentence: sfield });
49822
49889
  }
49890
+ PACKAGE_RE.lastIndex = 0;
49891
+ let pk;
49892
+ while ((pk = PACKAGE_RE.exec(sentence)) !== null) {
49893
+ const raw3 = pk[1].replace(/\s+/g, " ").trim();
49894
+ if (raw3.length >= 2) out2.push({ kind: "package", packageText: raw3, sentence: sfield });
49895
+ }
49896
+ COMPONENT_RE.lastIndex = 0;
49897
+ let cm;
49898
+ while ((cm = COMPONENT_RE.exec(sentence)) !== null) {
49899
+ const raw3 = cm[1].replace(/\s+/g, " ").trim();
49900
+ if (raw3.length >= 2) out2.push({ kind: "component", componentText: raw3, sentence: sfield });
49901
+ }
49823
49902
  CONSTRAINT_RE.lastIndex = 0;
49824
49903
  let c;
49825
49904
  while ((c = CONSTRAINT_RE.exec(sentence)) !== null) {
@@ -49854,7 +49933,12 @@ var LABEL_PAIR = {
49854
49933
  // EDGE_RULES-clean by construction: CONCERNS allows exactly these sources.
49855
49934
  "Problem>Tool": "CONCERNS",
49856
49935
  "Solution>Tool": "CONCERNS",
49857
- "RootCause>Tool": "CONCERNS"
49936
+ "RootCause>Tool": "CONCERNS",
49937
+ // Agent-named component anchors (OM-agent-anchors): a Component is a
49938
+ // framework/product-level unit the knowledge is ABOUT — CONCERNS, like Tool.
49939
+ "Problem>Component": "CONCERNS",
49940
+ "Solution>Component": "CONCERNS",
49941
+ "RootCause>Component": "CONCERNS"
49858
49942
  };
49859
49943
  var STACK_GROUNDING_EDGES = ["WRITTEN_IN", "DEPENDS_ON", "OCCURS_IN"];
49860
49944
  var TIEBREAK = [
@@ -49953,7 +50037,7 @@ function harvestInlineTags(store, text, opts) {
49953
50037
  const source = opts.sourceId ? store.getNode(opts.sourceId) : null;
49954
50038
  const mintPriors = opts.mintPriors ?? true;
49955
50039
  const touched = opts.sessionTouchedIds ?? /* @__PURE__ */ new Set();
49956
- const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], solutionLinks: [], instances: [], patterns: [], domains: [], refutes: [], corroborations: [] };
50040
+ const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], solutionLinks: [], instances: [], patterns: [], domains: [], packages: [], components: [], refutes: [], corroborations: [] };
49957
50041
  const tags = parseInlineTags(text);
49958
50042
  const symptomSeqs = tags.filter((t) => (t.kind === "problem" || t.kind === "todo" || t.kind === "constraint") && t.statement).map((t) => ({ seq: t.seq ?? -1, statement: t.statement, threadId: t.threadId })).sort((a, b) => a.seq - b.seq);
49959
50043
  const bindSymptom = (seq, threadId) => {
@@ -50093,6 +50177,16 @@ function harvestInlineTags(store, text, opts) {
50093
50177
  ...tag.threadId ? { threadId: tag.threadId } : {},
50094
50178
  evidence: b.evidence
50095
50179
  });
50180
+ } else if (tag.kind === "package" || tag.kind === "component") {
50181
+ const b = bindSymptom(tag.seq, tag.threadId);
50182
+ const bound = {
50183
+ ...b.statement ? { boundStatement: b.statement } : {},
50184
+ ...b.problemId ? { problemId: b.problemId } : {},
50185
+ ...tag.threadId ? { threadId: tag.threadId } : {},
50186
+ evidence: b.evidence
50187
+ };
50188
+ if (tag.kind === "package") plan.packages.push({ packageText: tag.packageText, ...bound });
50189
+ else plan.components.push({ componentText: tag.componentText, ...bound });
50096
50190
  } else if (tag.kind === "attempt" || tag.kind === "failure") {
50097
50191
  for (const h of tag.refuteHandles ?? []) {
50098
50192
  const nodeId = resolveHandle(store, h, opts.handleMap);
@@ -51695,7 +51789,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
51695
51789
  }
51696
51790
 
51697
51791
  // src/engine.ts
51698
- var DAEMON_VERSION = true ? "2.0.2-dev.81" : "2.0.0-alpha.0";
51792
+ var DAEMON_VERSION = true ? "2.0.2-dev.85" : "2.0.0-alpha.0";
51699
51793
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
51700
51794
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
51701
51795
  var GIT_OP_MUTE_MS = 4e3;
@@ -52529,6 +52623,20 @@ function createWorkspaceEngine(opts) {
52529
52623
  if (domainId === pid) continue;
52530
52624
  mintCiteEdge(pid, domainId, "PERTAIN_TO", d.evidence === "witnessed" ? 0.4 : 0.3, { domainCite: true, evidence: d.evidence });
52531
52625
  }
52626
+ for (const p of plan.packages) {
52627
+ const pid = bindPid(p);
52628
+ if (!pid) continue;
52629
+ const pkgId = mintCitedPackageNode(store, p.packageText, t);
52630
+ if (pkgId === pid) continue;
52631
+ mintCiteEdge(pid, pkgId, "DEPENDS_ON", p.evidence === "witnessed" ? 0.4 : 0.3, { packageCite: true, evidence: p.evidence });
52632
+ }
52633
+ for (const cpt of plan.components) {
52634
+ const pid = bindPid(cpt);
52635
+ if (!pid) continue;
52636
+ const componentId = mintComponentNode(store, cpt.componentText, t);
52637
+ if (componentId === pid) continue;
52638
+ mintCiteEdge(pid, componentId, "CONCERNS", cpt.evidence === "witnessed" ? 0.4 : 0.3, { componentCite: true, evidence: cpt.evidence });
52639
+ }
52532
52640
  for (const inst of plan.instances) {
52533
52641
  const pid = bindPid(inst);
52534
52642
  if (!pid) continue;
@@ -53391,8 +53499,8 @@ function noveltyAgainst(node2, neighbors, opts = {}) {
53391
53499
  // src/instance-ingest.ts
53392
53500
  var INSTANCE_LABELS = ["Problem", "Solution", "RootCause"];
53393
53501
  var INSTANCE_EDGES = ["CAUSED_BY", "SOLVED_BY"];
53394
- var ANCHOR_EDGES = ["OCCURS_IN", "DEPENDS_ON", "PERTAIN_TO"];
53395
- var ANCHOR_TARGET_LABELS = ["Language", "Package", "Domain"];
53502
+ var ANCHOR_EDGES = ["OCCURS_IN", "DEPENDS_ON", "PERTAIN_TO", "CONCERNS"];
53503
+ var ANCHOR_TARGET_LABELS = ["Language", "Package", "Domain", "Component"];
53396
53504
  function stripCodebaseScope(scope) {
53397
53505
  const s = { ...scope ?? {} };
53398
53506
  delete s["codebase"];
@@ -53427,7 +53535,11 @@ function shareableContext(n, wireId) {
53427
53535
  embedding: [],
53428
53536
  attrs,
53429
53537
  ...n.label === "Package" ? { anchorVisibility: "public" } : {},
53430
- ...n.label === "Language" && langAnchor(n) ? { anchorVisibility: "public", anchor: langAnchor(n) } : {}
53538
+ ...n.label === "Language" && langAnchor(n) ? { anchorVisibility: "public", anchor: langAnchor(n) } : {},
53539
+ // A Component stub claims itself by slug (OM-agent-anchors) — the door
53540
+ // confirms only against an EXISTING public Component of that slug, so an
53541
+ // org-internal component name never crosses (fails closed to org).
53542
+ ...n.label === "Component" ? { anchorVisibility: "public", anchor: `component:${wireId}` } : {}
53431
53543
  };
53432
53544
  }
53433
53545
  function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [], opts = {}) {
@@ -53488,15 +53600,18 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
53488
53600
  if (e.type === "OCCURS_IN" && t.label !== "Language") continue;
53489
53601
  if (e.type === "DEPENDS_ON" && t.label !== "Package") continue;
53490
53602
  if (e.type === "PERTAIN_TO" && t.label !== "Domain") continue;
53491
- if (t.label === "Package" && opts.includePackages !== true) continue;
53603
+ if (e.type === "CONCERNS" && t.label !== "Component") continue;
53604
+ if ((t.label === "Package" || t.label === "Component") && opts.includePackages !== true) continue;
53492
53605
  if (ignored(t.description) || ignored(String(t.attrs["name"] ?? ""))) continue;
53493
53606
  targets.push({ e, t, wireId: wireContextId(t) });
53494
53607
  }
53495
53608
  if (targets.length === 0) continue;
53496
53609
  const shipped = shippedById.get(sourceId);
53497
53610
  if (shipped) {
53498
- const anchors = (label) => targets.filter((x) => x.t.label === label).map((x) => label === "Language" ? langAnchor(x.t) : x.wireId).filter((a) => a != null).sort();
53499
- const anchor = anchors("Package")[0] ?? anchors("Language")[0];
53611
+ const anchors = (label) => targets.filter((x) => x.t.label === label).map(
53612
+ (x) => label === "Language" ? langAnchor(x.t) : label === "Component" ? `component:${x.wireId}` : x.wireId
53613
+ ).filter((a) => a != null).sort();
53614
+ const anchor = anchors("Package")[0] ?? anchors("Component")[0] ?? anchors("Language")[0];
53500
53615
  if (anchor) {
53501
53616
  shipped.anchorVisibility = "public";
53502
53617
  shipped.anchor = anchor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.81",
3
+ "version": "2.0.2-dev.85",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -15049,7 +15049,10 @@ var init_edge_rules = __esm({
15049
15049
  // NOT ruled here — the type pre-exists with broader extractor senses, and a
15050
15050
  // new rule on an old type would reject legitimate live flows (reject-never-flip
15051
15051
  // cuts both ways: only rule types you introduce or senses that are documented).
15052
- CONCERNS: { from: ["Problem", "Solution", "RootCause", "Claim", "Pattern"], to: ["Tool"] },
15052
+ // `Component` joined the target set with OM-agent-anchors: an agent-named
15053
+ // component ("React Router") is the same knowledge→named-unit anchor shape as
15054
+ // a Tool — the knowledge is ABOUT it, not dependent on it.
15055
+ CONCERNS: { from: ["Problem", "Solution", "RootCause", "Claim", "Pattern"], to: ["Tool", "Component"] },
15053
15056
  OPERATES_ON: { from: ["Algorithm"], to: ["DataStructure"] },
15054
15057
  INVOLVES: { from: ["Problem", "Solution"], to: ["DataStructure"] },
15055
15058
  // ── Taxonomy (Track 4 Stream C: MITRE CWE `ChildOf` → `Weakness —IS_A→ Weakness`) ──