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

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.
@@ -15307,7 +15307,12 @@ var init_wire = __esm({
15307
15307
  * knows which packages are private. The door does NOT trust a `public` claim
15308
15308
  * blindly (it re-confirms on the spine); absent ⇒ unknown ⇒ fail-closed to
15309
15309
  * org-private. Accepted-but-ignored until ORG_MEMBRANE_ENABLED flips. */
15310
- anchorVisibility: external_exports.enum(["public", "private"]).optional()
15310
+ anchorVisibility: external_exports.enum(["public", "private"]).optional(),
15311
+ /** The spine-resolvable anchor id backing a `public` tag (OM-anchor-tag): a
15312
+ * Package purl or `languageCanonicalId`. The door validates THIS on the
15313
+ * public spine (falling back to `canonicalId` when absent — context stubs
15314
+ * are self-anchored). Never trusted without spine confirmation. */
15315
+ anchor: external_exports.string().min(1).max(300).optional()
15311
15316
  });
15312
15317
  RouteContextCountWireSchema = external_exports.object({
15313
15318
  confirmed: external_exports.number().int().min(0),
package/errata.mjs CHANGED
@@ -938,6 +938,12 @@ function packageCanonicalId(p) {
938
938
  const name2 = eco === "npm" ? p.name.toLowerCase() : p.name;
939
939
  return `pkg:${eco}/${name2}${p.version ? `@${p.version}` : ""}`;
940
940
  }
941
+ function versionlessPurl(purl) {
942
+ if (!purl.startsWith("pkg:")) return null;
943
+ const lastSlash = purl.lastIndexOf("/");
944
+ const lastAt = purl.lastIndexOf("@");
945
+ return lastAt > lastSlash ? purl.slice(0, lastAt) : purl;
946
+ }
941
947
  function parsePackageRef(ref) {
942
948
  let rest2 = ref.trim();
943
949
  if (rest2.startsWith("pkg:")) {
@@ -15602,7 +15608,12 @@ var init_wire = __esm({
15602
15608
  * knows which packages are private. The door does NOT trust a `public` claim
15603
15609
  * blindly (it re-confirms on the spine); absent ⇒ unknown ⇒ fail-closed to
15604
15610
  * org-private. Accepted-but-ignored until ORG_MEMBRANE_ENABLED flips. */
15605
- anchorVisibility: external_exports.enum(["public", "private"]).optional()
15611
+ anchorVisibility: external_exports.enum(["public", "private"]).optional(),
15612
+ /** The spine-resolvable anchor id backing a `public` tag (OM-anchor-tag): a
15613
+ * Package purl or `languageCanonicalId`. The door validates THIS on the
15614
+ * public spine (falling back to `canonicalId` when absent — context stubs
15615
+ * are self-anchored). Never trusted without spine confirmation. */
15616
+ anchor: external_exports.string().min(1).max(300).optional()
15606
15617
  });
15607
15618
  RouteContextCountWireSchema = external_exports.object({
15608
15619
  confirmed: external_exports.number().int().min(0),
@@ -15993,6 +16004,7 @@ __export(src_exports, {
15993
16004
  toCloudAttrs: () => toCloudAttrs,
15994
16005
  toolCanonicalId: () => toolCanonicalId,
15995
16006
  validateCastaliaPayload: () => validateCastaliaPayload,
16007
+ versionlessPurl: () => versionlessPurl,
15996
16008
  vetSidecarSummaries: () => vetSidecarSummaries
15997
16009
  });
15998
16010
  var init_src = __esm({
@@ -21530,7 +21542,12 @@ function toWirePayload(batch, runId) {
21530
21542
  // attrs travel; node-level bookkeeping (embedding, momentum counters,
21531
21543
  // bi-temporal fields) is local-stratum and never crosses.
21532
21544
  attrs: n.attrs ?? {},
21533
- extractionSource: n.extractionSource
21545
+ extractionSource: n.extractionSource,
21546
+ // Org-membrane anchor tag (OM-anchor-tag): the batch builders set these
21547
+ // on wire-bound projections only; the door re-validates the claim on the
21548
+ // public spine, so lifting them is routing input, not a grant.
21549
+ ...n.anchorVisibility ? { anchorVisibility: n.anchorVisibility } : {},
21550
+ ...n.anchor ? { anchor: n.anchor } : {}
21534
21551
  }));
21535
21552
  const edges = batch.edges.filter((e) => !droppedNodeIds.has(e.from) && !droppedNodeIds.has(e.to)).map((e) => {
21536
21553
  const perContext = wirePerContext(e.attrs?.["perContext"]);
@@ -51664,7 +51681,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
51664
51681
  }
51665
51682
 
51666
51683
  // src/engine.ts
51667
- var DAEMON_VERSION = true ? "2.0.2-dev.70" : "2.0.0-alpha.0";
51684
+ var DAEMON_VERSION = true ? "2.0.2-dev.77" : "2.0.0-alpha.0";
51668
51685
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
51669
51686
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
51670
51687
  var GIT_OP_MUTE_MS = 4e3;
@@ -53262,7 +53279,12 @@ function buildContextIngest(store, profile, daemonVersion, ignorePatterns = [],
53262
53279
  name: n.attrs["name"],
53263
53280
  ecosystem: n.attrs["ecosystem"],
53264
53281
  resolved: n.attrs["resolved"]
53265
- } : { name: n.attrs["name"] }
53282
+ } : { name: n.attrs["name"] },
53283
+ // OM-anchor-tag: context stubs are self-anchored — the wire id IS the
53284
+ // spine key (purl / languageCanonicalId). The door re-confirms on the
53285
+ // public spine; a private-registry or workspace package never confirms
53286
+ // and fails closed to org, exactly as an untagged one would.
53287
+ anchorVisibility: "public"
53266
53288
  });
53267
53289
  seen.add(n.id);
53268
53290
  }
@@ -53372,6 +53394,10 @@ function wireContextId(n) {
53372
53394
  }
53373
53395
  return n.id;
53374
53396
  }
53397
+ function langAnchor(t) {
53398
+ const name2 = String(t.attrs["name"] ?? "").trim() || t.description.trim() || t.id.replace(/^lang:/, "").trim();
53399
+ return name2 ? `lang:${name2.toLowerCase()}` : void 0;
53400
+ }
53375
53401
  function shareableContext(n, wireId) {
53376
53402
  const attrs = n.label === "Package" ? {
53377
53403
  // No `version` attr: the purl encodes it, and the door's temporal
@@ -53381,7 +53407,14 @@ function shareableContext(n, wireId) {
53381
53407
  ecosystem: n.attrs["ecosystem"],
53382
53408
  resolved: n.attrs["resolved"]
53383
53409
  } : n.label === "Domain" ? { name: n.description, canonicalId: n.attrs["canonicalId"] } : { name: n.attrs["name"] };
53384
- return { ...n, id: wireId, embedding: [], attrs };
53410
+ return {
53411
+ ...n,
53412
+ id: wireId,
53413
+ embedding: [],
53414
+ attrs,
53415
+ ...n.label === "Package" ? { anchorVisibility: "public" } : {},
53416
+ ...n.label === "Language" && langAnchor(n) ? { anchorVisibility: "public", anchor: langAnchor(n) } : {}
53417
+ };
53385
53418
  }
53386
53419
  function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [], opts = {}) {
53387
53420
  const level = opts.level ?? 1;
@@ -53399,6 +53432,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
53399
53432
  });
53400
53433
  const nodes = [];
53401
53434
  const seen = /* @__PURE__ */ new Set();
53435
+ const shippedById = /* @__PURE__ */ new Map();
53402
53436
  const anchorSources = /* @__PURE__ */ new Set();
53403
53437
  const includedByLabel = /* @__PURE__ */ new Map();
53404
53438
  for (const label of INSTANCE_LABELS) {
@@ -53416,7 +53450,9 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
53416
53450
  }
53417
53451
  if (!noveltyAgainst(n, ref, noveltyOpts).ready) continue;
53418
53452
  ref.push(n);
53419
- nodes.push(shareable(n));
53453
+ const wireNode = shareable(n);
53454
+ nodes.push(wireNode);
53455
+ shippedById.set(n.id, wireNode);
53420
53456
  seen.add(n.id);
53421
53457
  anchorSources.add(n.id);
53422
53458
  }
@@ -53443,6 +53479,15 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
53443
53479
  targets.push({ e, t, wireId: wireContextId(t) });
53444
53480
  }
53445
53481
  if (targets.length === 0) continue;
53482
+ const shipped = shippedById.get(sourceId);
53483
+ if (shipped) {
53484
+ const anchors = (label) => targets.filter((x) => x.t.label === label).map((x) => label === "Language" ? langAnchor(x.t) : x.wireId).filter((a) => a != null).sort();
53485
+ const anchor = anchors("Package")[0] ?? anchors("Language")[0];
53486
+ if (anchor) {
53487
+ shipped.anchorVisibility = "public";
53488
+ shipped.anchor = anchor;
53489
+ }
53490
+ }
53446
53491
  const dg = digest(targets.map(({ e, wireId }) => `${e.type}>${wireId}`).sort());
53447
53492
  const sourceNode = store.getNode(sourceId);
53448
53493
  if (sourceNode?.attrs["anchorsContributedDigest"] === dg) continue;
@@ -53456,6 +53501,15 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
53456
53501
  contextNodes.push(shareableContext(t, wireId));
53457
53502
  }
53458
53503
  }
53504
+ const primaryLang = (profile.languages ?? []).map((l) => String(l).trim().toLowerCase()).filter(Boolean)[0];
53505
+ if (primaryLang) {
53506
+ for (const shipped of shippedById.values()) {
53507
+ if (!shipped.anchorVisibility) {
53508
+ shipped.anchorVisibility = "public";
53509
+ shipped.anchor = `lang:${primaryLang}`;
53510
+ }
53511
+ }
53512
+ }
53459
53513
  const project = opts.project;
53460
53514
  if (project) {
53461
53515
  const now = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.70",
3
+ "version": "2.0.2-dev.77",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -15162,7 +15162,12 @@ var init_wire = __esm({
15162
15162
  * knows which packages are private. The door does NOT trust a `public` claim
15163
15163
  * blindly (it re-confirms on the spine); absent ⇒ unknown ⇒ fail-closed to
15164
15164
  * org-private. Accepted-but-ignored until ORG_MEMBRANE_ENABLED flips. */
15165
- anchorVisibility: external_exports.enum(["public", "private"]).optional()
15165
+ anchorVisibility: external_exports.enum(["public", "private"]).optional(),
15166
+ /** The spine-resolvable anchor id backing a `public` tag (OM-anchor-tag): a
15167
+ * Package purl or `languageCanonicalId`. The door validates THIS on the
15168
+ * public spine (falling back to `canonicalId` when absent — context stubs
15169
+ * are self-anchored). Never trusted without spine confirmation. */
15170
+ anchor: external_exports.string().min(1).max(300).optional()
15166
15171
  });
15167
15172
  RouteContextCountWireSchema = external_exports.object({
15168
15173
  confirmed: external_exports.number().int().min(0),