@inerrata-corporation/errata 2.0.2-dev.930 → 2.0.2-dev.938

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 +56 -7
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -53019,6 +53019,20 @@ import { readFileSync as readFileSync10, writeFileSync as writeFileSync10 } from
53019
53019
  var NEG = /n['']t|\b(?:not|never|no|none|neither|nor|unrelated|irrelevant|would|might|could|if)\b/i;
53020
53020
  var CITE_GROUP_RE = /\(((?:[^()\n]|\([^()\n]*\)){1,200})\)/g;
53021
53021
  var HANDLE_RE = /\[([a-z0-9][\w-]{0,80})\]|((?:pat|sol|drc|dcause|dfix|dprob|prob|claim|err)_[0-9a-f]{6,})/gi;
53022
+ var PLACEHOLDER_HANDLES = /* @__PURE__ */ new Set([
53023
+ "handle",
53024
+ "its-handle",
53025
+ "another",
53026
+ "a-third",
53027
+ "h",
53028
+ "h1",
53029
+ "h2",
53030
+ "id",
53031
+ "its-id",
53032
+ "a",
53033
+ "b"
53034
+ ]);
53035
+ var isPlaceholderHandle = (h) => PLACEHOLDER_HANDLES.has(h.toLowerCase());
53022
53036
  var FIX_PREFIX = /^\s*fix:(?:#([a-z][\w-]{0,63}))?\s*/i;
53023
53037
  var CONSTRAINT_RE = /\(\s*constraint:\s*([^()\n]{8,}?)\s*\)/gi;
53024
53038
  var CAUSE_PREFIX = /^\s*cause:(?:#([a-z][\w-]{0,63}))?\s*/i;
@@ -53077,7 +53091,8 @@ function emptyTagDispositions() {
53077
53091
  refuteTooShort: 0,
53078
53092
  causeTooShort: 0,
53079
53093
  negated: 0,
53080
- unparseable: 0
53094
+ unparseable: 0,
53095
+ placeholderEcho: 0
53081
53096
  };
53082
53097
  }
53083
53098
  function addTagDispositions(a, b) {
@@ -53087,6 +53102,7 @@ function addTagDispositions(a, b) {
53087
53102
  a.causeTooShort += b.causeTooShort;
53088
53103
  a.negated += b.negated;
53089
53104
  a.unparseable += b.unparseable;
53105
+ a.placeholderEcho += b.placeholderEcho;
53090
53106
  }
53091
53107
  function parseInlineTags(text) {
53092
53108
  return parseInlineTagsWithDispositions(text).tags;
@@ -53134,7 +53150,12 @@ function parseInlineTagsWithDispositions(text) {
53134
53150
  let hh;
53135
53151
  while ((hh = HANDLE_RE.exec(body2)) !== null) {
53136
53152
  const handle2 = hh[1] ?? hh[2];
53137
- if (handle2 && !handles.includes(handle2)) handles.push(handle2);
53153
+ if (!handle2) continue;
53154
+ if (isPlaceholderHandle(handle2)) {
53155
+ dispositions.placeholderEcho++;
53156
+ continue;
53157
+ }
53158
+ if (!handles.includes(handle2)) handles.push(handle2);
53138
53159
  }
53139
53160
  if (handles.length > 0) {
53140
53161
  const kind = aidsM ? "transfer" : instM ? "instance" : ssM.kind;
@@ -53152,7 +53173,11 @@ function parseInlineTagsWithDispositions(text) {
53152
53173
  const body2 = content.replace(confirmM ? CONFIRM_PREFIX : REFUTE_PREFIX, "");
53153
53174
  HANDLE_RE.lastIndex = 0;
53154
53175
  const h2 = HANDLE_RE.exec(body2);
53155
- const handle2 = h2 ? h2[1] ?? h2[2] : void 0;
53176
+ let handle2 = h2 ? h2[1] ?? h2[2] : void 0;
53177
+ if (handle2 && isPlaceholderHandle(handle2)) {
53178
+ dispositions.placeholderEcho++;
53179
+ handle2 = void 0;
53180
+ }
53156
53181
  if (handle2) {
53157
53182
  if (refuteM) {
53158
53183
  const reason = body2.replace(new RegExp(HANDLE_RE.source, "gi"), " ").replace(/\s+/g, " ").trim();
@@ -53170,7 +53195,11 @@ function parseInlineTagsWithDispositions(text) {
53170
53195
  if (isCause) {
53171
53196
  HANDLE_RE.lastIndex = 0;
53172
53197
  const h2 = HANDLE_RE.exec(content);
53173
- const handle2 = h2 ? h2[1] ?? h2[2] : void 0;
53198
+ let handle2 = h2 ? h2[1] ?? h2[2] : void 0;
53199
+ if (handle2 && isPlaceholderHandle(handle2)) {
53200
+ dispositions.placeholderEcho++;
53201
+ handle2 = void 0;
53202
+ }
53174
53203
  if (handle2) {
53175
53204
  out2.push({ kind: "triage", handle: handle2, sentence: sfield, ...verbThread ? { threadId: verbThread } : {} });
53176
53205
  } else {
@@ -53196,6 +53225,10 @@ function parseInlineTagsWithDispositions(text) {
53196
53225
  let emittedHandle = false;
53197
53226
  while ((h = HANDLE_RE.exec(content)) !== null) {
53198
53227
  const handle2 = h[1] ?? h[2];
53228
+ if (handle2 && isPlaceholderHandle(handle2)) {
53229
+ dispositions.placeholderEcho++;
53230
+ continue;
53231
+ }
53199
53232
  if (handle2) {
53200
53233
  emittedHandle = true;
53201
53234
  out2.push({
@@ -53228,7 +53261,11 @@ function parseInlineTagsWithDispositions(text) {
53228
53261
  const content = lm[2];
53229
53262
  HANDLE_RE.lastIndex = 0;
53230
53263
  const h = HANDLE_RE.exec(content);
53231
- const handle2 = h ? h[1] ?? h[2] : void 0;
53264
+ let handle2 = h ? h[1] ?? h[2] : void 0;
53265
+ if (handle2 && isPlaceholderHandle(handle2)) {
53266
+ dispositions.placeholderEcho++;
53267
+ handle2 = void 0;
53268
+ }
53232
53269
  if (!pass.isFix) {
53233
53270
  if (handle2) {
53234
53271
  out2.push({ kind: "triage", handle: handle2, sentence: sfield, ...verbThread ? { threadId: verbThread } : {} });
@@ -56192,7 +56229,7 @@ function createLivenessWatch(deps) {
56192
56229
  }
56193
56230
 
56194
56231
  // src/engine.ts
56195
- var DAEMON_VERSION = true ? "2.0.2-dev.930" : "2.0.0-alpha.0";
56232
+ var DAEMON_VERSION = true ? "2.0.2-dev.938" : "2.0.0-alpha.0";
56196
56233
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
56197
56234
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
56198
56235
  var GIT_OP_MUTE_MS = 4e3;
@@ -56504,12 +56541,23 @@ function createWorkspaceEngine(opts) {
56504
56541
  });
56505
56542
  }
56506
56543
  setImmediate(() => {
56544
+ const reconcileStartedAt = Date.now();
56507
56545
  const reconcile = passWorker ? passWorker.reconcile().catch(() => reconcileStaleFiles(store, opts.workspaceRoot, profile.id)) : reconcileStaleFiles(store, opts.workspaceRoot, profile.id);
56508
56546
  void reconcile.then((n) => {
56547
+ appendPassLedger(paths.configDir, "reconcile", Date.now() - reconcileStartedAt, {
56548
+ filesReindexed: n,
56549
+ failedBatches: 0
56550
+ });
56509
56551
  if (n > 0) {
56510
56552
  console.log(`[errata] reconcile: re-indexed ${n} stale file(s) on startup`);
56511
56553
  }
56512
- }).catch((err2) => console.warn("[errata] startup reconcile failed:", err2)).finally(() => {
56554
+ }).catch((err2) => {
56555
+ appendPassLedger(paths.configDir, "reconcile", Date.now() - reconcileStartedAt, {
56556
+ filesReindexed: 0,
56557
+ failedBatches: 1
56558
+ });
56559
+ console.warn("[errata] startup reconcile failed:", err2);
56560
+ }).finally(() => {
56513
56561
  try {
56514
56562
  const reap = reapOrphanedFiles(store, opts.workspaceRoot, profile.id);
56515
56563
  appendPassLedger(paths.configDir, "orphan-reap", 0, {
@@ -57591,6 +57639,7 @@ function createWorkspaceEngine(opts) {
57591
57639
  tagsCauseTooShort: dispositions.causeTooShort,
57592
57640
  tagsNegated: dispositions.negated,
57593
57641
  tagsUnparseable: dispositions.unparseable,
57642
+ tagsPlaceholderEcho: dispositions.placeholderEcho,
57594
57643
  unresolvedHandles,
57595
57644
  priorEdgesFlagOff,
57596
57645
  priorEdgesNoSource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.930",
3
+ "version": "2.0.2-dev.938",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {