@inerrata-corporation/errata 2.0.2-dev.342 → 2.0.2-dev.344

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.
@@ -15511,6 +15511,51 @@ var init_review = __esm({
15511
15511
  }
15512
15512
  });
15513
15513
 
15514
+ // ../../packages/local-shared/src/anchorable.ts
15515
+ function anchorableExtensionAlternation() {
15516
+ return BY_LENGTH.map((e) => e.slice(1).replace(/[+.]/g, (c) => `\\${c}`)).join("|");
15517
+ }
15518
+ var ANCHORABLE_EXTENSIONS, BY_LENGTH;
15519
+ var init_anchorable = __esm({
15520
+ "../../packages/local-shared/src/anchorable.ts"() {
15521
+ "use strict";
15522
+ ANCHORABLE_EXTENSIONS = /* @__PURE__ */ new Set([
15523
+ // typescript provider
15524
+ ".ts",
15525
+ ".tsx",
15526
+ ".js",
15527
+ ".jsx",
15528
+ ".mjs",
15529
+ ".cjs",
15530
+ // python / go / rust / ruby / csharp providers
15531
+ ".py",
15532
+ ".go",
15533
+ ".rs",
15534
+ ".rb",
15535
+ ".cs",
15536
+ // cpp provider — every variant it parses, not just the three that were listed
15537
+ ".c",
15538
+ ".h",
15539
+ ".cpp",
15540
+ ".cc",
15541
+ ".cxx",
15542
+ ".c++",
15543
+ ".hpp",
15544
+ ".hh",
15545
+ ".hxx",
15546
+ ".h++",
15547
+ // CUDA — the cpp provider parses these too. Missed when this list was first
15548
+ // transcribed by hand; the parity test caught them on its very first run,
15549
+ // which is the argument for the test existing.
15550
+ ".cu",
15551
+ ".cuh",
15552
+ // no provider yet; the grammar ships. Inert, not wrong — see above.
15553
+ ".java"
15554
+ ]);
15555
+ BY_LENGTH = [...ANCHORABLE_EXTENSIONS].sort((a, b) => b.length - a.length);
15556
+ }
15557
+ });
15558
+
15514
15559
  // ../../packages/local-shared/src/sqlite-adapter.ts
15515
15560
  function openDatabase(path) {
15516
15561
  const db = new DatabaseSync(path);
@@ -15612,6 +15657,7 @@ var init_src2 = __esm({
15612
15657
  init_profile();
15613
15658
  init_daemon_wire();
15614
15659
  init_review();
15660
+ init_anchorable();
15615
15661
  init_sqlite_adapter();
15616
15662
  }
15617
15663
  });
@@ -16632,6 +16678,11 @@ init_src();
16632
16678
 
16633
16679
  // ../../packages/local-graph/src/anchor-backfill.ts
16634
16680
  init_src();
16681
+ init_src2();
16682
+ var STATEMENT_PATH_RE = new RegExp(
16683
+ String.raw`(?:[\w.+-]+\/)+[\w.+-]+\.(?:${anchorableExtensionAlternation()})`,
16684
+ "g"
16685
+ );
16635
16686
 
16636
16687
  // ../../packages/local-graph/src/percolate.ts
16637
16688
  init_src2();
package/errata.mjs CHANGED
@@ -16309,6 +16309,55 @@ var init_review = __esm({
16309
16309
  }
16310
16310
  });
16311
16311
 
16312
+ // ../../packages/local-shared/src/anchorable.ts
16313
+ function isAnchorableCodePath(relPath) {
16314
+ const p = relPath.toLowerCase();
16315
+ return BY_LENGTH.some((ext) => p.endsWith(ext));
16316
+ }
16317
+ function anchorableExtensionAlternation() {
16318
+ return BY_LENGTH.map((e) => e.slice(1).replace(/[+.]/g, (c) => `\\${c}`)).join("|");
16319
+ }
16320
+ var ANCHORABLE_EXTENSIONS, BY_LENGTH;
16321
+ var init_anchorable = __esm({
16322
+ "../../packages/local-shared/src/anchorable.ts"() {
16323
+ "use strict";
16324
+ ANCHORABLE_EXTENSIONS = /* @__PURE__ */ new Set([
16325
+ // typescript provider
16326
+ ".ts",
16327
+ ".tsx",
16328
+ ".js",
16329
+ ".jsx",
16330
+ ".mjs",
16331
+ ".cjs",
16332
+ // python / go / rust / ruby / csharp providers
16333
+ ".py",
16334
+ ".go",
16335
+ ".rs",
16336
+ ".rb",
16337
+ ".cs",
16338
+ // cpp provider — every variant it parses, not just the three that were listed
16339
+ ".c",
16340
+ ".h",
16341
+ ".cpp",
16342
+ ".cc",
16343
+ ".cxx",
16344
+ ".c++",
16345
+ ".hpp",
16346
+ ".hh",
16347
+ ".hxx",
16348
+ ".h++",
16349
+ // CUDA — the cpp provider parses these too. Missed when this list was first
16350
+ // transcribed by hand; the parity test caught them on its very first run,
16351
+ // which is the argument for the test existing.
16352
+ ".cu",
16353
+ ".cuh",
16354
+ // no provider yet; the grammar ships. Inert, not wrong — see above.
16355
+ ".java"
16356
+ ]);
16357
+ BY_LENGTH = [...ANCHORABLE_EXTENSIONS].sort((a, b) => b.length - a.length);
16358
+ }
16359
+ });
16360
+
16312
16361
  // ../../packages/local-shared/src/sqlite-adapter.ts
16313
16362
  function openDatabase(path2) {
16314
16363
  const db = new DatabaseSync(path2);
@@ -16410,6 +16459,7 @@ var init_src2 = __esm({
16410
16459
  init_profile();
16411
16460
  init_daemon_wire();
16412
16461
  init_review();
16462
+ init_anchorable();
16413
16463
  init_sqlite_adapter();
16414
16464
  }
16415
16465
  });
@@ -18563,7 +18613,7 @@ function tokenJaccard(a, b) {
18563
18613
  }
18564
18614
  function reinforceSameAnchorProblem(store, relPath, workspaceId2, statement, source, ts, kind = "problem") {
18565
18615
  const stmt = statement.trim();
18566
- if (!ANCHORABLE_CODE.test(relPath)) return null;
18616
+ if (!isAnchorableCodePath(relPath)) return null;
18567
18617
  const file2 = resolveFileNode(store, relPath, workspaceId2);
18568
18618
  if (!file2) return null;
18569
18619
  const selfId = identityId({ kind: "DesignProblem", statement: stmt });
@@ -18668,7 +18718,7 @@ function anchorSolutionToDiff(store, solutionId, changedPaths, workspaceId2, t,
18668
18718
  function anchorNodeToDiff(store, nodeId, expectLabel, changedPaths, workspaceId2, t, opts = {}) {
18669
18719
  const n0 = store.getNode(nodeId);
18670
18720
  if (!n0 || n0.label !== expectLabel) return 0;
18671
- const code = changedPaths.filter((f) => ANCHORABLE_CODE.test(f));
18721
+ const code = changedPaths.filter((f) => isAnchorableCodePath(f));
18672
18722
  const cap = opts.maxFiles ?? MAX_ANCHOR_FILES;
18673
18723
  if (code.length === 0 || code.length > cap) return 0;
18674
18724
  const already = new Set(store.outEdges(nodeId, ["ANCHORED_AT"]).map((e) => e.to));
@@ -18689,7 +18739,7 @@ function solutionForProblem(store, problemId) {
18689
18739
  function anchorProblemToWorkingFile(store, problemId, relPath, workspaceId2, ts, provenance = "edited") {
18690
18740
  const p = store.getNode(problemId);
18691
18741
  if (!p || p.label !== "Problem") return false;
18692
- if (!ANCHORABLE_CODE.test(relPath)) return false;
18742
+ if (!isAnchorableCodePath(relPath)) return false;
18693
18743
  const file2 = resolveFileNode(store, relPath, workspaceId2);
18694
18744
  if (!file2) return false;
18695
18745
  const already = new Set(store.outEdges(problemId, ["ANCHORED_AT"]).map((e) => e.to));
@@ -18837,7 +18887,7 @@ function markFixCandidates(store, t) {
18837
18887
  }
18838
18888
  return resolved;
18839
18889
  }
18840
- var DESIGN_PROMOTE_AT, DEDUP_STOPWORDS, SAME_ANCHOR_DEDUP_JACCARD, CITABLE_PRIOR_LABELS, ANCHORABLE_CODE, MAX_ANCHOR_FILES, AUTO_MINT_PREFIX;
18890
+ var DESIGN_PROMOTE_AT, DEDUP_STOPWORDS, SAME_ANCHOR_DEDUP_JACCARD, CITABLE_PRIOR_LABELS, MAX_ANCHOR_FILES, AUTO_MINT_PREFIX;
18841
18891
  var init_design_problem = __esm({
18842
18892
  "../../packages/local-graph/src/design-problem.ts"() {
18843
18893
  "use strict";
@@ -18877,7 +18927,6 @@ var init_design_problem = __esm({
18877
18927
  "Technique",
18878
18928
  "AntiPattern"
18879
18929
  ]);
18880
- ANCHORABLE_CODE = /\.(ts|tsx|js|mjs|cjs|py|go|rs|java|rb|c|cpp|h)$/;
18881
18930
  MAX_ANCHOR_FILES = 5;
18882
18931
  AUTO_MINT_PREFIX = "addressed by an edit to ";
18883
18932
  }
@@ -19025,7 +19074,11 @@ var init_anchor_backfill = __esm({
19025
19074
  init_src();
19026
19075
  init_justification();
19027
19076
  init_design_problem();
19028
- STATEMENT_PATH_RE = /(?:[\w.-]+\/)+[\w.-]+\.(?:ts|tsx|js|mjs|cjs|py|go|rs|java|rb|c|cpp|h)/g;
19077
+ init_src2();
19078
+ STATEMENT_PATH_RE = new RegExp(
19079
+ String.raw`(?:[\w.+-]+\/)+[\w.+-]+\.(?:${anchorableExtensionAlternation()})`,
19080
+ "g"
19081
+ );
19029
19082
  }
19030
19083
  });
19031
19084
 
@@ -53147,7 +53200,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
53147
53200
  }
53148
53201
 
53149
53202
  // src/engine.ts
53150
- var DAEMON_VERSION = true ? "2.0.2-dev.342" : "2.0.0-alpha.0";
53203
+ var DAEMON_VERSION = true ? "2.0.2-dev.344" : "2.0.0-alpha.0";
53151
53204
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
53152
53205
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
53153
53206
  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.342",
3
+ "version": "2.0.2-dev.344",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -15356,6 +15356,51 @@ var init_review = __esm({
15356
15356
  }
15357
15357
  });
15358
15358
 
15359
+ // ../../packages/local-shared/src/anchorable.ts
15360
+ function anchorableExtensionAlternation() {
15361
+ return BY_LENGTH.map((e) => e.slice(1).replace(/[+.]/g, (c) => `\\${c}`)).join("|");
15362
+ }
15363
+ var ANCHORABLE_EXTENSIONS, BY_LENGTH;
15364
+ var init_anchorable = __esm({
15365
+ "../../packages/local-shared/src/anchorable.ts"() {
15366
+ "use strict";
15367
+ ANCHORABLE_EXTENSIONS = /* @__PURE__ */ new Set([
15368
+ // typescript provider
15369
+ ".ts",
15370
+ ".tsx",
15371
+ ".js",
15372
+ ".jsx",
15373
+ ".mjs",
15374
+ ".cjs",
15375
+ // python / go / rust / ruby / csharp providers
15376
+ ".py",
15377
+ ".go",
15378
+ ".rs",
15379
+ ".rb",
15380
+ ".cs",
15381
+ // cpp provider — every variant it parses, not just the three that were listed
15382
+ ".c",
15383
+ ".h",
15384
+ ".cpp",
15385
+ ".cc",
15386
+ ".cxx",
15387
+ ".c++",
15388
+ ".hpp",
15389
+ ".hh",
15390
+ ".hxx",
15391
+ ".h++",
15392
+ // CUDA — the cpp provider parses these too. Missed when this list was first
15393
+ // transcribed by hand; the parity test caught them on its very first run,
15394
+ // which is the argument for the test existing.
15395
+ ".cu",
15396
+ ".cuh",
15397
+ // no provider yet; the grammar ships. Inert, not wrong — see above.
15398
+ ".java"
15399
+ ]);
15400
+ BY_LENGTH = [...ANCHORABLE_EXTENSIONS].sort((a, b) => b.length - a.length);
15401
+ }
15402
+ });
15403
+
15359
15404
  // ../../packages/local-shared/src/sqlite-adapter.ts
15360
15405
  function openDatabase(path) {
15361
15406
  const db = new DatabaseSync(path);
@@ -15457,6 +15502,7 @@ var init_src2 = __esm({
15457
15502
  init_profile();
15458
15503
  init_daemon_wire();
15459
15504
  init_review();
15505
+ init_anchorable();
15460
15506
  init_sqlite_adapter();
15461
15507
  }
15462
15508
  });
@@ -25412,10 +25458,14 @@ function markFixCandidates(store2, t) {
25412
25458
 
25413
25459
  // ../../packages/local-graph/src/anchor-backfill.ts
25414
25460
  init_src();
25461
+ init_src2();
25415
25462
  function isLegacyAnchor(attrs) {
25416
25463
  return attrs?.["captureTime"] === true && attrs["anchorProvenance"] === void 0;
25417
25464
  }
25418
- var STATEMENT_PATH_RE = /(?:[\w.-]+\/)+[\w.-]+\.(?:ts|tsx|js|mjs|cjs|py|go|rs|java|rb|c|cpp|h)/g;
25465
+ var STATEMENT_PATH_RE = new RegExp(
25466
+ String.raw`(?:[\w.+-]+\/)+[\w.+-]+\.(?:${anchorableExtensionAlternation()})`,
25467
+ "g"
25468
+ );
25419
25469
  function repairLegacyAnchorsFromStatement(store2, ts) {
25420
25470
  const report = {
25421
25471
  repaired: [],