@inerrata-corporation/errata 2.0.0-dev.50 → 2.0.0-dev.51

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.
@@ -15169,6 +15169,12 @@ var init_wire = __esm({
15169
15169
  /** Client-supplied UUID — one batch; pairs with the payload digest for replay. */
15170
15170
  runId: external_exports.string().uuid(),
15171
15171
  source: external_exports.enum(INGEST_SOURCES),
15172
+ /** The contributing project (origin key = project; the salted `wp_…` the
15173
+ * daemon already sends as telemetry workspaceId). Stamped onto created nodes
15174
+ * as `authoringProject` so the refute channel's cross-origin gate can tell a
15175
+ * self-refute from an independent one. Optional + additive — absent is
15176
+ * exactly today's wire (and leaves the gate fail-open for that node). */
15177
+ originProject: external_exports.string().min(1).max(120).optional(),
15172
15178
  nodes: external_exports.array(CastaliaIngestNodeSchema).max(1e3),
15173
15179
  edges: external_exports.array(CastaliaIngestEdgeSchema).max(5e3),
15174
15180
  /** Optional symbol→intent-summary sidecar (PP-symbol-intent). Only symbols
package/errata.mjs CHANGED
@@ -15472,6 +15472,12 @@ var init_wire = __esm({
15472
15472
  /** Client-supplied UUID — one batch; pairs with the payload digest for replay. */
15473
15473
  runId: external_exports.string().uuid(),
15474
15474
  source: external_exports.enum(INGEST_SOURCES),
15475
+ /** The contributing project (origin key = project; the salted `wp_…` the
15476
+ * daemon already sends as telemetry workspaceId). Stamped onto created nodes
15477
+ * as `authoringProject` so the refute channel's cross-origin gate can tell a
15478
+ * self-refute from an independent one. Optional + additive — absent is
15479
+ * exactly today's wire (and leaves the gate fail-open for that node). */
15480
+ originProject: external_exports.string().min(1).max(120).optional(),
15475
15481
  nodes: external_exports.array(CastaliaIngestNodeSchema).max(1e3),
15476
15482
  edges: external_exports.array(CastaliaIngestEdgeSchema).max(5e3),
15477
15483
  /** Optional symbol→intent-summary sidecar (PP-symbol-intent). Only symbols
@@ -20725,7 +20731,16 @@ function toWirePayload(batch, runId) {
20725
20731
  };
20726
20732
  });
20727
20733
  const symbolSummaries = sidecarForNodes(batch.symbolSummaries, nodes);
20728
- return { runId, source: "daemon", nodes, edges, ...symbolSummaries ? { symbolSummaries } : {} };
20734
+ return {
20735
+ runId,
20736
+ source: "daemon",
20737
+ // Origin key (= project) for the refute channel's cross-origin gate; absent
20738
+ // for id-less batches (principle sync) → those nodes stay fail-open.
20739
+ ...batch.originProject ? { originProject: batch.originProject } : {},
20740
+ nodes,
20741
+ edges,
20742
+ ...symbolSummaries ? { symbolSummaries } : {}
20743
+ };
20729
20744
  }
20730
20745
  function clamp012(x) {
20731
20746
  return Math.max(0, Math.min(1, x));
@@ -21206,6 +21221,12 @@ var init_client = __esm({
21206
21221
  async reportContradictions(payload) {
21207
21222
  return this.json("POST", "/v2/contradict", payload);
21208
21223
  }
21224
+ /** Transport corroborations (an agent leaned on / resolved a shown prior) to
21225
+ * the cloud's corroborationCount (§5.4). Cross-origin gated (this project vs
21226
+ * the node's author — no self-corroboration). Best-effort. */
21227
+ async reportCorroborations(payload) {
21228
+ return this.json("POST", "/v2/corroborate", payload);
21229
+ }
21209
21230
  async pushPrinciples(payload) {
21210
21231
  return this.json("POST", "/v2/private/principles", payload);
21211
21232
  }
@@ -41216,7 +41237,7 @@ function harvestInlineTags(store, text, opts) {
41216
41237
  const source = opts.sourceId ? store.getNode(opts.sourceId) : null;
41217
41238
  const mintPriors = opts.mintPriors ?? true;
41218
41239
  const touched = opts.sessionTouchedIds ?? /* @__PURE__ */ new Set();
41219
- const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], instances: [], patterns: [], refutes: [] };
41240
+ const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], instances: [], patterns: [], refutes: [], corroborations: [] };
41220
41241
  const tags = parseInlineTags(text);
41221
41242
  const symptomSeqs = tags.filter((t) => (t.kind === "problem" || t.kind === "todo" || t.kind === "constraint") && t.statement).map((t) => ({ seq: t.seq ?? -1, statement: t.statement, threadId: t.threadId })).sort((a, b) => a.seq - b.seq);
41222
41243
  const bindSymptom = (seq, threadId) => {
@@ -41252,8 +41273,13 @@ function harvestInlineTags(store, text, opts) {
41252
41273
  } else if (tag.kind === "fix") {
41253
41274
  if (tag.handle) {
41254
41275
  const problemId = resolveHandle(store, tag.handle, opts.handleMap);
41255
- if (problemId) plan.fixes.push({ problemId, ...tag.fixRationale ? { fixNote: tag.fixRationale } : {} });
41256
- else plan.unresolvedFixes.push({ handle: tag.handle, ...tag.fixRationale ? { fixNote: tag.fixRationale } : {} });
41276
+ if (problemId) {
41277
+ plan.fixes.push({ problemId, ...tag.fixRationale ? { fixNote: tag.fixRationale } : {} });
41278
+ const witnessKey = `corrob:${problemId}:${digest({ h: tag.handle })}`.slice(0, 72);
41279
+ if (!plan.corroborations.some((c) => c.witnessKey === witnessKey)) {
41280
+ plan.corroborations.push({ nodeId: problemId, witnessKey });
41281
+ }
41282
+ } else plan.unresolvedFixes.push({ handle: tag.handle, ...tag.fixRationale ? { fixNote: tag.fixRationale } : {} });
41257
41283
  } else if (tag.fixRationale) {
41258
41284
  const b = bindSymptom(tag.seq, tag.threadId);
41259
41285
  if (b.problemId) {
@@ -41690,6 +41716,8 @@ function buildClaimIngest(store, profile, daemonVersion, level = 1, ignorePatter
41690
41716
  const base = {
41691
41717
  daemonVersion,
41692
41718
  profile: { stack: profile.stack, languages: profile.languages, domains: profile.domains },
41719
+ // origin key (= project) for the refute channel's cross-origin gate.
41720
+ originProject: profile.id,
41693
41721
  nodes,
41694
41722
  edges: []
41695
41723
  };
@@ -41734,6 +41762,8 @@ function buildDesignProblemIngest(store, profile, daemonVersion, ignorePatterns
41734
41762
  const base = {
41735
41763
  daemonVersion,
41736
41764
  profile: { stack: profile.stack, languages: profile.languages, domains: profile.domains },
41765
+ // origin key (= project) for the refute channel's cross-origin gate.
41766
+ originProject: profile.id,
41737
41767
  nodes,
41738
41768
  edges
41739
41769
  };
@@ -42724,7 +42754,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
42724
42754
  }
42725
42755
 
42726
42756
  // src/engine.ts
42727
- var DAEMON_VERSION = true ? "2.0.0-dev.50" : "2.0.0-alpha.0";
42757
+ var DAEMON_VERSION = true ? "2.0.0-dev.51" : "2.0.0-alpha.0";
42728
42758
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
42729
42759
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
42730
42760
  var GIT_OP_MUTE_MS = 4e3;
@@ -43538,6 +43568,13 @@ function createWorkspaceEngine(opts) {
43538
43568
  (err2) => console.warn("[errata] refute transport failed (continuing):", err2 instanceof Error ? err2.message : err2)
43539
43569
  );
43540
43570
  }
43571
+ if (plan.corroborations.length > 0 && typeof cloud.reportCorroborations === "function") {
43572
+ void cloud.reportCorroborations({ daemonVersion: DAEMON_VERSION, projectId: profile.id, items: plan.corroborations }).then((r) => {
43573
+ if (r?.recorded) console.log(`[errata] corroborate: ${r.recorded} corroboration(s) recorded`);
43574
+ }).catch(
43575
+ (err2) => console.warn("[errata] corroboration transport failed (continuing):", err2 instanceof Error ? err2.message : err2)
43576
+ );
43577
+ }
43541
43578
  } catch (err2) {
43542
43579
  console.warn("[errata] inline-tag harvest failed:", err2);
43543
43580
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.50",
3
+ "version": "2.0.0-dev.51",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -15015,6 +15015,12 @@ var init_wire = __esm({
15015
15015
  /** Client-supplied UUID — one batch; pairs with the payload digest for replay. */
15016
15016
  runId: external_exports.string().uuid(),
15017
15017
  source: external_exports.enum(INGEST_SOURCES),
15018
+ /** The contributing project (origin key = project; the salted `wp_…` the
15019
+ * daemon already sends as telemetry workspaceId). Stamped onto created nodes
15020
+ * as `authoringProject` so the refute channel's cross-origin gate can tell a
15021
+ * self-refute from an independent one. Optional + additive — absent is
15022
+ * exactly today's wire (and leaves the gate fail-open for that node). */
15023
+ originProject: external_exports.string().min(1).max(120).optional(),
15018
15024
  nodes: external_exports.array(CastaliaIngestNodeSchema).max(1e3),
15019
15025
  edges: external_exports.array(CastaliaIngestEdgeSchema).max(5e3),
15020
15026
  /** Optional symbol→intent-summary sidecar (PP-symbol-intent). Only symbols