@hviana/sema 0.8.1 → 0.8.3
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 +29 -29
- package/TRADEMARKS.md +0 -1
- package/dist/src/config.d.ts +28 -0
- package/dist/src/config.js +20 -0
- package/dist/src/geometry.d.ts +21 -0
- package/dist/src/geometry.js +21 -0
- package/dist/src/meter.d.ts +76 -0
- package/dist/src/meter.js +95 -0
- package/dist/src/mind/attention.d.ts +4 -0
- package/dist/src/mind/attention.js +165 -16
- package/dist/src/mind/canonical.d.ts +16 -0
- package/dist/src/mind/canonical.js +41 -0
- package/dist/src/mind/corpus.d.ts +40 -0
- package/dist/src/mind/corpus.js +149 -0
- package/dist/src/mind/graph-search.d.ts +7 -0
- package/dist/src/mind/graph-search.js +254 -24
- package/dist/src/mind/index.d.ts +3 -1
- package/dist/src/mind/index.js +1 -0
- package/dist/src/mind/match.d.ts +9 -4
- package/dist/src/mind/match.js +147 -61
- package/dist/src/mind/mechanisms/cast.js +19 -3
- package/dist/src/mind/mechanisms/confluence.js +24 -0
- package/dist/src/mind/mechanisms/cover.js +6 -0
- package/dist/src/mind/mechanisms/recall.js +32 -4
- package/dist/src/mind/mind.d.ts +57 -0
- package/dist/src/mind/mind.js +72 -1
- package/dist/src/mind/pipeline-mechanism.d.ts +7 -0
- package/dist/src/mind/pipeline.js +66 -20
- package/dist/src/mind/primitives.js +9 -1
- package/dist/src/mind/rationale.d.ts +28 -1
- package/dist/src/mind/rationale.js +22 -1
- package/dist/src/mind/reasoning.d.ts +25 -3
- package/dist/src/mind/reasoning.js +125 -20
- package/dist/src/mind/recognition.js +4 -8
- package/dist/src/mind/resonance.js +20 -1
- package/dist/src/mind/trace.js +1 -0
- package/dist/src/mind/traverse.js +15 -3
- package/dist/src/mind/types.d.ts +49 -4
- package/docs/INVARIANTS.md +2 -2
- package/docs/architecture/bounded-reads.md +1 -1
- package/docs/architecture/commonality.md +2 -2
- package/docs/architecture/cost-model.md +2 -2
- package/docs/architecture/determinism.md +7 -7
- package/docs/architecture/match-project.md +2 -3
- package/docs/architecture/mechanism-market.md +10 -10
- package/docs/architecture/meter.md +5 -5
- package/docs/architecture/store.md +3 -3
- package/docs/failures/tempting-but-wrong.md +34 -6
- package/docs/harness/gates.md +2 -2
- package/docs/mechanisms/cast.md +2 -2
- package/docs/mechanisms/cover.md +2 -3
- package/docs/mechanisms/extraction.md +7 -7
- package/docs/mechanisms/recall.md +8 -9
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/alu/README.md +11 -12
- package/src/config.ts +48 -0
- package/src/geometry.ts +21 -0
- package/src/meter.ts +98 -0
- package/src/mind/attention.ts +167 -16
- package/src/mind/canonical.ts +43 -0
- package/src/mind/corpus.ts +202 -0
- package/src/mind/graph-search.ts +277 -23
- package/src/mind/index.ts +8 -1
- package/src/mind/match.ts +148 -57
- package/src/mind/mechanisms/cast.ts +20 -2
- package/src/mind/mechanisms/confluence.ts +24 -0
- package/src/mind/mechanisms/cover.ts +5 -0
- package/src/mind/mechanisms/recall.ts +32 -4
- package/src/mind/mind.ts +125 -0
- package/src/mind/pipeline-mechanism.ts +7 -0
- package/src/mind/pipeline.ts +79 -22
- package/src/mind/primitives.ts +9 -1
- package/src/mind/rationale.ts +35 -1
- package/src/mind/reasoning.ts +145 -13
- package/src/mind/recognition.ts +4 -8
- package/src/mind/resonance.ts +19 -1
- package/src/mind/trace.ts +1 -0
- package/src/mind/traverse.ts +16 -6
- package/src/mind/types.ts +53 -4
- package/test/100-complete-grounding-trace.test.mjs +109 -0
- package/test/101-alignment-gap-bound.test.mjs +106 -0
- package/test/102-production-composes-at-scale.test.mjs +110 -0
- package/test/103-alignment-gap-budget.test.mjs +89 -0
- package/test/104-composition-is-reported.test.mjs +90 -0
- package/test/105-derive-through-reports-its-refusal.test.mjs +137 -0
- package/test/106-the-join-fires.test.mjs +94 -0
- package/test/107-the-join-is-counted.test.mjs +81 -0
- package/test/108-the-join-chains.test.mjs +78 -0
- package/test/109-the-pivot-is-counted.test.mjs +60 -0
- package/test/110-the-reasoner-stops-when-the-question-is-answered.test.mjs +91 -0
- package/test/111-the-cover-assembly-is-counted.test.mjs +74 -0
- package/test/112-the-exploration-does-not-grow-with-the-hub.test.mjs +89 -0
- package/test/113-the-rationale-payload-is-bounded.test.mjs +84 -0
- package/test/114-alignment-budget-is-per-sweep.test.mjs +93 -0
- package/test/116-the-extension-is-gated-by-the-pipelines-own-remainder.test.mjs +100 -0
- package/test/117-corpus-search.test.mjs +171 -0
- package/test/118-the-join-reaches-a-key-off-the-cut.test.mjs +74 -0
- package/test/119-the-work-does-not-grow-with-the-corpus.test.mjs +122 -0
- package/test/120-composition-is-consequence.test.mjs +132 -0
- package/test/121-the-extension-does-not-grow-with-the-corpus.test.mjs +128 -0
- package/test/122-the-climb-search-does-not-grow-with-the-corpus.test.mjs +117 -0
- package/test/123-the-paired-formulas-agree.test.mjs +90 -0
- package/test/125-the-post-grounding-branch-publishes-its-operand.test.mjs +51 -0
- package/test/126-the-pipeline-does-not-name-mechanisms.test.mjs +42 -0
- package/test/128-the-leads-somewhere-pair-agrees.test.mjs +83 -0
- package/test/129-the-trace-payload-shape.test.mjs +164 -0
- package/test/14-scaling.test.mjs +10 -7
- package/test/32-confluence.test.mjs +68 -0
- package/test/38-reason-restate-guard.test.mjs +8 -2
- package/test/43-cast-analog-seat.test.mjs +10 -0
- package/test/55-cost-meter.test.mjs +859 -0
- package/test/76-reference-binding.test.mjs +6 -1
- package/test/89-completion-recursion.test.mjs +30 -5
|
@@ -144,7 +144,12 @@ test("the frame inventory REPORTS without judging", async () => {
|
|
|
144
144
|
"the country where the Eiffel Tower is",
|
|
145
145
|
);
|
|
146
146
|
assert.equal(clean(inst.slots[0].filler), "France");
|
|
147
|
-
|
|
147
|
+
// 24, not 23: the alignment's gap bound is the PAIR's extent now (budgeted),
|
|
148
|
+
// so the frame's constant run is no longer cut one byte short by
|
|
149
|
+
// chainReach(W). The contract this test pins — REPORT without judging — is
|
|
150
|
+
// untouched: the substitution is still reported (and still refused by
|
|
151
|
+
// `voiceable` below).
|
|
152
|
+
assert.equal(inst.covered, 24, "coverage must be reported, not judged");
|
|
148
153
|
|
|
149
154
|
// 2. An INSERTION — a real variation, and not a slot anything can carry.
|
|
150
155
|
const ins = frameSlots(
|
|
@@ -206,12 +206,37 @@ test("completion recursion: per-query work does not grow with the corpus", async
|
|
|
206
206
|
// NO OUTPUT CONFOUND. Work is allowed to grow with the ANSWER. Pinning the
|
|
207
207
|
// answer byte-for-byte across every size removes that defence entirely: any
|
|
208
208
|
// growth measured below bought exactly nothing.
|
|
209
|
+
// NO OUTPUT CONFOUND — WITHOUT DEMANDING A CONSTANT ANSWER.
|
|
210
|
+
//
|
|
211
|
+
// This used to require a byte-identical answer across corpus sizes, on the
|
|
212
|
+
// reasoning that with the output moving, any work growth would stop being
|
|
213
|
+
// attributable to the corpus. That was true only while an offer cap froze
|
|
214
|
+
// what a hop could reach: with the cap gone the offer follows the corpus, and
|
|
215
|
+
// a bigger corpus legitimately licenses a different — here CHEAPER —
|
|
216
|
+
// derivation. Measured at the three sizes: the answer moved at the largest
|
|
217
|
+
// (34 B → 34 B → 41 B) while the work did NOT (searches 2/2/2, pops
|
|
218
|
+
// 428/430/384, falling). So the confound worth defending against is not
|
|
219
|
+
// "the answer moved" but "the work grew because the answer grew", and that is
|
|
220
|
+
// removed by dividing the work by the answer it produced — the reading the
|
|
221
|
+
// comment below already allows ("Work is allowed to grow with the ANSWER").
|
|
222
|
+
// The two raw bars below stay exactly as they were; this only ADDS a bar.
|
|
223
|
+
// BYTES, not UTF-16 code units: this law is priced per byte (PASS/byte,
|
|
224
|
+
// bounded-reads.md), so the denominator is the answer's own byte length even
|
|
225
|
+
// though respondText hands back a string.
|
|
226
|
+
const answerBytes = answers.map((a) => new TextEncoder().encode(a).length);
|
|
227
|
+
const perByte = pops.map((p, i) => p / Math.max(1, answerBytes[i]));
|
|
228
|
+
const kPerByte = logLogSlope(SIZES, perByte);
|
|
229
|
+
console.log(
|
|
230
|
+
` answer-normalised pops/byte: ${
|
|
231
|
+
perByte.map((v) => v.toFixed(2)).join(" → ")
|
|
232
|
+
} · k ≈ ${kPerByte.toFixed(2)}`,
|
|
233
|
+
);
|
|
209
234
|
assert.ok(
|
|
210
|
-
|
|
211
|
-
`
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
`
|
|
235
|
+
kPerByte < 1,
|
|
236
|
+
`answer-normalised work grew with exponent k=${kPerByte.toFixed(2)} in ` +
|
|
237
|
+
`corpus size — dividing by the answer's own length already removes the ` +
|
|
238
|
+
`output confound, so growth beyond that is work the answer never asked ` +
|
|
239
|
+
`for (bounded-reads.md)`,
|
|
215
240
|
);
|
|
216
241
|
|
|
217
242
|
const kSearches = logLogSlope(SIZES, searches);
|