@hviana/sema 0.5.2 → 0.5.4
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 +115 -53
- package/HOW_IT_WORKS.md +291 -184
- package/jsr.json +6 -0
- package/package.json +1 -1
- package/src/mind/bridge.ts +10 -104
- package/src/mind/match.ts +497 -7
- package/src/mind/{prefix-completion.ts → mechanisms/prefix-completion.ts} +66 -92
- package/src/mind/mechanisms/recall.ts +38 -129
- package/src/mind/mechanisms/reference.ts +343 -0
- package/src/mind/mind.ts +12 -8
- package/src/mind/pipeline-mechanism.ts +120 -3
- package/src/mind/pipeline.ts +16 -2
- package/src/mind/traverse.ts +92 -1
- package/src/store.ts +13 -4
- package/test/33-multi-candidate.test.mjs +21 -11
- package/test/70-prefix-completion.test.mjs +1 -1
- package/test/72-prefix-candidate-supply.test.mjs +7 -9
- package/test/74-prefix-trap-not-sprung-early.test.mjs +1 -1
- package/test/76-reference-binding.test.mjs +543 -0
- package/dist/example/demo.d.ts +0 -1
- package/dist/example/demo.js +0 -39
- package/dist/example/train_base.d.ts +0 -93
- package/dist/example/train_base.js +0 -2269
- package/dist/src/alphabet.d.ts +0 -7
- package/dist/src/alphabet.js +0 -33
- package/dist/src/alu/src/alu.d.ts +0 -185
- package/dist/src/alu/src/alu.js +0 -440
- package/dist/src/alu/src/expr.d.ts +0 -61
- package/dist/src/alu/src/expr.js +0 -318
- package/dist/src/alu/src/index.d.ts +0 -11
- package/dist/src/alu/src/index.js +0 -19
- package/dist/src/alu/src/kernel-arith.d.ts +0 -16
- package/dist/src/alu/src/kernel-arith.js +0 -264
- package/dist/src/alu/src/kernel-bits.d.ts +0 -19
- package/dist/src/alu/src/kernel-bits.js +0 -152
- package/dist/src/alu/src/kernel-logic.d.ts +0 -4
- package/dist/src/alu/src/kernel-logic.js +0 -60
- package/dist/src/alu/src/kernel-nd.d.ts +0 -3
- package/dist/src/alu/src/kernel-nd.js +0 -208
- package/dist/src/alu/src/kernel-numeric.d.ts +0 -54
- package/dist/src/alu/src/kernel-numeric.js +0 -366
- package/dist/src/alu/src/operation.d.ts +0 -168
- package/dist/src/alu/src/operation.js +0 -189
- package/dist/src/alu/src/parser.d.ts +0 -221
- package/dist/src/alu/src/parser.js +0 -577
- package/dist/src/alu/src/resonance.d.ts +0 -55
- package/dist/src/alu/src/resonance.js +0 -126
- package/dist/src/alu/src/text.d.ts +0 -31
- package/dist/src/alu/src/text.js +0 -73
- package/dist/src/alu/src/value.d.ts +0 -109
- package/dist/src/alu/src/value.js +0 -300
- package/dist/src/alu/test/alu.test.d.ts +0 -1
- package/dist/src/alu/test/alu.test.js +0 -764
- package/dist/src/bytes.d.ts +0 -14
- package/dist/src/bytes.js +0 -59
- package/dist/src/canon.d.ts +0 -45
- package/dist/src/canon.js +0 -85
- package/dist/src/config.d.ts +0 -111
- package/dist/src/config.js +0 -91
- package/dist/src/derive/src/deduction.d.ts +0 -136
- package/dist/src/derive/src/deduction.js +0 -159
- package/dist/src/derive/src/index.d.ts +0 -8
- package/dist/src/derive/src/index.js +0 -11
- package/dist/src/derive/src/priority-queue.d.ts +0 -20
- package/dist/src/derive/src/priority-queue.js +0 -73
- package/dist/src/derive/src/rewrite.d.ts +0 -56
- package/dist/src/derive/src/rewrite.js +0 -100
- package/dist/src/derive/src/trie.d.ts +0 -90
- package/dist/src/derive/src/trie.js +0 -217
- package/dist/src/derive/test/derive.test.d.ts +0 -1
- package/dist/src/derive/test/derive.test.js +0 -122
- package/dist/src/extension.d.ts +0 -37
- package/dist/src/extension.js +0 -7
- package/dist/src/geometry.d.ts +0 -233
- package/dist/src/geometry.js +0 -1089
- package/dist/src/index.d.ts +0 -17
- package/dist/src/index.js +0 -19
- package/dist/src/ingest-cache.d.ts +0 -41
- package/dist/src/ingest-cache.js +0 -165
- package/dist/src/meter.d.ts +0 -176
- package/dist/src/meter.js +0 -274
- package/dist/src/mind/articulation.d.ts +0 -6
- package/dist/src/mind/articulation.js +0 -99
- package/dist/src/mind/attention.d.ts +0 -430
- package/dist/src/mind/attention.js +0 -2418
- package/dist/src/mind/bridge.d.ts +0 -39
- package/dist/src/mind/bridge.js +0 -998
- package/dist/src/mind/canonical.d.ts +0 -34
- package/dist/src/mind/canonical.js +0 -93
- package/dist/src/mind/frame-filler.d.ts +0 -15
- package/dist/src/mind/frame-filler.js +0 -535
- package/dist/src/mind/graph-search.d.ts +0 -294
- package/dist/src/mind/graph-search.js +0 -996
- package/dist/src/mind/index.d.ts +0 -9
- package/dist/src/mind/index.js +0 -5
- package/dist/src/mind/junction.d.ts +0 -137
- package/dist/src/mind/junction.js +0 -358
- package/dist/src/mind/learning.d.ts +0 -75
- package/dist/src/mind/learning.js +0 -265
- package/dist/src/mind/match.d.ts +0 -192
- package/dist/src/mind/match.js +0 -666
- package/dist/src/mind/mechanisms/alu.d.ts +0 -4
- package/dist/src/mind/mechanisms/alu.js +0 -36
- package/dist/src/mind/mechanisms/cast.d.ts +0 -89
- package/dist/src/mind/mechanisms/cast.js +0 -1186
- package/dist/src/mind/mechanisms/confluence.d.ts +0 -24
- package/dist/src/mind/mechanisms/confluence.js +0 -271
- package/dist/src/mind/mechanisms/cover.d.ts +0 -6
- package/dist/src/mind/mechanisms/cover.js +0 -232
- package/dist/src/mind/mechanisms/extraction.d.ts +0 -33
- package/dist/src/mind/mechanisms/extraction.js +0 -327
- package/dist/src/mind/mechanisms/recall.d.ts +0 -16
- package/dist/src/mind/mechanisms/recall.js +0 -558
- package/dist/src/mind/mind.d.ts +0 -386
- package/dist/src/mind/mind.js +0 -754
- package/dist/src/mind/pipeline-mechanism.d.ts +0 -183
- package/dist/src/mind/pipeline-mechanism.js +0 -521
- package/dist/src/mind/pipeline.d.ts +0 -49
- package/dist/src/mind/pipeline.js +0 -331
- package/dist/src/mind/prefix-completion.d.ts +0 -59
- package/dist/src/mind/prefix-completion.js +0 -270
- package/dist/src/mind/primitives.d.ts +0 -85
- package/dist/src/mind/primitives.js +0 -333
- package/dist/src/mind/rationale.d.ts +0 -139
- package/dist/src/mind/rationale.js +0 -163
- package/dist/src/mind/reasoning.d.ts +0 -42
- package/dist/src/mind/reasoning.js +0 -305
- package/dist/src/mind/recognition.d.ts +0 -20
- package/dist/src/mind/recognition.js +0 -696
- package/dist/src/mind/resonance.d.ts +0 -35
- package/dist/src/mind/resonance.js +0 -365
- package/dist/src/mind/trace.d.ts +0 -15
- package/dist/src/mind/trace.js +0 -73
- package/dist/src/mind/traverse.d.ts +0 -158
- package/dist/src/mind/traverse.js +0 -716
- package/dist/src/mind/types.d.ts +0 -418
- package/dist/src/mind/types.js +0 -179
- package/dist/src/rabitq-ivf/src/database.d.ts +0 -113
- package/dist/src/rabitq-ivf/src/database.js +0 -201
- package/dist/src/rabitq-ivf/src/index.d.ts +0 -7
- package/dist/src/rabitq-ivf/src/index.js +0 -4
- package/dist/src/rabitq-ivf/src/ivf.d.ts +0 -200
- package/dist/src/rabitq-ivf/src/ivf.js +0 -1165
- package/dist/src/rabitq-ivf/src/prng.d.ts +0 -19
- package/dist/src/rabitq-ivf/src/prng.js +0 -36
- package/dist/src/rabitq-ivf/src/rabitq.d.ts +0 -95
- package/dist/src/rabitq-ivf/src/rabitq.js +0 -313
- package/dist/src/sema.d.ts +0 -41
- package/dist/src/sema.js +0 -77
- package/dist/src/store-sqlite.d.ts +0 -184
- package/dist/src/store-sqlite.js +0 -942
- package/dist/src/store.d.ts +0 -762
- package/dist/src/store.js +0 -1823
- package/dist/src/vec.d.ts +0 -31
- package/dist/src/vec.js +0 -109
- package/src/mind/frame-filler.ts +0 -604
- package/test/69-frame-filler.test.mjs +0 -115
package/AGENTS.md
CHANGED
|
@@ -41,11 +41,12 @@ The mental model, top to bottom:
|
|
|
41
41
|
|
|
42
42
|
```
|
|
43
43
|
mind/pipeline.ts the grounding decider: mechanisms compete on one cost scale
|
|
44
|
-
mind/mechanisms/* cover · cast · confluence · extraction ·
|
|
44
|
+
mind/mechanisms/* cover · cast · confluence · extraction · reference ·
|
|
45
|
+
recall · prefix-completion · alu
|
|
45
46
|
mind/* shared machinery: match/project, attention, recognition,
|
|
46
47
|
junction ascent, graph search, learning, rationale;
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
the substitution bridge lives beside them, not inside
|
|
49
|
+
recall.ts
|
|
49
50
|
store.ts AbstractStore: ALL domain logic of the DAG store
|
|
50
51
|
store-sqlite.ts the one concrete backend (thin SQL wrappers)
|
|
51
52
|
geometry.ts + vec/alphabet/sema/canon
|
|
@@ -174,14 +175,16 @@ policy in callers, the engine neutral.
|
|
|
174
175
|
### 2.5 One factored machinery: match → project, under a gate
|
|
175
176
|
|
|
176
177
|
`mind/match.ts` is the shared family every generalising mechanism configures:
|
|
177
|
-
matchers (`locate`, `alignRuns`, `alignGraded`, `
|
|
178
|
-
`analogyStrength` and its structural tier
|
|
179
|
-
`spanSynonymStrength`), projections
|
|
180
|
-
`conceptHop`),
|
|
181
|
-
`
|
|
182
|
-
|
|
183
|
-
`
|
|
184
|
-
`
|
|
178
|
+
matchers (`locate`, `alignRuns`, `alignGraded`, `alignAround`/`frameSlots`,
|
|
179
|
+
`bestHaloMate`, `haloSiblings`, `analogyStrength` and its structural tier
|
|
180
|
+
`sharedFrameStrength`, `spanHalo`, `spanSynonymStrength`), projections
|
|
181
|
+
(`follow`, `reverseContext`, `project`, `conceptHop`), the span-shape family
|
|
182
|
+
(`skillExemplar`, `isSpanShaped`, `containsSpan`), and the STRUCTURAL gates that
|
|
183
|
+
are byte predicates rather than derived thresholds (`isSpanShaped`,
|
|
184
|
+
`carriesFillers`, `voicesDisplacedFiller`). `mind/traverse.ts` owns the graph
|
|
185
|
+
readings (`edgeAncestors`, `reachOf`, `chooseNext`/`chooseAmong`, `guidedFirst`,
|
|
186
|
+
`leadsSomewhere`, `allWindowsAreScaffolding`, `formsOpenedBy`) and the corpus
|
|
187
|
+
scale (`corpusN`, `hubBound`, `hubCap`, `atomReach`).
|
|
185
188
|
|
|
186
189
|
_Follow it:_ before writing a new generalising mechanism, express it as a
|
|
187
190
|
(matcher, direction, gate) triple. If those already exist, the mechanism is a
|
|
@@ -195,9 +198,62 @@ A shared analysis must not live inside a mechanism. If `pipeline-mechanism.ts`
|
|
|
195
198
|
(the shared contract and `Precomputed`) or a post-grounding stage has to import
|
|
196
199
|
_out of_ `mechanisms/`, the dependency is inverted and the market's decoupling
|
|
197
200
|
(2.6) is broken — deleting that mechanism would break the shared container. The
|
|
198
|
-
span-shape family (`isSpanShaped` / `containsSpan` / `skillExemplar`)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
span-shape family (`isSpanShaped` / `containsSpan` / `skillExemplar`) lives in
|
|
202
|
+
`match.ts` for exactly this reason: its two consumers reach it without knowing
|
|
203
|
+
extraction exists. `alignAround` is there on the same grounds — the substitution
|
|
204
|
+
bridge and the frame reading both need the same gaps, and ask opposite questions
|
|
205
|
+
of them (the bridge EXPANDS a gap until the query side attests, because a
|
|
206
|
+
substitution claims equivalence; the frame reading CONTRACTS it to its varying
|
|
207
|
+
core, because a reference claims only position). Neither reading derives the
|
|
208
|
+
other, and one aligner serves both. `formsOpenedBy` (`traverse.ts`) is the
|
|
209
|
+
retrieval counterpart: "which trained forms does this byte run open?" is a
|
|
210
|
+
question about the STORE, so it sits with the graph readings rather than inside
|
|
211
|
+
the mechanism that first needed it.
|
|
212
|
+
|
|
213
|
+
The **frame reading** (`alignAround` / `contractGap` / `frameSlots` /
|
|
214
|
+
`carriesFillers`, plus `Precomputed.frames`) is the worked example of this
|
|
215
|
+
pattern at full length. Sema is otherwise fully GROUND — nothing anywhere
|
|
216
|
+
represents a position whose occupant comes from the context rather than the
|
|
217
|
+
corpus — so without it no mechanism can tell "the corpus does not explain these
|
|
218
|
+
bytes" (PASS, refuse) from "these bytes occupy a place the corpus keeps open"
|
|
219
|
+
(bind). Split along the §2.5 triple the notion lands in three places, each at
|
|
220
|
+
its own altitude:
|
|
221
|
+
|
|
222
|
+
- the **matcher** (`frameSlots`) REPORTS and does not judge: every place a
|
|
223
|
+
pairing varies, contracted to its varying core, tagged
|
|
224
|
+
substitution/insertion/deletion, plus how much the two share. It rejects
|
|
225
|
+
nothing, so a consumer can apply its own reading to a pairing another consumer
|
|
226
|
+
would throw away.
|
|
227
|
+
- the **gate** (`carriesFillers`) is the much stronger claim that a slot may be
|
|
228
|
+
VOICED through, so it is deliberately not folded into the matcher: a consumer
|
|
229
|
+
taking the matcher's answer as permission to voice would be making exactly the
|
|
230
|
+
claim the licence withholds.
|
|
231
|
+
- the **inventory** (`Precomputed.frames`) elects no frame, because a slot is a
|
|
232
|
+
property of a PAIRING, not of the query. Election is each consumer's own —
|
|
233
|
+
`reference.ts` keeps the modal slot signature, and a consumer wanting another
|
|
234
|
+
reading is not fighting that one.
|
|
235
|
+
|
|
236
|
+
**Voicing gates belong to the consumer that voices, never to the matcher.** The
|
|
237
|
+
four reference applies — the frame must dominate the query, each slot must reach
|
|
238
|
+
one window on both sides, an insertion or deletion disqualifies the pairing,
|
|
239
|
+
fillers must be pairwise distinct — are all requirements for substituting and
|
|
240
|
+
SPEAKING, not for knowing where a pairing varies. Inside `frameSlots` they make
|
|
241
|
+
the shared reading useless to anyone else: measured over four real pairings,
|
|
242
|
+
only reference's own survives, while a definite description standing where a
|
|
243
|
+
proper noun stands, a pure insertion and a sub-window difference all come back
|
|
244
|
+
as NOTHING. Nothing fails to compile and no test notices.
|
|
245
|
+
|
|
246
|
+
_Follow it:_ a shared analysis with exactly ONE consumer is unproven, whatever
|
|
247
|
+
its address. Before declaring machinery shared, run a second consumer's real
|
|
248
|
+
case through it and check the answer is not `null`. If every gate you wrote
|
|
249
|
+
happens to be one your own mechanism needs, they are not the matcher's gates.
|
|
250
|
+
|
|
251
|
+
Making a notion available is not the same as imposing it, and two mechanisms
|
|
252
|
+
deliberately do **not** consume this one: the substitution bridge (its
|
|
253
|
+
substitution asserts equivalence, and it grounds through its candidate's
|
|
254
|
+
continuation UNSUBSTITUTED, so admitting a slot-gap there voices the corpus's
|
|
255
|
+
filler for the asker's referent) and CAST (its frame gate is weave-local while a
|
|
256
|
+
slot is cohort-local — §2.7 again).
|
|
201
257
|
|
|
202
258
|
Related single-definition contracts (define once, import everywhere):
|
|
203
259
|
|
|
@@ -208,7 +264,7 @@ Related single-definition contracts (define once, import everywhere):
|
|
|
208
264
|
- `canonical.ts` — the write/read contract for canonical segmentation
|
|
209
265
|
(`canonicalWindows`, `chainReach`, `leafIdRun`, `leafIdPrefix`, `windowIds`).
|
|
210
266
|
Learning writes through it; recognition, attention, confluence, the bridge and
|
|
211
|
-
prefix
|
|
267
|
+
prefix completion read through it. Changing one side means changing this file
|
|
212
268
|
— drift between sides breaks canonical recognition with **no type error**.
|
|
213
269
|
- `junction.ts` — the content-addressed "which learnt whole contains these two
|
|
214
270
|
forms?" ascent, shared by the bridge and cross-region attention, with its
|
|
@@ -237,8 +293,8 @@ the same interface, `PipelineMechanism` (`mind/pipeline-mechanism.ts`): optional
|
|
|
237
293
|
(an admissible lower bound, or `null` when the mechanism structurally cannot
|
|
238
294
|
fire), and `run` (candidate answers). The decider in `mind/pipeline.ts`
|
|
239
295
|
(`think`) holds a plain list (`defaultMechanisms`: cover, cast, confluence,
|
|
240
|
-
extraction, recall, plus the ALU and any user
|
|
241
|
-
which mechanism it is holding.
|
|
296
|
+
extraction, reference, recall, prefix-completion, plus the ALU and any user
|
|
297
|
+
mechanisms) and never branches on which mechanism it is holding.
|
|
242
298
|
|
|
243
299
|
Four constraints make the market honest — verify all four for anything you add:
|
|
244
300
|
|
|
@@ -305,9 +361,8 @@ using the wrong one is a semantic bug the type system cannot catch:
|
|
|
305
361
|
store?"
|
|
306
362
|
- **Weave-local** — reference set: the structures aligned with _this query_.
|
|
307
363
|
Tooling: the `depth[]` array built in `computeWeave` + `MIN_WEAVE` +
|
|
308
|
-
`dominates`. Used by CAST's frame gate
|
|
309
|
-
|
|
310
|
-
activates?"
|
|
364
|
+
`dominates`. Used by CAST's frame gate. Answers "does this discriminate among
|
|
365
|
+
the structures this query activates?"
|
|
311
366
|
|
|
312
367
|
`depth[]` counts **distinct covering structures**, not accumulated alignment
|
|
313
368
|
weight: the frame test compares it against a COUNT of aligned points, so
|
|
@@ -399,11 +454,14 @@ Asking never writes, which is the only reason per-response memos are sound.
|
|
|
399
454
|
`Precomputed` (`pipeline-mechanism.ts`) is the shared response-scoped container:
|
|
400
455
|
eager fields (recognition, computed spans, guide, the evidence-breadth constant
|
|
401
456
|
`k`) plus **lazily-cached methods** for expensive analyses (`attention()` — the
|
|
402
|
-
consensus climb, `weave()`, `
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
457
|
+
consensus climb, `weave()`, `resonance()` — the response's ONE top-k
|
|
458
|
+
content-index read, `wideResonance()` — the one WIDE candidate list every
|
|
459
|
+
past-the-top-k mechanism reads, `frames()` — the frame/slot inventory,
|
|
460
|
+
`spanShapedOf`/`spanShapedAll`, `queryWindows`, `queryResolved`, `windowsOf`,
|
|
461
|
+
`reachMemo`) — each computed at most once, shared by mechanisms and
|
|
462
|
+
post-grounding stages, and never computed if nobody asks. The async ones are
|
|
463
|
+
cached **by promise**, so a second caller awaits the first computation rather
|
|
464
|
+
than starting another.
|
|
407
465
|
|
|
408
466
|
Mind-level memos (`climbMemo`, `recogniseMemo`, `perceiveMemo`, `canonMemo`,
|
|
409
467
|
`_resolvedSubtrees`, `_edgeChoice`, `_gistCache`) are created in
|
|
@@ -554,32 +612,32 @@ story of the fix.
|
|
|
554
612
|
|
|
555
613
|
## 3. Where things live
|
|
556
614
|
|
|
557
|
-
| Concept | File(s)
|
|
558
|
-
| :-------------------------------------------------- |
|
|
559
|
-
| Public surface / assembly | `src/index.ts`, `src/mind/mind.ts`
|
|
560
|
-
| Conversation API (turns, state, answered spans) | `src/mind/mind.ts`
|
|
561
|
-
| Config (capacities, budgets, seed) | `src/config.ts`
|
|
562
|
-
| Derived thresholds, the fold, Hilbert | `src/geometry.ts`
|
|
563
|
-
| Content canonicalizer (injected, modality-specific) | `src/canon.ts`
|
|
564
|
-
| Vector primitives, alphabet, node/fold types, seats | `src/vec.ts`, `src/alphabet.ts`, `src/sema.ts`
|
|
565
|
-
| Perceive / resolve / read primitives | `src/mind/primitives.ts`
|
|
566
|
-
| Store domain logic / SQLite adapter | `src/store.ts`, `src/store-sqlite.ts`
|
|
567
|
-
| Mechanism contract + shared `Precomputed` | `src/mind/pipeline-mechanism.ts`
|
|
568
|
-
| The grounding decider (`think`) | `src/mind/pipeline.ts`
|
|
569
|
-
| Grounding mechanisms (one file each) | `src/mind/mechanisms/{cover,cast,confluence,extraction,recall,alu}.ts`
|
|
570
|
-
| Weighted deduction system + cost ladder | `src/mind/graph-search.ts` (engine in `src/derive/`)
|
|
571
|
-
| Match/project family | `src/mind/match.ts`
|
|
572
|
-
| Graph traversal, corpus scale, disambiguators | `src/mind/traverse.ts`
|
|
573
|
-
| Consensus climb + cross-region attention | `src/mind/attention.ts`
|
|
574
|
-
| Recall's refusal-path
|
|
575
|
-
| Recognition / canonical contract | `src/mind/recognition.ts`, `src/mind/canonical.ts`
|
|
576
|
-
| Junction ascent (bridge + attention share) | `src/mind/junction.ts`, `src/mind/resonance.ts`
|
|
577
|
-
| Learning / ingestion / training cache | `src/mind/learning.ts`, `src/ingest-cache.ts`
|
|
578
|
-
| Post-grounding (reason, fuse, articulate) | `src/mind/reasoning.ts`, `src/mind/articulation.ts`
|
|
579
|
-
| Rationale / trace | `src/mind/rationale.ts`, `src/mind/trace.ts`
|
|
580
|
-
| Computational-usage meter | `src/meter.ts` (harness: `bench/profile-inference.mjs`)
|
|
581
|
-
| Extension host types | `src/extension.ts`
|
|
582
|
-
| Sublibraries (own READMEs, own tests) | `src/derive/`, `src/alu/`, `src/rabitq-ivf/`
|
|
615
|
+
| Concept | File(s) |
|
|
616
|
+
| :-------------------------------------------------- | :------------------------------------------------------------------------------------------------- |
|
|
617
|
+
| Public surface / assembly | `src/index.ts`, `src/mind/mind.ts` |
|
|
618
|
+
| Conversation API (turns, state, answered spans) | `src/mind/mind.ts` |
|
|
619
|
+
| Config (capacities, budgets, seed) | `src/config.ts` |
|
|
620
|
+
| Derived thresholds, the fold, Hilbert | `src/geometry.ts` |
|
|
621
|
+
| Content canonicalizer (injected, modality-specific) | `src/canon.ts` |
|
|
622
|
+
| Vector primitives, alphabet, node/fold types, seats | `src/vec.ts`, `src/alphabet.ts`, `src/sema.ts` |
|
|
623
|
+
| Perceive / resolve / read primitives | `src/mind/primitives.ts` |
|
|
624
|
+
| Store domain logic / SQLite adapter | `src/store.ts`, `src/store-sqlite.ts` |
|
|
625
|
+
| Mechanism contract + shared `Precomputed` | `src/mind/pipeline-mechanism.ts` |
|
|
626
|
+
| The grounding decider (`think`) | `src/mind/pipeline.ts` |
|
|
627
|
+
| Grounding mechanisms (one file each) | `src/mind/mechanisms/{cover,cast,confluence,extraction,reference,recall,prefix-completion,alu}.ts` |
|
|
628
|
+
| Weighted deduction system + cost ladder | `src/mind/graph-search.ts` (engine in `src/derive/`) |
|
|
629
|
+
| Match/project family | `src/mind/match.ts` |
|
|
630
|
+
| Graph traversal, corpus scale, disambiguators | `src/mind/traverse.ts` |
|
|
631
|
+
| Consensus climb + cross-region attention | `src/mind/attention.ts` |
|
|
632
|
+
| Recall's refusal-path tier (substitution bridge) | `src/mind/bridge.ts` |
|
|
633
|
+
| Recognition / canonical contract | `src/mind/recognition.ts`, `src/mind/canonical.ts` |
|
|
634
|
+
| Junction ascent (bridge + attention share) | `src/mind/junction.ts`, `src/mind/resonance.ts` |
|
|
635
|
+
| Learning / ingestion / training cache | `src/mind/learning.ts`, `src/ingest-cache.ts` |
|
|
636
|
+
| Post-grounding (reason, fuse, articulate) | `src/mind/reasoning.ts`, `src/mind/articulation.ts` |
|
|
637
|
+
| Rationale / trace | `src/mind/rationale.ts`, `src/mind/trace.ts` |
|
|
638
|
+
| Computational-usage meter | `src/meter.ts` (harness: `bench/profile-inference.mjs`) |
|
|
639
|
+
| Extension host types | `src/extension.ts` |
|
|
640
|
+
| Sublibraries (own READMEs, own tests) | `src/derive/`, `src/alu/`, `src/rabitq-ivf/` |
|
|
583
641
|
|
|
584
642
|
Mind functions are **free functions over `MindContext`** (`mind/types.ts`), not
|
|
585
643
|
methods — `mind.ts` is a thin assembly that implements the context and
|
|
@@ -666,13 +724,17 @@ into the response-scoped slots for the turn's duration.
|
|
|
666
724
|
const r = await mind.respond(query, (rationale) => {
|
|
667
725
|
console.dir(rationale, { depth: null }); // every step, cost, data-flow edge
|
|
668
726
|
});
|
|
669
|
-
console.log(r.provenance); // cast | join | cover | extract | recall | recall-echo
|
|
727
|
+
console.log(r.provenance); // cast | join | cover | extract | reference | recall | recall-echo | prefix
|
|
670
728
|
```
|
|
671
729
|
|
|
672
730
|
Read top-down: which mechanism fired (and why the others abstained), what
|
|
673
731
|
recognition found, how the climb voted, which edges were followed
|
|
674
732
|
(`disambiguate` steps carry the evidence). `recall-echo` means "nearest stored
|
|
675
|
-
form, not a derived fact".
|
|
733
|
+
form, not a derived fact". `reference` means "part of this answer is bytes the
|
|
734
|
+
ASKER supplied, voiced through a slot the corpus attests as a carriage" — read
|
|
735
|
+
its `bindReferent` step for the referents and the instances, and
|
|
736
|
+
`referenceLicence` for why a binding was refused. `prefix` means "the query is
|
|
737
|
+
the literal opening of exactly one trained form, which this voiced whole".
|
|
676
738
|
|
|
677
739
|
Three steps carry **structured data**, so tooling need not parse notes:
|
|
678
740
|
`decideGrounding` (every candidate's provenance, exact weight, discrete grade,
|