@inerrata-corporation/errata 2.0.0-dev.98 → 2.0.1-dev.100

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 -32
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -51649,7 +51649,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
51649
51649
  }
51650
51650
 
51651
51651
  // src/engine.ts
51652
- var DAEMON_VERSION = true ? "2.0.0-dev.98" : "2.0.0-alpha.0";
51652
+ var DAEMON_VERSION = true ? "2.0.1-dev.100" : "2.0.0-alpha.0";
51653
51653
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
51654
51654
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
51655
51655
  var GIT_OP_MUTE_MS = 4e3;
@@ -53238,10 +53238,13 @@ function buildContextIngest(store, profile, daemonVersion, ignorePatterns = [],
53238
53238
  // Package ids are already the purl (= the cross-stratum canonicalId).
53239
53239
  id: label === "Language" ? languageCanonicalId(String(n.attrs["name"] ?? "").trim() || n.description) : n.id,
53240
53240
  embedding: [],
53241
+ // No `version` attr on the wire: the purl already encodes the resolved
53242
+ // version, and the door's temporal guard rejects ANY `attrs.version` as
53243
+ // bi-temporal bookkeeping (ingest-temporal-guard.ts) — shipping it 422s
53244
+ // the whole batch. `resolved` still travels (range-vs-lockfile signal).
53241
53245
  attrs: label === "Package" ? {
53242
53246
  purl: n.attrs["purl"],
53243
53247
  name: n.attrs["name"],
53244
- version: n.attrs["version"],
53245
53248
  ecosystem: n.attrs["ecosystem"],
53246
53249
  resolved: n.attrs["resolved"]
53247
53250
  } : { name: n.attrs["name"] }
@@ -53356,9 +53359,10 @@ function wireContextId(n) {
53356
53359
  }
53357
53360
  function shareableContext(n, wireId) {
53358
53361
  const attrs = n.label === "Package" ? {
53362
+ // No `version` attr: the purl encodes it, and the door's temporal
53363
+ // guard 422s any `attrs.version` (mirrors buildContextIngest).
53359
53364
  purl: n.attrs["purl"],
53360
53365
  name: n.attrs["name"],
53361
- version: n.attrs["version"],
53362
53366
  ecosystem: n.attrs["ecosystem"],
53363
53367
  resolved: n.attrs["resolved"]
53364
53368
  } : n.label === "Domain" ? { name: n.description, canonicalId: n.attrs["canonicalId"] } : { name: n.attrs["name"] };
@@ -54533,14 +54537,27 @@ async function startMultiDaemon(opts = {}) {
54533
54537
  const ignore = loadClaimIgnorePatterns(globalDir());
54534
54538
  const client = cloudNow();
54535
54539
  let uploaded = 0;
54540
+ const errors = [];
54541
+ const lane = async (name2, projectName, run3) => {
54542
+ try {
54543
+ await run3();
54544
+ } catch (err2) {
54545
+ const msg = `[${projectName}] ${name2}: ${err2 instanceof Error ? err2.message : String(err2)}`;
54546
+ errors.push(msg);
54547
+ console.error(`[sync\u2192cloud] ${msg}`);
54548
+ }
54549
+ };
54536
54550
  for (const r of records) {
54537
54551
  const store = r.engine.store;
54552
+ const projectName = r.engine.profile.name ?? r.engine.profile.id;
54538
54553
  const context = buildContextIngest(store, r.engine.profile, DAEMON_VERSION, ignore, {
54539
54554
  includePackages: cfg2.consent.contributePackages
54540
54555
  });
54541
54556
  if (context) {
54542
- const res = await client.ingest(context);
54543
- uploaded += res.accepted;
54557
+ await lane("context", projectName, async () => {
54558
+ const res = await client.ingest(context);
54559
+ uploaded += res.accepted;
54560
+ });
54544
54561
  }
54545
54562
  let lexicon;
54546
54563
  try {
@@ -54563,34 +54580,36 @@ async function startMultiDaemon(opts = {}) {
54563
54580
  });
54564
54581
  if (instances) {
54565
54582
  if (project) instances.projectId = project.projectId;
54566
- const res = await client.ingest(instances);
54567
- uploaded += res.accepted;
54568
- const seq = store.currentIngestSeq();
54569
- const cloudIdByLocal = new Map(
54570
- res.result.nodes.filter((rn) => rn.nodeId).map((rn) => [rn.canonicalId, rn.nodeId])
54571
- );
54572
- for (const n of instances.nodes) {
54573
- const local = store.getNode(n.id);
54574
- if (!local || !["Problem", "Solution", "RootCause"].includes(local.label)) continue;
54575
- const cloudNodeId = cloudIdByLocal.get(n.id);
54576
- store.updateNode(n.id, {
54577
- attrs: {
54578
- ...local.attrs,
54579
- contributedAtSeq: seq,
54580
- ...cloudNodeId && cloudNodeId !== n.id ? { cloudNodeId } : {}
54581
- }
54582
- });
54583
- }
54584
- for (const [localId, dg] of Object.entries(instances.anchorDigests)) {
54585
- const local = store.getNode(localId);
54586
- if (!local) continue;
54587
- store.updateNode(localId, {
54588
- attrs: { ...local.attrs, anchorsContributedDigest: dg }
54589
- });
54590
- }
54583
+ await lane("instances", projectName, async () => {
54584
+ const res = await client.ingest(instances);
54585
+ uploaded += res.accepted;
54586
+ const seq = store.currentIngestSeq();
54587
+ const cloudIdByLocal = new Map(
54588
+ res.result.nodes.filter((rn) => rn.nodeId).map((rn) => [rn.canonicalId, rn.nodeId])
54589
+ );
54590
+ for (const n of instances.nodes) {
54591
+ const local = store.getNode(n.id);
54592
+ if (!local || !["Problem", "Solution", "RootCause"].includes(local.label)) continue;
54593
+ const cloudNodeId = cloudIdByLocal.get(n.id);
54594
+ store.updateNode(n.id, {
54595
+ attrs: {
54596
+ ...local.attrs,
54597
+ contributedAtSeq: seq,
54598
+ ...cloudNodeId && cloudNodeId !== n.id ? { cloudNodeId } : {}
54599
+ }
54600
+ });
54601
+ }
54602
+ for (const [localId, dg] of Object.entries(instances.anchorDigests)) {
54603
+ const local = store.getNode(localId);
54604
+ if (!local) continue;
54605
+ store.updateNode(localId, {
54606
+ attrs: { ...local.attrs, anchorsContributedDigest: dg }
54607
+ });
54608
+ }
54609
+ });
54591
54610
  }
54592
54611
  }
54593
- return { uploaded };
54612
+ return { uploaded, ...errors.length > 0 ? { errors } : {} };
54594
54613
  },
54595
54614
  async pullTriagePublic() {
54596
54615
  if (!loadConfig().consent.sync) return { merged: 0, skipped: "consent-off" };
@@ -54640,7 +54659,12 @@ async function startMultiDaemon(opts = {}) {
54640
54659
  }
54641
54660
  const inst = await daemon.syncInstancesPublic();
54642
54661
  const skills = await daemon.syncSkillsAll();
54643
- return { uploaded: inst.uploaded, written: skills.written, pruned: skills.pruned };
54662
+ return {
54663
+ uploaded: inst.uploaded,
54664
+ written: skills.written,
54665
+ pruned: skills.pruned,
54666
+ ...inst.errors ? { errors: inst.errors } : {}
54667
+ };
54644
54668
  } finally {
54645
54669
  boundaryFlushing = false;
54646
54670
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.98",
3
+ "version": "2.0.1-dev.100",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {