@inerrata-corporation/errata 2.0.6-dev.1983 → 2.0.6-dev.1986

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.
@@ -15375,7 +15375,17 @@ var init_wire = __esm({
15375
15375
  extractedBy: external_exports.enum(INGEST_EXTRACTION_SOURCES).optional(),
15376
15376
  /** Triage route per-context counts (T3 induction). Carried as structured data
15377
15377
  * here; stored JSON-encoded on the Neo4j rel (`perContextJson`). */
15378
- perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional()
15378
+ perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional(),
15379
+ /** PJ-anchor-version: WHICH version of a symbol an `ANCHORED_AT` was
15380
+ * witnessed against. Both opaque — the observing checkout's HEAD sha and
15381
+ * the indexer's 16-hex sha256 of the symbol body. Neither is reversible
15382
+ * to code or names (a sha identifies a commit only to someone holding the
15383
+ * repo), so they add nothing to the §6c disclosure surface. A consumer
15384
+ * (reanchor) compares the hash with its local symbol's `bodyHash` to
15385
+ * classify the anchor current / pre-change; absent ⇒ the pre-versioning
15386
+ * contract, unverified. Only meaningful on `ANCHORED_AT`. */
15387
+ observedAtCommit: external_exports.string().regex(/^[0-9a-f]{7,40}$/).optional(),
15388
+ symbolContentHash: external_exports.string().regex(/^[0-9a-f]{8,64}$/).optional()
15379
15389
  }).optional()
15380
15390
  });
15381
15391
  SymbolSummarySidecarSchema = external_exports.record(
package/errata.mjs CHANGED
@@ -15818,7 +15818,17 @@ var init_wire = __esm({
15818
15818
  extractedBy: external_exports.enum(INGEST_EXTRACTION_SOURCES).optional(),
15819
15819
  /** Triage route per-context counts (T3 induction). Carried as structured data
15820
15820
  * here; stored JSON-encoded on the Neo4j rel (`perContextJson`). */
15821
- perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional()
15821
+ perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional(),
15822
+ /** PJ-anchor-version: WHICH version of a symbol an `ANCHORED_AT` was
15823
+ * witnessed against. Both opaque — the observing checkout's HEAD sha and
15824
+ * the indexer's 16-hex sha256 of the symbol body. Neither is reversible
15825
+ * to code or names (a sha identifies a commit only to someone holding the
15826
+ * repo), so they add nothing to the §6c disclosure surface. A consumer
15827
+ * (reanchor) compares the hash with its local symbol's `bodyHash` to
15828
+ * classify the anchor current / pre-change; absent ⇒ the pre-versioning
15829
+ * contract, unverified. Only meaningful on `ANCHORED_AT`. */
15830
+ observedAtCommit: external_exports.string().regex(/^[0-9a-f]{7,40}$/).optional(),
15831
+ symbolContentHash: external_exports.string().regex(/^[0-9a-f]{8,64}$/).optional()
15822
15832
  }).optional()
15823
15833
  });
15824
15834
  SymbolSummarySidecarSchema = external_exports.record(
@@ -19716,7 +19726,16 @@ function anchorProblemToWorkingFile(store, problemId, relPath, workspaceId2, ts,
19716
19726
  captureTime: true,
19717
19727
  anchorProvenance: provenance,
19718
19728
  anchorLine: opts.line,
19719
- enclosingSymbol: true
19729
+ enclosingSymbol: true,
19730
+ // PJ-anchor-version: WHICH version of the symbol this was witnessed
19731
+ // against. `bodyHash` is the indexer's 16-hex sha256 of the body;
19732
+ // `headSha` is the checkout's HEAD at capture. Both opaque, both
19733
+ // cross the membrane on the anchor edge, and a teammate's reanchor
19734
+ // compares the hash with their own symbol to tell "current" from
19735
+ // "pre-change" — the branch hazard where a fix witnessed on feat/x
19736
+ // would otherwise read as a fact about the unchanged symbol on dev.
19737
+ ...typeof sym.attrs["bodyHash"] === "string" ? { symbolContentHash: sym.attrs["bodyHash"] } : {},
19738
+ ...opts.headSha ? { observedAtCommit: opts.headSha } : {}
19720
19739
  }
19721
19740
  });
19722
19741
  }
@@ -24268,7 +24287,9 @@ function toWirePayload(batch, runId) {
24268
24287
  type: e.type,
24269
24288
  attrs: {
24270
24289
  ...typeof e.confidence === "number" ? { confidence: clamp012(e.confidence) } : {},
24271
- ...perContext ? { perContext } : {}
24290
+ ...perContext ? { perContext } : {},
24291
+ // PJ-anchor-version: the two opaque version stamps ride on anchors only.
24292
+ ...e.type === "ANCHORED_AT" ? wireAnchorVersion(e.attrs) : {}
24272
24293
  }
24273
24294
  };
24274
24295
  });
@@ -24304,6 +24325,15 @@ function textOrThrow(value, field) {
24304
24325
  if (!text) throw new TypeError(`${field} must be a non-empty string`);
24305
24326
  return text;
24306
24327
  }
24328
+ function wireAnchorVersion(attrs) {
24329
+ if (!attrs) return {};
24330
+ const commit = attrs["observedAtCommit"];
24331
+ const hash2 = attrs["symbolContentHash"];
24332
+ return {
24333
+ ...typeof commit === "string" && HEX_SHA.test(commit) ? { observedAtCommit: commit } : {},
24334
+ ...typeof hash2 === "string" && HEX_BODY.test(hash2) ? { symbolContentHash: hash2 } : {}
24335
+ };
24336
+ }
24307
24337
  function optionalEdgeAttrs(confidence) {
24308
24338
  return typeof confidence === "number" ? { confidence: clamp012(confidence) } : void 0;
24309
24339
  }
@@ -24429,13 +24459,15 @@ function provenanceHeaders(provenance) {
24429
24459
  ...provenance.agentModel ? { "x-inerrata-agent-model": provenance.agentModel } : {}
24430
24460
  };
24431
24461
  }
24432
- var asWireCount, INGEST_NODE_CHUNK, E6B_PUBLIC_CONTEXT_SENTINEL, CloudClient, CloudError;
24462
+ var asWireCount, HEX_SHA, HEX_BODY, INGEST_NODE_CHUNK, E6B_PUBLIC_CONTEXT_SENTINEL, CloudClient, CloudError;
24433
24463
  var init_client = __esm({
24434
24464
  "../../packages/cloud-client/src/client.ts"() {
24435
24465
  "use strict";
24436
24466
  init_oauth();
24437
24467
  init_src();
24438
24468
  asWireCount = (n) => typeof n === "number" && Number.isFinite(n) && n >= 0 ? Math.floor(n) : null;
24469
+ HEX_SHA = /^[0-9a-f]{7,40}$/;
24470
+ HEX_BODY = /^[0-9a-f]{8,64}$/;
24439
24471
  INGEST_NODE_CHUNK = 8;
24440
24472
  E6B_PUBLIC_CONTEXT_SENTINEL = "00000000-0000-4e6b-8000-000000000e6b";
24441
24473
  CloudClient = class {
@@ -57934,7 +57966,7 @@ function createWatchBreaker(deps) {
57934
57966
  }
57935
57967
 
57936
57968
  // src/engine.ts
57937
- var DAEMON_VERSION = true ? "2.0.6-dev.1983" : "2.0.0-alpha.0";
57969
+ var DAEMON_VERSION = true ? "2.0.6-dev.1986" : "2.0.0-alpha.0";
57938
57970
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
57939
57971
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
57940
57972
  var GIT_OP_MUTE_MS = 4e3;
@@ -59089,7 +59121,12 @@ function createWorkspaceEngine(opts) {
59089
59121
  let enclosing = {};
59090
59122
  if (p.location?.line !== void 0) {
59091
59123
  try {
59092
- enclosing = { line: p.location.line, fileText: readFileSync24(join29(opts.workspaceRoot, anchorPath), "utf8") };
59124
+ const headSha = readGitRefState(join29(opts.workspaceRoot, ".git")).sha ?? void 0;
59125
+ enclosing = {
59126
+ line: p.location.line,
59127
+ fileText: readFileSync24(join29(opts.workspaceRoot, anchorPath), "utf8"),
59128
+ ...headSha ? { headSha } : {}
59129
+ };
59093
59130
  } catch {
59094
59131
  enclosing = {};
59095
59132
  }
@@ -60653,6 +60690,15 @@ function contributedWireId(n) {
60653
60690
  }
60654
60691
  var WIRE_CANONICAL_ID_MIN = 6;
60655
60692
  var SHIP_TERMINAL_REFUSALS = 3;
60693
+ function anchorVersionAttrs(attrs) {
60694
+ if (!attrs) return {};
60695
+ const commit = attrs["observedAtCommit"];
60696
+ const hash2 = attrs["symbolContentHash"];
60697
+ return {
60698
+ ...typeof commit === "string" && /^[0-9a-f]{7,40}$/.test(commit) ? { observedAtCommit: commit } : {},
60699
+ ...typeof hash2 === "string" && /^[0-9a-f]{8,64}$/.test(hash2) ? { symbolContentHash: hash2 } : {}
60700
+ };
60701
+ }
60656
60702
  function refusalFingerprint(reason, description) {
60657
60703
  return digest(`${reason}\0${description}`);
60658
60704
  }
@@ -60935,7 +60981,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
60935
60981
  stability: "unstable"
60936
60982
  });
60937
60983
  }
60938
- anchorEdges.push({ ...e, from: wireFrom, to: symId, attrs: {} });
60984
+ anchorEdges.push({ ...e, from: wireFrom, to: symId, attrs: anchorVersionAttrs(e.attrs) });
60939
60985
  }
60940
60986
  }
60941
60987
  }
@@ -61417,6 +61463,12 @@ var ANCHOR_SYMBOL_KINDS = [
61417
61463
  "Namespace",
61418
61464
  "Property"
61419
61465
  ];
61466
+ function classifyAnchorVersion(cloudAttrs, localSymbol) {
61467
+ const seen = cloudAttrs["symbolContentHash"];
61468
+ const have = localSymbol?.attrs["bodyHash"];
61469
+ if (typeof seen !== "string" || typeof have !== "string") return "unverified";
61470
+ return seen === have ? "current" : "pre-change";
61471
+ }
61420
61472
  function buildReverseSymbolMap(opts) {
61421
61473
  const { store, salt, projectId } = opts;
61422
61474
  const reverse = /* @__PURE__ */ new Map();
@@ -61469,7 +61521,7 @@ async function reanchorProject(opts) {
61469
61521
  // Tagged `source: 'cloud'` (C7 — never re-shipped outward). GUARDRAIL 2 holds
61470
61522
  // by construction: we merge the EDGE onto the LOCAL node id, never the `sym_`
61471
61523
  // Symbol node — that stayed a translation key and never enters the store.
61472
- attrs: { ...a.attrs, source: "cloud" }
61524
+ attrs: { ...a.attrs, source: "cloud", anchorState: classifyAnchorVersion(a.attrs, store.getNode(localTo)) }
61473
61525
  };
61474
61526
  store.mergeEdge(edge2);
61475
61527
  anchors++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.6-dev.1983",
3
+ "version": "2.0.6-dev.1986",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -15248,7 +15248,17 @@ var init_wire = __esm({
15248
15248
  extractedBy: external_exports.enum(INGEST_EXTRACTION_SOURCES).optional(),
15249
15249
  /** Triage route per-context counts (T3 induction). Carried as structured data
15250
15250
  * here; stored JSON-encoded on the Neo4j rel (`perContextJson`). */
15251
- perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional()
15251
+ perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional(),
15252
+ /** PJ-anchor-version: WHICH version of a symbol an `ANCHORED_AT` was
15253
+ * witnessed against. Both opaque — the observing checkout's HEAD sha and
15254
+ * the indexer's 16-hex sha256 of the symbol body. Neither is reversible
15255
+ * to code or names (a sha identifies a commit only to someone holding the
15256
+ * repo), so they add nothing to the §6c disclosure surface. A consumer
15257
+ * (reanchor) compares the hash with its local symbol's `bodyHash` to
15258
+ * classify the anchor current / pre-change; absent ⇒ the pre-versioning
15259
+ * contract, unverified. Only meaningful on `ANCHORED_AT`. */
15260
+ observedAtCommit: external_exports.string().regex(/^[0-9a-f]{7,40}$/).optional(),
15261
+ symbolContentHash: external_exports.string().regex(/^[0-9a-f]{8,64}$/).optional()
15252
15262
  }).optional()
15253
15263
  });
15254
15264
  SymbolSummarySidecarSchema = external_exports.record(