@inerrata-corporation/errata 2.0.0-dev.74 → 2.0.0-dev.76

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.
@@ -53,7 +53,18 @@ var init_castalia = __esm({
53
53
  "OperatingSystem",
54
54
  "Paradigm",
55
55
  "DataStructure",
56
- "AgentModel"
56
+ "AgentModel",
57
+ // An OPAQUE anchor identity in a project's stratum (PJ-anchors · plan §6c).
58
+ // Deliberately NOT one of the CODE_NODE_LABELS below — those are the local code
59
+ // graph and never cross. A cloud `Symbol` carries the salted `sym_` id and a
60
+ // coarse `kind`, and NOTHING ELSE: no path, no qualified name. It exists so two
61
+ // teammates' knowledge about the same function lands on one node; the cloud
62
+ // learns THAT they concern the same symbol, never WHICH symbol.
63
+ //
64
+ // Project-stratum only. The ingest door rejects a `Symbol` node — and any
65
+ // ANCHORED_AT edge — on a batch that carries no verified projectId, so the
66
+ // org/team/public lanes can never acquire one by accident.
67
+ "Symbol"
57
68
  ];
58
69
  CODE_NODE_LABELS = [
59
70
  "File",
@@ -15123,7 +15134,7 @@ var init_symbol_intent = __esm({
15123
15134
  });
15124
15135
 
15125
15136
  // ../../packages/shared/src/wire.ts
15126
- var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, CastaliaIngestNodeSchema, RouteContextCountWireSchema, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
15137
+ var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, CastaliaIngestNodeSchema, RouteContextCountWireSchema, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
15127
15138
  var init_wire = __esm({
15128
15139
  "../../packages/shared/src/wire.ts"() {
15129
15140
  "use strict";
@@ -15154,11 +15165,20 @@ var init_wire = __esm({
15154
15165
  "DataStructure",
15155
15166
  "Triage",
15156
15167
  "Claim",
15157
- "AntiPattern"
15168
+ "AntiPattern",
15169
+ // PJ-anchors (§6c): the OPAQUE project anchor identity — salted `sym_` id +
15170
+ // coarse kind, no path, no qualified name. Writable ONLY on a batch with a
15171
+ // verified projectId; the ingest door rejects it outright otherwise, so its
15172
+ // presence in this list does not admit it to the org/team/public lanes.
15173
+ "Symbol"
15158
15174
  ];
15175
+ PROJECT_ONLY_NODE_LABELS = ["Symbol"];
15176
+ PROJECT_ONLY_NODE_LABEL_SET = new Set(PROJECT_ONLY_NODE_LABELS);
15177
+ PROJECT_ONLY_EDGE_TYPES = ["ANCHORED_AT"];
15178
+ PROJECT_ONLY_EDGE_TYPE_SET = new Set(PROJECT_ONLY_EDGE_TYPES);
15159
15179
  CLOUD_WRITABLE_NODE_LABEL_SET = new Set(CLOUD_WRITABLE_NODE_LABELS);
15160
15180
  CLOUD_EDGE_TYPES = ALL_EDGE_TYPES.filter(
15161
- (e) => !CODE_EDGES.includes(e) && !GIT_EDGES.includes(e) && !BRIDGE_EDGES.includes(e)
15181
+ (e) => e === "ANCHORED_AT" || !CODE_EDGES.includes(e) && !GIT_EDGES.includes(e) && !BRIDGE_EDGES.includes(e)
15162
15182
  );
15163
15183
  INGEST_SOURCES = ["agent", "daemon", "corpus-importer", "spine-importer"];
15164
15184
  INGEST_EXTRACTION_SOURCES = [
@@ -15251,7 +15271,6 @@ var init_repo_locator = __esm({
15251
15271
  var init_project_symbol = __esm({
15252
15272
  "../../packages/shared/src/project-symbol.ts"() {
15253
15273
  "use strict";
15254
- init_hash();
15255
15274
  }
15256
15275
  });
15257
15276
 
package/errata.mjs CHANGED
@@ -103,7 +103,18 @@ var init_castalia = __esm({
103
103
  "OperatingSystem",
104
104
  "Paradigm",
105
105
  "DataStructure",
106
- "AgentModel"
106
+ "AgentModel",
107
+ // An OPAQUE anchor identity in a project's stratum (PJ-anchors · plan §6c).
108
+ // Deliberately NOT one of the CODE_NODE_LABELS below — those are the local code
109
+ // graph and never cross. A cloud `Symbol` carries the salted `sym_` id and a
110
+ // coarse `kind`, and NOTHING ELSE: no path, no qualified name. It exists so two
111
+ // teammates' knowledge about the same function lands on one node; the cloud
112
+ // learns THAT they concern the same symbol, never WHICH symbol.
113
+ //
114
+ // Project-stratum only. The ingest door rejects a `Symbol` node — and any
115
+ // ANCHORED_AT edge — on a batch that carries no verified projectId, so the
116
+ // org/team/public lanes can never acquire one by accident.
117
+ "Symbol"
107
118
  ];
108
119
  CODE_NODE_LABELS = [
109
120
  "File",
@@ -15259,6 +15270,18 @@ var init_edge_rules = __esm({
15259
15270
  "../../packages/shared/src/edge-rules.ts"() {
15260
15271
  "use strict";
15261
15272
  EDGE_RULES = {
15273
+ // ── Project anchors (PJ-anchors · PLAN_PROJECT_STORE §6c) ──
15274
+ // ANCHORED_AT is the ONE bridge edge admitted to the cloud, and it exists for
15275
+ // exactly one purpose: point a piece of knowledge at an OPAQUE project `Symbol`
15276
+ // so two teammates' observations about the same function converge on one node.
15277
+ // Constrain it to that purpose — an unconstrained ANCHORED_AT (its state before
15278
+ // this rule, since a missing entry means "anything goes") would let a batch
15279
+ // anchor anything at anything, e.g. at a public `Package`, quietly re-creating
15280
+ // the code↔collective bridge the membrane exists to prevent.
15281
+ ANCHORED_AT: {
15282
+ from: ["Problem", "Solution", "RootCause", "Claim"],
15283
+ to: ["Symbol"]
15284
+ },
15262
15285
  // ── Security spine (v1 taxonomy.ts SECURITY_FORWARD_ONLY commentary) ──
15263
15286
  TARGETS: { from: ["Exploit"], to: ["Vulnerability"] },
15264
15287
  ENABLES: { from: ["AntiPattern"], to: ["Vulnerability"] },
@@ -15385,6 +15408,12 @@ var init_symbol_intent = __esm({
15385
15408
  });
15386
15409
 
15387
15410
  // ../../packages/shared/src/wire.ts
15411
+ function isProjectOnlyNodeLabel(label) {
15412
+ return PROJECT_ONLY_NODE_LABEL_SET.has(label);
15413
+ }
15414
+ function isProjectOnlyEdgeType(type) {
15415
+ return PROJECT_ONLY_EDGE_TYPE_SET.has(type);
15416
+ }
15388
15417
  function isCloudWritableNodeLabel(label) {
15389
15418
  return CLOUD_WRITABLE_NODE_LABEL_SET.has(label);
15390
15419
  }
@@ -15440,7 +15469,7 @@ function summarizeIngestResult(r) {
15440
15469
  ...r.patternReconciliation ? { patternReconciliation: r.patternReconciliation } : {}
15441
15470
  };
15442
15471
  }
15443
- var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, QUARANTINE_EXTRACTION_SOURCE_PREFIX, MAX_NODES_PER_PAYLOAD, MAX_EDGES_PER_PAYLOAD, CastaliaIngestNodeSchema, RouteContextCountWireSchema, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
15472
+ var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, QUARANTINE_EXTRACTION_SOURCE_PREFIX, MAX_NODES_PER_PAYLOAD, MAX_EDGES_PER_PAYLOAD, CastaliaIngestNodeSchema, RouteContextCountWireSchema, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
15444
15473
  var init_wire = __esm({
15445
15474
  "../../packages/shared/src/wire.ts"() {
15446
15475
  "use strict";
@@ -15471,11 +15500,20 @@ var init_wire = __esm({
15471
15500
  "DataStructure",
15472
15501
  "Triage",
15473
15502
  "Claim",
15474
- "AntiPattern"
15503
+ "AntiPattern",
15504
+ // PJ-anchors (§6c): the OPAQUE project anchor identity — salted `sym_` id +
15505
+ // coarse kind, no path, no qualified name. Writable ONLY on a batch with a
15506
+ // verified projectId; the ingest door rejects it outright otherwise, so its
15507
+ // presence in this list does not admit it to the org/team/public lanes.
15508
+ "Symbol"
15475
15509
  ];
15510
+ PROJECT_ONLY_NODE_LABELS = ["Symbol"];
15511
+ PROJECT_ONLY_NODE_LABEL_SET = new Set(PROJECT_ONLY_NODE_LABELS);
15512
+ PROJECT_ONLY_EDGE_TYPES = ["ANCHORED_AT"];
15513
+ PROJECT_ONLY_EDGE_TYPE_SET = new Set(PROJECT_ONLY_EDGE_TYPES);
15476
15514
  CLOUD_WRITABLE_NODE_LABEL_SET = new Set(CLOUD_WRITABLE_NODE_LABELS);
15477
15515
  CLOUD_EDGE_TYPES = ALL_EDGE_TYPES.filter(
15478
- (e) => !CODE_EDGES.includes(e) && !GIT_EDGES.includes(e) && !BRIDGE_EDGES.includes(e)
15516
+ (e) => e === "ANCHORED_AT" || !CODE_EDGES.includes(e) && !GIT_EDGES.includes(e) && !BRIDGE_EDGES.includes(e)
15479
15517
  );
15480
15518
  INGEST_SOURCES = ["agent", "daemon", "corpus-importer", "spine-importer"];
15481
15519
  INGEST_EXTRACTION_SOURCES = [
@@ -15597,17 +15635,17 @@ var init_repo_locator = __esm({
15597
15635
  });
15598
15636
 
15599
15637
  // ../../packages/shared/src/project-symbol.ts
15638
+ import { createHmac } from "node:crypto";
15600
15639
  function normalizeSymbolPath(relPath) {
15601
15640
  return relPath.replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^\.\//, "").replace(/^\//, "");
15602
15641
  }
15603
- function projectSymbolId(projectId, relPath, qname, kind) {
15642
+ function projectSymbolId(projectSalt, projectId, relPath, qname, kind) {
15604
15643
  const path2 = normalizeSymbolPath(relPath);
15605
- return `sym_${sha256(`${projectId}:${path2}:${qname}:${kind}`).slice(0, 24)}`;
15644
+ return `sym_${createHmac("sha256", projectSalt).update(`${projectId}:${path2}:${qname}:${kind}`).digest("hex").slice(0, 24)}`;
15606
15645
  }
15607
15646
  var init_project_symbol = __esm({
15608
15647
  "../../packages/shared/src/project-symbol.ts"() {
15609
15648
  "use strict";
15610
- init_hash();
15611
15649
  }
15612
15650
  });
15613
15651
 
@@ -15677,6 +15715,8 @@ __export(src_exports, {
15677
15715
  MAX_SYMBOL_SUMMARY_CHARS: () => MAX_SYMBOL_SUMMARY_CHARS,
15678
15716
  PAGERANK_EXCLUSIONS: () => PAGERANK_EXCLUSIONS,
15679
15717
  PROBLEM_RESOLUTION: () => PROBLEM_RESOLUTION,
15718
+ PROJECT_ONLY_EDGE_TYPES: () => PROJECT_ONLY_EDGE_TYPES,
15719
+ PROJECT_ONLY_NODE_LABELS: () => PROJECT_ONLY_NODE_LABELS,
15680
15720
  QUARANTINE_EXTRACTION_SOURCE_PREFIX: () => QUARANTINE_EXTRACTION_SOURCE_PREFIX,
15681
15721
  RESOLUTION_EDGES: () => RESOLUTION_EDGES,
15682
15722
  RouteContextCountWireSchema: () => RouteContextCountWireSchema,
@@ -15713,6 +15753,8 @@ __export(src_exports, {
15713
15753
  isCodeLabel: () => isCodeLabel,
15714
15754
  isContextLabel: () => isContextLabel,
15715
15755
  isInferredSource: () => isInferredSource,
15756
+ isProjectOnlyEdgeType: () => isProjectOnlyEdgeType,
15757
+ isProjectOnlyNodeLabel: () => isProjectOnlyNodeLabel,
15716
15758
  isQuarantinedExtractionSource: () => isQuarantinedExtractionSource,
15717
15759
  isSeedProvenance: () => isSeedProvenance,
15718
15760
  isSemanticLabel: () => isSemanticLabel,
@@ -43234,7 +43276,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
43234
43276
  }
43235
43277
 
43236
43278
  // src/engine.ts
43237
- var DAEMON_VERSION = true ? "2.0.0-dev.74" : "2.0.0-alpha.0";
43279
+ var DAEMON_VERSION = true ? "2.0.0-dev.76" : "2.0.0-alpha.0";
43238
43280
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
43239
43281
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
43240
43282
  var GIT_OP_MUTE_MS = 4e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.74",
3
+ "version": "2.0.0-dev.76",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -64,7 +64,18 @@ var init_castalia = __esm({
64
64
  "OperatingSystem",
65
65
  "Paradigm",
66
66
  "DataStructure",
67
- "AgentModel"
67
+ "AgentModel",
68
+ // An OPAQUE anchor identity in a project's stratum (PJ-anchors · plan §6c).
69
+ // Deliberately NOT one of the CODE_NODE_LABELS below — those are the local code
70
+ // graph and never cross. A cloud `Symbol` carries the salted `sym_` id and a
71
+ // coarse `kind`, and NOTHING ELSE: no path, no qualified name. It exists so two
72
+ // teammates' knowledge about the same function lands on one node; the cloud
73
+ // learns THAT they concern the same symbol, never WHICH symbol.
74
+ //
75
+ // Project-stratum only. The ingest door rejects a `Symbol` node — and any
76
+ // ANCHORED_AT edge — on a batch that carries no verified projectId, so the
77
+ // org/team/public lanes can never acquire one by accident.
78
+ "Symbol"
68
79
  ];
69
80
  CODE_NODE_LABELS = [
70
81
  "File",
@@ -14978,7 +14989,7 @@ var init_symbol_intent = __esm({
14978
14989
  });
14979
14990
 
14980
14991
  // ../../packages/shared/src/wire.ts
14981
- var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, CastaliaIngestNodeSchema, RouteContextCountWireSchema, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
14992
+ var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, CastaliaIngestNodeSchema, RouteContextCountWireSchema, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
14982
14993
  var init_wire = __esm({
14983
14994
  "../../packages/shared/src/wire.ts"() {
14984
14995
  "use strict";
@@ -15009,11 +15020,20 @@ var init_wire = __esm({
15009
15020
  "DataStructure",
15010
15021
  "Triage",
15011
15022
  "Claim",
15012
- "AntiPattern"
15023
+ "AntiPattern",
15024
+ // PJ-anchors (§6c): the OPAQUE project anchor identity — salted `sym_` id +
15025
+ // coarse kind, no path, no qualified name. Writable ONLY on a batch with a
15026
+ // verified projectId; the ingest door rejects it outright otherwise, so its
15027
+ // presence in this list does not admit it to the org/team/public lanes.
15028
+ "Symbol"
15013
15029
  ];
15030
+ PROJECT_ONLY_NODE_LABELS = ["Symbol"];
15031
+ PROJECT_ONLY_NODE_LABEL_SET = new Set(PROJECT_ONLY_NODE_LABELS);
15032
+ PROJECT_ONLY_EDGE_TYPES = ["ANCHORED_AT"];
15033
+ PROJECT_ONLY_EDGE_TYPE_SET = new Set(PROJECT_ONLY_EDGE_TYPES);
15014
15034
  CLOUD_WRITABLE_NODE_LABEL_SET = new Set(CLOUD_WRITABLE_NODE_LABELS);
15015
15035
  CLOUD_EDGE_TYPES = ALL_EDGE_TYPES.filter(
15016
- (e) => !CODE_EDGES.includes(e) && !GIT_EDGES.includes(e) && !BRIDGE_EDGES.includes(e)
15036
+ (e) => e === "ANCHORED_AT" || !CODE_EDGES.includes(e) && !GIT_EDGES.includes(e) && !BRIDGE_EDGES.includes(e)
15017
15037
  );
15018
15038
  INGEST_SOURCES = ["agent", "daemon", "corpus-importer", "spine-importer"];
15019
15039
  INGEST_EXTRACTION_SOURCES = [
@@ -15106,7 +15126,6 @@ var init_repo_locator = __esm({
15106
15126
  var init_project_symbol = __esm({
15107
15127
  "../../packages/shared/src/project-symbol.ts"() {
15108
15128
  "use strict";
15109
- init_hash();
15110
15129
  }
15111
15130
  });
15112
15131