@inerrata-corporation/errata 2.0.21-dev.3763 → 2.0.21-dev.3863

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.
@@ -594,6 +594,13 @@ function aliasRegex(alias) {
594
594
  const body = escapeRe(alias).replace(/\\?\s+/g, "\\s+");
595
595
  return new RegExp(`(?<![\\w-])${body}(?![\\w-])`, "i");
596
596
  }
597
+ function withoutEntityMentions(text, entityId) {
598
+ let out = text;
599
+ for (const { entity, re } of COMPILED) {
600
+ if (entity.id === entityId) out = out.replace(new RegExp(re.source, "gi"), " ");
601
+ }
602
+ return out;
603
+ }
597
604
  function prefilterEntities(text) {
598
605
  const seen = /* @__PURE__ */ new Set();
599
606
  const hits = [];
@@ -770,13 +777,19 @@ var init_concept_bag = __esm({
770
777
 
771
778
  // ../../packages/shared/src/nlp/claim-id.ts
772
779
  function claimStructure(text, scope) {
773
- const entities = prefilterEntities(text).map((e) => e.id).sort();
780
+ const extracted = prefilterEntities(text);
781
+ const entities = extracted.map((e) => e.id).sort();
774
782
  const predicate = normalizePredicate(text);
775
783
  const stance = detectStance(text);
776
784
  const base = { entities, predicate, stance, scope: scope ?? {} };
777
- if (predicate === "" || entities.length === 0) base.raw = conceptBag(text);
785
+ if (predicate === "" || entities.length === 0 || predicateIsTheEntity(text, extracted[0].id, entities.length)) {
786
+ base.raw = conceptBag(text);
787
+ }
778
788
  return base;
779
789
  }
790
+ function predicateIsTheEntity(text, entityId, entityCount) {
791
+ return entityCount === 1 && normalizePredicate(withoutEntityMentions(text, entityId)) === "";
792
+ }
780
793
  function canonicalClaimId(text, scope) {
781
794
  const s = claimStructure(text, scope);
782
795
  return digest(
@@ -16614,6 +16627,10 @@ function detectCommunitiesLeiden(input, opts = {}) {
16614
16627
  return normalize(assignment);
16615
16628
  }
16616
16629
 
16630
+ // ../../packages/math/src/void-demand.ts
16631
+ var DEMAND_HOT = Math.log1p(10);
16632
+ var DEMAND_WARM = Math.log1p(5);
16633
+
16617
16634
  // ../../packages/local-graph/src/store.ts
16618
16635
  var PAGE_RANK_SCALE_KEY = "pageRankScale.p95.v1";
16619
16636
  var TEXT_SEARCH_COLUMNS = `id, label, description, page_rank,
package/errata.mjs CHANGED
@@ -873,6 +873,13 @@ function aliasRegex(alias) {
873
873
  const body2 = escapeRe(alias).replace(/\\?\s+/g, "\\s+");
874
874
  return new RegExp(`(?<![\\w-])${body2}(?![\\w-])`, "i");
875
875
  }
876
+ function withoutEntityMentions(text, entityId) {
877
+ let out2 = text;
878
+ for (const { entity, re } of COMPILED) {
879
+ if (entity.id === entityId) out2 = out2.replace(new RegExp(re.source, "gi"), " ");
880
+ }
881
+ return out2;
882
+ }
876
883
  function prefilterEntities(text) {
877
884
  const seen = /* @__PURE__ */ new Set();
878
885
  const hits = [];
@@ -1052,13 +1059,19 @@ var init_concept_bag = __esm({
1052
1059
 
1053
1060
  // ../../packages/shared/src/nlp/claim-id.ts
1054
1061
  function claimStructure(text, scope) {
1055
- const entities = prefilterEntities(text).map((e) => e.id).sort();
1062
+ const extracted = prefilterEntities(text);
1063
+ const entities = extracted.map((e) => e.id).sort();
1056
1064
  const predicate = normalizePredicate(text);
1057
1065
  const stance = detectStance(text);
1058
1066
  const base = { entities, predicate, stance, scope: scope ?? {} };
1059
- if (predicate === "" || entities.length === 0) base.raw = conceptBag(text);
1067
+ if (predicate === "" || entities.length === 0 || predicateIsTheEntity(text, extracted[0].id, entities.length)) {
1068
+ base.raw = conceptBag(text);
1069
+ }
1060
1070
  return base;
1061
1071
  }
1072
+ function predicateIsTheEntity(text, entityId, entityCount) {
1073
+ return entityCount === 1 && normalizePredicate(withoutEntityMentions(text, entityId)) === "";
1074
+ }
1062
1075
  function canonicalClaimId(text, scope) {
1063
1076
  const s = claimStructure(text, scope);
1064
1077
  return digest(
@@ -17708,7 +17721,8 @@ __export(src_exports, {
17708
17721
  unregisteredGraphEventKeys: () => unregisteredGraphEventKeys,
17709
17722
  validateCastaliaPayload: () => validateCastaliaPayload,
17710
17723
  versionlessPurl: () => versionlessPurl,
17711
- vetSidecarSummaries: () => vetSidecarSummaries
17724
+ vetSidecarSummaries: () => vetSidecarSummaries,
17725
+ withoutEntityMentions: () => withoutEntityMentions
17712
17726
  });
17713
17727
  var init_src = __esm({
17714
17728
  "../../packages/shared/src/index.ts"() {
@@ -19014,6 +19028,24 @@ var init_spectral = __esm({
19014
19028
  }
19015
19029
  });
19016
19030
 
19031
+ // ../../packages/math/src/community-health.ts
19032
+ var init_community_health = __esm({
19033
+ "../../packages/math/src/community-health.ts"() {
19034
+ "use strict";
19035
+ init_spectral();
19036
+ }
19037
+ });
19038
+
19039
+ // ../../packages/math/src/void-demand.ts
19040
+ var DEMAND_HOT, DEMAND_WARM;
19041
+ var init_void_demand = __esm({
19042
+ "../../packages/math/src/void-demand.ts"() {
19043
+ "use strict";
19044
+ DEMAND_HOT = Math.log1p(10);
19045
+ DEMAND_WARM = Math.log1p(5);
19046
+ }
19047
+ });
19048
+
19017
19049
  // ../../packages/math/src/bko/a1-stable-motif.ts
19018
19050
  function a1StableMotif(input) {
19019
19051
  if (input.instanceCount >= MIN_INSTANCES && input.survivedRuns >= MIN_SURVIVED_RUNS) {
@@ -19261,6 +19293,8 @@ var init_src3 = __esm({
19261
19293
  init_relevance();
19262
19294
  init_leiden();
19263
19295
  init_spectral();
19296
+ init_community_health();
19297
+ init_void_demand();
19264
19298
  init_motif_gate();
19265
19299
  init_bko();
19266
19300
  init_pagerank_local();
@@ -82979,7 +83013,7 @@ function createWatchBreaker(deps) {
82979
83013
  }
82980
83014
 
82981
83015
  // src/engine.ts
82982
- var DAEMON_VERSION = true ? "2.0.21-dev.3763" : "2.0.0-alpha.0";
83016
+ var DAEMON_VERSION = true ? "2.0.21-dev.3863" : "2.0.0-alpha.0";
82983
83017
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
82984
83018
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
82985
83019
  var GIT_OP_MUTE_MS = 4e3;
@@ -15021,6 +15021,10 @@ function pageRankScale(ranks) {
15021
15021
  return positive.length ? Math.max(1e-9, positive[Math.floor((positive.length - 1) * 0.95)]) : 1;
15022
15022
  }
15023
15023
 
15024
+ // ../../packages/math/src/void-demand.ts
15025
+ var DEMAND_HOT = Math.log1p(10);
15026
+ var DEMAND_WARM = Math.log1p(5);
15027
+
15024
15028
  // ../../packages/local-graph/src/store.ts
15025
15029
  var PAGE_RANK_SCALE_KEY = "pageRankScale.p95.v1";
15026
15030
  var TEXT_SEARCH_COLUMNS = `id, label, description, page_rank,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.21-dev.3763",
3
+ "version": "2.0.21-dev.3863",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -25728,6 +25728,10 @@ function detectCommunitiesLeiden(input, opts = {}) {
25728
25728
  return normalize(assignment);
25729
25729
  }
25730
25730
 
25731
+ // ../../packages/math/src/void-demand.ts
25732
+ var DEMAND_HOT = Math.log1p(10);
25733
+ var DEMAND_WARM = Math.log1p(5);
25734
+
25731
25735
  // ../../packages/math/src/bko/a1-stable-motif.ts
25732
25736
  var MIN_INSTANCES = 5;
25733
25737
  var MIN_SURVIVED_RUNS = 2;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errata-context",
3
- "version": "2.0.21-dev.3763",
3
+ "version": "2.0.21-dev.3863",
4
4
  "description": "A minimal 3D view of loaded Errata priors and recent graph bursts.",
5
5
  "author": {
6
6
  "name": "inErrata"
@@ -1,4 +1,4 @@
1
- 9cdbe6022b073c75f8e7f7c88290ecc356976f7febaac12fb63cb506342ffc3c .codex-plugin/plugin.json
1
+ d2b8238acf66ab6c4bb1cfb326376ef90018fc2e3ebe8c4a3dabdfff67135669 .codex-plugin/plugin.json
2
2
  a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
3
3
  fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
4
4
  73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js