@hviana/sema 0.9.0 → 0.9.2
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.
- package/AGENTS.md +7 -7
- package/dist/src/alu/src/index.d.ts +1 -1
- package/dist/src/alu/src/index.js +1 -1
- package/dist/src/alu/src/parser.js +2 -6
- package/dist/src/alu/src/resonance.d.ts +13 -0
- package/dist/src/alu/src/resonance.js +41 -0
- package/dist/src/alu/test/alu.test.js +39 -0
- package/dist/src/bytes.d.ts +6 -2
- package/dist/src/bytes.js +10 -4
- package/dist/src/canon.js +44 -0
- package/dist/src/geometry.d.ts +19 -1
- package/dist/src/geometry.js +125 -141
- package/dist/src/meter.d.ts +33 -0
- package/dist/src/meter.js +34 -1
- package/dist/src/mind/articulation.js +14 -1
- package/dist/src/mind/attention.d.ts +12 -0
- package/dist/src/mind/attention.js +44 -16
- package/dist/src/mind/bridge.js +3 -3
- package/dist/src/mind/derivation.d.ts +40 -0
- package/dist/src/mind/derivation.js +34 -0
- package/dist/src/mind/evidence.d.ts +24 -0
- package/dist/src/mind/evidence.js +90 -0
- package/dist/src/mind/graph-search.d.ts +89 -15
- package/dist/src/mind/graph-search.js +345 -174
- package/dist/src/mind/learning.js +1 -1
- package/dist/src/mind/mechanisms/cover.d.ts +19 -3
- package/dist/src/mind/mechanisms/cover.js +142 -61
- package/dist/src/mind/mechanisms/recall.js +10 -3
- package/dist/src/mind/mind.d.ts +6 -0
- package/dist/src/mind/mind.js +5 -2
- package/dist/src/mind/pipeline.d.ts +5 -1
- package/dist/src/mind/pipeline.js +220 -90
- package/dist/src/mind/primitives.d.ts +25 -5
- package/dist/src/mind/primitives.js +107 -44
- package/dist/src/mind/reasoning.d.ts +18 -4
- package/dist/src/mind/reasoning.js +487 -328
- package/dist/src/mind/recognition.js +29 -13
- package/dist/src/mind/resonance.js +1 -11
- package/dist/src/mind/traverse.d.ts +45 -5
- package/dist/src/mind/traverse.js +285 -8
- package/dist/src/mind/types.d.ts +16 -1
- package/dist/src/store-sqlite.d.ts +25 -0
- package/dist/src/store-sqlite.js +89 -1
- package/dist/src/store.d.ts +48 -4
- package/dist/src/store.js +86 -6
- package/docs/INDEX.md +20 -19
- package/docs/INVARIANTS.md +17 -16
- package/docs/architecture/bounded-reads.md +1 -1
- package/docs/architecture/caches.md +5 -4
- package/docs/architecture/closure.md +45 -5
- package/docs/architecture/cost-model.md +16 -0
- package/docs/architecture/evidence.md +113 -0
- package/docs/architecture/exact-vs-approximate.md +10 -9
- package/docs/architecture/factored-machinery.md +14 -13
- package/docs/architecture/fold-contract.md +51 -1
- package/docs/architecture/mechanism-market.md +21 -0
- package/docs/architecture/memoization.md +3 -3
- package/docs/architecture/meter.md +2 -1
- package/docs/architecture/saturation.md +12 -0
- package/docs/architecture/store.md +25 -2
- package/docs/failures/tempting-but-wrong.md +13 -2
- package/docs/harness/gates.md +12 -10
- package/docs/mechanisms/cover.md +23 -6
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/alu/README.md +10 -2
- package/src/alu/src/index.ts +1 -0
- package/src/alu/src/parser.ts +6 -6
- package/src/alu/src/resonance.ts +42 -0
- package/src/alu/test/alu.test.ts +40 -0
- package/src/bytes.ts +13 -3
- package/src/canon.ts +40 -0
- package/src/geometry.ts +183 -154
- package/src/meter.ts +34 -1
- package/src/mind/articulation.ts +14 -2
- package/src/mind/attention.ts +47 -25
- package/src/mind/bridge.ts +3 -3
- package/src/mind/derivation.ts +77 -0
- package/src/mind/evidence.ts +107 -0
- package/src/mind/graph-search.ts +449 -221
- package/src/mind/learning.ts +1 -7
- package/src/mind/match.ts +1 -2
- package/src/mind/mechanisms/cast.ts +1 -2
- package/src/mind/mechanisms/cover.ts +207 -87
- package/src/mind/mechanisms/extraction.ts +1 -2
- package/src/mind/mechanisms/prefix-completion.ts +1 -1
- package/src/mind/mechanisms/recall.ts +17 -5
- package/src/mind/mechanisms/reference.ts +1 -1
- package/src/mind/mind.ts +9 -30
- package/src/mind/pipeline.ts +263 -104
- package/src/mind/primitives.ts +119 -43
- package/src/mind/reasoning.ts +611 -419
- package/src/mind/recognition.ts +24 -9
- package/src/mind/resonance.ts +2 -16
- package/src/mind/trace.ts +1 -1
- package/src/mind/traverse.ts +321 -8
- package/src/mind/types.ts +15 -11
- package/src/store-sqlite.ts +92 -1
- package/src/store.ts +113 -7
- package/test/105-derive-through-reports-its-refusal.test.mjs +8 -5
- package/test/106-the-join-fires.test.mjs +21 -0
- package/test/111-the-cover-assembly-is-counted.test.mjs +8 -5
- package/test/128-the-leads-somewhere-pair-agrees.test.mjs +18 -12
- package/test/136-the-two-named-limits.test.mjs +3 -2
- package/test/137-the-law-lives-once-and-below.test.mjs +21 -0
- package/test/148-exact-shortcuts-agree.test.mjs +188 -0
- package/test/149-the-closure-engine.test.mjs +138 -0
- package/test/150-the-join-is-output-sensitive.test.mjs +66 -0
- package/test/151-the-cover-pays-for-what-it-reaches.test.mjs +142 -0
- package/test/152-the-read-side-names-as-the-write-side.test.mjs +146 -0
- package/test/153-a-cheaper-bound-is-looked-at-first.test.mjs +155 -0
- package/test/154-the-question-names-the-step.test.mjs +281 -0
- package/test/24-generalization.test.mjs +32 -0
- package/test/36-bloom.test.mjs +53 -0
- package/test/37-cluster-dispersion-fusion.test.mjs +75 -0
- package/test/48-recognise-turn-connective.test.mjs +3 -2
- package/test/55-cost-meter.test.mjs +4 -4
- package/test/90-connector-read-cap.test.mjs +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// 90-connector-read-cap.test.mjs — the "already answered" probe must read by
|
|
2
2
|
// the QUERY, not by the corpus.
|
|
3
3
|
//
|
|
4
|
-
// `
|
|
4
|
+
// `offerConnectors` (src/mind/mechanisms/cover.ts) drops a site whose
|
|
5
5
|
// continuation already appears elsewhere in the query — stale transcript
|
|
6
6
|
// evidence, whose bridges would only be discarded later. The test is a
|
|
7
7
|
// substring search, so it needs the candidate's bytes; it used to reconstruct
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// B reconstructed against a 3-byte prompt. So the invariant here is per-read
|
|
29
29
|
// SIZE.
|
|
30
30
|
//
|
|
31
|
-
// It is measured by calling `
|
|
31
|
+
// It is measured by calling `offerConnectors` DIRECTLY and diffing the meter
|
|
32
32
|
// across it. A whole-response counter cannot express this: `bytesRead` sums
|
|
33
33
|
// every reader in the pipeline, and the answer itself is a long continuation
|
|
34
34
|
// that is legitimately read in full — an earlier draft of this file asserted on
|
|
@@ -46,7 +46,7 @@ import { test } from "node:test";
|
|
|
46
46
|
import assert from "node:assert/strict";
|
|
47
47
|
import { Mind } from "../dist/src/index.js";
|
|
48
48
|
import { SQliteStore } from "../dist/src/store-sqlite.js";
|
|
49
|
-
import {
|
|
49
|
+
import { offerConnectors } from "../dist/src/mind/mechanisms/cover.js";
|
|
50
50
|
|
|
51
51
|
/** Learnt CONTINUATIONS far longer than the query that will be asked — the
|
|
52
52
|
* shape the cap governs: an uncapped probe reconstructs each one in full
|
|
@@ -80,7 +80,7 @@ test("connector probe reads by the query, not by the learnt continuation", async
|
|
|
80
80
|
mind.beginResponse();
|
|
81
81
|
try {
|
|
82
82
|
const { sites } = mind.recogniseSpan(bytes);
|
|
83
|
-
// EXACT ISOLATION.
|
|
83
|
+
// EXACT ISOLATION. offerConnectors also reads bytes the probe has
|
|
84
84
|
// nothing to do with (the n-ary bridge reads each ordered node in full, and
|
|
85
85
|
// legitimately so). The probe itself early-returns when answeredSpans is
|
|
86
86
|
// empty, so running the SAME call both ways and differencing leaves exactly
|
|
@@ -88,12 +88,12 @@ test("connector probe reads by the query, not by the learnt continuation", async
|
|
|
88
88
|
const m = mind.meter;
|
|
89
89
|
mind.answeredSpans = [];
|
|
90
90
|
const a0 = m.byteReads, b0 = m.bytesRead;
|
|
91
|
-
|
|
91
|
+
offerConnectors(mind, sites, bytes);
|
|
92
92
|
const baseReads = m.byteReads - a0, baseBytes = m.bytesRead - b0;
|
|
93
93
|
|
|
94
94
|
mind.answeredSpans = [[0, 1]];
|
|
95
95
|
const a1 = m.byteReads, b1 = m.bytesRead;
|
|
96
|
-
|
|
96
|
+
offerConnectors(mind, sites, bytes);
|
|
97
97
|
const reads = (m.byteReads - a1) - baseReads;
|
|
98
98
|
const read = (m.bytesRead - b1) - baseBytes;
|
|
99
99
|
|
|
@@ -107,7 +107,7 @@ test("connector probe reads by the query, not by the learnt continuation", async
|
|
|
107
107
|
// below is trivially true and proves nothing.
|
|
108
108
|
assert.ok(
|
|
109
109
|
reads > 0,
|
|
110
|
-
`
|
|
110
|
+
`offerConnectors made no byte reads — the probe never ran (sites=${sites.length}), ` +
|
|
111
111
|
`so this file is not testing anything`,
|
|
112
112
|
);
|
|
113
113
|
|