@inerrata-corporation/errata 2.0.21-dev.3716 → 2.0.21-dev.3745

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.
@@ -774,7 +774,7 @@ function claimStructure(text, scope) {
774
774
  const predicate = normalizePredicate(text);
775
775
  const stance = detectStance(text);
776
776
  const base = { entities, predicate, stance, scope: scope ?? {} };
777
- if (predicate === "") base.raw = conceptBag(text);
777
+ if (predicate === "" || entities.length === 0) base.raw = conceptBag(text);
778
778
  return base;
779
779
  }
780
780
  function canonicalClaimId(text, scope) {
package/errata.mjs CHANGED
@@ -1056,7 +1056,7 @@ function claimStructure(text, scope) {
1056
1056
  const predicate = normalizePredicate(text);
1057
1057
  const stance = detectStance(text);
1058
1058
  const base = { entities, predicate, stance, scope: scope ?? {} };
1059
- if (predicate === "") base.raw = conceptBag(text);
1059
+ if (predicate === "" || entities.length === 0) base.raw = conceptBag(text);
1060
1060
  return base;
1061
1061
  }
1062
1062
  function canonicalClaimId(text, scope) {
@@ -32475,7 +32475,7 @@ function triageBullet(ref) {
32475
32475
  " \u2022 you diagnosed a cause \u2014 fold the chain into the flag with <- (caused-by), deepest",
32476
32476
  " sure mechanism rightmost: [!symptom <- cause <- root cause]. Symptom and cause far",
32477
32477
  " apart? open a thread [!#slug symptom] \u2026 later bind (cause:#slug mechanism);",
32478
- ` explaining a problem we SHOWED you \u2192 (cause:[${ref}] \u2026)`
32478
+ ` explaining a SHOWN problem \u2192 ${TAG_EXAMPLE.triageExplain(ref)}`
32479
32479
  ].join("\n");
32480
32480
  }
32481
32481
  function linkBullet(ref) {
@@ -32536,6 +32536,8 @@ var init_agent_signals = __esm({
32536
32536
  // links to a cited RootCause/Solution node; `(cause: free text)` mints a RootCause
32537
32537
  // from the text. Harvested in prior-tags.ts → engine.ts (see the triage note below).
32538
32538
  triage: (ref) => `(cause:[${ref}])`,
32539
+ // Unlike a bare cause citation, this handle names the Problem being explained.
32540
+ triageExplain: (ref) => `(cause:[${ref}] the mechanism)`,
32539
32541
  // The MINT form — free-text cause that mints a RootCause. Prime-time surfacing
32540
32542
  // (recallForFile) pastes this next to an open Problem that has no cause yet, so the
32541
32543
  // diagnostic moment is cued when the agent is looking at the problem. Kept here so
@@ -77493,6 +77495,32 @@ function emptyTagDispositions() {
77493
77495
  flagAsHandle: 0
77494
77496
  };
77495
77497
  }
77498
+ function parseCauseTag(content, sentence, threadId, dispositions) {
77499
+ const body2 = content.replace(/\s+/g, " ").trim();
77500
+ const cited = new RegExp(HANDLE_RE.source, "i").exec(body2);
77501
+ const handle2 = cited ? cited[1] ?? cited[2] : void 0;
77502
+ const base = { kind: "triage", sentence, ...threadId ? { threadId } : {} };
77503
+ if (handle2 && cited) {
77504
+ if (isPlaceholderHandle(handle2)) {
77505
+ dispositions.placeholderEcho++;
77506
+ return;
77507
+ }
77508
+ const mechanism = body2.slice(cited.index + cited[0].length).trim();
77509
+ if (!threadId && cited.index === 0 && mechanism) {
77510
+ if (mechanism.length < CAUSE_TEXT_MIN) {
77511
+ dispositions.causeTooShort++;
77512
+ return;
77513
+ }
77514
+ return { ...base, symptomHandle: handle2, causeText: mechanism };
77515
+ }
77516
+ return { ...base, handle: handle2 };
77517
+ }
77518
+ if (body2.length < CAUSE_TEXT_MIN) {
77519
+ dispositions.causeTooShort++;
77520
+ return;
77521
+ }
77522
+ return { ...base, causeText: body2 };
77523
+ }
77496
77524
  function addTagDispositions(a, b) {
77497
77525
  a.invalidVulnerability += b.invalidVulnerability;
77498
77526
  a.oversizeSegments += b.oversizeSegments;
@@ -77615,22 +77643,8 @@ function parseInlineTagsWithDispositions(text) {
77615
77643
  if (isFix) content = content.replace(FIX_PREFIX, "");
77616
77644
  else if (isCause) content = content.replace(CAUSE_PREFIX, "");
77617
77645
  if (isCause) {
77618
- HANDLE_RE.lastIndex = 0;
77619
- const h2 = HANDLE_RE.exec(content);
77620
- let handle2 = h2 ? h2[1] ?? h2[2] : void 0;
77621
- if (handle2 && isPlaceholderHandle(handle2)) {
77622
- dispositions.placeholderEcho++;
77623
- handle2 = void 0;
77624
- }
77625
- if (handle2) {
77626
- out2.push({ kind: "triage", handle: handle2, sentence: sfield, ...verbThread ? { threadId: verbThread } : {} });
77627
- } else {
77628
- const raw3 = content.replace(/\s+/g, " ").trim();
77629
- if (raw3.length >= CAUSE_TEXT_MIN) {
77630
- const causeText = raw3;
77631
- out2.push({ kind: "triage", causeText, sentence: sfield, ...verbThread ? { threadId: verbThread } : {} });
77632
- } else dispositions.causeTooShort++;
77633
- }
77646
+ const cause = parseCauseTag(content, sfield, verbThread, dispositions);
77647
+ if (cause) out2.push(cause);
77634
77648
  continue;
77635
77649
  }
77636
77650
  if (!isFix && NEG.test(clauseBefore(sentence, g.index))) {
@@ -77681,6 +77695,11 @@ function parseInlineTagsWithDispositions(text) {
77681
77695
  if (citeMatched.has(lm.index)) continue;
77682
77696
  const verbThread = lm[1] ?? void 0;
77683
77697
  const content = lm[2];
77698
+ if (!pass.isFix) {
77699
+ const cause = parseCauseTag(content, sfield, verbThread, dispositions);
77700
+ if (cause) out2.push(cause);
77701
+ continue;
77702
+ }
77684
77703
  HANDLE_RE.lastIndex = 0;
77685
77704
  const h = HANDLE_RE.exec(content);
77686
77705
  let handle2 = h ? h[1] ?? h[2] : void 0;
@@ -77688,16 +77707,6 @@ function parseInlineTagsWithDispositions(text) {
77688
77707
  dispositions.placeholderEcho++;
77689
77708
  handle2 = void 0;
77690
77709
  }
77691
- if (!pass.isFix) {
77692
- if (handle2) {
77693
- out2.push({ kind: "triage", handle: handle2, sentence: sfield, ...verbThread ? { threadId: verbThread } : {} });
77694
- } else {
77695
- const causeText = content.replace(/\s+/g, " ").trim();
77696
- if (causeText.length >= CAUSE_TEXT_MIN)
77697
- out2.push({ kind: "triage", causeText, sentence: sfield, ...verbThread ? { threadId: verbThread } : {} });
77698
- }
77699
- continue;
77700
- }
77701
77710
  if (handle2) {
77702
77711
  const inGroup = content.replace(new RegExp(HANDLE_RE.source, "gi"), " ").replace(/\s+/g, " ").trim();
77703
77712
  const r = inGroup.length >= FIX_RATIONALE_MIN ? inGroup : deriveFixRationale(sentence, lm.index, lm.index + lm[0].length);
@@ -78214,7 +78223,14 @@ function harvestInlineTags(store, text, opts) {
78214
78223
  }
78215
78224
  }
78216
78225
  } else if (tag.kind === "triage") {
78217
- const b = bindSymptom(tag.seq, tag.threadId);
78226
+ const symptomId = tag.symptomHandle ? resolveCited("triage", tag.symptomHandle) : null;
78227
+ const symptom = symptomId ? store.getNode(symptomId) : null;
78228
+ if (tag.symptomHandle && !symptom) continue;
78229
+ if (symptom && (symptom.label !== "Problem" || !symptom.description?.trim())) {
78230
+ plan.dispositions.unparseable++;
78231
+ continue;
78232
+ }
78233
+ const b = symptom ? { statement: symptom.description, problemId: symptom.id, evidence: "witnessed" } : bindSymptom(tag.seq, tag.threadId);
78218
78234
  const bound = {
78219
78235
  ...b.statement ? { symptomStatement: b.statement } : {},
78220
78236
  ...b.problemId ? { symptomProblemId: b.problemId } : {},
@@ -82853,7 +82869,7 @@ function createWatchBreaker(deps) {
82853
82869
  }
82854
82870
 
82855
82871
  // src/engine.ts
82856
- var DAEMON_VERSION = true ? "2.0.21-dev.3716" : "2.0.0-alpha.0";
82872
+ var DAEMON_VERSION = true ? "2.0.21-dev.3745" : "2.0.0-alpha.0";
82857
82873
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
82858
82874
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
82859
82875
  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.21-dev.3716",
3
+ "version": "2.0.21-dev.3745",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errata-context",
3
- "version": "2.0.21-dev.3716",
3
+ "version": "2.0.21-dev.3745",
4
4
  "description": "A minimal 3D view of loaded Errata priors and recent graph bursts.",
5
5
  "author": {
6
6
  "name": "inErrata"
@@ -1,4 +1,4 @@
1
- da2a059b614c25491075da85eaf5f31609a9b467573b8dc378237c618d1fe1a4 .codex-plugin/plugin.json
1
+ 1aa33af9d2cae022f6d281c977018288c7259abde1cb3b69ba8d5033fa3cd5ab .codex-plugin/plugin.json
2
2
  a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
3
3
  fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
4
4
  73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js