@inerrata-corporation/errata 2.0.6-dev.2710 → 2.0.6-dev.2725

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 +15 -4
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -79905,7 +79905,7 @@ function createWatchBreaker(deps) {
79905
79905
  }
79906
79906
 
79907
79907
  // src/engine.ts
79908
- var DAEMON_VERSION = true ? "2.0.6-dev.2710" : "2.0.0-alpha.0";
79908
+ var DAEMON_VERSION = true ? "2.0.6-dev.2725" : "2.0.0-alpha.0";
79909
79909
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
79910
79910
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
79911
79911
  var GIT_OP_MUTE_MS = 4e3;
@@ -84520,7 +84520,8 @@ function stage(profile, patch, now) {
84520
84520
  // `lastError: undefined` in the patch CLEARS it (a resumed walk must not
84521
84521
  // keep showing the error it recovered from); an absent key keeps it.
84522
84522
  ..."lastError" in patch ? patch.lastError ? { lastError: patch.lastError } : {} : prev?.lastError ? { lastError: prev.lastError } : {},
84523
- ...patch.counts ? { counts: patch.counts } : prev?.counts ? { counts: prev.counts } : {}
84523
+ ...patch.counts ? { counts: patch.counts } : prev?.counts ? { counts: prev.counts } : {},
84524
+ ...patch.backfillAnchor ? { backfillAnchor: patch.backfillAnchor } : prev?.backfillAnchor ? { backfillAnchor: prev.backfillAnchor } : {}
84524
84525
  }
84525
84526
  };
84526
84527
  }
@@ -84570,7 +84571,8 @@ async function walk10(root, input, client, opts, readBlob) {
84570
84571
  const since = profile.historyStage?.watermarkSha ?? null;
84571
84572
  const units = await (opts.enumerate ?? enumerateUnits)(root, since ? { since } : {});
84572
84573
  const total = (profile.historyStage?.unitsDone ?? 0) + units.length;
84573
- profile = stage(profile, { state: "scanning", unitsTotal: total, headSha, lastError: void 0 }, now);
84574
+ const anchor = profile.historyStage?.backfillAnchor ? { ...profile.historyStage.backfillAnchor } : { index: Number((await git3(root, ["rev-list", "--first-parent", "--count", headSha])).trim()) - 1 };
84575
+ profile = stage(profile, { state: "scanning", unitsTotal: total, headSha, lastError: void 0, backfillAnchor: anchor }, now);
84574
84576
  persist(profile);
84575
84577
  let response = await reportHistoryStage(client, profile, log);
84576
84578
  if (response?.stopRequested) {
@@ -84628,7 +84630,8 @@ async function walk10(root, input, client, opts, readBlob) {
84628
84630
  extractorVersion: HISTORY_EXTRACTOR_VERSION,
84629
84631
  ...opts.frame ? { frame: opts.frame } : {},
84630
84632
  ...dryRun ? { dryRun: true } : {},
84631
- ...prev ? { after: { sha: prev.sha, subIndex: prev.subIndex } } : {}
84633
+ ...prev ? { after: { sha: prev.sha, subIndex: prev.subIndex } } : {},
84634
+ ...!dryRun && u.index <= anchor.index ? { backfill: { anchorIndex: anchor.index, ...anchor.seq !== void 0 ? { anchorSeq: anchor.seq } : {} } } : {}
84632
84635
  };
84633
84636
  const spine = await spineForUnit(git3, root, u, readBlob);
84634
84637
  if (spine) body2.spine = spine;
@@ -84695,6 +84698,9 @@ async function walk10(root, input, client, opts, readBlob) {
84695
84698
  let attempt = 0;
84696
84699
  while (outcome === null) {
84697
84700
  attempt += 1;
84701
+ if (!first && body2.backfill && body2.backfill.anchorSeq === void 0 && anchor.seq !== void 0) {
84702
+ body2.backfill = { ...body2.backfill, anchorSeq: anchor.seq };
84703
+ }
84698
84704
  const settled = await (first ?? settle(Promise.resolve().then(() => post(projectId, body2))));
84699
84705
  first = null;
84700
84706
  if ("err" in settled) {
@@ -84714,6 +84720,11 @@ async function walk10(root, input, client, opts, readBlob) {
84714
84720
  }
84715
84721
  const res = settled.res;
84716
84722
  if (res.ordered) doorOrders = true;
84723
+ if (res.backfill && anchor.seq === void 0) {
84724
+ anchor.seq = res.backfill.anchorSeq;
84725
+ profile = stage(profile, { backfillAnchor: { ...anchor } }, now);
84726
+ persist(profile);
84727
+ }
84717
84728
  if (res.status === "in_progress") {
84718
84729
  const retryAt = new Date(Date.now() + res.retryAfterMs).toISOString();
84719
84730
  if (Date.now() - started2 > RECOVERY_DEADLINE_MS) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.6-dev.2710",
3
+ "version": "2.0.6-dev.2725",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {