@inerrata-corporation/errata 2.0.6-dev.2266 → 2.0.6-dev.2272

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.
Files changed (2) hide show
  1. package/errata.mjs +93 -5
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -74013,6 +74013,8 @@ var CAUSE_PREFIX = /^\s*cause:(?:#([a-z][\w-]{0,63}))?\s*/i;
74013
74013
  var NEST2_UNIT = String.raw`(?:[^()\n]|\((?:[^()\n]|\([^()\n]*\))*\))`;
74014
74014
  var FIX_LONG_RE = new RegExp(String.raw`\(\s*fix:(?:#([a-z][\w-]{0,63}))?\s*(${NEST2_UNIT}{12,}?)\s*\)`, "gi");
74015
74015
  var CAUSE_LONG_RE = new RegExp(String.raw`\(\s*cause:(?:#([a-z][\w-]{0,63}))?\s*(${NEST2_UNIT}{8,}?)\s*\)`, "gi");
74016
+ var CONFIRM_LONG_RE = new RegExp(String.raw`\(\s*confirm:\s*(${NEST2_UNIT}{4,}?)\s*\)`, "gi");
74017
+ var REFUTE_LONG_RE = new RegExp(String.raw`\(\s*refute:\s*(${NEST2_UNIT}{4,}?)\s*\)`, "gi");
74016
74018
  var CAUSE_ARROW = /\s+(?:<-|←)\s+/;
74017
74019
  var ATTEMPT_RE = /\(\s*(tried|failed):(?:#([a-z][\w-]{0,63}))?\s*((?:[^()\n]|\([^()\n]*\)){8,}?)\s*\)/gi;
74018
74020
  var AIDS_PREFIX = /^\s*aids:(?:#([a-z][\w-]{0,63}))?\s*/i;
@@ -74066,7 +74068,8 @@ function emptyTagDispositions() {
74066
74068
  causeTooShort: 0,
74067
74069
  negated: 0,
74068
74070
  unparseable: 0,
74069
- placeholderEcho: 0
74071
+ placeholderEcho: 0,
74072
+ verdictNoHandle: 0
74070
74073
  };
74071
74074
  }
74072
74075
  function addTagDispositions(a, b) {
@@ -74077,6 +74080,7 @@ function addTagDispositions(a, b) {
74077
74080
  a.negated += b.negated;
74078
74081
  a.unparseable += b.unparseable;
74079
74082
  a.placeholderEcho += b.placeholderEcho;
74083
+ a.verdictNoHandle += b.verdictNoHandle;
74080
74084
  }
74081
74085
  function parseInlineTags(text) {
74082
74086
  return parseInlineTagsWithDispositions(text).tags;
@@ -74160,6 +74164,8 @@ function parseInlineTagsWithDispositions(text) {
74160
74164
  } else {
74161
74165
  out2.push({ kind: "confirm", handle: handle2, sentence: sfield });
74162
74166
  }
74167
+ } else {
74168
+ dispositions.verdictNoHandle++;
74163
74169
  }
74164
74170
  continue;
74165
74171
  }
@@ -74276,6 +74282,35 @@ function parseInlineTagsWithDispositions(text) {
74276
74282
  out2.push({ kind: "fix", fixRationale: note, sentence: sfield, ...verbThread ? { threadId: verbThread } : {} });
74277
74283
  }
74278
74284
  }
74285
+ for (const pass of [
74286
+ { re: CONFIRM_LONG_RE, refute: false },
74287
+ { re: REFUTE_LONG_RE, refute: true }
74288
+ ]) {
74289
+ pass.re.lastIndex = 0;
74290
+ let vm;
74291
+ while ((vm = pass.re.exec(sentence)) !== null) {
74292
+ if (citeMatched.has(vm.index)) continue;
74293
+ const body2 = vm[1];
74294
+ HANDLE_RE.lastIndex = 0;
74295
+ const h = HANDLE_RE.exec(body2);
74296
+ let handle2 = h ? h[1] ?? h[2] : void 0;
74297
+ if (handle2 && isPlaceholderHandle(handle2)) {
74298
+ dispositions.placeholderEcho++;
74299
+ handle2 = void 0;
74300
+ }
74301
+ if (!handle2) {
74302
+ dispositions.verdictNoHandle++;
74303
+ continue;
74304
+ }
74305
+ if (pass.refute) {
74306
+ const reason = body2.replace(new RegExp(HANDLE_RE.source, "gi"), " ").replace(/\s+/g, " ").trim();
74307
+ if (reason.length >= REFUTE_REASON_MIN) out2.push({ kind: "refute", handle: handle2, statement: reason, sentence: sfield });
74308
+ else dispositions.refuteTooShort++;
74309
+ } else {
74310
+ out2.push({ kind: "confirm", handle: handle2, sentence: sfield });
74311
+ }
74312
+ }
74313
+ }
74279
74314
  FLAG_RE.lastIndex = 0;
74280
74315
  let f;
74281
74316
  while ((f = FLAG_RE.exec(sentence)) !== null) {
@@ -77521,6 +77556,23 @@ function partitionReplayable(queue, channel, isShipped) {
77521
77556
  function retireWitnesses(queue, channel, settledKeys) {
77522
77557
  return queue.filter((w) => !(w.channel === channel && settledKeys.has(w.witnessKey)));
77523
77558
  }
77559
+ var WIRE_SHIPPED_LABELS = /* @__PURE__ */ new Set(["Problem", "Solution", "RootCause"]);
77560
+ var MOTIF_ID_PREFIX = "motif_community_";
77561
+ var CANONICAL_ID_RE = /^(?:pat|sol|drc|dcause|dfix|dprob|prob|claim|err)_[0-9a-f]{6,}$/i;
77562
+ function classifyWitnessTarget(nodeId, getNode) {
77563
+ if (nodeId.startsWith(MOTIF_ID_PREFIX)) {
77564
+ const exemplar = nodeId.slice(MOTIF_ID_PREFIX.length);
77565
+ if (CANONICAL_ID_RE.test(exemplar) && !exemplar.startsWith("pat_")) {
77566
+ const v = classifyWitnessTarget(exemplar, getNode);
77567
+ return v.kind === "deliverable" ? { kind: "translated", nodeId: v.nodeId } : v;
77568
+ }
77569
+ return { kind: "undeliverable", label: "Pattern" };
77570
+ }
77571
+ const n = getNode(nodeId);
77572
+ if (!n) return { kind: "deliverable", nodeId };
77573
+ if (WIRE_SHIPPED_LABELS.has(n.label)) return { kind: "deliverable", nodeId };
77574
+ return { kind: "undeliverable", label: n.label };
77575
+ }
77524
77576
 
77525
77577
  // src/engine.ts
77526
77578
  init_witness_ledger();
@@ -78046,7 +78098,7 @@ function createWatchBreaker(deps) {
78046
78098
  }
78047
78099
 
78048
78100
  // src/engine.ts
78049
- var DAEMON_VERSION = true ? "2.0.6-dev.2266" : "2.0.0-alpha.0";
78101
+ var DAEMON_VERSION = true ? "2.0.6-dev.2272" : "2.0.0-alpha.0";
78050
78102
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
78051
78103
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
78052
78104
  var GIT_OP_MUTE_MS = 4e3;
@@ -79467,8 +79519,39 @@ function createWorkspaceEngine(opts) {
79467
79519
  const n = store.getNode(nodeId);
79468
79520
  return !n || n.attrs["contributedAtSeq"] != null;
79469
79521
  };
79522
+ const getNode = (id) => store.getNode(id);
79523
+ let undeliverable = 0;
79524
+ const routedFresh = [];
79525
+ for (const f of fresh) {
79526
+ const v = classifyWitnessTarget(f.nodeId, getNode);
79527
+ if (v.kind === "undeliverable") {
79528
+ undeliverable++;
79529
+ continue;
79530
+ }
79531
+ routedFresh.push({ nodeId: v.nodeId, witnessKey: f.witnessKey });
79532
+ }
79533
+ const healed = [];
79534
+ for (const q of witnessQueue) {
79535
+ if (q.channel !== channel) {
79536
+ healed.push(q);
79537
+ continue;
79538
+ }
79539
+ const v = classifyWitnessTarget(q.nodeId, getNode);
79540
+ if (v.kind === "undeliverable") {
79541
+ undeliverable++;
79542
+ continue;
79543
+ }
79544
+ healed.push(v.nodeId === q.nodeId ? q : { ...q, nodeId: v.nodeId });
79545
+ }
79546
+ witnessQueue = healed;
79547
+ fresh = routedFresh;
79470
79548
  const { replay: queued, waiting } = partitionReplayable(witnessQueue, channel, isShipped);
79471
79549
  if (fresh.length === 0 && queued.length === 0) {
79550
+ if (undeliverable > 0) {
79551
+ saveWitnessQueue(witnessQueuePath(paths.configDir), witnessQueue);
79552
+ appendWitnessLedger(paths.configDir, { ts: Date.now(), channel, undeliverable, parked: pendingFor(witnessQueue, channel).length });
79553
+ console.log(`[errata] ${channel}: ${undeliverable} witness(es) retired \u2014 cited node class never ships (counted, not parked)`);
79554
+ }
79472
79555
  if (waiting.length > 0) {
79473
79556
  console.log(`[errata] ${channel}: ${waiting.length} parked awaiting node drain`);
79474
79557
  }
@@ -79520,7 +79603,7 @@ function createWorkspaceEngine(opts) {
79520
79603
  witnessQueue = enq.queue;
79521
79604
  saveWitnessQueue(witnessQueuePath(paths.configDir), witnessQueue);
79522
79605
  const lost = enq.dropped.expiredTtl + enq.dropped.exhaustedAttempts + enq.dropped.cappedOverflow;
79523
- if (lost > 0 || recovered > 0) {
79606
+ if (lost > 0 || recovered > 0 || undeliverable > 0) {
79524
79607
  appendPassLedger(paths.configDir, "witness-queue", 0, {
79525
79608
  recovered,
79526
79609
  replayed: queued.length,
@@ -79528,7 +79611,8 @@ function createWorkspaceEngine(opts) {
79528
79611
  parked: pendingFor(witnessQueue, channel).length,
79529
79612
  expiredTtl: enq.dropped.expiredTtl,
79530
79613
  exhaustedAttempts: enq.dropped.exhaustedAttempts,
79531
- cappedOverflow: enq.dropped.cappedOverflow
79614
+ cappedOverflow: enq.dropped.cappedOverflow,
79615
+ undeliverable
79532
79616
  });
79533
79617
  }
79534
79618
  console.log(
@@ -79542,7 +79626,8 @@ function createWorkspaceEngine(opts) {
79542
79626
  duplicate,
79543
79627
  selfGated,
79544
79628
  parked: pendingFor(witnessQueue, channel).length,
79545
- awaitingDrain: waiting.length
79629
+ awaitingDrain: waiting.length,
79630
+ ...undeliverable > 0 ? { undeliverable } : {}
79546
79631
  });
79547
79632
  };
79548
79633
  if (typeof cloud.reportContradictions === "function") {
@@ -79667,6 +79752,9 @@ function createWorkspaceEngine(opts) {
79667
79752
  tagsNegated: dispositions.negated,
79668
79753
  tagsUnparseable: dispositions.unparseable,
79669
79754
  tagsPlaceholderEcho: dispositions.placeholderEcho,
79755
+ // HZ-corrob-wire: a verdict group naming no resolvable handle — judged,
79756
+ // but nothing judgeable was cited.
79757
+ tagsVerdictNoHandle: dispositions.verdictNoHandle,
79670
79758
  unresolvedHandles,
79671
79759
  priorEdgesFlagOff,
79672
79760
  priorEdgesNoSource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.6-dev.2266",
3
+ "version": "2.0.6-dev.2272",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {