@inerrata-corporation/errata 2.0.23-dev.4881 → 2.0.23-dev.4901

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.
@@ -40,6 +40,33 @@ The Codex context plugin under `resources/context-plugin/` carries its own
40
40
  ## Data credits
41
41
 
42
42
  - tldr-pages command index (snapshot in src/tldr-tools.generated.ts): Command names from the tldr-pages project, (c) the tldr-pages contributors, licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Source: https://github.com/tldr-pages/tldr
43
+ - Static embedding weights (resources/models/potion-base-8M.q8.bin): potion-base-8M by The Minish Lab (model2vec), MIT License; vocabulary from baai/bge-base-en-v1.5. Redistributed quantized to per-row int8 by packages/embedding/scripts/build-static-model.ts. Source: https://huggingface.co/minishlab/potion-base-8M (revision bf8b056651a2c21b8d2565580b8569da283cab23)
44
+
45
+ ### Static embedding weights (resources/models/potion-base-8M.q8.bin) — MIT
46
+
47
+ ```
48
+ MIT License
49
+
50
+ Copyright (c) 2024 Thomas van Dongen
51
+
52
+ Permission is hereby granted, free of charge, to any person obtaining a copy
53
+ of this software and associated documentation files (the "Software"), to deal
54
+ in the Software without restriction, including without limitation the rights
55
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56
+ copies of the Software, and to permit persons to whom the Software is
57
+ furnished to do so, subject to the following conditions:
58
+
59
+ The above copyright notice and this permission notice shall be included in all
60
+ copies or substantial portions of the Software.
61
+
62
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
68
+ SOFTWARE.
69
+ ```
43
70
 
44
71
  ---
45
72
 
@@ -17438,9 +17438,6 @@ function installLineageIntegrityRepair(db, now = Date.now()) {
17438
17438
  });
17439
17439
  }
17440
17440
 
17441
- // ../../packages/math/src/constants.ts
17442
- var NEMORI_DEDUP_COSINE = 0.88;
17443
-
17444
17441
  // ../../packages/math/src/triage.ts
17445
17442
  var TRIAGE_GLOBAL_BUCKET = "*";
17446
17443
  function triageContextBuckets(ctx) {
@@ -19694,6 +19691,38 @@ init_src();
19694
19691
  // ../../packages/local-graph/src/problem-package-link.ts
19695
19692
  init_src();
19696
19693
 
19694
+ // ../../packages/embedding/src/bands.ts
19695
+ var DESIGNED_FOR_MINILM = {
19696
+ dedup: 0.88,
19697
+ softWriteMin: 0.8,
19698
+ bindMin: 0.78,
19699
+ nearMiss: 0.72,
19700
+ judgeMin: 0.5,
19701
+ predictionFloor: 0.5,
19702
+ relevanceFloor: 0.25,
19703
+ relatedWeak: 0.35,
19704
+ relatedStrong: 0.45
19705
+ };
19706
+ var BANDS = {
19707
+ "hash-v1": DESIGNED_FOR_MINILM,
19708
+ "minilm-l6-v2": DESIGNED_FOR_MINILM,
19709
+ "potion-8m-q8": {
19710
+ dedup: 0.895,
19711
+ softWriteMin: 0.835,
19712
+ bindMin: 0.83,
19713
+ nearMiss: 0.775,
19714
+ judgeMin: 0.335,
19715
+ predictionFloor: 0.335,
19716
+ relevanceFloor: 0.35,
19717
+ relatedWeak: 0.49,
19718
+ relatedStrong: 0.53
19719
+ }
19720
+ };
19721
+ var UNKNOWN = { ...DESIGNED_FOR_MINILM, relevanceFloor: 0.5 };
19722
+ function cosineBandsFor(version3) {
19723
+ return (version3 ? BANDS[version3] : void 0) ?? UNKNOWN;
19724
+ }
19725
+
19697
19726
  // ../../packages/local-graph/src/design-problem.ts
19698
19727
  init_src2();
19699
19728
 
@@ -20658,7 +20687,9 @@ function cosine2(a, b) {
20658
20687
  return na === 0 || nb === 0 ? 0 : dot / (Math.sqrt(na) * Math.sqrt(nb));
20659
20688
  }
20660
20689
  function noveltyAgainst(node, neighbors, opts = {}) {
20661
- const floor = opts.dedupCosine ?? NEMORI_DEDUP_COSINE;
20690
+ const versionOf = (n) => String(n.attrs?.["embeddingVersion"] ?? "hash-v1");
20691
+ const version3 = versionOf(node);
20692
+ const floor = opts.dedupCosine ?? cosineBandsFor(version3).dedup;
20662
20693
  const emb = node.embedding ?? [];
20663
20694
  if (emb.length === 0) {
20664
20695
  return { ready: true, surprise: 1, topCosine: 0, reason: "no-embedding (fidelity-first)" };
@@ -20667,7 +20698,7 @@ function noveltyAgainst(node, neighbors, opts = {}) {
20667
20698
  for (const other of neighbors) {
20668
20699
  if (other.id === node.id) continue;
20669
20700
  const oe = other.embedding ?? [];
20670
- if (oe.length !== emb.length) continue;
20701
+ if (oe.length !== emb.length || versionOf(other) !== version3) continue;
20671
20702
  const c = cosine2(emb, oe);
20672
20703
  if (c > topCosine) topCosine = c;
20673
20704
  }