@inerrata-corporation/errata 2.0.22-dev.4540 → 2.0.22-dev.4578

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.
@@ -19814,6 +19814,22 @@ init_src3();
19814
19814
  function findStrandedSymbols(store) {
19815
19815
  return store.strandedSymbols();
19816
19816
  }
19817
+ var FILE_DECLARATION_LABELS = [
19818
+ "Function",
19819
+ "Class",
19820
+ "Method",
19821
+ "Module",
19822
+ "Interface",
19823
+ "Const",
19824
+ "Static",
19825
+ "Property",
19826
+ "TypeAlias",
19827
+ "Namespace",
19828
+ "Enum",
19829
+ "Annotation",
19830
+ "Comment"
19831
+ ];
19832
+ var DECLARATION_LABEL_SET = new Set(FILE_DECLARATION_LABELS);
19817
19833
 
19818
19834
  // src/package-index.ts
19819
19835
  init_src();
package/errata.mjs CHANGED
@@ -47007,6 +47007,12 @@ function reapOrphanedFiles(store, rootPath, workspaceId2, ignoreDirs = []) {
47007
47007
  candidates: orphans.length
47008
47008
  };
47009
47009
  }
47010
+ const repairDue = store.getMeta?.(NESTED_REAP_REPAIRED_KEY) == null;
47011
+ const stranded = repairDue ? store.selectNodes({ labels: [...FILE_DECLARATION_LABELS], attrs: ["workspaceId", "relPath"] }).filter((n) => n.attrs["workspaceId"] === workspaceId2 && typeof n.attrs["relPath"] === "string" && !onDisk.has(n.attrs["relPath"])) : [];
47012
+ const strandedPaths = new Set(stranded.map((n) => n.attrs["relPath"]));
47013
+ if (strandedPaths.size > allowance) {
47014
+ return { reaped: 0, symbolsClosed: 0, skipped: "over-fraction", candidates: strandedPaths.size };
47015
+ }
47010
47016
  const t = Date.now();
47011
47017
  let symbolsClosed = 0;
47012
47018
  store.transaction(() => {
@@ -47021,6 +47027,18 @@ function reapOrphanedFiles(store, rootPath, workspaceId2, ignoreDirs = []) {
47021
47027
  }
47022
47028
  store.closeNode(f.id, t);
47023
47029
  }
47030
+ const gone = orphans.map((f) => f.attrs["relPath"]);
47031
+ for (const n of store.nodesByRelPath(gone)) {
47032
+ if (!DECLARATION_LABEL_SET.has(n.label) || n.attrs["workspaceId"] !== workspaceId2) continue;
47033
+ store.closeNode(n.id, t);
47034
+ symbolsClosed++;
47035
+ }
47036
+ for (const n of stranded) {
47037
+ if ((store.getNode(n.id)?.validTo ?? null) !== null) continue;
47038
+ store.closeNode(n.id, t);
47039
+ symbolsClosed++;
47040
+ }
47041
+ if (repairDue) store.setMeta?.(NESTED_REAP_REPAIRED_KEY, String(t));
47024
47042
  });
47025
47043
  return { reaped: orphans.length, symbolsClosed };
47026
47044
  }
@@ -47057,7 +47075,7 @@ async function reconcileStaleFiles(store, rootPath, workspaceId2) {
47057
47075
  }
47058
47076
  return total;
47059
47077
  }
47060
- var IGNORED, SOURCE_RE, SCAN_YIELD_EVERY, STRANDED_KEY, STRANDED_WINDOW_MAX, ORPHAN_REAP_MAX_FRACTION, ORPHAN_REAP_MIN_ALLOWANCE, LINEAGE_VERIFIED_KEY;
47078
+ var IGNORED, SOURCE_RE, SCAN_YIELD_EVERY, STRANDED_KEY, STRANDED_WINDOW_MAX, ORPHAN_REAP_MAX_FRACTION, ORPHAN_REAP_MIN_ALLOWANCE, FILE_DECLARATION_LABELS, DECLARATION_LABEL_SET, NESTED_REAP_REPAIRED_KEY, LINEAGE_VERIFIED_KEY;
47061
47079
  var init_reconcile = __esm({
47062
47080
  "src/reconcile.ts"() {
47063
47081
  "use strict";
@@ -47069,6 +47087,23 @@ var init_reconcile = __esm({
47069
47087
  STRANDED_WINDOW_MAX = 2e4;
47070
47088
  ORPHAN_REAP_MAX_FRACTION = 0.25;
47071
47089
  ORPHAN_REAP_MIN_ALLOWANCE = 50;
47090
+ FILE_DECLARATION_LABELS = [
47091
+ "Function",
47092
+ "Class",
47093
+ "Method",
47094
+ "Module",
47095
+ "Interface",
47096
+ "Const",
47097
+ "Static",
47098
+ "Property",
47099
+ "TypeAlias",
47100
+ "Namespace",
47101
+ "Enum",
47102
+ "Annotation",
47103
+ "Comment"
47104
+ ];
47105
+ DECLARATION_LABEL_SET = new Set(FILE_DECLARATION_LABELS);
47106
+ NESTED_REAP_REPAIRED_KEY = "orphan-reap:nested-declarations-v1";
47072
47107
  LINEAGE_VERIFIED_KEY = "pass-inputs:reconcile-lineage";
47073
47108
  }
47074
47109
  });
@@ -86676,7 +86711,7 @@ function createWatchBreaker(deps) {
86676
86711
  }
86677
86712
 
86678
86713
  // src/engine.ts
86679
- var DAEMON_VERSION = true ? "2.0.22-dev.4540" : "2.0.0-alpha.0";
86714
+ var DAEMON_VERSION = true ? "2.0.22-dev.4578" : "2.0.0-alpha.0";
86680
86715
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
86681
86716
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
86682
86717
  var GIT_OP_MUTE_MS = 4e3;
@@ -92415,7 +92450,7 @@ async function syncHistoryRevisionPage(opts, resolve10) {
92415
92450
  const key = `${root}|${atCommit}|${ignoreKey}|${[...manifestIds].sort().join(",")}`;
92416
92451
  let snapshot = caches.dependencies.get(key);
92417
92452
  if (!snapshot) {
92418
- const listed = (args2) => {
92453
+ const listed2 = (args2) => {
92419
92454
  if (args2[0] !== "ls-tree") return git3(args2);
92420
92455
  const k = `${root}|${args2.join(" ")}`;
92421
92456
  let out2 = caches.listings.get(k);
@@ -92441,7 +92476,7 @@ async function syncHistoryRevisionPage(opts, resolve10) {
92441
92476
  commit: atCommit,
92442
92477
  side: "after",
92443
92478
  manifestIds,
92444
- git: listed,
92479
+ git: listed2,
92445
92480
  readBlob: blob,
92446
92481
  allowPath: (p) => pathAllowedByFloor(p) && !isPathBlocked(ignore2, p)
92447
92482
  });
@@ -92460,8 +92495,13 @@ async function syncHistoryRevisionPage(opts, resolve10) {
92460
92495
  caches.trees.set(treeKey, tree);
92461
92496
  tree.catch(() => caches.trees.delete(treeKey));
92462
92497
  }
92463
- const blobs = await (tree ?? Promise.resolve(/* @__PURE__ */ new Map())).catch(() => /* @__PURE__ */ new Map());
92498
+ let listed = !!tree;
92499
+ const blobs = await (tree ?? Promise.resolve(/* @__PURE__ */ new Map())).catch(() => {
92500
+ listed = false;
92501
+ return /* @__PURE__ */ new Map();
92502
+ });
92464
92503
  const fileId = (path3) => blobs.get(path3) ?? `commit:${atCommit}`;
92504
+ let heldBack = 0;
92465
92505
  for (const occurrence of toPost) {
92466
92506
  const anchors = occurrence.quality["historicalAnchors"];
92467
92507
  const paths = /* @__PURE__ */ new Set(), symbols = [];
@@ -92471,6 +92511,7 @@ async function syncHistoryRevisionPage(opts, resolve10) {
92471
92511
  const path3 = local?.attrs["relPath"];
92472
92512
  if (typeof path3 !== "string" || !pathAllowedByFloor(path3) || isPathBlocked(ignore2, path3) || /[\r\n]/.test(path3)) continue;
92473
92513
  paths.add(path3);
92514
+ if (listed && !blobs.has(path3)) continue;
92474
92515
  const file2 = await fileSymbols({ caches, providers, root, salt, projectId }, path3, fileId(path3), () => git3(["show", `${atCommit}:${path3}`]));
92475
92516
  if (!file2) partial2 = true;
92476
92517
  const bodyHash = file2?.hashes.get(anchor.symbolId);
@@ -92508,9 +92549,13 @@ async function syncHistoryRevisionPage(opts, resolve10) {
92508
92549
  complete: old.data.dependencies.length === 0 || currentDependencies?.complete === true,
92509
92550
  dependencies: currentDependencies?.dependencies.filter((d) => old.data.dependencies.some((o) => o.packageId === d.packageId && o.manifestId === d.manifestId)) ?? []
92510
92551
  } : void 0;
92511
- if (partial2) continue;
92552
+ if (partial2) {
92553
+ heldBack++;
92554
+ continue;
92555
+ }
92512
92556
  observations.push({ occurrenceId: occurrence.occurrenceId, symbols, ...diff ? { diff } : {}, ...dependencyContext ? { dependencyContext } : {} });
92513
92557
  }
92558
+ if (heldBack) console.warn(`[errata] history revision held back ${heldBack} occurrence(s) at ${atCommit.slice(0, 12)} for ${profile.name}: a Git read failed; retried next sweep`);
92514
92559
  const response = observations.length ? await cloud.reconcileHistory(projectId, { atCommit, parents, observations }) : { atCommit, receipts: [] };
92515
92560
  if (response.atCommit !== atCommit || response.receipts.length !== observations.length || new Set(response.receipts.map((r) => r.occurrenceId)).size !== response.receipts.length || response.receipts.some((r) => r.atCommit !== atCommit || !observations.some((o) => o.occurrenceId === r.occurrenceId))) throw new Error("incomplete history reconciliation response");
92516
92561
  const receipts = new Map(response.receipts.map((r) => [r.occurrenceId, r]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.22-dev.4540",
3
+ "version": "2.0.22-dev.4578",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -31152,6 +31152,22 @@ async function findStaleFiles(store2, rootPath, workspaceId, lineageVerifiedAt)
31152
31152
  check2();
31153
31153
  return stale;
31154
31154
  }
31155
+ var FILE_DECLARATION_LABELS = [
31156
+ "Function",
31157
+ "Class",
31158
+ "Method",
31159
+ "Module",
31160
+ "Interface",
31161
+ "Const",
31162
+ "Static",
31163
+ "Property",
31164
+ "TypeAlias",
31165
+ "Namespace",
31166
+ "Enum",
31167
+ "Annotation",
31168
+ "Comment"
31169
+ ];
31170
+ var DECLARATION_LABEL_SET = new Set(FILE_DECLARATION_LABELS);
31155
31171
  var LINEAGE_VERIFIED_KEY = "pass-inputs:reconcile-lineage";
31156
31172
  async function reconcileStaleFiles(store2, rootPath, workspaceId) {
31157
31173
  const startedAt = store2.changeSeq?.();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errata-context",
3
- "version": "2.0.22-dev.4540",
3
+ "version": "2.0.22-dev.4578",
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
- 49972879e17f1037397b0fe434c6c78f4d41ae4458de157acb01a2e5a7208033 .codex-plugin/plugin.json
1
+ ca4d68d0efc2998562b8c7a86e88495dc7e0c2dbe4ae6a9568071f403f15d903 .codex-plugin/plugin.json
2
2
  a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
3
3
  fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
4
4
  73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js