@inerrata-corporation/errata 2.0.2-dev.77 → 2.0.2-dev.79

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 +11 -3
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -51681,7 +51681,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
51681
51681
  }
51682
51682
 
51683
51683
  // src/engine.ts
51684
- var DAEMON_VERSION = true ? "2.0.2-dev.77" : "2.0.0-alpha.0";
51684
+ var DAEMON_VERSION = true ? "2.0.2-dev.79" : "2.0.0-alpha.0";
51685
51685
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
51686
51686
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
51687
51687
  var GIT_OP_MUTE_MS = 4e3;
@@ -54827,6 +54827,8 @@ async function startMultiDaemon(opts = {}) {
54827
54827
  }
54828
54828
  };
54829
54829
  app.post("/api/sync", async (c) => {
54830
+ if (boundaryFlushing) return c.json({ skipped: "in-flight" }, 409);
54831
+ boundaryFlushing = true;
54830
54832
  try {
54831
54833
  const principles = await daemon.syncPrinciplesPublic();
54832
54834
  const triage = await daemon.syncTriagePublic();
@@ -54835,6 +54837,8 @@ async function startMultiDaemon(opts = {}) {
54835
54837
  return c.json({ principles, triage, instances, edgeBackfill });
54836
54838
  } catch (err2) {
54837
54839
  return c.json({ error: err2 instanceof Error ? err2.message : String(err2) }, 500);
54840
+ } finally {
54841
+ boundaryFlushing = false;
54838
54842
  }
54839
54843
  });
54840
54844
  app.post("/api/tick", async (c) => {
@@ -57658,8 +57662,12 @@ async function cmdSync(arg) {
57658
57662
  try {
57659
57663
  const res = await fetch(`${lock.webUiUrl}/api/sync`, {
57660
57664
  method: "POST",
57661
- signal: AbortSignal.timeout(3e4)
57665
+ signal: AbortSignal.timeout(15 * 6e4)
57662
57666
  });
57667
+ if (res.status === 409) {
57668
+ console.log("sync already running: the daemon is mid-drain \u2014 it will finish on its own. Nothing new was started.");
57669
+ return;
57670
+ }
57663
57671
  if (!res.ok) {
57664
57672
  const detail = await res.text().catch(() => "");
57665
57673
  console.error(`sync failed: daemon at ${lock.webUiUrl} returned ${res.status}${detail ? ` \u2014 ${detail}` : ""}`);
@@ -57670,7 +57678,7 @@ async function cmdSync(arg) {
57670
57678
  } catch (err2) {
57671
57679
  const timedOut = err2 instanceof Error && err2.name === "TimeoutError";
57672
57680
  console.error(
57673
- timedOut ? `sync failed: the running daemon at ${lock.webUiUrl} didn't respond within 30s \u2014 it may be mid-reindex. Retry shortly.` : `sync failed: could not reach the running daemon at ${lock.webUiUrl} (${err2 instanceof Error ? err2.message : err2})`
57681
+ timedOut ? `sync gave up waiting after 15 min \u2014 the daemon's pass may STILL be running (aborting this request does not cancel it). Check daemon.log before retrying; a retry while it runs answers 409.` : `sync failed: could not reach the running daemon at ${lock.webUiUrl} (${err2 instanceof Error ? err2.message : err2})`
57674
57682
  );
57675
57683
  process.exit(1);
57676
57684
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.77",
3
+ "version": "2.0.2-dev.79",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {