Mr-DS-ML-85 commited on
Commit
2b2bae2
·
verified ·
1 Parent(s): 7bd6343

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -1,3 +1,3 @@
1
  *.bin filter=lfs diff=lfs merge=lfs -text
2
  model/*/substrate.bin filter=lfs diff=lfs merge=lfs -text
3
- model/giant-latin/substrate.bin filter=lfs diff=lfs merge=lfs -text
 
1
  *.bin filter=lfs diff=lfs merge=lfs -text
2
  model/*/substrate.bin filter=lfs diff=lfs merge=lfs -text
3
+ build/libsyfox_core.so filter=lfs diff=lfs merge=lfs -text
CHANGELOG.md ADDED
@@ -0,0 +1,561 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## v3.2.0 — the semantic layer (Stages 1-4), retrieval by default, the two-stage physics router, the dedicated bank77 fabric
2
+
3
+ **The semantic field (core, deterministic, no ML).** Every concept node
4
+ carries a 64-dim semantic vector: signed character-trigram hashing of the
5
+ string (Stage 1 "concept frequency encoding" generalizes to a full vector)
6
+ plus two fabric-grounding passes over the Hebbian lanes — meaning diffuses
7
+ along the fabric, nothing is fitted. From the vectors: omega_semantic (fixed
8
+ scalar projection), top-6 resonance edges (cos >= 0.50, persisted in a
9
+ magic-guarded v4 substrate.bin tail), and typed reads (cos >= 0.82
10
+ synonym-grade, >= 0.66 related — Option 2 derived from the vectors rather
11
+ than a hand table). At settle, sources leak sem_coupling 0.12 of their
12
+ post-diffusion energy along resonance edges, distributed by cos x
13
+ frequency-match — ENERGY CONSERVED exactly (test-enforced); readout gains a
14
+ semantic-neighbour term (sem_hop 0.10). **Context-sensitive lanes (Stage
15
+ 2)**: lanes accumulate required/forbidden context words from the lessons
16
+ that laid them; at settle a mismatched lane carries less (forbidden x0.20,
17
+ missing-required x0.60..1.0 by match count, all-1.0 bit-identical to the
18
+ plain path) — contextual disambiguation as dampened coupling, not rules.
19
+ **Stage 3 semantic hierarchy** ships as hierarchy.json (intents/categories/
20
+ floor) and gates intent candidates by stage-1 category energies at readout.
21
+ **Replay contract**: pre-v3.2 files end at the v3 tail, semantics inert,
22
+ bit-for-bit replay (test-enforced); intern() invalidates a stale field
23
+ (segfault fix caught by the M3 ledger test); --no-semantics is the runtime
24
+ kill switch. **Retrieval by default**: a memories.jsonl in the model dir is
25
+ fingerprinted once at load; every decide primes the field with the top-5
26
+ resonating memories' outcomes at dose 0.30 x inject (deterministic,
27
+ disclosed in usage.retrieval); --memories/--retrieval-topk/--retrieval-dose/
28
+ --no-retrieval.
29
+
30
+ **Dedicated bank77 fabric (the v3.0 architecture, now with physics that
31
+ match it).** 9,000 opaque-anchor intent lessons + 9,000 category lessons
32
+ (12 chunks, zero false contradictions after de-colliding the twins),
33
+ 1,648 nodes / 217,729 lanes / 7,728 resonance edges / 141,920 context-signed
34
+ lanes / 256 retrieval memories. Hidden 3,080 rows scored once (energy-norm):
35
+ **0.158 top-1** vs 0.081 (v3.1.0 dedicated+opaque) and 0.023 (77-way in the
36
+ shared giant fabric). Ablations on cal (1,003): --no-semantics 0.039 (the
37
+ semantic field is the jump), retrieval neutral, hierarchy gate
38
+ measured-negative (floor 0.35: 0.111 vs gate-off 0.133; monotone in the
39
+ floor sweep) — the shipped model carries floor 1.0 = gate off, documented.
40
+
41
+ **Two-stage physics router.** tools/router_prepare.py carves a
42
+ router-question-only sample (16 domains x 60 rows) into a dedicated small
43
+ fabric: model-router16, 4,742 nodes, cal 16-way routing **0.444** (chance
44
+ 0.0625), ECE 0.380 -> 0.086. `decide --router model-router16 ...` settles
45
+ the state on the router fabric, then the mapped domain fabric decides
46
+ (router.json anchors/models); the route is disclosed as route:{anchor,
47
+ confidence,top,model}. Bank77 queries route to the dedicated fabric; all
48
+ other domains to the giant fabric.
49
+
50
+ **Zero-shot re-run under v3.2** (docs/ZEROSHOT.md Part 4,
51
+ tools/zeroshot_suite.py, data/zeroshot_v32_results.json): email spam on the
52
+ tickets-only fabric 6/6 plain and 6/6 semantic-rebuild (conf 0.91-0.99);
53
+ SMS spam 5/6 both (the error at conf 0.103 — honest low-conf disclosure);
54
+ snake 1/8 both; tic-tac-toe picks cell 1 at conf 0 — multi-constraint
55
+ composition fails exactly as in Part 1, and the semantic field does not
56
+ fake it (honest scope: it moves trained discrimination, not symbolic
57
+ reasoning).
58
+
59
+ **Surface.** CLI: --router, --no-semantics, --no-retrieval, --no-hierarchy,
60
+ --retrieval-topk, --retrieval-dose, decide --memories FILE; stats reports
61
+ semantics/sem_edges/lane_contexts/retrieval/hierarchy. C API + HTTP bridge:
62
+ set_semantics/set_retrieval/set_retrieval_topk/set_retrieval_dose/
63
+ set_hierarchy + decide_ex opts keys + usage.retrieval + engine info fields.
64
+ Tests: 4 new groups (semantic field determinism/conservation/round-trip/
65
+ pre-v3.2 contract, context lanes learn+gate, retrieval-by-default +
66
+ kill switch + inert-without-memories, hierarchy load+gate). Tools:
67
+ bank77_hier.py, router_prepare.py, zeroshot_suite.py, rebuild_sem.cpp;
68
+ Makefile b77-hier-data/b77-sem/b77-sem-bench/b77-sem-hidden/router-data/
69
+ router16/router16-bench/zeroshot-sem/zeroshot. Core physics (injection,
70
+ settle lane diffusion, Hebbian learning, honest silence) unchanged where
71
+ the semantic tail is absent.
72
+
73
+ ## v3.1.3 — routed-learn isolation bugfix; the 16-domain giant model + syfox-hf packaging
74
+
75
+ **Bugfix (CLI, boundary layer):** `learn --lang auto` taught EVERY script
76
+ family the ENTIRE corpus — the routed loop iterated all rows instead of the
77
+ family's rows, so each per-script substrate (`<model>-<slug>`) was a full
78
+ copy of everything and the "one fabric per script" isolation contract was
79
+ broken since v2.2. Fixed: families now teach only their own rows (epochs
80
+ applied per family). All tests pass; multilingual fabrics should be
81
+ retrained — the giant model below was trained post-fix, and its
82
+ bengali/devanagari/cyrillic substrates (546-680 nodes) answer their
83
+ held-out tickets at 0.920-0.959 with a trivially perfect in-substrate
84
+ router.
85
+
86
+ **The giant model** (built in the sandbox, packaged in the separate
87
+ `syfox-hf` repo): 16 domains — bank77 (9k), UCI SMS (3.9k), the 6 data/big
88
+ corpora (27.2k), plus 8 newly downloaded real HF datasets (CLINC-150,
89
+ enron_spam, emotion, Davidson hate, ag_news, amazon_polarity, dbpedia_14,
90
+ boolq) — 76,142 train rows / 152,284 lessons per epoch, 278 globally unique
91
+ opaque anchors, empty instructions everywhere, round-robin domain
92
+ interleave, mined top-10 criteria for the new domains, per-script
93
+ calibration. One interleaved pass: giant-latin 43,420 nodes / 1,905,170
94
+ lanes. Hidden (scored once, energy-norm on): tickets_en 0.904, sms 0.752,
95
+ enron 0.752, hate 0.653, agnews 0.604, polarity 0.571, dbpedia 0.475, boolq
96
+ 0.531 (majority-level), bank77 0.023 (77-way collapses in a shared fabric);
97
+ bn 0.943 / hi 0.920 / ru 0.959 on their own substrates. Router measured
98
+ under THREE conditions: informed 0.432 (weighted, the bench condition),
99
+ blind 0.400 hidden (23,528 rows) / 0.399 cal, all-questions 0.399 cal —
100
+ asking everything dilutes the anchoring instead of recovering it. Router
101
+ wording sweep (cal only): short4 0.426 > abstract 0.208 > mid8 0.164 >
102
+ rich12 0.079 — richer specific criteria HARVEST worse (PROBING.md
103
+ mechanism). Tooling: tools/hf_fetch.py (cached parquet fetcher),
104
+ tools/giant_prepare.py (corpus builder with the three failure-mode fixes),
105
+ tools/giant_bench.py (router+class+e2e per-row bench, slim-format aware),
106
+ tools/router_sweep.py, tools/wrapper_condition_experiment.py; Makefile
107
+ targets giant-fetch/-prepare/-chunks. data/giant bulk gitignored
108
+ (schemas/probes/MANIFEST committed).
109
+
110
+ ## v3.1.2 — zero-shot probe reports archived; the runtime-flag mechanism measured
111
+
112
+ The model-xl zero-shot experiments (Snake 8-scenario suite + the A–E flag
113
+ experiment, Tic-Tac-Toe symbolic composition, file-organizer routing) are
114
+ archived in `docs/ZEROSHOT.md`, and the report's central observation —
115
+ winner flips at constant settled energy, Miller-window confidence 0.805 on
116
+ an illegal move — is now mechanism-explained in code and re-measured on
117
+ repo fabrics with real held-out rows (`tools/flag_probe_experiment.py`,
118
+ 2,638 hidden rows, trained schema, deterministic):
119
+
120
+ - **Source modes don't touch the field.** With the injection dose held
121
+ constant, settled energy is bit-identical across salience/miller configs
122
+ (spread ≤ 0.001 on 99.5% / 99.8% of rows) because a settle pass conserves
123
+ energy up to uniform decay — source gating only decides which nodes
124
+ propagate ("gated nodes keep their energy (readout-visible) but stay
125
+ silent as sources", `si_substrate.hpp settle()`). The same invariance is
126
+ why the model-xl A–E run reported 83.928 in every amplified config.
127
+ - **Energy-norm DOES change the field** (injection dose): 0% of rows keep
128
+ their settled energy vs baseline. On trained schemas it is pure
129
+ amplification — tickets-big flips 0.1% of winners at identical 0.971
130
+ accuracy while margins rise 0.0355 → 0.9430 and confidence 0.002 → 0.923;
131
+ baseline deferrals 35 → 0 (the documented M1 purpose).
132
+ - **Flags are diagnostic instruments, not defaults.** Salience gating is
133
+ fabric-dependent: −4.1 points on tickets-big (0.971 → 0.930), +19 points
134
+ on sms-natural (0.160 → 0.360) where the full-source readout is dominated
135
+ by harvest noise. High-confidence-wrong rows (conf ≥ 0.5 while wrong):
136
+ 0 at baseline on both fabrics → 15–86 under amplified configs.
137
+ - Zero-shot and trained-domain results stay in separate buckets; the
138
+ interpretation rules (confidence = concentration, never correctness;
139
+ `--defer-margin` for honest ties) are in ZEROSHOT.md §Part 3 and
140
+ PROBING.md §6.
141
+
142
+ Also: the four SMS probe data files (`data/sms_train.jsonl`,
143
+ `sms_hidden_match/reworded/empty.jsonl`) are now committed so the v3.1.1
144
+ probe experiment and this flag experiment reproduce from a fresh clone.
145
+
146
+ ## v3.1.1 — the probe experiment: criteria wording is a first-class input; honest ties via --defer-margin
147
+
148
+ The model-xl diagnostic (handcrafted Bangla/English/SMS probes tying at
149
+ ~0.50/0.50 with confidence 0 and deferred:false) reproduced and explained on
150
+ real data. Experiment: one fabric trained on real UCI SMS spam (5,574 rows,
151
+ stratified 70/15/15), the SAME hidden rows decided under three criteria
152
+ wordings:
153
+
154
+ | decide-side criteria | hidden top-1 | mean margin |
155
+ |---|---|---|
156
+ | matched (trained schema) | 0.160 | 0.444 |
157
+ | reworded (handcrafted, abstract) | 0.842 | 0.043 |
158
+ | empty (labels only) | 0.422 | 0.017 |
159
+
160
+ Findings (all measured, `tools/sms_probe_experiment.py`):
161
+ - The criteria text at decide selects which nodes the question probes.
162
+ Matched-trained criteria can HURT: their state-overlapping words harvest
163
+ direct hits (anchor-hub noise) and land worse than the majority baseline,
164
+ with huge misleading margins. Abstract reworded criteria suppress the
165
+ harvest and let the anchor one-hop (class-typicality) carry the decision —
166
+ at tie-sized margins. Same fabric: accuracy swings 0.16 <-> 0.84.
167
+ - The model-xl probe pattern (near-tied probabilities, confidence 0,
168
+ deferred:false) is the reworded/empty condition of this mechanism: the
169
+ probes were measuring a DIFFERENT system than the benchmark number
170
+ (SMS 0.937 was measured under the trained schema). Handcrafted probes
171
+ bound; held-out runs conclude. Methodology written up in docs/PROBING.md.
172
+ - Decision-layer honesty: new `decide --defer-margin P` (and server
173
+ `options.defer_margin`) discloses p1-p2 below P as `deferred: true,
174
+ reason: "low_margin"` instead of a confident-looking label on tied
175
+ candidates. The substrate still decides; physics untouched. Measured live:
176
+ a 0.509/0.491 tie now returns a deferral, not a spam label.
177
+ - Packaging note (from the model-xl diagnostic): a fresh checkout has no
178
+ build/ directory (gitignored) — run `make all` first; that also produces
179
+ libsyfox_core.so for the HTTP server.
180
+
181
+ ## v3.1.0 — banking77: real 77-way benchmark, the manual error anatomy, and the hub-pollution fixes
182
+
183
+ Real dataset, not synthetic: PolyAI banking77 — 10,003 official train rows /
184
+ 3,080 official test rows / 77 intents (`tools/bank77_prepare.py` pulls the
185
+ CSVs). The official test split becomes the hidden test (firewall-enforced
186
+ naming); 10% of train is carved stratified (seed 77) for calibration.
187
+
188
+ ### Measured fix ladder (selection on cal ONLY, hidden scored once)
189
+ | config change | cal top-1 |
190
+ |---|---|
191
+ | naive: generic criteria, instructions inline, natural labels | 0.029 |
192
+ | + mined per-class criteria (log-ratio, unigrams+bigrams, top-20) | (baseline run) |
193
+ | + empty instructions (learn folds instructions into the state side; identical per-row instructions are hub pollution — they are never injected at decide) | 0.041 |
194
+ | + opaque anchors `c00..c76` (natural labels like `card_arrival` tokenize into shared hubs; "card" spans many classes. Opaque ids give every class a DEDICATED anchor node) | 0.073 |
195
+ | + consolidation epochs 3 (reproduces the model-xl recipe on the clean schema) | 0.081–0.085 |
196
+ | + top-20 terms + anchor arbitration (flat top-5 re-ranked by bare-anchor readout — product of two readout views) | **0.091** |
197
+
198
+ HIDDEN (official test, 3,080 rows, scored once): **top-1 0.081, top-3 0.221,
199
+ top-5 0.326** vs chance 0.013 — 6.3× chance at top-1, 25× at top-5.
200
+ No cal overfit: cal predicted 0.091, hidden gave 0.081.
201
+
202
+ ### What the manual benchmark exposed (the point of doing it by hand)
203
+ - Without `--energy-norm`, corpus-scale masses silence the readout: all 77
204
+ options sit at exactly 1/77 and argmax degrades to alphabetical order.
205
+ The M1 measurement gain is MANDATORY at this scale (0% -> 100% coverage).
206
+ - The error anatomy (`tools/bank77_analysis.py`): gold sits at ranks 2-20 for
207
+ ~60% of rows; margin-when-correct is ~2x margin-when-wrong; a single class
208
+ (`wrong_exchange_rate_for_cash_withdrawal`) absorbs wrong predictions from
209
+ every other class via hub-word bigrams ("cash abroad" is class-pure as a
210
+ bigram while "cash" is global as a word — the readout tokens are words).
211
+ - Measured NEGATIVE (kept off, documented): stopword filtering (0.036 —
212
+ verb+stop combos like "was taken" are the signal), term-level purity caps
213
+ (0.035), word-level purity caps (0.031-0.053), first-token hierarchical
214
+ two-stage (0.051), shorter criteria under the clean schema, unigram-only
215
+ criteria (0.045-0.052). The hub phrases are simultaneously the noise and
216
+ the signal.
217
+ - Honest gap note: 0.081 hidden here is not model-xl's 0.284 — model-xl is a
218
+ 14-domain consolidated fabric (45,892 nodes / 1.9M lanes) whose mining
219
+ recipe this sandbox rebuild does not replicate. What transfers is the
220
+ SCHEMA (opaque anchors + empty instructions + mined criteria + energy-norm)
221
+ and the measurement tooling: point `tools/bank77_analysis.py --model
222
+ model-xl` at any hidden file to re-run the same anatomy there.
223
+
224
+ ### Infrastructure
225
+ - `tools/bank77_prepare.py`: CSV -> train/cal/hidden JSONL (firewall naming),
226
+ stratified carve, deterministic criteria mining, SHA-256 manifest.
227
+ - `tools/bank77_analysis.py`: the manual benchmark — per-row probabilities
228
+ through the ctypes bridge; top-1/3/5, gold-rank bands, margin and
229
+ confidence-when-wrong, worst confusion pairs, per-class accuracy, deferral
230
+ anatomy, per-row JSONL dump. `--arbitrate` = anchor product-of-experts.
231
+ - Makefile: `bank77` (prepare + learn + cal-bench), `bank77-report` (hidden
232
+ run). Bulk splits are gitignored (167 MB inline criteria); the tool
233
+ regenerates them deterministically.
234
+
235
+ ## v3.0.0 — milestones 1–5: scale discipline, distinct experience, provenance, adversarial suite, multicore
236
+
237
+ Every claim below is a number from a real run on this repo (commands in the
238
+ Makefile; raw JSON in `build/`). Nothing is projected or estimated.
239
+
240
+ ### Milestone 1 — large held-out datasets, hidden-test firewall
241
+ - `tools/gen_corpus.py` (+`tools/corpus_pools.py`): deterministic generator,
242
+ seed 20260927. Per domain — tickets_en 12,000 rows (8,400/1,800/1,800),
243
+ game 8,000 (5,600/1,200/1,200), guard 8,000 (5,600/1,200/1,200); Bengali /
244
+ Hindi / Russian tickets 3,600-ish each with hidden splits of 540 / 539 / 539
245
+ (all ≥ the 500 the milestone requires). 70/15/15 train/cal/hidden, label
246
+ distributions in `data/big/MANIFEST.json` with a SHA-256 per file.
247
+ - `core/firewall.hpp` (new): the hidden-test contract ENFORCED in code, not
248
+ prose. `learn` refuses `_hidden`/`_cal`; `calibrate` refuses `_hidden`;
249
+ `derive --gate` refuses `_hidden`. `make firewall-check` proves all four
250
+ refusals on the real CLI.
251
+ - Hidden-test reports (`make bench-big`, `--energy-norm`, calibration fit on
252
+ the `_cal` split only): **tickets_en 0.971** (ECE 0.005), **game 0.763**
253
+ (ECE 0.049), **guard 0.638** (ECE 0.037; guardrail hold precision 0.782,
254
+ recall 0.910). p95 latency 126–441 µs, decisions bit-deterministic.
255
+ - Multilingual hidden (`make bench-big-ml`, per-script routing):
256
+ **Bengali 0.969** (ECE 0.015), **Hindi 0.965** (ECE 0.020),
257
+ **Russian 0.970** (ECE 0.011).
258
+ - Coverage-vs-accuracy on the hidden tests (`make coverage-big`), all three
259
+ operating points feasible: tickets 96.4%@53% / 90.1%@73% / 83.0%@93%;
260
+ game 94.3%@52% / 86.7%@76% / 80.2%@91%; guard 76.2%@54% / 68.1%@80% /
261
+ 65.8%@90%. Dose-response (`make scale-probe`): 0.603@250 → 0.825@8,400
262
+ distinct rows — distinct experience keeps paying at scale.
263
+
264
+ ### Milestone 2 — distinct experience beats repeated phrasings (measured)
265
+ - `learn --dedup`: exact-duplicate lessons skipped, auditable via
266
+ `dedup_skipped` in the learn report.
267
+ - The A/B at EQUAL lesson counts (25,200 each; `make ab-distinct`):
268
+ **8,400 distinct rows 0.825** (39,158 lanes, 1,898 nodes) vs **1,050 rows
269
+ re-taught 8× 0.782** (18,633 lanes, 530 nodes). Distinct experience wins
270
+ and builds a 2.1× denser fabric. B-dedup (duplicates skipped) lands at
271
+ 0.609 with dedup_skipped=22,050 — consistent with the dose-response curve
272
+ at ~1,000 rows, cross-checking both measurements.
273
+ - `--novelty` per-lesson novelty weighting: measured NEUTRAL at floor 0.90
274
+ (0.827 vs 0.825 baseline) — ships OFF; dedup is the mechanism that pays.
275
+
276
+ ### Milestone 3 — contradiction handling and machine-auditable evidence
277
+ - Every lane carries an evidence ledger: support events, counter events
278
+ (anti-Hebbian dissolutions), generation, first/last teach seq, substrate
279
+ context. `decide --evidence` prints it per channel — e.g. `department`
280
+ resolved with 62 supporting lanes, top lane `the -> problem` w=0.2896,
281
+ 10,870 support events, seq window [1, 25198].
282
+ - Contradictions (same state+question taught with a different outcome) are
283
+ DETECTED, counted in the learn report, and recorded — never silently
284
+ overridden. Live test: teach `a` ×3 then `b` ×3 → decide keeps `a`,
285
+ `contested: true`, contradiction record carries old/new outcome, both seqs,
286
+ state hash; lanes show counter events. The ledger is read-only: lane
287
+ weights drive the field, the ledger never does.
288
+
289
+ ### Milestone 4 — adversarial/OOD suite (`bench --adversarial`, `make adv-big`)
290
+ Deterministic families on the hidden tests, honest per-family metrics:
291
+ - tickets: reorder 0.971, padding 0.968, typos 0.968, intensifiers 0.976,
292
+ self-contradiction 0.969, negation 0.974, double-negation 0.942 (weakest),
293
+ near-miss 0.933, cross-domain 0.908; **unknown concepts defer 100%**
294
+ (zero false confidence — honest silence under attack).
295
+ - Conflicting-lessons attack (40 real contradictions taught post-hoc, with a
296
+ control arm re-taught at gold to isolate the teach-event cost):
297
+ silent_override = FALSE on all three domains, contested 40/40, decisions
298
+ bit-deterministic after. Contradiction-specific damage on untouched rows
299
+ (tickets): 0.7193 → 0.6517 vs control 0.7027 — the anti-Hebbian law costs
300
+ ~5.1 pts beyond generic re-teaching, now measured instead of guessed.
301
+
302
+ ### Milestone 5 — multicore settle, batched throughput, the GPU gate
303
+ - CSR mirror of the lane fabric (contiguous offsets/targets/weights, lazily
304
+ rebuilt, order-preserving — every float sum keeps its exact operand order).
305
+ - OpenMP build (`make omp`, same sources, `-fopenmp`): parallel settle with
306
+ static partitioning + per-thread scatter buffers combined in fixed thread
307
+ order. **Bit-identity proven**: `make omp-identity` — sequential and
308
+ `--threads 2` produce identical routing/calibration/honesty/guardrail
309
+ blocks at 0.971 on the hidden test. `syfox-test-omp` all-pass.
310
+ - Honest performance note: at this fabric size on a 2-core sandbox the
311
+ deterministic parallel settle is SLOWER (p50 620 µs vs 415 µs) — thread
312
+ coordination exceeds the gain below ~10k nodes. It exists for dense
313
+ fabrics; the numbers say when to use it.
314
+ - Batched multicore throughput (`bench --throughput N`, private engine per
315
+ worker, checksum proves real work): 2,390 → 3,714 decisions/sec
316
+ (**1.554×** on 2 cores) on the 3,518-node tickets fabric.
317
+ - GPU gate measured (`make density`): per-fabric density 0.0067 (tickets,
318
+ 3,518 nodes / 82,655 lanes, degree 23.5) — the SoA/CSR layout is in place;
319
+ a GPU port stays DESIGN-ONLY until substrates are dense enough to justify
320
+ it. No GPU claims.
321
+
322
+ ### Fixed in v3 (found by running the milestones, not by reading)
323
+ - `si_substrate.hpp`: Substrate class was left unclosed by an interrupted
324
+ edit (build broken); CSR cache members needed `mutable`.
325
+ - Parallel settle segfault: per-thread scatter buffers were constructed
326
+ EMPTY (n vectors of size 0) → out-of-bounds combine. Now sized n.
327
+ - `omp-identity`/`throughput`/`density` targets silently measured an EMPTY
328
+ fabric (missing `--lang auto` on a per-script-routed model) — the "ok"
329
+ was vacuous. All three now load real substrates; identity re-proven at
330
+ 0.971, throughput checksum non-zero.
331
+
332
+ ## v2.2.0 — multilingual boundary, trigram bridges, active learning
333
+
334
+ The language barrier was at the tokenizer: v2.1's byte-level `std::isalnum`
335
+ scan produced ZERO tokens for any multi-byte UTF-8 query — Bengali, Hindi,
336
+ Russian, every non-ASCII language deferred forever. v2.2 rebuilds the input
337
+ boundary (si_substrate.hpp still byte-identical to v0.2):
338
+
339
+ ### Multilingual boundary
340
+ - `core/script.hpp` (new): UTF-8 decode + 35 Unicode script families by
341
+ block-range majority vote (deterministic; ties by table order; digits
342
+ neutral; malformed bytes are separators). Families cover 100+ languages.
343
+ - `core/normalize.hpp`: codepoint-aware tokenization. Pure-ASCII input keeps
344
+ the byte-identical v2.1 path (test-guarded); non-ASCII decodes UTF-8 into
345
+ script-homogeneous runs; Cyrillic/Greek/Latin lowercase maps; Porter +
346
+ synonyms apply to pure-ASCII tokens only (Porter 1980 is English-only).
347
+ - `--lang auto|<slug>`: per-script routing. learn routes lessons into
348
+ `<model>-<script>` substrates (one fabric per script family — Latin gets
349
+ its own); decide/bench/calibrate/recall route queries, with an honest
350
+ fallback note when the routed substrate is missing.
351
+ - Seed data: `data/tickets_bn_{train,heldout}.jsonl`, `tickets_hi_train.jsonl`,
352
+ `tickets_ru_train.jsonl`, plus a disjoint-vocabulary `tickets_eval_extra.jsonl`
353
+ (unseen words, known intents). `make models-multilingual && make bench-multilingual`.
354
+ - Measured: Bengali held-out routing 1.000 (n=3); Bengali train 1.000/1.000
355
+ (in-sample); Hindi/Russian demos route and answer billing; OOD defer 1.00.
356
+
357
+ ### Character trigram bridges (typo robustness, traction-gated)
358
+ - `core/ngram.hpp` (new): literal `g3:`-prefixed trigram lanes (no hashing —
359
+ every lane inspectable), taught word<->gram fabric + gram<->outcome lanes.
360
+ - Decide-time protocol: an unknown word injects its trigrams only when >=25%
361
+ already exist in the fabric (corrupted-form signature: "refnd" keeps
362
+ g3:ref of "refund"); legitimate unseen words stay dark — honest silence,
363
+ no manufactured evidence. Non-Latin routed substrates enable bridges
364
+ automatically; `--ngrams on|off` overrides.
365
+ - Measured A/B: with the traction gate, clean Latin held-out numbers stay
366
+ byte-identical to v2.1 (tickets 1.000 / game 0.667 / guard 0.750); the
367
+ deterministic corruption sweep (`bench --typos P`) quantifies robustness
368
+ honestly. bench OOD probes now also skip sub-word-entangled nonsense
369
+ (no fake silence violations).
370
+
371
+ ### Mass-guarded variant lessons (measured — still negative, documented)
372
+ - `learn --augment` + `tools/gen_variants.py` (8-10 variants/state,
373
+ deterministic, refuses held-out paths): re-teaching skips intern() for
374
+ known concepts, so lanes strengthen but acoustic mass never re-deposits.
375
+ - Held-out verdict: STILL regresses (tickets 1.000 -> 0.500, game 0.667 ->
376
+ 0.000, guard 0.750 -> 0.500 with 199 variants). With the mass confound
377
+ removed the mechanism is visible: shared vocabulary across labels smears
378
+ tiny multi-label fabrics. Coverage comes from distinct labelled experience
379
+ — which the active-learning loop collects. `make models-vast` keeps the
380
+ A/B reproducible.
381
+
382
+ ### Active learning loop
383
+ - `decide --log-deferrals FILE`: every deferral logged with state + the FULL
384
+ question schema (a labeled row is directly teachable).
385
+ - `syfox active --deferrals FILE --out FILE [--min-count N]`: dedups and
386
+ ranks the log into a labeling worksheet. Deploy -> log -> label -> re-learn.
387
+
388
+ ### Other
389
+ - `bench --typos P`: deterministic word corruption (deletion/swap/duplication
390
+ by word hash; codepoint-level, works on Bengali/Hindi), reports clean vs
391
+ corrupted accuracy + delta.
392
+ - VERSION 2.1.0 -> 2.2.0; tests: +5 suites (script table, UTF-8 boundary,
393
+ trigram lanes, mass guard, Bengali e2e + determinism, corruption sweep).
394
+
395
+ # Changelog
396
+
397
+ All notable changes to SyFox. Versions follow the eval-methodology
398
+ milestones; every number in here is reproducible from the tagged sources
399
+ (`make models && make bench-heldout && make coverage && make heldout-gate`).
400
+
401
+ ## v2.1.0 — evaluation-methodology fix + generalization work
402
+
403
+ The v0.2 eval graded the model on its own training rows (in-domain
404
+ resubstitution) and fitted its calibration the same way. v2.1 replaces the
405
+ methodology: a real held-out split gates everything, the headline metric is
406
+ the coverage-vs-accuracy curve, and the harness decides — by measurement —
407
+ what ships.
408
+
409
+ ### P1 — held-out eval split (blocks everything else)
410
+
411
+ * `tools/split_data.py`: deterministic 70/30 split of every
412
+ `data/*_train.jsonl` (which was the FULL dataset), stratified by first
413
+ label, seeded RNG, refuses to double-split. Pre-split files remain in git
414
+ history. Result: 31 train / 13 held-out rows; every label class present on
415
+ both sides.
416
+ * `make models` now teaches the fabric from `*_train.jsonl` only.
417
+ * `syfox bench --split train|heldout` scores the right file and labels the
418
+ source in `eval_source` (`held-out 30% split; fabric never taught from
419
+ these rows` vs `train split; in-sample for the fabric`).
420
+
421
+ ### P2 — coverage-vs-accuracy curve (the headline metric)
422
+
423
+ * `syfox bench --coverage-curve` sweeps a confidence threshold τ over
424
+ 0.0→1.0 (21 steps) and reports emitted / correct / coverage /
425
+ accuracy-within-coverage, an ASCII accuracy-vs-coverage plot, explicit
426
+ operating points at ≥50% / ≥70% / ≥90% coverage, and a JSON block.
427
+ * Engine-level honest silence (unknown vocabulary) is never emitted at any
428
+ threshold — the curve measures the calibrated-confidence band on top of it.
429
+ * Choice + score questions on labelled rows; deferred answers stay out of
430
+ every denominator.
431
+ * Tickets, held-out: 100% coverage → 83.3% accuracy; ≥70% coverage → 90.0%;
432
+ 50% coverage → 100%. The confident subset is trustworthy, measurably.
433
+
434
+ ### P3 — paraphrase generation (implemented, then gated by measurement)
435
+
436
+ * `tools/gen_paraphrases.py`: up to 5 variants per taught state — clause
437
+ reorders, neutral-politeness fillers, combos. Deterministic (per-row seeded
438
+ RNG), refuses any held-out path, replaces words only via the single-word
439
+ synonym table (never inserts domain-significant words), so labels stay
440
+ valid by construction. Output: `data/*_paraphrased.jsonl` (155 lessons).
441
+ * Measured verdict on the held-out split: augmentation REGRESSES accuracy —
442
+ tickets 1.000 → 0.500, guard 0.750 → 0.667, game 0.667 → 0.667 (1 variant
443
+ per state is equally harmful). Mechanism: `intern()` mass grows linearly
444
+ and injection damps by 1/√mass, so re-teaching near-duplicate lessons
445
+ re-weights the field toward the training surface forms. A lesson here is a
446
+ physical deposition, not a data point.
447
+ * Consequence: `make models` ships un-augmented; `make models-augmented`
448
+ reproduces the augmented A/B. Synonym-only variants were dropped from the
449
+ generator entirely (they normalize to identical token streams — pure
450
+ repetition, zero novelty).
451
+
452
+ ### P4 — tokenization improvement
453
+
454
+ * `core/normalize.hpp`: one deterministic pipeline for teach, decide,
455
+ recall and harvest — lowercase alnum scan → Porter (1980) stemming (faithful
456
+ port, verified against the reference vocabulary) → synonym folding via
457
+ `data/synonyms.txt` (embedded copy as fallback; `--synonyms` overrides).
458
+ "reimbursement" now lands on the same node as "refund" at decide time.
459
+ * `si_substrate.hpp` is byte-identical to v0.2: this is input encoding at the
460
+ boundary, not physics. No neural net, no pattern matching added anywhere.
461
+ * Label-safety rule for the table: a swap must never be able to change a
462
+ row's labels (no urgency words in fillers, no cross-department drift).
463
+
464
+ ### P5 — derivation gated on held-out
465
+
466
+ * `syfox derive --gate data/*_heldout.jsonl` (per model, `make heldout-gate`):
467
+ the no-regression gate now replays the HELD-OUT rows, and the report
468
+ carries gold-labelled accuracy before/after plus a verdict and revert
469
+ reason.
470
+ * Verdicts: tickets **REVERT** (9 held-out flips), guard **REVERT** (1 flip),
471
+ game **PASS** (253 derived lanes committed, held-out accuracy held
472
+ 0.667 → 0.667). The §10-era mitigation ("ship seed models un-derived") is
473
+ now a measured, per-model decision made by the harness.
474
+
475
+ ### P6 — calibration on held-out + ECE
476
+
477
+ * `syfox calibrate --examples data/*_heldout.jsonl` (wired into
478
+ `make models`): temperature/Platt fitted on held-out rows. The fabric never
479
+ learns from held-out rows; the fit sets 2–3 scalars and is monotone, so
480
+ argmax decisions are unaffected. Disclosed: the reported "after" ECE is
481
+ measured on the same rows the scalars were fitted on (standard for
482
+ temperature scaling; 1–2 parameters).
483
+ * Calibration rows now carry the FULL candidate energy vector + gold label;
484
+ the fit objective is multi-class NLL over the true softmax (the textbook
485
+ definition). The old pairwise {correct, worst-wrong} view was structurally
486
+ blind to argmax errors on near-ties and could drive T to its floor,
487
+ manufacturing confidence on wrong answers.
488
+ * 1-bit adoption guard per question type: keep T = 1 / default Platt when the
489
+ fitted parameters would worsen held-out multi-class ECE.
490
+ * Two real defects fixed along the way: a 0.005 floor clamp inside the NLL
491
+ search flattened the objective below 0.005 and hid the true optimum (the
492
+ max-subtracted softmax is overflow-safe for any T > 0), and the same clamp
493
+ in the decide path silently discarded any fitted T below it. Also fixed:
494
+ array-criteria labels (score levels) were compared to level text and
495
+ silently dropped from every fit.
496
+ * Results (held-out, multi-class ECE, top-prob confidence): tickets
497
+ 0.665 → **0.012** (T = 0.0005 adopted; the ECE < 0.1 bar is met), guard
498
+ 0.496 → 0.200 (T = 0.0107 adopted), game 0.329 kept (fit rejected — the
499
+ fitted T would have worsened ECE to 0.503). With 1 wrong answer among
500
+ 3–4 emitted questions, ECE ≥ (1/n)·|0 − conf| ≥ 0.2 is forced by
501
+ arithmetic at any temperature; the remedy is more held-out data, which the
502
+ harness now measures.
503
+ * Bench ECE now uses the standard top-probability confidence (the signal
504
+ temperature scaling acts on); the entropy confidence remains in the
505
+ conf-when-correct/wrong fields.
506
+
507
+ ### P7 — documentation
508
+
509
+ * README: held-out tables replace the resubstitution table (the old numbers
510
+ are kept only as the labeled in-sample contrast), coverage-vs-accuracy
511
+ table at 50/70/90% coverage, calibration-before/after table, augmentation
512
+ dose-response table, per-model gate verdicts, latency + cost section
513
+ (p50 29–64 µs, CPU-only, no per-decision API cost), tokenizer docs.
514
+ * `syfox --help` documents the new flags.
515
+
516
+ ### Tests
517
+
518
+ * New checks: Porter spot-checks against the 1980 reference vocabulary,
519
+ synonym folding through the stemmed table, normalize determinism.
520
+ * `test_calibration_tool` updated to the multi-class row shape and now
521
+ asserts the fit sharpens on clean margins.
522
+ * Gate test: the harvest-revert branch compares against the pre-derive
523
+ fabric state (a committed compose gate legitimately changes lanes first).
524
+ * Full suite: 107 checks, all passing. Substrate physics untouched:
525
+ `git diff f4dba63 -- core/si_substrate.hpp` is empty — every change in
526
+ v2.1 lives at the input boundary (normalize.hpp, new) or in tooling
527
+ (bench / calibrate / gate reporting, Makefile, data split).
528
+
529
+ ### Honesty notes
530
+
531
+ * The held-out split is small (13 rows total). Every number above carries its
532
+ n. The harness exists precisely so that growing `data/` makes the numbers
533
+ *mean more* without changing any code.
534
+ * Held-out rows touch two consumers beyond eval: the calibration fit (2–3
535
+ scalars, disclosed above) and the derivation gate (read-only replay). No
536
+ held-out row ever strengthens a lane. The coverage curve, accuracy, and
537
+ flips are computed from decisions only.
538
+ * Jev's published figures remain side-by-side references (`jev_reference`);
539
+ no parity is claimed beyond sharing the measurement axes.
540
+
541
+ ## v0.2.0 — SI salience lineage + Jev-parity bench + gated derivation
542
+
543
+ * Real SI salience port: cavity integrator (s = tanh(s·0.995 + 0.05·|v|)),
544
+ TSDA-lineage Miller window behind runtime flags (`--salience-gating`,
545
+ `--miller-window`), state-hash-derived draws for bit-exact determinism.
546
+ * Jev-parity benchmark suite (accuracy, latency, calibration, honesty,
547
+ guardrail, determinism axes) with published Jev figures carried for
548
+ side-by-side reading.
549
+ * Derivation layer: lane induction (compose + harvest), dreamer with
550
+ human-validated promotion ledger, structural analogy (energy fingerprints).
551
+ * No-regression derivation gate: transactional derive with bit-exact
552
+ snapshot/restore; any taught-row argmax flip or manufactured certainty on
553
+ ambiguous probes reverts.
554
+
555
+ ## v0.1.0 — System One decision engine on SI substrate physics
556
+
557
+ * Energy injection → dissipative settling → dual-channel readout
558
+ (Specific mean / Support mass) → Hebbian learning + anti-Hebbian
559
+ dissolution, honest silence below the floor.
560
+ * Energy-gated source cap (24 sources/pass), deterministic tie-breaking.
561
+ * CLI: learn / calibrate / decide / demo / stats.
PUSHING.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Pushing to HuggingFace
2
+
3
+ The latin substrate (`model/giant-latin/substrate.bin`, 112 MB) exceeds
4
+ HuggingFace's 100 MB non-LFS limit. `.gitattributes` already marks
5
+ `*.bin` as LFS — you only need git-lfs installed locally and the blob
6
+ re-staged as an LFS object:
7
+
8
+ ```bash
9
+ git lfs install # once per machine
10
+ git rm --cached model/giant-latin/substrate.bin
11
+ git add model/giant-latin/substrate.bin # now stored as an LFS pointer
12
+ git commit --amend --no-edit
13
+ git remote add origin https://huggingface.co/<your-user>/syfox-hf
14
+ git push -u origin main
15
+ ```
16
+
17
+ The three small substrates (bengali/devanagari/cyrillic, ~0.5-0.6 MB) are
18
+ under the same `*.bin` rule and will ride along as LFS objects too.
19
+
20
+ v3.2 adds two more model dirs — `model/b77-sem/substrate.bin` (~24 MB) and
21
+ `model/router16/substrate.bin` (~4 MB). If git-lfs is installed they are
22
+ picked up by the same `*.bin` rule automatically; the `git rm --cached` +
23
+ `git add` re-stage step is only needed for files committed BEFORE git-lfs
24
+ was installed (i.e. giant-latin).
25
+
26
+ If you clone this repo after the LFS push, run `git lfs pull` to fetch the
27
+ binaries.
README.md CHANGED
@@ -61,19 +61,61 @@ same-script domains — blind routing alone measures **0.400** on hidden
61
  (23,528 rows) and the table's router column is the *informed* condition
62
  (router + the true domain's class question asked together); naming the
63
  domain in the API gives the class numbers. bank77's 77-way readout collapses
64
- in a shared fabric (dedicated-fabric reference: 0.081); boolq stays near
 
65
  majority — boolean passage comprehension is a measured limit of bag-of-words
66
  SI physics. Latency ≈ 6-11 ms/row on the 43k-node latin fabric.
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  ## Files
69
 
70
  ```
71
- engine/ C++ SI substrate core (core/*.hpp, src/*.cpp) — builds with make
72
- server/ FastAPI HTTP bridge (v3 API, CLI-equal flags)
73
  inference.py thin python wrapper (auto script routing)
74
- model/ giant-{latin,bengali,devanagari,cyrillic}/substrate.bin (+meta, calibration)
75
- datasets/ eval hidden splits, probes, schemas, MANIFEST (SHA-256), DATASETS.md
76
- docs/ EVALUATION.md, ARCHITECTURE.md, PROBING.md, ZEROSHOT.md
 
 
 
77
  examples/ JSON payloads + curl + python usage
78
  Dockerfile HuggingFace Spaces (builds engine, serves on 7860)
79
  ```
@@ -106,12 +148,15 @@ curl -X POST http://localhost:7860/v1/systemone -H 'Content-Type: application/js
106
 
107
  The server also exposes `/v1/health`, `/v1/models`, `/v1/deferrals`
108
  (active-learning mirror) and per-call options `energy_norm`,
109
- `salience_gating`, `miller_window`, `ngrams`, `defer_margin`, `evidence`.
 
 
110
 
111
  ## Docker (HuggingFace Spaces)
112
 
113
  The included Dockerfile builds the engine from source and serves the v3 API
114
- on port 7860.
 
115
 
116
  ## Training recipe (reproduce or extend)
117
 
@@ -124,15 +169,18 @@ selection happened on cal; the core physics was never modified.
124
  ## Limitations
125
 
126
  - Single-router e2e is bottlenecked by 16-way choice in one fabric (measured;
127
- wording sweep shows it is the readout mechanism, not the wording).
128
- - 77-way banking intents need a dedicated fabric (or arbitration) at this
129
- scale.
 
 
 
 
130
  - Boolean passage comprehension is near-majority — the substrate reads
131
  lexical fields, not logic.
132
- - Zero-shot composition (constraints, topology) is NOT solved by scale —
133
- see docs/ZEROSHOT.md for the measured two-dimension separation.
134
-
135
- Github repo : https://github.com/Mr-DS-ML-85/SyFox
136
 
137
  ## License & credit
138
 
 
61
  (23,528 rows) and the table's router column is the *informed* condition
62
  (router + the true domain's class question asked together); naming the
63
  domain in the API gives the class numbers. bank77's 77-way readout collapses
64
+ in a shared fabric — see **v3.2: the dedicated bank77 fabric** below for the
65
+ architectural fix (0.023 → 0.081 → **0.158**); boolq stays near
66
  majority — boolean passage comprehension is a measured limit of bag-of-words
67
  SI physics. Latency ≈ 6-11 ms/row on the 43k-node latin fabric.
68
 
69
+ ## v3.2 — the semantic layer, retrieval by default, the two-stage router
70
+
71
+ The engine in this repo is SyFox **v3.2.0**: the substrate now carries a
72
+ second, deterministic field — a 64-dim semantic vector per concept (signed
73
+ character-trigram hashing + two fabric-grounding passes over the Hebbian
74
+ lanes; no ML, no fit) — from which **resonance edges** leak an
75
+ energy-conserving share of a source's energy to semantically similar
76
+ neighbours during settle. **Context-sensitive lanes** learn required/forbidden
77
+ context words from the lessons that laid them and carry less when the
78
+ decision's own tokens do not match. **Retrieval is default-on**: a
79
+ `memories.jsonl` in the model dir primes every decide with the outcomes of
80
+ the most resonating lived experiences (Hopfield-style settled-field cosine),
81
+ disclosed in the response as `usage.retrieval`. Pre-v3.2 fabrics replay
82
+ bit-for-bit; `--no-semantics / --no-retrieval / --no-hierarchy` (and the
83
+ equal `options` keys on HTTP) are the kill switches.
84
+
85
+ Two new model dirs ship here:
86
+
87
+ - **model/b77-sem** — the DEDICATED banking77 fabric: 9,000 opaque-anchor
88
+ intent lessons + 9,000 category lessons, 1,648 nodes / 217,729 lanes,
89
+ 7,728 resonance edges, 141,920 context-signed lanes, 256 retrieval
90
+ memories, calibrated. Hidden (3,080 rows, scored once, energy-norm):
91
+ **0.158 top-1** vs 0.081 (v3.1.0 dedicated+opaque) and 0.023 (shared
92
+ giant). Ablation: `--no-semantics` 0.039 — the semantic field IS the jump;
93
+ the hierarchy gate measured-negative on cal and ships floor 1.0 = off.
94
+ - **model/router16** — the two-stage physics router: 4,742 nodes trained
95
+ ONLY on router questions (16 domain anchors x 60 rows). Cal 16-way routing
96
+ **0.444** (chance 0.0625), ECE 0.380 → 0.086. Route with
97
+ `decide --router model/router16` (CLI) or the two-call pattern below —
98
+ bank77 queries route to model/b77-sem, everything else to giant-latin.
99
+
100
+ Zero-shot re-run under v3.2 (docs/ZEROSHOT.md Part 4,
101
+ datasets/zeroshot_v32_results.json): email spam on the tickets-only fabric
102
+ 6/6 plain and 6/6 semantic rebuild; sms spam 5/6 (the one error at conf
103
+ 0.103, disclosed); snake 1/8 both; tic-tac-toe picks cell 1 at conf 0 —
104
+ multi-constraint composition fails exactly as in Part 1 and the semantic
105
+ field does not fake it.
106
+
107
  ## Files
108
 
109
  ```
110
+ engine/ C++ SI substrate core v3.2 (core/*.hpp, src/*.cpp) — builds with make
111
+ server/ HTTP bridge (v3 API, CLI-equal flags incl. the v3.2 knobs)
112
  inference.py thin python wrapper (auto script routing)
113
+ model/ giant-{latin,bengali,devanagari,cyrillic}/substrate.bin
114
+ b77-sem/ dedicated 77-way banking fabric (v3.2 semantic layer)
115
+ router16/ two-stage physics router (router.json: anchors+models)
116
+ datasets/ eval hidden splits, probes, schemas, MANIFEST (SHA-256),
117
+ router16_router.json, zeroshot_v32_results.json, DATASETS.md
118
+ docs/ EVALUATION.md, ARCHITECTURE.md (§16 = v3.2), PROBING.md, ZEROSHOT.md
119
  examples/ JSON payloads + curl + python usage
120
  Dockerfile HuggingFace Spaces (builds engine, serves on 7860)
121
  ```
 
148
 
149
  The server also exposes `/v1/health`, `/v1/models`, `/v1/deferrals`
150
  (active-learning mirror) and per-call options `energy_norm`,
151
+ `salience_gating`, `miller_window`, `ngrams`, `defer_margin`, `evidence`,
152
+ and the v3.2 knobs `semantics`, `retrieval`, `retrieval_topk`,
153
+ `retrieval_dose`, `hierarchy`.
154
 
155
  ## Docker (HuggingFace Spaces)
156
 
157
  The included Dockerfile builds the engine from source and serves the v3 API
158
+ on port 7860. Create a Docker Space, push this repo, done. CLI-equal flags
159
+ are passed in the `CMD` (`--lang auto --energy-norm`).
160
 
161
  ## Training recipe (reproduce or extend)
162
 
 
169
  ## Limitations
170
 
171
  - Single-router e2e is bottlenecked by 16-way choice in one fabric (measured;
172
+ wording sweep shows it is the readout mechanism, not the wording); the
173
+ v3.2 dedicated router16 fabric raises blind 16-way routing to 0.444 on its
174
+ cal carve and routes bank77 to its dedicated fabric.
175
+ - 77-way banking intents: dedicated fabric v3.2 measures 0.158 hidden
176
+ (semantic field ablation 0.039 — the field is the mechanism); higher
177
+ ladders need arbitration or per-category substrates (hierarchy gating
178
+ itself measured-negative on cal, shipped off).
179
  - Boolean passage comprehension is near-majority — the substrate reads
180
  lexical fields, not logic.
181
+ - Zero-shot composition (constraints, topology) is NOT solved by scale or
182
+ by the semantic field — see docs/ZEROSHOT.md Parts 1 and 4 for the
183
+ measured two-dimension separation.
 
184
 
185
  ## License & credit
186
 
build/libsyfox_core.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85643349db5b3d11877d4ba28549ebc837f9b6845e9dc57f302b9d09c0e3301f
3
+ size 204920
datasets/router16_router.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "anchors": {
3
+ "rt00": "news headlines sports",
4
+ "rt01": "banking cards payments",
5
+ "rt02": "boolean question passage",
6
+ "rt03": "assistant requests weather",
7
+ "rt04": "encyclopedia entities topics",
8
+ "rt05": "feelings emotions reactions",
9
+ "rt06": "email inbox messages",
10
+ "rt07": "game commands actions",
11
+ "rt08": "safety destructive irreversible",
12
+ "rt09": "social offensive posts",
13
+ "rt10": "product reviews opinions",
14
+ "rt11": "text messages spam",
15
+ "rt12": "support tickets bengali",
16
+ "rt13": "support billing sales technical",
17
+ "rt14": "support tickets hindi",
18
+ "rt15": "support tickets russian"
19
+ },
20
+ "models": {
21
+ "rt00": "model-giant-latin",
22
+ "rt01": "model-b77-sem",
23
+ "rt02": "model-giant-latin",
24
+ "rt03": "model-giant-latin",
25
+ "rt04": "model-giant-latin",
26
+ "rt05": "model-giant-latin",
27
+ "rt06": "model-giant-latin",
28
+ "rt07": "model-giant-latin",
29
+ "rt08": "model-giant-latin",
30
+ "rt09": "model-giant-latin",
31
+ "rt10": "model-giant-latin",
32
+ "rt11": "model-giant-latin",
33
+ "rt12": "model-giant-latin",
34
+ "rt13": "model-giant-latin",
35
+ "rt14": "model-giant-latin",
36
+ "rt15": "model-giant-latin"
37
+ },
38
+ "domains": {
39
+ "rt00": "agnews",
40
+ "rt01": "bank77",
41
+ "rt02": "boolq",
42
+ "rt03": "clinc",
43
+ "rt04": "dbpedia",
44
+ "rt05": "emotion",
45
+ "rt06": "enron",
46
+ "rt07": "game",
47
+ "rt08": "guard",
48
+ "rt09": "hate",
49
+ "rt10": "polarity",
50
+ "rt11": "sms",
51
+ "rt12": "tickets_bn",
52
+ "rt13": "tickets_en",
53
+ "rt14": "tickets_hi",
54
+ "rt15": "tickets_ru"
55
+ }
56
+ }
datasets/zeroshot_v32_results.json ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "email_spam": {
3
+ "accuracy": 1.0,
4
+ "rows": [
5
+ {
6
+ "state": "Congratulations you are our lucky winner click thi",
7
+ "expected": "spam",
8
+ "picked": "spam",
9
+ "conf": 0.977,
10
+ "deferred": false
11
+ },
12
+ {
13
+ "state": "Urgent your account will be suspended verify your ",
14
+ "expected": "spam",
15
+ "picked": "spam",
16
+ "conf": 0.978,
17
+ "deferred": false
18
+ },
19
+ {
20
+ "state": "Win a free holiday click here offer expires today ",
21
+ "expected": "spam",
22
+ "picked": "spam",
23
+ "conf": 0.994,
24
+ "deferred": false
25
+ },
26
+ {
27
+ "state": "Hi team the invoice for this month is attached ple",
28
+ "expected": "ham",
29
+ "picked": "ham",
30
+ "conf": 0.989,
31
+ "deferred": false
32
+ },
33
+ {
34
+ "state": "Can we move the meeting to tomorrow morning and ad",
35
+ "expected": "ham",
36
+ "picked": "ham",
37
+ "conf": 0.611,
38
+ "deferred": false
39
+ },
40
+ {
41
+ "state": "Thanks for your help with the refund the money arr",
42
+ "expected": "ham",
43
+ "picked": "ham",
44
+ "conf": 0.999,
45
+ "deferred": false
46
+ }
47
+ ]
48
+ },
49
+ "email_spam_sem": {
50
+ "accuracy": 1.0,
51
+ "rows": [
52
+ {
53
+ "state": "Congratulations you are our lucky winner click thi",
54
+ "expected": "spam",
55
+ "picked": "spam",
56
+ "conf": 0.958,
57
+ "deferred": false
58
+ },
59
+ {
60
+ "state": "Urgent your account will be suspended verify your ",
61
+ "expected": "spam",
62
+ "picked": "spam",
63
+ "conf": 0.913,
64
+ "deferred": false
65
+ },
66
+ {
67
+ "state": "Win a free holiday click here offer expires today ",
68
+ "expected": "spam",
69
+ "picked": "spam",
70
+ "conf": 0.918,
71
+ "deferred": false
72
+ },
73
+ {
74
+ "state": "Hi team the invoice for this month is attached ple",
75
+ "expected": "ham",
76
+ "picked": "ham",
77
+ "conf": 0.957,
78
+ "deferred": false
79
+ },
80
+ {
81
+ "state": "Can we move the meeting to tomorrow morning and ad",
82
+ "expected": "ham",
83
+ "picked": "ham",
84
+ "conf": 0.639,
85
+ "deferred": false
86
+ },
87
+ {
88
+ "state": "Thanks for your help with the refund the money arr",
89
+ "expected": "ham",
90
+ "picked": "ham",
91
+ "conf": 0.985,
92
+ "deferred": false
93
+ }
94
+ ]
95
+ },
96
+ "sms_spam": {
97
+ "accuracy": 0.833,
98
+ "rows": [
99
+ {
100
+ "state": "FREE entry to win 1000 cash prize text WIN to the ",
101
+ "expected": "spam",
102
+ "picked": "spam",
103
+ "conf": 0.228,
104
+ "deferred": false
105
+ },
106
+ {
107
+ "state": "Your mobile prize is waiting claim your reward cli",
108
+ "expected": "spam",
109
+ "picked": "spam",
110
+ "conf": 0.999,
111
+ "deferred": false
112
+ },
113
+ {
114
+ "state": "Hey are we still meeting at the pub tonight let me",
115
+ "expected": "ham",
116
+ "picked": "ham",
117
+ "conf": 0.76,
118
+ "deferred": false
119
+ },
120
+ {
121
+ "state": "Running late sorry be there in ten minutes see you",
122
+ "expected": "ham",
123
+ "picked": "spam",
124
+ "conf": 0.103,
125
+ "deferred": false
126
+ },
127
+ {
128
+ "state": "Can you send me the photos from the weekend thanks",
129
+ "expected": "ham",
130
+ "picked": "ham",
131
+ "conf": 0.985,
132
+ "deferred": false
133
+ },
134
+ {
135
+ "state": "Your account balance is low top up now to avoid ch",
136
+ "expected": "spam",
137
+ "picked": "spam",
138
+ "conf": 0.281,
139
+ "deferred": false
140
+ }
141
+ ]
142
+ },
143
+ "sms_spam_sem": {
144
+ "accuracy": 0.833,
145
+ "rows": [
146
+ {
147
+ "state": "FREE entry to win 1000 cash prize text WIN to the ",
148
+ "expected": "spam",
149
+ "picked": "spam",
150
+ "conf": 0.154,
151
+ "deferred": false
152
+ },
153
+ {
154
+ "state": "Your mobile prize is waiting claim your reward cli",
155
+ "expected": "spam",
156
+ "picked": "spam",
157
+ "conf": 0.999,
158
+ "deferred": false
159
+ },
160
+ {
161
+ "state": "Hey are we still meeting at the pub tonight let me",
162
+ "expected": "ham",
163
+ "picked": "ham",
164
+ "conf": 0.15,
165
+ "deferred": false
166
+ },
167
+ {
168
+ "state": "Running late sorry be there in ten minutes see you",
169
+ "expected": "ham",
170
+ "picked": "spam",
171
+ "conf": 0.075,
172
+ "deferred": false
173
+ },
174
+ {
175
+ "state": "Can you send me the photos from the weekend thanks",
176
+ "expected": "ham",
177
+ "picked": "ham",
178
+ "conf": 0.846,
179
+ "deferred": false
180
+ },
181
+ {
182
+ "state": "Your account balance is low top up now to avoid ch",
183
+ "expected": "spam",
184
+ "picked": "spam",
185
+ "conf": 0.25,
186
+ "deferred": false
187
+ }
188
+ ]
189
+ },
190
+ "snake": {
191
+ "accuracy": 0.125,
192
+ "rows": [
193
+ {
194
+ "state": "snake game the food is directly ahead of the head ",
195
+ "expected": "right",
196
+ "picked": "right",
197
+ "conf": 0.16,
198
+ "deferred": false
199
+ },
200
+ {
201
+ "state": "snake game a wall is directly ahead moving right h",
202
+ "expected": "up/down",
203
+ "picked": "right",
204
+ "conf": 0.044,
205
+ "deferred": false
206
+ },
207
+ {
208
+ "state": "snake game the body blocks the right side so right",
209
+ "expected": "up/down/left",
210
+ "picked": "right",
211
+ "conf": 0.248,
212
+ "deferred": false
213
+ },
214
+ {
215
+ "state": "snake game the food is behind while the head moves",
216
+ "expected": "up/down",
217
+ "picked": "right",
218
+ "conf": 0.064,
219
+ "deferred": false
220
+ },
221
+ {
222
+ "state": "snake game the food is at the wall and right is le",
223
+ "expected": "up/down",
224
+ "picked": "right",
225
+ "conf": 0.266,
226
+ "deferred": false
227
+ },
228
+ {
229
+ "state": "snake game long term survival avoid the walls keep",
230
+ "expected": "up",
231
+ "picked": "down",
232
+ "conf": 0.003,
233
+ "deferred": false
234
+ },
235
+ {
236
+ "state": "snake game only one safe move remains all others h",
237
+ "expected": "down",
238
+ "picked": "up",
239
+ "conf": 0.001,
240
+ "deferred": false
241
+ },
242
+ {
243
+ "state": "snake game shortest safe route to the food",
244
+ "expected": "up",
245
+ "picked": "right",
246
+ "conf": 0.014,
247
+ "deferred": false
248
+ }
249
+ ]
250
+ },
251
+ "snake_sem": {
252
+ "accuracy": 0.125,
253
+ "rows": [
254
+ {
255
+ "state": "snake game the food is directly ahead of the head ",
256
+ "expected": "right",
257
+ "picked": "right",
258
+ "conf": 0.233,
259
+ "deferred": false
260
+ },
261
+ {
262
+ "state": "snake game a wall is directly ahead moving right h",
263
+ "expected": "up/down",
264
+ "picked": "right",
265
+ "conf": 0.031,
266
+ "deferred": false
267
+ },
268
+ {
269
+ "state": "snake game the body blocks the right side so right",
270
+ "expected": "up/down/left",
271
+ "picked": "right",
272
+ "conf": 0.135,
273
+ "deferred": false
274
+ },
275
+ {
276
+ "state": "snake game the food is behind while the head moves",
277
+ "expected": "up/down",
278
+ "picked": "right",
279
+ "conf": 0.04,
280
+ "deferred": false
281
+ },
282
+ {
283
+ "state": "snake game the food is at the wall and right is le",
284
+ "expected": "up/down",
285
+ "picked": "right",
286
+ "conf": 0.199,
287
+ "deferred": false
288
+ },
289
+ {
290
+ "state": "snake game long term survival avoid the walls keep",
291
+ "expected": "up",
292
+ "picked": "right",
293
+ "conf": 0.001,
294
+ "deferred": false
295
+ },
296
+ {
297
+ "state": "snake game only one safe move remains all others h",
298
+ "expected": "down",
299
+ "picked": "up",
300
+ "conf": 0.001,
301
+ "deferred": false
302
+ },
303
+ {
304
+ "state": "snake game shortest safe route to the food",
305
+ "expected": "up",
306
+ "picked": "right",
307
+ "conf": 0.006,
308
+ "deferred": false
309
+ }
310
+ ]
311
+ },
312
+ "tictactoe": {
313
+ "accuracy": 0.0,
314
+ "rows": [
315
+ {
316
+ "state": "tic tac toe board positions 1 to 9 X holds 1 and 2",
317
+ "expected": "3",
318
+ "picked": "1",
319
+ "conf": 0,
320
+ "deferred": false
321
+ }
322
+ ]
323
+ },
324
+ "tictactoe_sem": {
325
+ "accuracy": 0.0,
326
+ "rows": [
327
+ {
328
+ "state": "tic tac toe board positions 1 to 9 X holds 1 and 2",
329
+ "expected": "3",
330
+ "picked": "1",
331
+ "conf": 0,
332
+ "deferred": false
333
+ }
334
+ ]
335
+ }
336
+ }
docs/ARCHITECTURE.md CHANGED
@@ -429,3 +429,128 @@ transfer costs pay for themselves — until then it stays design, and the
429
  SoA/CSR buffers above are the only GPU-specific preparation the core
430
  carries. No neural network enters the core at any point; the parallelism
431
  is the SAME physics, executed on more cores.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
429
  SoA/CSR buffers above are the only GPU-specific preparation the core
430
  carries. No neural network enters the core at any point; the parallelism
431
  is the SAME physics, executed on more cores.
432
+
433
+ ## 16. v3.2 — the semantic field, context-sensitive lanes, retrieval by default, the two-stage router
434
+
435
+ The largest boundary-layer addition since v3.0, and the first that adds a
436
+ second field to the substrate. Everything below is deterministic, seeded by
437
+ nothing, fitted to nothing — there is still no neural network, no
438
+ transformer, and no pattern-matching classifier in the core.
439
+
440
+ ### Stage 1 + 4 — the semantic vector field (64-dim, resonance)
441
+
442
+ Every concept node carries a 64-dim semantic vector built in two
443
+ deterministic steps. The LEXICAL LAYER hashes the concept string's character
444
+ trigrams into 64 buckets with FNV-1a-signed weights and L2-normalizes —
445
+ "card_arrival" and "card_delivery" share trigrams, so their base vectors
446
+ align; unrelated words stay near-orthogonal. FABRIC GROUNDING then runs two
447
+ smoothing passes over the Hebbian lanes (v_i <- normalize(v_i + 0.5 *
448
+ lane-weighted mean of v_j)): the fabric's own co-occurrence structure shapes
449
+ the vectors, which is meaning diffusing along the lanes, not a fit. From the
450
+ vectors, three derived quantities:
451
+
452
+ - **omega_semantic** (Stage 1, "concept frequency encoding") — a scalar
453
+ projection onto one fixed deterministic direction, mapped to [0,1]. Two
454
+ nodes with close omega resonate harder, like coupled oscillators that are
455
+ nearly tuned; the fixed axis makes "card" map to the same omega in every
456
+ fabric.
457
+ - **resonance edges** (Stage 4, "semantic field") — the top-6 cosine
458
+ neighbours with cos >= 0.50, stored as a CSR adjacency in the substrate's
459
+ v4 file tail. During settle, every SOURCE (and only sources — the working
460
+ set stays capped) leaks a fraction (sem_coupling 0.12) of its post-diffusion
461
+ energy along these edges, distributed proportionally to cos x
462
+ frequency-match. Energy is CONSERVED exactly: the pool is subtracted from
463
+ the source and distributed; decay applies next pass as always.
464
+ - **typed reads** (Option 2) — cos >= 0.82 reads as synonym-grade kin, >=
465
+ 0.66 as related; `syfox analogs` and the evidence surface expose the type.
466
+ The v2.1 synonym folding table remains the string-level canonicalization;
467
+ the vectors add the fabric-shaped layer above it.
468
+
469
+ Readout gains a semantic-neighbour term (sem_hop 0.10 x cosine x neighbour
470
+ energy): energy resting on semantically similar nodes counts for a probe
471
+ even where no lane connects them.
472
+
473
+ ### Stage 2 — context-sensitive lanes
474
+
475
+ A lane may carry a CONTEXT SIGNATURE: required and forbidden context words,
476
+ learned from the co-occurrence statistics of the lessons that laid it
477
+ (`add_ctx_support` accumulates counts at learn time; `finalize_contexts`
478
+ promotes surviving counts — top-4 with count >= 2 — into required sets, and
479
+ cross-lane diffs (strong in a sibling lane's context, absent here) into
480
+ forbidden words, top-2). At settle, a lane's effective weight is
481
+ w x factor: any forbidden word present in the decision's own injected
482
+ tokens -> x0.20; required words missing -> x0.60..1.0 interpolated by match
483
+ count; all present -> x1.0 (bit-identical to the plain path). The node's
484
+ total outflow scales by sum(w x f)/sum(w), so damped lanes carry LESS and
485
+ the energy stays home — context-mismatched routes fade physically instead of
486
+ being pruned by a rule. The same "card" can now route toward card_arrival
487
+ when arrive/receive are in the state and toward card_delivery_estimate when
488
+ estimate/how-long is.
489
+
490
+ ### Persistence and the replay contract
491
+
492
+ The semantic field, resonance edges and lane contexts live in a magic-
493
+ guarded v4 tail of substrate.bin. Pre-v3.2 files simply end at the v3
494
+ evidence tail: has_semantics() is false and every semantic code path is
495
+ inert, so every v2/v3 model replays bit-for-bit under the new binary
496
+ (test-enforced). `intern()` invalidates the field when the fabric grows —
497
+ a stale top-k neighbourhood must never be indexed — and the next
498
+ `save_model()` rebuilds it deterministically. `--no-semantics` /
499
+ `set_semantics(false)` is the runtime kill switch.
500
+
501
+ ### Retrieval by default
502
+
503
+ A model dir may ship `memories.jsonl` (rows {"label": ..., "state": ...}).
504
+ load_model fingerprints each memory once (its own settled field, the
505
+ recall.hpp Hopfield-style mechanism); every decide then ranks memories by
506
+ settled-field cosine against the query and injects the top-5 outcomes at a
507
+ faint dose (0.30 x inject_energy) BEFORE the state settles — a physical
508
+ prior from lived experience, deterministic, bit-reproducible for the same
509
+ state + memories. No memories file => the whole path is inert (pre-3.2
510
+ behavior). Flags: --memories FILE (explicit store), --retrieval-topk,
511
+ --retrieval-dose, --no-retrieval. usage.retrieval discloses what primed the
512
+ decision, in the CLI, the C API and the HTTP bridge alike.
513
+
514
+ ### Stage 3 — the semantic hierarchy
515
+
516
+ A model dir may ship `hierarchy.json` {"intents": {intent: category},
517
+ "categories": {category: {"criteria": ...}}, "floor": 0.35}. Both levels are
518
+ TRAINED anchors in one fabric; at decide, stage-1 category energies scale the
519
+ stage-2 intent candidates by floor + (1-floor) x cat/max_cat — a readout-side
520
+ two-stage classification. MEASURED on bank77 (cal, 1,003 rows): gate OFF
521
+ 0.133 > floor 0.85: 0.129 > 0.5: 0.113 > 0.35: 0.111 — the category readout
522
+ is not additive on this fabric (consistent with the v3.1.0 finding that the
523
+ hierarchical first-token split was measured-negative), so the shipped
524
+ model-b77-sem carries floor 1.0 = gate off, kept as documentation. The
525
+ mechanism stays available (--no-hierarchy to disable elsewhere).
526
+
527
+ ### The dedicated bank77 fabric + the two-stage router
528
+
529
+ The v3.2 answer to high-cardinality collapse is ARCHITECTURAL, as the
530
+ v3.0 design intended: a DEDICATED fabric per hard domain, routed by a small
531
+ dedicated router fabric.
532
+
533
+ - **model-b77-sem** (dedicated bank77): 9,000 intent lessons + 9,000
534
+ category lessons (12 chunks), 1,648 nodes / 217,729 lanes, 7,728 resonance
535
+ edges, 141,920 lane contexts, 256 retrieval memories, calibrated. Hidden
536
+ (3,080 rows, scored once, energy-norm): **0.158** — vs 0.081 (v3.1.0
537
+ dedicated+opaque) and 0.023 (77-way in the shared giant fabric). Ablations
538
+ on cal: --no-semantics 0.039 (the semantic field is the jump: 0.039 ->
539
+ 0.133), retrieval neutral, hierarchy gate negative (above).
540
+ - **model-router16** (two-stage, stage 1): a 4,742-node fabric trained ONLY
541
+ on router questions (16 anchors, one per giant domain, 60 rows/domain).
542
+ Cal 16-way routing 0.444 (chance 0.0625), ECE 0.380 -> 0.086.
543
+ `decide --router model-router16 ...` settles the state on the router
544
+ fabric, picks the domain anchor, then the mapped domain fabric (router.json
545
+ "models") decides the real questions; the route is disclosed in the output
546
+ as route:{anchor,confidence,top,model}. Physics-based routing, no
547
+ classifier — the two-stage architecture from the v3.0 design, now measured.
548
+
549
+ ### Zero-shot, re-measured under v3.2 (docs/ZEROSHOT.md Part 4)
550
+
551
+ Email spam on the tickets-only fabric (never taught spam): 6/6 (plain) and
552
+ 6/6 (semantic rebuild). SMS spam: 5/6 both. Snake on the giant fabric: 1/8
553
+ both; Tic-tac-toe: picks 1 at conf 0 — multi-constraint composition is
554
+ still not a fabric property, and the semantic field does not fake it.
555
+ Honest as ever: the semantic field moves TRAINED-discrimination and
556
+ vocabulary-overlap zero-shot, not symbolic reasoning.
docs/ZEROSHOT.md CHANGED
@@ -222,3 +222,49 @@ Findings, all measured:
222
  flag experiment reproduce from a fresh clone).
223
  - **tickets/game/guard big splits**: synthetic corpora (`data/big/`,
224
  SHA-256 `MANIFEST.json`).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  flag experiment reproduce from a fresh clone).
223
  - **tickets/game/guard big splits**: synthetic corpora (`data/big/`,
224
  SHA-256 `MANIFEST.json`).
225
+
226
+ ---
227
+
228
+ ## Part 4 — v3.2 zero-shot re-run (Super Z, measured runs, 2026-09)
229
+
230
+ The v3.2 semantic layer changed the trained-discrimination numbers
231
+ (bank77 dedicated fabric 0.081 -> 0.158 hidden). Before claiming anything
232
+ about zero-shot, the suite was RE-RUN under v3.2 per the interpretation
233
+ rules above: `tools/zeroshot_suite.py` (data/zeroshot_v32_results.json has
234
+ every row). Every number below is a real CLI decide (--energy-norm,
235
+ retrieval disabled for the probe, deterministic).
236
+
237
+ ### Setup
238
+
239
+ | Probe family | Fabric | Trained on | Zero-shot claim |
240
+ |---|---|---|---|
241
+ | email spam x6 | model-tickets-big-latin (+ `-sem` semantic rebuild) | support tickets only | no spam lessons ever |
242
+ | sms spam x6 | same | support tickets only | no spam lessons ever |
243
+ | snake x8 | model-giant-latin (+ `-sem`) | 16 domains incl. game; zero Snake lessons | same spirit as Part 1 model-xl |
244
+ | tic-tac-toe x1 | same | zero Tic-tac-toe lessons | same spirit as Part 1 model-xl |
245
+
246
+ `-sem` rebuilds are `load + save_model` of the SAME fabric (no retrain):
247
+ the deterministic v3.2 semantic field (vectors, resonance edges) built over
248
+ the frozen lanes.
249
+
250
+ ### Results (measured)
251
+
252
+ | Family | plain | semantic rebuild | detail |
253
+ |---|---|---|---|
254
+ | email spam | **1.00** (6/6) | **1.00** (6/6) | conf 0.91-0.99; the criteria words overlap the tickets vocabulary — the composition channel is surface overlap, as in Part 1 |
255
+ | sms spam | **0.83** (5/6) | 0.83 (5/6) | the one error is a ham read as spam at conf 0.103 (the honest low-conf regime, disclosed) |
256
+ | snake | 0.12 (1/8) | 0.12 (1/8) | "food directly ahead -> right" (0.160 plain / 0.233 sem) is the only correct row; every wall/body/lethal-right scenario still picks the food-biased direction — the Part 1 composition failure reproduces under v3.2 |
257
+ | tic-tac-toe | picks 1, conf 0.000 | picks 1, conf 0.000 | winning cell 3 still gets no composed support (Part 1's run picked 8; both are wrong — different field, same failure class) |
258
+
259
+ ### What Part 4 adds
260
+
261
+ - The v3.2 semantic field (resonance + semantic readout) does NOT fake
262
+ symbolic composition: multi-constraint scenarios (lethal wall, forbidden
263
+ reversal, exclusions) fail exactly as in Part 1, with the food-direction
264
+ attractor dominating.
265
+ - Where zero-shot WORKS (spam/ham through vocabulary overlap), the semantic
266
+ rebuild preserves it — energy-norm-level confidence, no new failures.
267
+ - Trained discrimination and zero-shot composition remain the two separate
268
+ axes of Part 2, and v3.2 moves the first, not the second. Nothing above
269
+ is evidence of reasoning; the honest-silence disclosures (low-conf rows)
270
+ are doing their job.
engine/core/si_substrate.hpp CHANGED
@@ -43,12 +43,59 @@
43
  #include <fstream>
44
  #include <string>
45
  #include <unordered_map>
 
46
  #include <vector>
47
 
48
  namespace si {
49
 
50
  using NodeId = std::uint32_t;
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  // ---------------------------------------------------------------------------
53
  // v3 Milestone 3 — the lane evidence ledger (audit surface, NOT physics).
54
  // A lane's WEIGHT drives the field (settle/readout) exactly as before; the
@@ -91,6 +138,14 @@ struct SubstrateConfig {
91
  float lane_decay = 0.995f; // per-lesson lane weight decay
92
  std::size_t lane_cap = 256; // max lanes per node (weakest evicted)
93
  float hop_coupling = 0.35f; // 1-hop lane contribution at readout
 
 
 
 
 
 
 
 
94
  };
95
 
96
  inline float fnv1a_hash(const std::string& s) { // deterministic token hash
@@ -110,6 +165,15 @@ public:
110
  NodeId intern(const std::string& concept) {
111
  auto it = index_.find(concept);
112
  if (it != index_.end()) { nodes_[it->second].mass += 1.0f; return it->second; }
 
 
 
 
 
 
 
 
 
113
  NodeId id = static_cast<NodeId>(nodes_.size());
114
  index_.emplace(concept, id);
115
  // occurrence mass: a LINEAR count of intern() calls (not log-compressed).
@@ -151,6 +215,7 @@ public:
151
  if (lanes.size() > cfg_.lane_cap) { // evict weakest lane
152
  auto weakest = std::min_element(lanes.begin(), lanes.end(),
153
  [](const auto& x, const auto& y){ return x.second < y.second; });
 
154
  lanes.erase(weakest);
155
  }
156
  }
@@ -164,7 +229,10 @@ public:
164
  for (std::size_t i = 0; i < lanes.size(); ++i)
165
  if (lanes[i].first == b) {
166
  lanes[i].second = std::max(0.0f, lanes[i].second + dw);
167
- if (lanes[i].second <= 0.0f) lanes.erase(lanes.begin() + static_cast<std::ptrdiff_t>(i));
 
 
 
168
  csr_dirty_ = true;
169
  return;
170
  }
@@ -182,6 +250,7 @@ public:
182
  float mass_damp = 1.0f / std::sqrt(n.mass); // heavy => less per-token
183
  n.energy += energy * mass_damp;
184
  n.salience = 1.0f; // TSDA: spike to ceiling on touch
 
185
  state_hash_ = state_hash_ * 1099511628211ull
186
  + static_cast<std::uint64_t>(fnv1a_hash(t)); // decision fingerprint
187
  }
@@ -292,6 +361,33 @@ public:
292
  if (!is_source[i]) { scatter[i] += nd.energy * cfg_.decay; continue; } // gated: decay only
293
  const std::size_t b = csr_off_[i], e = csr_off_[i + 1];
294
  float out_w = 0.0f;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  for (std::size_t k = b; k < e; ++k) out_w += csr_w_[k];
296
  float retained = (out_w > 0.0f) ? (1.0f - cfg_.diffusion) : 1.0f;
297
  scatter[i] += nd.energy * cfg_.decay * retained; // damped self-retention
@@ -306,6 +402,32 @@ public:
306
  for (const auto& tb : thread_bufs)
307
  for (std::size_t i = 0; i < n; ++i) next[i] += tb[i];
308
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  // SI cavity salience integrator: s = tanh(s·decay + gain·|ΔE|).
310
  // Motion proxy is how much energy moved through the node this
311
  // pass. Updated before the energies are committed, so the next
@@ -367,6 +489,15 @@ public:
367
  for (const auto& lane : lane_it->second)
368
  r += cfg_.hop_coupling * lane.second * nodes_[lane.first].energy;
369
  }
 
 
 
 
 
 
 
 
 
370
  }
371
  return r;
372
  }
@@ -393,6 +524,7 @@ public:
393
  // -- HONEST SILENCE reset ---------------------------------------------------
394
  void reset_field() {
395
  for (auto& n : nodes_) { n.energy = 0.0f; n.salience = 0.0f; }
 
396
  state_hash_ = 0;
397
  }
398
 
@@ -460,6 +592,147 @@ public:
460
  }
461
  std::size_t evidence_count() const { return lane_evidence_.size(); }
462
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
463
  // -- persistence (binary, deterministic) -------------------------------------
464
  void save(const std::string& path) const {
465
  std::ofstream f(path, std::ios::binary);
@@ -506,6 +779,39 @@ public:
506
  f.write(reinterpret_cast<const char*>(&clen), 4);
507
  if (clen) f.write(kv.second.context.data(), clen);
508
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
  }
510
 
511
  void load(const std::string& path) {
@@ -562,6 +868,62 @@ public:
562
  lane_evidence_[lane_key(static_cast<NodeId>(a), static_cast<NodeId>(b))] = e;
563
  }
564
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  }
566
 
567
  const SubstrateConfig& config() const { return cfg_; }
@@ -611,6 +973,8 @@ public:
611
  if (mit != out_.end()) erase_one(mit->second, a);
612
  derived_gen_.erase(lane_key(a, b));
613
  derived_gen_.erase(lane_key(b, a));
 
 
614
  csr_dirty_ = true;
615
  }
616
 
@@ -717,6 +1081,7 @@ private:
717
  auto weakest = std::min_element(lanes.begin(), lanes.end(),
718
  [](const auto& x, const auto& y){ return x.second < y.second; });
719
  derived_gen_.erase(lane_key(a, weakest->first));
 
720
  lanes.erase(weakest);
721
  }
722
  }
@@ -735,6 +1100,15 @@ private:
735
  std::unordered_map<std::uint64_t, std::uint32_t> derived_gen_;
736
  // v3 Milestone 3: audit ledger (support/counter events, provenance window)
737
  std::unordered_map<std::uint64_t, LaneEvidence> lane_evidence_;
 
 
 
 
 
 
 
 
 
738
  std::uint64_t state_hash_ = 0; // decision fingerprint for Miller sampling
739
  float last_cap_ = 0.0f; // cap used by the last settle()
740
 
@@ -752,6 +1126,57 @@ private:
752
  mutable bool csr_dirty_ = true;
753
  bool parallel_settle_ = true; // OMP builds honor this; sequential builds ignore it
754
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
755
  void build_csr() const {
756
  const std::size_t n = nodes_.size();
757
  csr_off_.assign(n + 1, 0);
@@ -799,6 +1224,134 @@ public:
799
  }
800
  };
801
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
802
  // ---------------------------------------------------------------------------
803
  // Tokenizer — plain lexical split (I/O concern, not pattern matching):
804
  // lowercase, split on non-alphanumeric, keep tokens of length 2..24.
 
43
  #include <fstream>
44
  #include <string>
45
  #include <unordered_map>
46
+ #include <unordered_set>
47
  #include <vector>
48
 
49
  namespace si {
50
 
51
  using NodeId = std::uint32_t;
52
 
53
+ // ---------------------------------------------------------------------------
54
+ // v3.2 SEMANTIC FIELD — the substrate's second field, deterministic, no ML.
55
+ // Every concept node carries a 64-dim semantic vector built in two
56
+ // deterministic steps (see build_semantics):
57
+ // 1. LEXICAL LAYER — signed character-trigram hashing of the concept
58
+ // string into 64 buckets ("card_arrival" and "card_delivery" share
59
+ // trigrams, so their base vectors align; unrelated words stay
60
+ // near-orthogonal). A fixed function of the string: no training.
61
+ // 2. FABRIC GROUNDING — two smoothing passes over the Hebbian lanes
62
+ // (v_i <- normalize(v_i + beta * lane-weighted mean of v_j)). The
63
+ // fabric's own co-occurrence structure shapes the vectors — a
64
+ // deterministic diffusion of meaning along the lanes, not a fit.
65
+ // From the vectors, per node:
66
+ // omega_semantic — scalar projection onto one fixed direction (Stage 1
67
+ // "concept frequency encoding"); close frequencies
68
+ // resonate, like coupled oscillators detuned.
69
+ // resonance edges — top-k cosine neighbours (cos >= sem_theta), weight
70
+ // = cos * frequency-match (Stage 4 "semantic field":
71
+ // during settle, sources leak a small fraction of
72
+ // their retained energy to semantically similar nodes
73
+ // — energy is CONSERVED, the flow is one more
74
+ // diffusion channel beside the Hebbian lanes).
75
+ // semantic type — cos >= 0.82 reads as synonym-grade kin, >= 0.66 as
76
+ // related (Option 2 typed lanes, derived from the
77
+ // vectors, not from a hand-written table).
78
+ // CONTEXT-SENSITIVE LANES (Stage 2): a lane may carry a context signature
79
+ // (required/forbidden context words, learned from the co-occurrence
80
+ // statistics of the lessons that laid it). At settle, the lane's flow is
81
+ // damped when the current decision's injected tokens do not match the
82
+ // signature: all required present -> full flow, missing -> ctx_missing,
83
+ // any forbidden present -> ctx_forbidden. The same "card" can then route
84
+ // toward card_arrival when arrive/receive are in the state and toward
85
+ // card_delivery_estimate when estimate/how-long is — contextual
86
+ // disambiguation as dampened coupling, not pattern matching.
87
+ // Persistence: a v4 tail in substrate.bin. Models saved before v3.2 have no
88
+ // tail: has_semantics() is false and every semantic code path is inert, so
89
+ // old fabrics replay bit-for-bit. Runtime kill switch: set_semantics(false).
90
+ // ---------------------------------------------------------------------------
91
+ inline constexpr std::size_t SEM_DIMS = 64;
92
+
93
+ // v3.2 context signature attached to a lane (read-side of Stage 2).
94
+ struct LaneCtx {
95
+ std::vector<NodeId> required; // all of these should be in the state
96
+ std::vector<NodeId> forbidden; // any of these suppresses the lane
97
+ };
98
+
99
  // ---------------------------------------------------------------------------
100
  // v3 Milestone 3 — the lane evidence ledger (audit surface, NOT physics).
101
  // A lane's WEIGHT drives the field (settle/readout) exactly as before; the
 
138
  float lane_decay = 0.995f; // per-lesson lane weight decay
139
  std::size_t lane_cap = 256; // max lanes per node (weakest evicted)
140
  float hop_coupling = 0.35f; // 1-hop lane contribution at readout
141
+ // -- v3.2 semantic field constants ---------------------------------------
142
+ float sem_coupling = 0.12f; // resonance outflow fraction of retained energy
143
+ float sem_theta = 0.50f; // min cosine for a resonance edge
144
+ float sem_hop = 0.10f; // semantic-neighbour contribution at readout
145
+ float sem_beta = 0.50f; // fabric-grounding strength (vector smoothing)
146
+ int sem_neighbors = 6; // resonance edges per node
147
+ float ctx_missing = 0.60f; // lane flow factor when required context is absent
148
+ float ctx_forbidden = 0.20f; // lane flow factor when forbidden context is present
149
  };
150
 
151
  inline float fnv1a_hash(const std::string& s) { // deterministic token hash
 
165
  NodeId intern(const std::string& concept) {
166
  auto it = index_.find(concept);
167
  if (it != index_.end()) { nodes_[it->second].mass += 1.0f; return it->second; }
168
+ // v3.2: the semantic field is a property of the WHOLE fabric — a new
169
+ // node changes every top-k neighbourhood, so the stored field is now
170
+ // stale. Invalidate rather than index out of bounds: the next
171
+ // save_model() rebuilds it over the grown fabric (and in-memory
172
+ // engines run lane-physics only until then — honest degradation).
173
+ if (!semvecs_.empty()) {
174
+ semvecs_.clear(); sem_edges_.clear(); sem_off_.clear();
175
+ sem_edge_count_ = 0;
176
+ }
177
  NodeId id = static_cast<NodeId>(nodes_.size());
178
  index_.emplace(concept, id);
179
  // occurrence mass: a LINEAR count of intern() calls (not log-compressed).
 
215
  if (lanes.size() > cfg_.lane_cap) { // evict weakest lane
216
  auto weakest = std::min_element(lanes.begin(), lanes.end(),
217
  [](const auto& x, const auto& y){ return x.second < y.second; });
218
+ drop_lane_ctx(a, weakest->first); // v3.2: signature dies with its lane
219
  lanes.erase(weakest);
220
  }
221
  }
 
229
  for (std::size_t i = 0; i < lanes.size(); ++i)
230
  if (lanes[i].first == b) {
231
  lanes[i].second = std::max(0.0f, lanes[i].second + dw);
232
+ if (lanes[i].second <= 0.0f) {
233
+ drop_lane_ctx(a, b); // v3.2: signature dies with its lane
234
+ lanes.erase(lanes.begin() + static_cast<std::ptrdiff_t>(i));
235
+ }
236
  csr_dirty_ = true;
237
  return;
238
  }
 
250
  float mass_damp = 1.0f / std::sqrt(n.mass); // heavy => less per-token
251
  n.energy += energy * mass_damp;
252
  n.salience = 1.0f; // TSDA: spike to ceiling on touch
253
+ present_.insert(id); // v3.2: context-lane visibility (until next reset)
254
  state_hash_ = state_hash_ * 1099511628211ull
255
  + static_cast<std::uint64_t>(fnv1a_hash(t)); // decision fingerprint
256
  }
 
361
  if (!is_source[i]) { scatter[i] += nd.energy * cfg_.decay; continue; } // gated: decay only
362
  const std::size_t b = csr_off_[i], e = csr_off_[i + 1];
363
  float out_w = 0.0f;
364
+ if (sem_active() && !lane_ctx_.empty()) {
365
+ // v3.2 Stage 2: context-sensitive lanes — each lane's
366
+ // EFFECTIVE weight is w * factor(f). The node's total
367
+ // outflow scales by (sum w*f / sum w): damped lanes
368
+ // carry less, the energy stays home. All factors 1.0
369
+ // reproduces the plain path bit-for-bit (same float
370
+ // sum order, 1.0f multiplies are exact).
371
+ float raw_w = 0.0f, eff_w = 0.0f;
372
+ for (std::size_t k = b; k < e; ++k) {
373
+ const float f = lane_flow_factor(i, csr_dst_[k]);
374
+ raw_w += csr_w_[k];
375
+ eff_w += csr_w_[k] * f;
376
+ }
377
+ if (raw_w > 0.0f && eff_w > 0.0f) {
378
+ const float out_frac = cfg_.diffusion * (eff_w / raw_w);
379
+ scatter[i] += nd.energy * cfg_.decay * (1.0f - out_frac);
380
+ const float flow = nd.energy * cfg_.decay * out_frac;
381
+ for (std::size_t k = b; k < e; ++k) {
382
+ const float f = lane_flow_factor(i, csr_dst_[k]);
383
+ if (f > 0.0f)
384
+ scatter[csr_dst_[k]] += flow * (csr_w_[k] * f / eff_w);
385
+ }
386
+ } else {
387
+ scatter[i] += nd.energy * cfg_.decay; // nothing flows
388
+ }
389
+ continue;
390
+ }
391
  for (std::size_t k = b; k < e; ++k) out_w += csr_w_[k];
392
  float retained = (out_w > 0.0f) ? (1.0f - cfg_.diffusion) : 1.0f;
393
  scatter[i] += nd.energy * cfg_.decay * retained; // damped self-retention
 
402
  for (const auto& tb : thread_bufs)
403
  for (std::size_t i = 0; i < n; ++i) next[i] += tb[i];
404
  }
405
+ // -- v3.2 SEMANTIC RESONANCE (Stage 4) ----------------------------
406
+ // Sequential by design (determinism contract): sources — and only
407
+ // sources, so the working-set cap stays meaningful — leak a small
408
+ // fraction (sem_coupling) of their POST-diffusion energy along
409
+ // their resonance edges, distributed proportionally to
410
+ // cos * frequency-match. Energy is conserved exactly (the pool is
411
+ // subtracted from the source, then distributed); decay applies
412
+ // next pass as always. A node with no resonance edges is an
413
+ // exact fixed point of this pass.
414
+ if (sem_active()) {
415
+ for (std::size_t i = 0; i < n; ++i) {
416
+ if (!is_source[i]) continue;
417
+ const std::size_t sb = sem_off_[i], se = sem_off_[i + 1];
418
+ if (sb == se) continue;
419
+ float wsum = 0.0f;
420
+ for (std::size_t k = sb; k < se; ++k)
421
+ wsum += sem_edges_[k].second * freq_match(i, sem_edges_[k].first);
422
+ if (wsum <= 0.0f) continue;
423
+ const float pool = next[i] * cfg_.sem_coupling;
424
+ next[i] -= pool;
425
+ for (std::size_t k = sb; k < se; ++k) {
426
+ const float fm = freq_match(i, sem_edges_[k].first);
427
+ next[sem_edges_[k].first] += pool * (sem_edges_[k].second * fm / wsum);
428
+ }
429
+ }
430
+ }
431
  // SI cavity salience integrator: s = tanh(s·decay + gain·|ΔE|).
432
  // Motion proxy is how much energy moved through the node this
433
  // pass. Updated before the energies are committed, so the next
 
489
  for (const auto& lane : lane_it->second)
490
  r += cfg_.hop_coupling * lane.second * nodes_[lane.first].energy;
491
  }
492
+ // v3.2 Stage 4: semantic-neighbour term — energy resting on
493
+ // semantically similar nodes counts for this probe even where no
494
+ // lane connects them. Weighted by the edge cosine; zero when the
495
+ // fabric carries no semantic field (pre-v3.2 models, or --no-semantics).
496
+ if (sem_active()) {
497
+ const std::size_t sb = sem_off_[it->second], se = sem_off_[it->second + 1];
498
+ for (std::size_t k = sb; k < se; ++k)
499
+ r += cfg_.sem_hop * sem_edges_[k].second * nodes_[sem_edges_[k].first].energy;
500
+ }
501
  }
502
  return r;
503
  }
 
524
  // -- HONEST SILENCE reset ---------------------------------------------------
525
  void reset_field() {
526
  for (auto& n : nodes_) { n.energy = 0.0f; n.salience = 0.0f; }
527
+ present_.clear();
528
  state_hash_ = 0;
529
  }
530
 
 
592
  }
593
  std::size_t evidence_count() const { return lane_evidence_.size(); }
594
 
595
+ // =====================================================================
596
+ // v3.2 SEMANTIC FIELD API (deterministic; see the header comment block)
597
+ // =====================================================================
598
+
599
+ // Stage 2 learn-side accumulation: ctx_word co-occurred with lane (a,b)
600
+ // in the lesson that laid it. Counts live in a scratch table; only
601
+ // finalize_contexts() (called at save) promotes surviving counts into
602
+ // the lane's signature. Bookkeeping — nothing here touches the field.
603
+ void add_ctx_support(NodeId a, NodeId b, NodeId ctx_word) {
604
+ if (a == b || ctx_word == a || ctx_word == b) return;
605
+ lane_ctx_acc_[lane_key(a, b)][ctx_word] += 1.0f;
606
+ }
607
+
608
+ // Promote accumulated co-occurrence counts into per-lane signatures.
609
+ // Deterministic pruning over node-id-ascending iteration:
610
+ // required — top-4 context words with count >= 2 for this lane
611
+ // forbidden — up to 2 words that are STRONG required context of the
612
+ // same source node's lanes into a DIFFERENT target family
613
+ // (count >= 3 there, absent-or-weak here). This is the
614
+ // cross-class diff: the words that discriminate WHERE
615
+ // this source node's energy should go.
616
+ // Idempotent: the scratch table is consumed; calling twice is a no-op.
617
+ void finalize_contexts() {
618
+ if (lane_ctx_acc_.empty()) return;
619
+ // gather per-source: which targets exist and each target's top context
620
+ for (auto& kv : lane_ctx_acc_) {
621
+ const std::uint64_t key = kv.first;
622
+ const NodeId a = static_cast<NodeId>(key >> 32);
623
+ const NodeId b = static_cast<NodeId>(key & 0xffffffffull);
624
+ // required: top-4 by (count, then node id ascending for ties)
625
+ std::vector<std::pair<float, NodeId>> cand;
626
+ for (const auto& cv : kv.second)
627
+ if (cv.second >= 2.0f) cand.emplace_back(cv.second, cv.first);
628
+ if (cand.empty()) continue;
629
+ std::sort(cand.begin(), cand.end(), [](const auto& x, const auto& y) {
630
+ return x.first != y.first ? x.first > y.first : x.second < y.second;
631
+ });
632
+ LaneCtx sig;
633
+ for (std::size_t i = 0; i < cand.size() && i < 4; ++i)
634
+ sig.required.push_back(cand[i].second);
635
+ lane_ctx_[key] = std::move(sig);
636
+ (void)a; (void)b;
637
+ }
638
+ // forbidden pass: for lane (a,b), words that dominate a sibling lane
639
+ // (a,b') with b' != b and are not in this lane's required set.
640
+ std::unordered_map<std::uint64_t, std::vector<std::uint64_t>> by_source;
641
+ for (const auto& kv : lane_ctx_) {
642
+ const NodeId a = static_cast<NodeId>(kv.first >> 32);
643
+ by_source[a].push_back(kv.first);
644
+ }
645
+ for (auto& sv : by_source) {
646
+ auto& keys = sv.second;
647
+ std::sort(keys.begin(), keys.end());
648
+ for (std::size_t i = 0; i < keys.size(); ++i) {
649
+ // collect the strongest context words of the SIBLING lanes
650
+ std::unordered_map<NodeId, float> sibling_ctx;
651
+ for (std::size_t j = 0; j < keys.size(); ++j) {
652
+ if (i == j) continue;
653
+ auto it = lane_ctx_acc_.find(keys[j]);
654
+ if (it == lane_ctx_acc_.end()) continue; // consumed
655
+ for (const auto& cv : it->second)
656
+ if (cv.second >= 3.0f) sibling_ctx[cv.first] += cv.second;
657
+ }
658
+ if (sibling_ctx.empty()) continue;
659
+ // not already required here
660
+ const LaneCtx& mine = lane_ctx_[keys[i]];
661
+ auto is_req = [&](NodeId w) {
662
+ for (NodeId r : mine.required) if (r == w) return true;
663
+ return false;
664
+ };
665
+ std::vector<std::pair<float, NodeId>> fc;
666
+ for (const auto& cv : sibling_ctx)
667
+ if (!is_req(cv.first)) fc.emplace_back(cv.second, cv.first);
668
+ if (fc.empty()) continue;
669
+ std::sort(fc.begin(), fc.end(), [](const auto& x, const auto& y) {
670
+ return x.first != y.first ? x.first > y.first : x.second < y.second;
671
+ });
672
+ for (std::size_t k = 0; k < fc.size() && k < 2; ++k)
673
+ lane_ctx_[keys[i]].forbidden.push_back(fc[k].second);
674
+ }
675
+ }
676
+ lane_ctx_acc_.clear();
677
+ }
678
+
679
+ bool has_semantics() const { return !semvecs_.empty(); }
680
+ void set_semantics(bool on) { sem_enabled_ = on; }
681
+ std::size_t resonance_edge_count() const { return sem_edge_count_; }
682
+ std::size_t lane_context_count() const { return lane_ctx_.size(); }
683
+
684
+ // semantic vector of a node (empty vector when semantics absent)
685
+ std::vector<float> sem_vector(NodeId id) const {
686
+ std::vector<float> v;
687
+ if (id >= node_count() || semvecs_.empty()) return v;
688
+ v.assign(semvecs_.begin() + static_cast<std::ptrdiff_t>(id * SEM_DIMS),
689
+ semvecs_.begin() + static_cast<std::ptrdiff_t>((id + 1) * SEM_DIMS));
690
+ return v;
691
+ }
692
+
693
+ // Stage 1: omega_semantic — scalar projection of the semantic vector onto
694
+ // one FIXED deterministic direction, mapped to [0,1]. Fixed point of the
695
+ // frequency axis: same string -> same omega, always.
696
+ float semantic_freq(NodeId id) const {
697
+ if (id >= node_count() || semvecs_.empty()) return 0.0f;
698
+ float d = 0.0f;
699
+ for (std::size_t k = 0; k < SEM_DIMS; ++k)
700
+ d += semvecs_[id * SEM_DIMS + k] * omega_dir()[k];
701
+ return std::max(0.0f, std::min(1.0f, 0.5f + 0.5f * d));
702
+ }
703
+
704
+ // Option 2 typed-lane read: cos >= 0.82 synonym-grade kin,
705
+ // cos >= 0.66 related; 0 = no semantic relation measured.
706
+ static const char* semantic_type(float cos) {
707
+ if (cos >= 0.82f) return "synonym";
708
+ if (cos >= 0.66f) return "related";
709
+ if (cos > 0.0f) return "resonance";
710
+ return "none";
711
+ }
712
+
713
+ // resonance neighbours of a node (id, cosine) — empty when no semantics
714
+ const std::vector<std::pair<NodeId, float>>* resonance_of(NodeId id) const {
715
+ if (semvecs_.empty() || id >= node_count()) return nullptr;
716
+ static const std::vector<std::pair<NodeId, float>> kEmpty;
717
+ const std::size_t b = sem_off_[id], e = sem_off_[id + 1];
718
+ if (b == e) return &kEmpty;
719
+ // slices live in sem_edges_; return pointer into it (stable between builds)
720
+ static thread_local std::vector<std::pair<NodeId, float>> out;
721
+ out.assign(sem_edges_.begin() + static_cast<std::ptrdiff_t>(b),
722
+ sem_edges_.begin() + static_cast<std::ptrdiff_t>(e));
723
+ return &out;
724
+ }
725
+
726
+ const LaneCtx* lane_context(NodeId a, NodeId b) const {
727
+ auto it = lane_ctx_.find(lane_key(a, b));
728
+ return it == lane_ctx_.end() ? nullptr : &it->second;
729
+ }
730
+
731
+ // Build the semantic field over the CURRENT fabric. Deterministic.
732
+ // Expensive once (O(n^2 * dims) neighbour search, OMP-parallel with a
733
+ // fixed per-row reduction); stored in the model from then on.
734
+ void build_semantics(int threads = 0);
735
+
736
  // -- persistence (binary, deterministic) -------------------------------------
737
  void save(const std::string& path) const {
738
  std::ofstream f(path, std::ios::binary);
 
779
  f.write(reinterpret_cast<const char*>(&clen), 4);
780
  if (clen) f.write(kv.second.context.data(), clen);
781
  }
782
+ // v3.2 SEMANTIC TAIL — vectors + resonance edges + lane contexts.
783
+ // Magic-guarded: a truncated/garbage read leaves semantics off and the
784
+ // rest of the model fully usable (pre-v3.2 files simply end here).
785
+ const std::uint32_t sem_magic = 0x53454D34u; // 'SEM4'
786
+ f.write(reinterpret_cast<const char*>(&sem_magic), 4);
787
+ const std::uint32_t has_sem = semvecs_.empty() ? 0u : 1u;
788
+ f.write(reinterpret_cast<const char*>(&has_sem), 4);
789
+ if (has_sem) {
790
+ f.write(reinterpret_cast<const char*>(semvecs_.data()),
791
+ static_cast<std::streamsize>(semvecs_.size() * sizeof(float)));
792
+ const std::size_t n = nodes_.size();
793
+ std::uint32_t total = static_cast<std::uint32_t>(sem_edges_.size());
794
+ f.write(reinterpret_cast<const char*>(&total), 4);
795
+ for (std::size_t i = 0; i <= n; ++i) {
796
+ std::uint32_t off = static_cast<std::uint32_t>(sem_off_[i]);
797
+ f.write(reinterpret_cast<const char*>(&off), 4);
798
+ }
799
+ for (const auto& e : sem_edges_) {
800
+ f.write(reinterpret_cast<const char*>(&e.first), 4);
801
+ f.write(reinterpret_cast<const char*>(&e.second), 4);
802
+ }
803
+ }
804
+ const std::uint32_t ctxc = static_cast<std::uint32_t>(lane_ctx_.size());
805
+ f.write(reinterpret_cast<const char*>(&ctxc), 4);
806
+ for (const auto& kv : lane_ctx_) {
807
+ f.write(reinterpret_cast<const char*>(&kv.first), 8);
808
+ std::uint32_t rq = static_cast<std::uint32_t>(kv.second.required.size());
809
+ f.write(reinterpret_cast<const char*>(&rq), 4);
810
+ for (NodeId w : kv.second.required) f.write(reinterpret_cast<const char*>(&w), 4);
811
+ std::uint32_t fb = static_cast<std::uint32_t>(kv.second.forbidden.size());
812
+ f.write(reinterpret_cast<const char*>(&fb), 4);
813
+ for (NodeId w : kv.second.forbidden) f.write(reinterpret_cast<const char*>(&w), 4);
814
+ }
815
  }
816
 
817
  void load(const std::string& path) {
 
868
  lane_evidence_[lane_key(static_cast<NodeId>(a), static_cast<NodeId>(b))] = e;
869
  }
870
  }
871
+ // v3.2 semantic tail (optional, magic-guarded): pre-v3.2 files end at
872
+ // the evidence tail; the failed magic read leaves semantics absent.
873
+ std::uint32_t magic = 0;
874
+ if (f.read(reinterpret_cast<char*>(&magic), 4) && magic == 0x53454D34u) {
875
+ std::uint32_t has_sem = 0;
876
+ if (f.read(reinterpret_cast<char*>(&has_sem), 4) && has_sem == 1) {
877
+ const std::size_t n = nodes_.size();
878
+ semvecs_.assign(n * SEM_DIMS, 0.0f);
879
+ if (f.read(reinterpret_cast<char*>(semvecs_.data()),
880
+ static_cast<std::streamsize>(semvecs_.size() * sizeof(float)))) {
881
+ std::uint32_t total = 0;
882
+ if (f.read(reinterpret_cast<char*>(&total), 4)) {
883
+ sem_edges_.clear();
884
+ sem_edges_.reserve(total);
885
+ sem_off_.assign(n + 1, 0);
886
+ bool ok = true;
887
+ for (std::size_t i = 0; i <= n && ok; ++i) {
888
+ std::uint32_t off = 0;
889
+ ok = static_cast<bool>(f.read(reinterpret_cast<char*>(&off), 4));
890
+ sem_off_[i] = off;
891
+ }
892
+ for (std::uint32_t k = 0; k < total && ok; ++k) {
893
+ std::uint32_t id = 0; float w = 0;
894
+ ok = static_cast<bool>(f.read(reinterpret_cast<char*>(&id), 4));
895
+ if (ok) ok = static_cast<bool>(f.read(reinterpret_cast<char*>(&w), 4));
896
+ if (ok) sem_edges_.emplace_back(id, w);
897
+ }
898
+ if (ok) sem_edge_count_ = total;
899
+ else { sem_edges_.clear(); sem_off_.clear(); }
900
+ }
901
+ }
902
+ if (sem_edges_.empty()) semvecs_.clear(); // torn tail: stay off
903
+ }
904
+ std::uint32_t ctxc = 0;
905
+ if (f.read(reinterpret_cast<char*>(&ctxc), 4)) {
906
+ bool ok = true;
907
+ for (std::uint32_t k = 0; k < ctxc && ok; ++k) {
908
+ std::uint64_t key = 0; std::uint32_t rq = 0, fb = 0;
909
+ ok = static_cast<bool>(f.read(reinterpret_cast<char*>(&key), 8));
910
+ if (ok) ok = static_cast<bool>(f.read(reinterpret_cast<char*>(&rq), 4));
911
+ LaneCtx sig;
912
+ for (std::uint32_t j = 0; j < rq && ok; ++j) {
913
+ std::uint32_t w = 0;
914
+ ok = static_cast<bool>(f.read(reinterpret_cast<char*>(&w), 4));
915
+ if (ok) sig.required.push_back(w);
916
+ }
917
+ if (ok) ok = static_cast<bool>(f.read(reinterpret_cast<char*>(&fb), 4));
918
+ for (std::uint32_t j = 0; j < fb && ok; ++j) {
919
+ std::uint32_t w = 0;
920
+ ok = static_cast<bool>(f.read(reinterpret_cast<char*>(&w), 4));
921
+ if (ok) sig.forbidden.push_back(w);
922
+ }
923
+ if (ok) lane_ctx_[key] = std::move(sig);
924
+ }
925
+ }
926
+ }
927
  }
928
 
929
  const SubstrateConfig& config() const { return cfg_; }
 
973
  if (mit != out_.end()) erase_one(mit->second, a);
974
  derived_gen_.erase(lane_key(a, b));
975
  derived_gen_.erase(lane_key(b, a));
976
+ drop_lane_ctx(a, b); // v3.2: signature dies with its lane
977
+ drop_lane_ctx(b, a);
978
  csr_dirty_ = true;
979
  }
980
 
 
1081
  auto weakest = std::min_element(lanes.begin(), lanes.end(),
1082
  [](const auto& x, const auto& y){ return x.second < y.second; });
1083
  derived_gen_.erase(lane_key(a, weakest->first));
1084
+ drop_lane_ctx(a, weakest->first); // v3.2: signature dies with its lane
1085
  lanes.erase(weakest);
1086
  }
1087
  }
 
1100
  std::unordered_map<std::uint64_t, std::uint32_t> derived_gen_;
1101
  // v3 Milestone 3: audit ledger (support/counter events, provenance window)
1102
  std::unordered_map<std::uint64_t, LaneEvidence> lane_evidence_;
1103
+ // v3.2 semantic field state ------------------------------------------------
1104
+ std::vector<float> semvecs_; // nodes_ * SEM_DIMS (row-major); empty = absent
1105
+ std::vector<std::pair<NodeId, float>> sem_edges_; // resonance edges, CSR payload
1106
+ std::vector<std::size_t> sem_off_; // CSR offsets, nodes_.size()+1
1107
+ std::size_t sem_edge_count_ = 0;
1108
+ std::unordered_map<std::uint64_t, LaneCtx> lane_ctx_; // final signatures
1109
+ std::unordered_map<std::uint64_t, std::unordered_map<NodeId, float>> lane_ctx_acc_; // learn-time scratch
1110
+ std::unordered_set<NodeId> present_; // tokens injected since last reset_field()
1111
+ bool sem_enabled_ = true; // runtime kill switch (--no-semantics)
1112
  std::uint64_t state_hash_ = 0; // decision fingerprint for Miller sampling
1113
  float last_cap_ = 0.0f; // cap used by the last settle()
1114
 
 
1126
  mutable bool csr_dirty_ = true;
1127
  bool parallel_settle_ = true; // OMP builds honor this; sequential builds ignore it
1128
 
1129
+ private:
1130
+ // -- v3.2 semantic helpers --------------------------------------------------
1131
+ bool sem_active() const {
1132
+ return sem_enabled_ && !semvecs_.empty() && !sem_edges_.empty();
1133
+ }
1134
+
1135
+ // fixed deterministic direction for omega_semantic (Stage 1); computed once
1136
+ static const float* omega_dir() {
1137
+ static const std::vector<float> dir = [] {
1138
+ std::vector<float> d(SEM_DIMS, 0.0f);
1139
+ for (std::size_t k = 0; k < SEM_DIMS; ++k) {
1140
+ std::uint64_t h = 1469598103934665603ull;
1141
+ const std::string seed = "syfox-omega-axis-" + std::to_string(k);
1142
+ for (unsigned char c : seed) { h ^= c; h *= 1099511628211ull; }
1143
+ d[k] = (static_cast<float>(h & 0xFFFFu) / 32767.5f) - 1.0f; // [-1,1)
1144
+ }
1145
+ float n2 = 0.0f;
1146
+ for (float v : d) n2 += v * v;
1147
+ if (n2 > 0.0f) { const float inv = 1.0f / std::sqrt(n2); for (auto& v : d) v *= inv; }
1148
+ return d;
1149
+ }();
1150
+ return dir.data();
1151
+ }
1152
+
1153
+ // coupled-oscillator detuning: equal frequencies exchange fully, far ones don't
1154
+ float freq_match(NodeId a, NodeId b) const {
1155
+ return 1.0f - 0.5f * std::fabs(semantic_freq(a) - semantic_freq(b));
1156
+ }
1157
+
1158
+ // Stage 2 settle-side factor: how much of a lane's weight flows this pass
1159
+ float lane_flow_factor(NodeId a, NodeId b) const {
1160
+ auto it = lane_ctx_.find(lane_key(a, b));
1161
+ if (it == lane_ctx_.end()) return 1.0f;
1162
+ const LaneCtx& sig = it->second;
1163
+ for (const NodeId w : sig.forbidden)
1164
+ if (present_.count(w)) return cfg_.ctx_forbidden;
1165
+ if (sig.required.empty()) return 1.0f;
1166
+ std::size_t matched = 0;
1167
+ for (const NodeId w : sig.required)
1168
+ if (present_.count(w)) ++matched;
1169
+ if (matched == sig.required.size()) return 1.0f;
1170
+ return cfg_.ctx_missing
1171
+ + (1.0f - cfg_.ctx_missing)
1172
+ * (static_cast<float>(matched) / static_cast<float>(sig.required.size()));
1173
+ }
1174
+
1175
+ void drop_lane_ctx(NodeId a, NodeId b) {
1176
+ lane_ctx_.erase(lane_key(a, b));
1177
+ lane_ctx_acc_.erase(lane_key(a, b));
1178
+ }
1179
+
1180
  void build_csr() const {
1181
  const std::size_t n = nodes_.size();
1182
  csr_off_.assign(n + 1, 0);
 
1224
  }
1225
  };
1226
 
1227
+ // ---------------------------------------------------------------------------
1228
+ // v3.2 build_semantics — defined outside the class for OMP clarity.
1229
+ // Deterministic end to end: lexical hashing is a pure function of the string;
1230
+ // the grounding passes iterate node ids ascending; the neighbour search
1231
+ // parallelizes over ROWS (each row's top-k depends only on that row), with
1232
+ // ties broken by (cosine desc, neighbour id asc).
1233
+ // ---------------------------------------------------------------------------
1234
+ inline void Substrate::build_semantics(int threads) {
1235
+ const std::size_t n = node_count();
1236
+ semvecs_.clear(); sem_edges_.clear(); sem_off_.clear(); sem_edge_count_ = 0;
1237
+ if (n == 0) return;
1238
+ // Cost guard: the neighbour search is O(n^2 * dims). Dedicated fabrics are
1239
+ // 10^3..10^4 nodes (seconds); a 43k-node fabric is minutes once. Beyond
1240
+ // 65k the build is refused — semantics stays absent, the model stays
1241
+ // fully usable (honest scope, not silent failure).
1242
+ if (n > 65000) return;
1243
+ (void)threads;
1244
+ #if defined(_OPENMP)
1245
+ if (threads > 0) omp_set_num_threads(threads);
1246
+ #endif
1247
+
1248
+ // Step 1 — LEXICAL LAYER: signed character-trigram hashing, L2-normalized.
1249
+ semvecs_.assign(n * SEM_DIMS, 0.0f);
1250
+ for (std::size_t i = 0; i < n; ++i) {
1251
+ float* v = &semvecs_[i * SEM_DIMS];
1252
+ const std::string& s = concept_of(static_cast<NodeId>(i));
1253
+ auto bump = [&](const std::string& g, float w) {
1254
+ std::uint64_t h = 1469598103934665603ull;
1255
+ for (unsigned char c : g) { h ^= c; h *= 1099511628211ull; }
1256
+ const std::size_t bucket = static_cast<std::size_t>(h % SEM_DIMS);
1257
+ const float sign = ((h >> 40) & 1u) ? 1.0f : -1.0f;
1258
+ v[bucket] += sign * w;
1259
+ };
1260
+ if (s.size() < 3) {
1261
+ bump(s, 2.0f);
1262
+ } else {
1263
+ for (std::size_t p = 0; p + 3 <= s.size(); ++p) bump(s.substr(p, 3), 1.0f);
1264
+ bump(s, 1.5f); // whole-token identity, too
1265
+ }
1266
+ float n2 = 0.0f;
1267
+ for (std::size_t k = 0; k < SEM_DIMS; ++k) n2 += v[k] * v[k];
1268
+ if (n2 > 0.0f) {
1269
+ const float inv = 1.0f / std::sqrt(n2);
1270
+ for (std::size_t k = 0; k < SEM_DIMS; ++k) v[k] *= inv;
1271
+ }
1272
+ }
1273
+
1274
+ // Step 2 — FABRIC GROUNDING: two smoothing passes over the Hebbian lanes.
1275
+ // v_i <- normalize(v_i + beta * lane-weighted mean of v_j). This is how
1276
+ // the fabric's own co-occurrence structure shapes the vectors — meaning
1277
+ // diffusing along the lanes, not a fit.
1278
+ for (int pass = 0; pass < 2; ++pass) {
1279
+ std::vector<float> nx(n * SEM_DIMS, 0.0f);
1280
+ for (std::size_t i = 0; i < n; ++i) {
1281
+ const float* v = &semvecs_[i * SEM_DIMS];
1282
+ float* o = &nx[i * SEM_DIMS];
1283
+ for (std::size_t k = 0; k < SEM_DIMS; ++k) o[k] = v[k];
1284
+ auto it = out_.find(static_cast<NodeId>(i));
1285
+ if (it != out_.end() && !it->second.empty()) {
1286
+ float wsum = 0.0f;
1287
+ float avg[SEM_DIMS];
1288
+ for (std::size_t k = 0; k < SEM_DIMS; ++k) avg[k] = 0.0f;
1289
+ for (const auto& l : it->second) {
1290
+ const float* u = &semvecs_[l.first * SEM_DIMS];
1291
+ for (std::size_t k = 0; k < SEM_DIMS; ++k) avg[k] += l.second * u[k];
1292
+ wsum += l.second;
1293
+ }
1294
+ if (wsum > 0.0f)
1295
+ for (std::size_t k = 0; k < SEM_DIMS; ++k)
1296
+ o[k] = v[k] + cfg_.sem_beta * (avg[k] / wsum);
1297
+ }
1298
+ float n2 = 0.0f;
1299
+ for (std::size_t k = 0; k < SEM_DIMS; ++k) n2 += o[k] * o[k];
1300
+ if (n2 > 0.0f) {
1301
+ const float inv = 1.0f / std::sqrt(n2);
1302
+ for (std::size_t k = 0; k < SEM_DIMS; ++k) o[k] *= inv;
1303
+ }
1304
+ }
1305
+ semvecs_.swap(nx);
1306
+ }
1307
+ (void)omega_dir(); // materialize the fixed omega axis once
1308
+
1309
+ // Step 3 — RESONANCE EDGES: top-k cosine neighbours with cos >= theta.
1310
+ const int kmax = std::max(1, cfg_.sem_neighbors);
1311
+ std::vector<std::vector<std::pair<float, NodeId>>> per(n);
1312
+ #if defined(_OPENMP)
1313
+ #pragma omp parallel for schedule(static)
1314
+ #endif
1315
+ for (std::ptrdiff_t ii = 0; ii < static_cast<std::ptrdiff_t>(n); ++ii) {
1316
+ const std::size_t i = static_cast<std::size_t>(ii);
1317
+ const float* vi = &semvecs_[i * SEM_DIMS];
1318
+ float vi2 = 0.0f;
1319
+ for (std::size_t d = 0; d < SEM_DIMS; ++d) vi2 += vi[d] * vi[d];
1320
+ if (vi2 <= 0.0f) continue; // dark node: no resonance
1321
+ std::vector<std::pair<float, NodeId>> best; // kept sorted: cos desc, id asc
1322
+ best.reserve(static_cast<std::size_t>(kmax) + 1);
1323
+ auto better = [](const std::pair<float, NodeId>& x, const std::pair<float, NodeId>& y) {
1324
+ return x.first != y.first ? x.first > y.first : x.second < y.second;
1325
+ };
1326
+ for (std::size_t j = 0; j < n; ++j) {
1327
+ if (j == i) continue;
1328
+ const float* vj = &semvecs_[j * SEM_DIMS];
1329
+ float dot = 0.0f;
1330
+ for (std::size_t d = 0; d < SEM_DIMS; ++d) dot += vi[d] * vj[d];
1331
+ if (dot < cfg_.sem_theta) continue;
1332
+ if (best.size() < static_cast<std::size_t>(kmax)) {
1333
+ best.emplace_back(dot, static_cast<NodeId>(j));
1334
+ std::sort(best.begin(), best.end(), better);
1335
+ } else if (better({dot, static_cast<NodeId>(j)}, best.back())) {
1336
+ best.back() = {dot, static_cast<NodeId>(j)};
1337
+ std::sort(best.begin(), best.end(), better);
1338
+ }
1339
+ }
1340
+ per[i] = std::move(best);
1341
+ }
1342
+ sem_off_.assign(n + 1, 0);
1343
+ std::size_t running = 0;
1344
+ for (std::size_t i = 0; i < n; ++i) {
1345
+ sem_off_[i] = running;
1346
+ running += per[i].size();
1347
+ }
1348
+ sem_off_[n] = running;
1349
+ sem_edges_.reserve(running);
1350
+ for (std::size_t i = 0; i < n; ++i)
1351
+ for (const auto& p : per[i]) sem_edges_.emplace_back(p.second, p.first);
1352
+ sem_edge_count_ = running;
1353
+ }
1354
+
1355
  // ---------------------------------------------------------------------------
1356
  // Tokenizer — plain lexical split (I/O concern, not pattern matching):
1357
  // lowercase, split on non-alphanumeric, keep tokens of length 2..24.
engine/core/syfox.hpp CHANGED
@@ -20,6 +20,7 @@
20
  #include "si_substrate.hpp"
21
  #include "normalize.hpp"
22
  #include "ngram.hpp"
 
23
 
24
  #include <algorithm>
25
  #include <cmath>
@@ -33,7 +34,7 @@
33
 
34
  namespace syfox {
35
 
36
- inline const char* VERSION = "3.1.2";
37
 
38
  // ---------------------------------------------------------------------------
39
  // v2.2 boundary injection protocol — sub-word bridges for corrupted forms.
@@ -101,6 +102,9 @@ struct Usage {
101
  int settle_passes = 0;
102
  float settled_energy = 0.0f;
103
  bool calibrated = false;
 
 
 
104
  };
105
 
106
  struct Calibration {
@@ -157,9 +161,14 @@ public:
157
  bool energy_norm() const { return energy_norm_; }
158
 
159
  // -- model persistence ----------------------------------------------------
160
- void save_model(const std::string& dir) const {
161
  std::string cmd_mkdir = "mkdir -p '" + dir + "'";
162
  (void)std::system(cmd_mkdir.c_str());
 
 
 
 
 
163
  si_.save(dir + "/substrate.bin");
164
  std::ofstream cf(dir + "/calibration.json");
165
  cf << calib_.to_json().dump();
@@ -170,7 +179,11 @@ public:
170
  {"lanes", static_cast<double>(si_.lane_count())},
171
  {"evidence_records", static_cast<double>(si_.evidence_count())},
172
  {"teach_events", static_cast<double>(teach_seq_)},
173
- {"contradictions", static_cast<double>(conflicts_.size())}}).dump();
 
 
 
 
174
  // v3 Milestone 3: the audit trail. conflicts.jsonl = every detected
175
  // contradiction; lessons_index.jsonl = state-hash -> outcome index
176
  // (so a LATER learn invocation still detects contradictions against
@@ -224,7 +237,81 @@ public:
224
  }
225
  }
226
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  }
 
 
228
 
229
  // set the audit context tag recorded into the lane evidence ledger
230
  void set_context(const std::string& c) { context_ = c; }
@@ -312,6 +399,25 @@ public:
312
  if (si_.has(g))
313
  si_.bind(si_.find(w), si_.find(g), si_.config().learn_eta * 0.5f * eta);
314
  si_.hebbian_lesson(state, outcome, eta);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  // Milestone 3: record the support evidence for every state->outcome
316
  // lane this lesson just strengthened (bookkeeping; the ledger never
317
  // feeds back into the field).
@@ -514,6 +620,39 @@ public:
514
  usage.state_tokens = words.size();
515
 
516
  si_.reset_field();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
517
  si_.inject(words, state_dose(words)); // words at the (gained) substrate level
518
  if (si::norm::grams_enabled()) { // bridges for corrupted forms, gated
519
  std::vector<std::string> bridges;
@@ -799,6 +938,36 @@ private:
799
  energies.push_back(probe_energy(v.as_str(), ""));
800
  }
801
  if (labels.empty()) { a.deferred = true; a.reason = "no_options"; return; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
802
  std::vector<float> p;
803
  softmax_ps(energies, p, calib_.choice_temperature);
804
  std::size_t best = std::max_element(p.begin(), p.end()) - p.begin();
@@ -908,6 +1077,17 @@ private:
908
  Calibration calib_;
909
  bool energy_norm_ = false; // Milestone-1 gain knob (default off)
910
  std::unordered_set<std::uint64_t> lesson_hashes_; // Milestone-2 dedup memory
 
 
 
 
 
 
 
 
 
 
 
911
  // Milestone-3 audit state
912
  std::string context_ = "default";
913
  std::uint64_t teach_seq_ = 0;
 
20
  #include "si_substrate.hpp"
21
  #include "normalize.hpp"
22
  #include "ngram.hpp"
23
+ #include "recall.hpp"
24
 
25
  #include <algorithm>
26
  #include <cmath>
 
34
 
35
  namespace syfox {
36
 
37
+ inline const char* VERSION = "3.2.0";
38
 
39
  // ---------------------------------------------------------------------------
40
  // v2.2 boundary injection protocol — sub-word bridges for corrupted forms.
 
102
  int settle_passes = 0;
103
  float settled_energy = 0.0f;
104
  bool calibrated = false;
105
+ // v3.2 retrieval-by-default: the memories that primed this decision
106
+ // (label, resonance) pairs, strongest first; empty when retrieval off.
107
+ std::vector<std::pair<std::string, float>> retrieved;
108
  };
109
 
110
  struct Calibration {
 
161
  bool energy_norm() const { return energy_norm_; }
162
 
163
  // -- model persistence ----------------------------------------------------
164
+ void save_model(const std::string& dir) {
165
  std::string cmd_mkdir = "mkdir -p '" + dir + "'";
166
  (void)std::system(cmd_mkdir.c_str());
167
+ // v3.2: promote context signatures, then build the semantic field over
168
+ // the final fabric. Both are deterministic; both persist into the
169
+ // substrate v4 tail so decide-time needs no rebuild.
170
+ si_.finalize_contexts();
171
+ si_.build_semantics();
172
  si_.save(dir + "/substrate.bin");
173
  std::ofstream cf(dir + "/calibration.json");
174
  cf << calib_.to_json().dump();
 
179
  {"lanes", static_cast<double>(si_.lane_count())},
180
  {"evidence_records", static_cast<double>(si_.evidence_count())},
181
  {"teach_events", static_cast<double>(teach_seq_)},
182
+ {"contradictions", static_cast<double>(conflicts_.size())},
183
+ {"semantics", si_.has_semantics()},
184
+ {"sem_edges", static_cast<double>(si_.resonance_edge_count())},
185
+ {"lane_contexts", static_cast<double>(si_.lane_context_count())},
186
+ {"retrieval_memories", static_cast<double>(memories_.size())}}).dump();
187
  // v3 Milestone 3: the audit trail. conflicts.jsonl = every detected
188
  // contradiction; lessons_index.jsonl = state-hash -> outcome index
189
  // (so a LATER learn invocation still detects contradictions against
 
237
  }
238
  }
239
  }
240
+ // v3.2: semantic hierarchy (Stage 3) ships as hierarchy.json in the
241
+ // model dir; absent file = single-stage readout, exactly as before.
242
+ load_hierarchy(dir + "/hierarchy.json");
243
+ // v3.2 retrieval BY DEFAULT: a memories.jsonl shipped in the model dir
244
+ // is loaded and fingerprinted once (settled-field cosines are then
245
+ // free at decide time). No file => retrieval is inert, behavior of
246
+ // every pre-3.2 model unchanged. --no-retrieval disables at runtime.
247
+ {
248
+ std::ifstream f(dir + "/memories.jsonl");
249
+ if (f) {
250
+ std::vector<recall::Memory> mems;
251
+ std::string line;
252
+ while (std::getline(f, line)) {
253
+ if (line.empty()) continue;
254
+ try {
255
+ sfx::JV r = sfx::JV::parse(line);
256
+ recall::Memory m;
257
+ m.label = r.at("label").as_str();
258
+ m.state = si::norm::normalize(r.at("state").as_str());
259
+ if (!m.label.empty() && !m.state.empty()) mems.push_back(std::move(m));
260
+ } catch (const std::exception&) { /* skip malformed line */ }
261
+ }
262
+ if (!mems.empty()) set_memories(std::move(mems));
263
+ }
264
+ }
265
+ }
266
+
267
+ // -- v3.2 retrieval-by-default (associative priming) ------------------------
268
+ // Memories are NOT a second classifier: each memory is fingerprinted by
269
+ // its own settled field (recall.hpp Hopfield-style resonance), and the
270
+ // top-k resonating memories inject their OUTCOME tokens at a faint dose
271
+ // before the state settles — a physical prior from lived experience.
272
+ // Deterministic: fingerprints are fixed at load, the query fingerprint
273
+ // is a pure function of the state, ties break by memory order.
274
+ void set_memories(std::vector<recall::Memory> mems) {
275
+ memories_ = std::move(mems);
276
+ memory_fps_.clear();
277
+ memory_fps_.reserve(memories_.size());
278
+ for (const auto& m : memories_)
279
+ memory_fps_.push_back(recall::fingerprint(si_, m.state));
280
+ retrieval_on_ = true;
281
+ }
282
+ void set_retrieval(bool on) { retrieval_on_ = on; }
283
+ bool retrieval_on() const { return retrieval_on_; }
284
+ void set_retrieval_topk(int k) { retrieval_topk_ = std::max(0, k); }
285
+ void set_retrieval_dose(float d) { retrieval_dose_ = std::max(0.0f, d); }
286
+ const std::vector<recall::Memory>& memories() const { return memories_; }
287
+
288
+ // -- v3.2 Stage 3: semantic hierarchy (readout-side two-stage) --------------
289
+ // hierarchy.json: {"intents": {"c42": "h_card"}, "categories":
290
+ // {"h_card": {"criteria": "..."}}, "floor": 0.35}. Both levels are
291
+ // TRAINED anchors in the same fabric; at decide, stage 1 reads category
292
+ // energies, stage 2 scales each intent candidate by its category's
293
+ // normalized score (floor keeps every candidate physically alive).
294
+ bool load_hierarchy(const std::string& path) {
295
+ std::ifstream f(path);
296
+ if (!f) return false;
297
+ std::string buf((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
298
+ try {
299
+ sfx::JV j = sfx::JV::parse(buf);
300
+ hier_of_.clear(); hier_cat_criteria_.clear();
301
+ if (j.has("intents") && j.at("intents").is_obj())
302
+ for (const auto& kv : j.at("intents").obj)
303
+ hier_of_[kv.first] = kv.second.as_str();
304
+ if (j.has("categories") && j.at("categories").is_obj())
305
+ for (const auto& kv : j.at("categories").obj)
306
+ hier_cat_criteria_[kv.first] = kv.second.has("criteria")
307
+ ? kv.second.at("criteria").as_str() : std::string();
308
+ hier_floor_ = static_cast<float>(j.has("floor") ? j.at("floor").as_num(0.35) : 0.35);
309
+ hier_on_ = !hier_of_.empty() && !hier_cat_criteria_.empty();
310
+ } catch (const std::exception&) { hier_on_ = false; }
311
+ return hier_on_;
312
  }
313
+ void set_hierarchy(bool on) { hier_on_ = on; }
314
+ bool hierarchy_on() const { return hier_on_; }
315
 
316
  // set the audit context tag recorded into the lane evidence ledger
317
  void set_context(const std::string& c) { context_ = c; }
 
399
  if (si_.has(g))
400
  si_.bind(si_.find(w), si_.find(g), si_.config().learn_eta * 0.5f * eta);
401
  si_.hebbian_lesson(state, outcome, eta);
402
+ // v3.2 Stage 2: context-signature accumulation on the state->outcome
403
+ // lanes. The row's own tokens (state + criteria words) are the lane's
404
+ // context evidence; counts that survive pruning (>= 2 lessons) become
405
+ // the lane's required set at save time, and cross-lane diffs become
406
+ // forbidden words. Bookkeeping only — the field is untouched here.
407
+ {
408
+ std::vector<si::NodeId> ctx_ids;
409
+ for (const auto& u : words) {
410
+ if (si_.has(u)) ctx_ids.push_back(si_.find(u));
411
+ if (ctx_ids.size() >= 16) break;
412
+ }
413
+ if (!ctx_ids.empty())
414
+ for (const auto& a : state)
415
+ if (si_.has(a))
416
+ for (const auto& b : outcome)
417
+ if (si_.has(b))
418
+ for (const si::NodeId u : ctx_ids)
419
+ si_.add_ctx_support(si_.find(a), si_.find(b), u);
420
+ }
421
  // Milestone 3: record the support evidence for every state->outcome
422
  // lane this lesson just strengthened (bookkeeping; the ledger never
423
  // feeds back into the field).
 
620
  usage.state_tokens = words.size();
621
 
622
  si_.reset_field();
623
+ // v3.2 retrieval-by-default: if the model ships memories, the query's
624
+ // settled-field fingerprint ranks them (Hopfield-style resonance,
625
+ // recall.hpp) and the top-k outcomes inject a faint prime dose before
626
+ // the state settles. The prime is part of the decision composition:
627
+ // same state + same memories => same field, bit for bit. No memories
628
+ // (or --no-retrieval) => this block is skipped entirely.
629
+ if (retrieval_on_ && !memories_.empty() && retrieval_topk_ > 0) {
630
+ const std::vector<float> fq = recall::fingerprint(si_, words);
631
+ struct Hit { float r; std::size_t idx; };
632
+ std::vector<Hit> hits;
633
+ hits.reserve(memories_.size());
634
+ for (std::size_t m = 0; m < memories_.size(); ++m) {
635
+ const std::vector<float>& fm = memory_fps_[m];
636
+ float dot = 0.0f;
637
+ const std::size_t nn = std::min(fq.size(), fm.size());
638
+ for (std::size_t i = 0; i < nn; ++i) dot += fq[i] * fm[i];
639
+ hits.push_back({dot, m});
640
+ }
641
+ std::stable_sort(hits.begin(), hits.end(),
642
+ [](const Hit& x, const Hit& y) { return x.r > y.r; });
643
+ const std::size_t kk = std::min<std::size_t>(static_cast<std::size_t>(retrieval_topk_), hits.size());
644
+ si_.reset_field(); // fresh field: prime + state only
645
+ const float dose = retrieval_dose_ * si_.config().inject_energy;
646
+ for (std::size_t i = 0; i < kk; ++i) {
647
+ if (hits[i].r <= 0.01f) continue; // a whisper of resonance primes nothing
648
+ const recall::Memory& m = memories_[hits[i].idx];
649
+ std::vector<std::string> prime;
650
+ for (const auto& t : si::norm::normalize(m.label))
651
+ if (si_.has(t)) prime.push_back(t);
652
+ if (!prime.empty()) si_.inject(prime, dose);
653
+ usage.retrieved.emplace_back(m.label, hits[i].r);
654
+ }
655
+ }
656
  si_.inject(words, state_dose(words)); // words at the (gained) substrate level
657
  if (si::norm::grams_enabled()) { // bridges for corrupted forms, gated
658
  std::vector<std::string> bridges;
 
938
  energies.push_back(probe_energy(v.as_str(), ""));
939
  }
940
  if (labels.empty()) { a.deferred = true; a.reason = "no_options"; return; }
941
+ // v3.2 Stage 3 — semantic hierarchy gating (readout-side): when the
942
+ // model ships a hierarchy and the candidates carry categories, stage-1
943
+ // category energies scale the stage-2 intent energies. Deterministic,
944
+ // physics-read-only: the settled field is measured, never rewritten.
945
+ if (hier_on_ && !hier_of_.empty()) {
946
+ std::map<std::string, float> cat_e;
947
+ float max_cat = 0.0f;
948
+ bool any = false;
949
+ for (const auto& l : labels) {
950
+ auto it = hier_of_.find(l);
951
+ if (it == hier_of_.end()) continue;
952
+ if (cat_e.count(it->second) == 0) {
953
+ auto cit = hier_cat_criteria_.find(it->second);
954
+ const float e = (cit != hier_cat_criteria_.end())
955
+ ? probe_energy(it->second, cit->second) : 0.0f;
956
+ cat_e[it->second] = e;
957
+ }
958
+ max_cat = std::max(max_cat, cat_e[it->second]);
959
+ any = true;
960
+ }
961
+ if (any && max_cat > 0.0f) {
962
+ for (std::size_t i = 0; i < labels.size(); ++i) {
963
+ auto it = hier_of_.find(labels[i]);
964
+ if (it == hier_of_.end()) continue;
965
+ const float gate = hier_floor_
966
+ + (1.0f - hier_floor_) * (cat_e[it->second] / max_cat);
967
+ energies[i] *= gate;
968
+ }
969
+ }
970
+ }
971
  std::vector<float> p;
972
  softmax_ps(energies, p, calib_.choice_temperature);
973
  std::size_t best = std::max_element(p.begin(), p.end()) - p.begin();
 
1077
  Calibration calib_;
1078
  bool energy_norm_ = false; // Milestone-1 gain knob (default off)
1079
  std::unordered_set<std::uint64_t> lesson_hashes_; // Milestone-2 dedup memory
1080
+ // v3.2 retrieval-by-default state
1081
+ std::vector<recall::Memory> memories_;
1082
+ std::vector<std::vector<float>> memory_fps_; // settled-field fingerprints, fixed at load
1083
+ bool retrieval_on_ = true; // default ON (inert until memories exist)
1084
+ int retrieval_topk_ = 5;
1085
+ float retrieval_dose_ = 0.30f; // prime dose as a fraction of inject_energy
1086
+ // v3.2 Stage 3 hierarchy state
1087
+ std::map<std::string, std::string> hier_of_; // intent anchor -> category anchor
1088
+ std::map<std::string, std::string> hier_cat_criteria_; // category anchor -> criteria text
1089
+ float hier_floor_ = 0.35f;
1090
+ bool hier_on_ = false;
1091
  // Milestone-3 audit state
1092
  std::string context_ = "default";
1093
  std::uint64_t teach_seq_ = 0;
engine/src/rebuild_sem.cpp ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // load a model dir, rebuild its semantic field, save to a NEW dir (no retrain)
2
+ #include "core/syfox.hpp"
3
+ #include <chrono>
4
+ #include <cstdio>
5
+ int main(int argc, char** argv) {
6
+ if (argc < 3) { std::fprintf(stderr, "usage: rebuild_sem SRC DST\n"); return 2; }
7
+ syfox::Engine eng;
8
+ eng.load_model(argv[1]);
9
+ const auto t0 = std::chrono::steady_clock::now();
10
+ eng.save_model(argv[2]); // finalize_contexts + build_semantics + save
11
+ const auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(
12
+ std::chrono::steady_clock::now() - t0).count();
13
+ std::printf("rebuilt %s -> %s (%lld ms, nodes %zu, sem %d, edges %zu, ctx %zu)\n",
14
+ argv[1], argv[2], (long long)ms, eng.substrate().node_count(),
15
+ (int)eng.substrate().has_semantics(), eng.substrate().resonance_edge_count(),
16
+ eng.substrate().lane_context_count());
17
+ return 0;
18
+ }
engine/src/syfox_cli.cpp CHANGED
@@ -70,12 +70,26 @@ struct Args {
70
  bool state_file = false, questions_file = false;
71
  // SI-faithful selection modes (off by default; never persisted into the model)
72
  bool salience_gating = false, miller_window = false;
 
 
 
 
 
 
 
73
  };
74
 
75
  // Apply the CLI mode overrides after load_model(). Mode-neutral by design:
76
  // substrate.bin stays untouched, flags live only for this process.
77
  void apply_modes(syfox::Engine& eng, const Args& a) {
78
  eng.substrate().set_source_modes(a.salience_gating, a.miller_window);
 
 
 
 
 
 
 
79
  // v3 Milestone 5: --threads N controls deterministic parallel settle on
80
  // OMP builds (bit-identical to sequential; test-verified). N=1 forces the
81
  // sequential path; N=0 leaves the default. Non-OMP builds ignore it.
@@ -210,23 +224,30 @@ void cmd_learn(const Args& a) {
210
  syfox::Engine eng;
211
  eng.load_model(dir); // incremental if exists
212
  eng.set_context(dir); // audit context tag (M3)
213
- for (const auto* exp : epoch_rows) {
214
- const sfx::JV& qs = exp->at("questions");
215
- const sfx::JV& labels = exp->at("labels");
216
- const std::string state = exp->at("state").as_str();
217
- for (const auto& qkv : qs.obj) {
218
- const sfx::JV& q = qkv.second;
219
- std::string type = q.at("type").as_str();
220
- std::string label = labels.at(qkv.first).as_str();
221
- bool learned = false;
222
- if (type == "choice" || type == "score")
223
- eng.learn_example(state, q.at("instructions").as_str(),
224
- outcome_text(q, label), a.augment, lp, &learned);
225
- else if (type == "noul")
226
- eng.learn_noul(state, q.at("instructions").as_str(),
227
- label == "true", a.augment, lp, &learned);
228
- ++lessons;
229
- if (!learned) ++skipped;
 
 
 
 
 
 
 
230
  }
231
  }
232
  eng.save_model(dir);
@@ -377,6 +398,14 @@ sfx::JV answers_to_json(const std::vector<syfox::Answer>& ans, const syfox::Usag
377
  {"engine", std::string("syfox-") + syfox::VERSION},
378
  {"core", "si-substrate"},
379
  };
 
 
 
 
 
 
 
 
380
  return sfx::JV(sfx::JVObj{{"answers", sfx::JV(out)}, {"usage", sfx::JV(usage)}});
381
  }
382
 
@@ -386,11 +415,78 @@ void cmd_decide(const Args& a) {
386
  sfx::JV questions = sfx::JV::parse(qtext);
387
  if (!questions.is_obj()) { std::cerr << "syfox: questions must be a JSON object\n"; std::exit(2); }
388
  std::string lang_note;
389
- const std::string model_dir = route_model(a, state, lang_note, false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  syfox::Engine eng;
391
  eng.load_model(model_dir);
392
  apply_modes(eng, a);
393
  if (a.energy_norm) eng.set_energy_norm(true); // Milestone-1 gain knob
 
 
 
 
 
 
 
 
 
 
 
 
394
  syfox::Usage u;
395
  auto answers = eng.decide(state, questions, u);
396
  u.calibrated = eng.calibration().fitted; // decide() resets Usage; set after
@@ -415,6 +511,7 @@ void cmd_decide(const Args& a) {
415
  }
416
  sfx::JV out = answers_to_json(answers, u);
417
  if (!lang_note.empty()) out.obj["lang_note"] = sfx::JV(lang_note);
 
418
  // v3 Milestone 3: machine-auditable evidence — supporting lanes with
419
  // provenance, plus any contradiction records for this exact state.
420
  if (a.evidence)
@@ -518,7 +615,14 @@ void cmd_stats(const Args& a) {
518
  {"noul_a", eng.calibration().noul_a},
519
  {"noul_b", eng.calibration().noul_b},
520
  {"salience_gating", sfx::JV(eng.substrate().config().salience_gating)},
521
- {"miller_window", sfx::JV(eng.substrate().config().miller_window)}}).dump() << "\n";
 
 
 
 
 
 
 
522
  }
523
 
524
  // ---------------------------------------------------------------------------
@@ -1106,7 +1210,35 @@ void usage_exit() {
1106
  " instead of raw energy\n"
1107
  " --miller-window live source cap drawn from [source_cap-4, source_cap]\n"
1108
  " per decision (= [20,24] at the default cap 24;\n"
1109
- " TSDA live_cap lineage, SI samples [5,9] at cap 9)\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1110
  std::exit(2);
1111
  }
1112
 
@@ -1169,6 +1301,13 @@ int main(int argc, char** argv) {
1169
  else if (k == "--seed") { if (i + 1 >= argc) usage_exit(); a.seed = std::strtoull(argv[++i], nullptr, 0); }
1170
  else if (k == "--salience-gating") a.salience_gating = true;
1171
  else if (k == "--miller-window") a.miller_window = true;
 
 
 
 
 
 
 
1172
  else usage_exit();
1173
  }
1174
  // v2.1 (P4): one synonym table for the whole process. --synonyms wins;
 
70
  bool state_file = false, questions_file = false;
71
  // SI-faithful selection modes (off by default; never persisted into the model)
72
  bool salience_gating = false, miller_window = false;
73
+ // v3.2 semantic layer + retrieval-by-default + two-stage router
74
+ bool no_semantics = false; // --no-semantics: runtime kill switch for the semantic field
75
+ bool no_retrieval = false; // --no-retrieval: skip associative priming
76
+ bool no_hierarchy = false; // --no-hierarchy: skip stage-1 category gating
77
+ long retrieval_topk = -1; // --retrieval-topk N (-1 = engine default 5)
78
+ float retrieval_dose = 0; // --retrieval-dose F (0 = engine default 0.30)
79
+ std::string router; // --router DIR: stage-1 domain fabric (router.json maps domains)
80
  };
81
 
82
  // Apply the CLI mode overrides after load_model(). Mode-neutral by design:
83
  // substrate.bin stays untouched, flags live only for this process.
84
  void apply_modes(syfox::Engine& eng, const Args& a) {
85
  eng.substrate().set_source_modes(a.salience_gating, a.miller_window);
86
+ // v3.2 semantic layer knobs: the field is ON whenever the model ships it
87
+ // (substrate v4 tail); the kill switches restore pre-3.2 behavior exactly.
88
+ eng.substrate().set_semantics(!a.no_semantics);
89
+ eng.set_retrieval(!a.no_retrieval);
90
+ if (a.retrieval_topk >= 0) eng.set_retrieval_topk(static_cast<int>(a.retrieval_topk));
91
+ if (a.retrieval_dose > 0) eng.set_retrieval_dose(a.retrieval_dose);
92
+ if (a.no_hierarchy) eng.set_hierarchy(false);
93
  // v3 Milestone 5: --threads N controls deterministic parallel settle on
94
  // OMP builds (bit-identical to sequential; test-verified). N=1 forces the
95
  // sequential path; N=0 leaves the default. Non-OMP builds ignore it.
 
224
  syfox::Engine eng;
225
  eng.load_model(dir); // incremental if exists
226
  eng.set_context(dir); // audit context tag (M3)
227
+ // v3.1.3 BUGFIX: this loop MUST teach g.second (this script
228
+ // family's rows), not epoch_rows (the whole file). The v2.2 code
229
+ // iterated epoch_rows here, so every per-script substrate was
230
+ // taught the ENTIRE corpus — the opposite of the isolation the
231
+ // routing contract promises. Epochs are applied per family.
232
+ for (long e = 0; e < a.epochs; ++e) {
233
+ for (const auto* exp : g.second) {
234
+ const sfx::JV& qs = exp->at("questions");
235
+ const sfx::JV& labels = exp->at("labels");
236
+ const std::string state = exp->at("state").as_str();
237
+ for (const auto& qkv : qs.obj) {
238
+ const sfx::JV& q = qkv.second;
239
+ std::string type = q.at("type").as_str();
240
+ std::string label = labels.at(qkv.first).as_str();
241
+ bool learned = false;
242
+ if (type == "choice" || type == "score")
243
+ eng.learn_example(state, q.at("instructions").as_str(),
244
+ outcome_text(q, label), a.augment, lp, &learned);
245
+ else if (type == "noul")
246
+ eng.learn_noul(state, q.at("instructions").as_str(),
247
+ label == "true", a.augment, lp, &learned);
248
+ ++lessons;
249
+ if (!learned) ++skipped;
250
+ }
251
  }
252
  }
253
  eng.save_model(dir);
 
398
  {"engine", std::string("syfox-") + syfox::VERSION},
399
  {"core", "si-substrate"},
400
  };
401
+ if (!u.retrieved.empty()) {
402
+ sfx::JVArr ret;
403
+ for (const auto& r : u.retrieved)
404
+ ret.push_back(sfx::JV(sfx::JVObj{
405
+ {"label", sfx::JV(r.first)},
406
+ {"resonance", std::round(r.second * 1000.0f) / 1000.0f}}));
407
+ usage["retrieval"] = sfx::JV(ret); // v3.2: memories that primed this decision
408
+ }
409
  return sfx::JV(sfx::JVObj{{"answers", sfx::JV(out)}, {"usage", sfx::JV(usage)}});
410
  }
411
 
 
415
  sfx::JV questions = sfx::JV::parse(qtext);
416
  if (!questions.is_obj()) { std::cerr << "syfox: questions must be a JSON object\n"; std::exit(2); }
417
  std::string lang_note;
418
+ std::string model_dir = route_model(a, state, lang_note, false);
419
+ sfx::JVObj route_report;
420
+ // -- v3.2 two-stage physics router ---------------------------------------
421
+ // Stage 1: a SMALL dedicated router fabric (500-node class, one anchor per
422
+ // domain) settles the state and picks the domain anchor — pure field
423
+ // dynamics, same substrate physics, no classifier.
424
+ // Stage 2: the domain model mapped in the router's router.json (models:
425
+ // {anchor: model-dir}) decides the actual questions; --model stays as the
426
+ // fallback domain layer when the mapping misses. Both stages are
427
+ // independent SI settles; the route is disclosed in the output.
428
+ if (!a.router.empty()) {
429
+ syfox::Engine reng;
430
+ reng.load_model(a.router);
431
+ apply_modes(reng, a);
432
+ if (a.energy_norm) reng.set_energy_norm(true); // M1 gain for the router too
433
+ sfx::JV rschema(sfx::JVObj{});
434
+ {
435
+ std::ifstream rf(a.router + "/router.json");
436
+ if (rf) {
437
+ std::string buf((std::istreambuf_iterator<char>(rf)), std::istreambuf_iterator<char>());
438
+ rschema = sfx::JV::parse(buf);
439
+ }
440
+ }
441
+ if (!rschema.has("anchors") || !rschema.at("anchors").is_obj()) {
442
+ std::cerr << "syfox: router model " << a.router << " lacks router.json anchors\n";
443
+ std::exit(2);
444
+ }
445
+ sfx::JV rqs(sfx::JVObj{
446
+ {"route", sfx::JV(sfx::JVObj{
447
+ {"type", sfx::JV("choice")},
448
+ {"instructions", sfx::JV("which domain does this state belong to")},
449
+ {"criteria", rschema.at("anchors")}})}});
450
+ syfox::Usage ru;
451
+ auto rans = reng.decide(state, rqs, ru);
452
+ ru.calibrated = reng.calibration().fitted;
453
+ const syfox::Answer& ra = rans[0];
454
+ sfx::JVObj rj;
455
+ rj["anchor"] = sfx::JV(ra.deferred ? std::string() : ra.choice);
456
+ rj["confidence"] = sfx::JV(std::round(ra.confidence * 1000.0f) / 1000.0f);
457
+ rj["deferred"] = sfx::JV(ra.deferred);
458
+ std::vector<std::pair<float, std::string>> ranked;
459
+ for (const auto& p : ra.probabilities) ranked.emplace_back(p.second, p.first);
460
+ std::sort(ranked.begin(), ranked.end(), [](const auto& x, const auto& y){ return x.first > y.first; });
461
+ sfx::JVArr top3;
462
+ for (std::size_t i = 0; i < ranked.size() && i < 3; ++i)
463
+ top3.push_back(sfx::JV(sfx::JVObj{
464
+ {"anchor", sfx::JV(ranked[i].second)},
465
+ {"p", sfx::JV(std::round(ranked[i].first * 1000.0f) / 1000.0f)}}));
466
+ rj["top"] = sfx::JV(top3);
467
+ if (rschema.has("models") && rschema.at("models").is_obj()
468
+ && !ra.deferred && rschema.at("models").has(ra.choice)) {
469
+ model_dir = rschema.at("models").at(ra.choice).as_str();
470
+ rj["model"] = sfx::JV(model_dir);
471
+ }
472
+ route_report = std::move(rj);
473
+ }
474
  syfox::Engine eng;
475
  eng.load_model(model_dir);
476
  apply_modes(eng, a);
477
  if (a.energy_norm) eng.set_energy_norm(true); // Milestone-1 gain knob
478
+ // --memories FILE (v3.2): explicit memory store for decide — overrides any
479
+ // model-dir memories.jsonl for this process. Rows: {"label":..., "state":...}.
480
+ if (!a.memories.empty()) {
481
+ std::vector<syfox::recall::Memory> mems;
482
+ for (const auto& r : load_jsonl(a.memories)) {
483
+ syfox::recall::Memory m;
484
+ m.label = r.at("label").as_str();
485
+ m.state = si::norm::normalize(r.at("state").as_str());
486
+ if (!m.label.empty() && !m.state.empty()) mems.push_back(std::move(m));
487
+ }
488
+ if (!mems.empty()) eng.set_memories(std::move(mems));
489
+ }
490
  syfox::Usage u;
491
  auto answers = eng.decide(state, questions, u);
492
  u.calibrated = eng.calibration().fitted; // decide() resets Usage; set after
 
511
  }
512
  sfx::JV out = answers_to_json(answers, u);
513
  if (!lang_note.empty()) out.obj["lang_note"] = sfx::JV(lang_note);
514
+ if (!route_report.empty()) out.obj["route"] = sfx::JV(route_report);
515
  // v3 Milestone 3: machine-auditable evidence — supporting lanes with
516
  // provenance, plus any contradiction records for this exact state.
517
  if (a.evidence)
 
615
  {"noul_a", eng.calibration().noul_a},
616
  {"noul_b", eng.calibration().noul_b},
617
  {"salience_gating", sfx::JV(eng.substrate().config().salience_gating)},
618
+ {"miller_window", sfx::JV(eng.substrate().config().miller_window)},
619
+ // v3.2 semantic layer + retrieval + hierarchy
620
+ {"semantics", sfx::JV(eng.substrate().has_semantics() && !a.no_semantics)},
621
+ {"sem_edges", static_cast<double>(eng.substrate().resonance_edge_count())},
622
+ {"lane_contexts", static_cast<double>(eng.substrate().lane_context_count())},
623
+ {"retrieval", sfx::JV(eng.retrieval_on() && !a.no_retrieval)},
624
+ {"retrieval_memories", static_cast<double>(eng.memories().size())},
625
+ {"hierarchy", sfx::JV(eng.hierarchy_on() && !a.no_hierarchy)}}).dump() << "\n";
626
  }
627
 
628
  // ---------------------------------------------------------------------------
 
1210
  " instead of raw energy\n"
1211
  " --miller-window live source cap drawn from [source_cap-4, source_cap]\n"
1212
  " per decision (= [20,24] at the default cap 24;\n"
1213
+ " TSDA live_cap lineage, SI samples [5,9] at cap 9)\n"
1214
+ "semantic layer (v3.2, deterministic, no ML — default ON for models saved\n"
1215
+ " by v3.2+; pre-v3.2 fabrics replay unchanged because they carry no\n"
1216
+ " semantic tail):\n"
1217
+ " Stage 1 omega_semantic: fixed scalar projection of each concept's\n"
1218
+ " 64-dim semantic vector (frequency encoding for resonance)\n"
1219
+ " Stage 2 context-sensitive lanes: lanes learn required/forbidden\n"
1220
+ " context words from the lessons that laid them; at settle a\n"
1221
+ " mismatched lane carries less (forbidden context x0.20,\n"
1222
+ " missing required x0.60..1.0 by match count)\n"
1223
+ " Stage 3 semantic hierarchy: hierarchy.json in the model dir; stage 1\n"
1224
+ " reads category anchors, stage 2 scales intent candidates\n"
1225
+ " (--no-hierarchy disables)\n"
1226
+ " Stage 4 semantic field: resonance edges (top-k cosine neighbours of\n"
1227
+ " the fabric-grounded vectors) leak a small energy share to\n"
1228
+ " semantically similar nodes at settle (conserved), and\n"
1229
+ " readout adds a semantic-neighbour term\n"
1230
+ " --no-semantics runtime kill switch for the whole layer\n"
1231
+ "retrieval by default (v3.2): decide consults associative memory — a\n"
1232
+ " memories.jsonl in the model dir (rows {\"label\":...,\"state\":...}) is\n"
1233
+ " fingerprinted once at load; each decide ranks memories by settled-field\n"
1234
+ " resonance and primes the field with the top-k outcomes at a faint dose\n"
1235
+ " (0.30 x inject). Deterministic. Flags: --memories FILE (explicit store),\n"
1236
+ " --retrieval-topk N (default 5), --retrieval-dose F, --no-retrieval.\n"
1237
+ "two-stage router (v3.2): decide --router DIR runs a small dedicated\n"
1238
+ " router fabric (one anchor per domain; router.json holds anchors +\n"
1239
+ " models mapping) as stage 1, then the mapped domain model decides —\n"
1240
+ " physics-based routing, no classifier. The route is disclosed in the\n"
1241
+ " output as route:{anchor,confidence,top,model}.\n";
1242
  std::exit(2);
1243
  }
1244
 
 
1301
  else if (k == "--seed") { if (i + 1 >= argc) usage_exit(); a.seed = std::strtoull(argv[++i], nullptr, 0); }
1302
  else if (k == "--salience-gating") a.salience_gating = true;
1303
  else if (k == "--miller-window") a.miller_window = true;
1304
+ // v3.2 semantic layer / retrieval / router
1305
+ else if (k == "--no-semantics") a.no_semantics = true;
1306
+ else if (k == "--no-retrieval") a.no_retrieval = true;
1307
+ else if (k == "--no-hierarchy") a.no_hierarchy = true;
1308
+ else if (k == "--retrieval-topk") { if (i + 1 >= argc) usage_exit(); a.retrieval_topk = std::strtol(argv[++i], nullptr, 10); }
1309
+ else if (k == "--retrieval-dose") { if (i + 1 >= argc) usage_exit(); a.retrieval_dose = std::strtof(argv[++i], nullptr); }
1310
+ else if (k == "--router") need(a.router);
1311
  else usage_exit();
1312
  }
1313
  // v2.1 (P4): one synonym table for the whole process. --synonyms wins;
engine/src/syfox_core.cpp CHANGED
@@ -9,6 +9,8 @@
9
  // v2.2 trigram lane policy -> syfox_engine_set_ngrams
10
  // v2.2 script routing -> syfox_detect_script
11
  // M3 machine-auditable evidence -> syfox_decide_ex(opts.evidence)
 
 
12
  //
13
  // No transformer, no classifier, no physics changes: si_substrate.hpp is
14
  // untouched; every knob here exists because the CLI exposes it too.
@@ -69,6 +71,27 @@ void syfox_engine_set_ngrams(SyFoxHandle* h, int on) {
69
  si::norm::grams_enabled() = (on != 0); // v2.2 trigram lanes
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  // -- script detection (v2.2 --lang auto) ------------------------------------
73
  // Returns a malloc'd slug ("latin", "bengali", ...) or "unknown".
74
  char* syfox_detect_script(const char* text) {
@@ -124,6 +147,14 @@ static std::string decide_json(SyFoxHandle* h, const char* state,
124
  {"calibrated", sfx::JV(u.calibrated)},
125
  {"engine", std::string("syfox-") + syfox::VERSION},
126
  {"core", "si-substrate"}};
 
 
 
 
 
 
 
 
127
  sfx::JVObj root{{"answers", sfx::JV(ans)}, {"usage", sfx::JV(usage)}};
128
  if (want_evidence) // M3: supporting lanes + provenance + contradictions
129
  root["evidence"] = h->eng->evidence_json(state, q, answers);
@@ -146,7 +177,9 @@ char* syfox_decide(SyFoxHandle* h, const char* state, const char* questions_json
146
  }
147
 
148
  // opts_json: {"evidence":bool, "energy_norm":bool, "salience_gating":bool,
149
- // "miller_window":bool, "ngrams":"on"|"off"}
 
 
150
  // Absent keys leave the current engine state untouched (sticky, CLI-equal).
151
  char* syfox_decide_ex(SyFoxHandle* h, const char* state, const char* questions_json,
152
  const char* opts_json) {
@@ -167,6 +200,11 @@ char* syfox_decide_ex(SyFoxHandle* h, const char* state, const char* questions_j
167
  if (g == "on") si::norm::grams_enabled() = true;
168
  if (g == "off") si::norm::grams_enabled() = false;
169
  }
 
 
 
 
 
170
  }
171
  } catch (...) { /* opts are optional; a bad opts object is ignored */ }
172
  }
@@ -185,6 +223,11 @@ char* syfox_engine_info(SyFoxHandle* h) {
185
  {"lanes", static_cast<double>(h->eng->substrate().lane_count())},
186
  {"evidence_records", static_cast<double>(h->eng->substrate().evidence_count())},
187
  {"calibrated", sfx::JV(h->eng->calibration().fitted)},
 
 
 
 
 
188
  {"version", std::string(syfox::VERSION)},
189
  {"core", "si-substrate"}};
190
  const std::string s = sfx::JV(o).dump();
 
9
  // v2.2 trigram lane policy -> syfox_engine_set_ngrams
10
  // v2.2 script routing -> syfox_detect_script
11
  // M3 machine-auditable evidence -> syfox_decide_ex(opts.evidence)
12
+ // v3.2 semantic layer + retrieval + hierarchy -> set_semantics / set_retrieval /
13
+ // set_retrieval_topk / set_retrieval_dose / set_hierarchy + opts keys
14
  //
15
  // No transformer, no classifier, no physics changes: si_substrate.hpp is
16
  // untouched; every knob here exists because the CLI exposes it too.
 
71
  si::norm::grams_enabled() = (on != 0); // v2.2 trigram lanes
72
  }
73
 
74
+ // -- v3.2 semantic layer / retrieval-by-default / hierarchy knobs -------------
75
+ void syfox_engine_set_semantics(SyFoxHandle* h, int on) {
76
+ if (h) h->eng->substrate().set_semantics(on != 0);
77
+ }
78
+
79
+ void syfox_engine_set_retrieval(SyFoxHandle* h, int on) {
80
+ if (h) h->eng->set_retrieval(on != 0);
81
+ }
82
+
83
+ void syfox_engine_set_retrieval_topk(SyFoxHandle* h, int topk) {
84
+ if (h) h->eng->set_retrieval_topk(topk);
85
+ }
86
+
87
+ void syfox_engine_set_retrieval_dose(SyFoxHandle* h, double dose) {
88
+ if (h) h->eng->set_retrieval_dose(static_cast<float>(dose));
89
+ }
90
+
91
+ void syfox_engine_set_hierarchy(SyFoxHandle* h, int on) {
92
+ if (h) h->eng->set_hierarchy(on != 0);
93
+ }
94
+
95
  // -- script detection (v2.2 --lang auto) ------------------------------------
96
  // Returns a malloc'd slug ("latin", "bengali", ...) or "unknown".
97
  char* syfox_detect_script(const char* text) {
 
147
  {"calibrated", sfx::JV(u.calibrated)},
148
  {"engine", std::string("syfox-") + syfox::VERSION},
149
  {"core", "si-substrate"}};
150
+ if (!u.retrieved.empty()) {
151
+ sfx::JVArr ret;
152
+ for (const auto& r : u.retrieved)
153
+ ret.push_back(sfx::JV(sfx::JVObj{
154
+ {"label", sfx::JV(r.first)},
155
+ {"resonance", std::round(r.second * 1000.0f) / 1000.0f}}));
156
+ usage["retrieval"] = sfx::JV(ret); // v3.2: priming memories
157
+ }
158
  sfx::JVObj root{{"answers", sfx::JV(ans)}, {"usage", sfx::JV(usage)}};
159
  if (want_evidence) // M3: supporting lanes + provenance + contradictions
160
  root["evidence"] = h->eng->evidence_json(state, q, answers);
 
177
  }
178
 
179
  // opts_json: {"evidence":bool, "energy_norm":bool, "salience_gating":bool,
180
+ // "miller_window":bool, "ngrams":"on"|"off",
181
+ // "semantics":bool, "retrieval":bool, "retrieval_topk":int,
182
+ // "retrieval_dose":num, "hierarchy":bool}
183
  // Absent keys leave the current engine state untouched (sticky, CLI-equal).
184
  char* syfox_decide_ex(SyFoxHandle* h, const char* state, const char* questions_json,
185
  const char* opts_json) {
 
200
  if (g == "on") si::norm::grams_enabled() = true;
201
  if (g == "off") si::norm::grams_enabled() = false;
202
  }
203
+ if (o.has("semantics")) h->eng->substrate().set_semantics(truthy(o.at("semantics")));
204
+ if (o.has("retrieval")) h->eng->set_retrieval(truthy(o.at("retrieval")));
205
+ if (o.has("retrieval_topk")) h->eng->set_retrieval_topk(static_cast<int>(o.at("retrieval_topk").as_num(5)));
206
+ if (o.has("retrieval_dose")) h->eng->set_retrieval_dose(static_cast<float>(o.at("retrieval_dose").as_num(0.30)));
207
+ if (o.has("hierarchy")) h->eng->set_hierarchy(truthy(o.at("hierarchy")));
208
  }
209
  } catch (...) { /* opts are optional; a bad opts object is ignored */ }
210
  }
 
223
  {"lanes", static_cast<double>(h->eng->substrate().lane_count())},
224
  {"evidence_records", static_cast<double>(h->eng->substrate().evidence_count())},
225
  {"calibrated", sfx::JV(h->eng->calibration().fitted)},
226
+ {"semantics", sfx::JV(h->eng->substrate().has_semantics())},
227
+ {"sem_edges", static_cast<double>(h->eng->substrate().resonance_edge_count())},
228
+ {"lane_contexts", static_cast<double>(h->eng->substrate().lane_context_count())},
229
+ {"retrieval_memories", static_cast<double>(h->eng->memories().size())},
230
+ {"hierarchy", sfx::JV(h->eng->hierarchy_on())},
231
  {"version", std::string(syfox::VERSION)},
232
  {"core", "si-substrate"}};
233
  const std::string s = sfx::JV(o).dump();
engine/src/syfox_test.cpp ADDED
@@ -0,0 +1,1203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // ============================================================================
2
+ // SyFox tests — assert-based, no framework.
3
+ // Every test names the mechanism it protects.
4
+ // ============================================================================
5
+ #include "core/syfox.hpp"
6
+ #include "core/derive.hpp"
7
+ #include "core/bench.hpp"
8
+ #include "core/gate.hpp"
9
+ #include "core/recall.hpp"
10
+
11
+ #include <cassert>
12
+ #include <cmath>
13
+ #include <iostream>
14
+
15
+ static int failures = 0;
16
+ #define CHECK(cond, msg) \
17
+ do { \
18
+ if (cond) { std::cout << " ok " << msg << "\n"; } \
19
+ else { std::cout << " FAIL " << msg << "\n"; ++failures; } \
20
+ } while (0)
21
+
22
+ static void test_json() {
23
+ std::cout << "[json]\n";
24
+ auto v = sfx::JV::parse(R"({"a":1,"b":[true,null,"x\ny"],"c":{"d":-2.5e1}})");
25
+ CHECK(v.is_obj(), "object parses");
26
+ CHECK(v.at("a").as_num() == 1.0, "number");
27
+ CHECK(v.at("b").is_arr() && v.at("b").arr.size() == 3, "array");
28
+ CHECK(v.at("b").arr[2].str == "x\ny", "string escape");
29
+ CHECK(std::fabs(v.at("c").at("d").as_num() + 25.0) < 1e-9, "exponent");
30
+ std::string dumped = v.dump();
31
+ auto v2 = sfx::JV::parse(dumped);
32
+ CHECK(v2.dump() == dumped, "roundtrip stable");
33
+ bool threw = false;
34
+ try { sfx::JV::parse("{\"a\":}"); } catch (const std::exception&) { threw = true; }
35
+ CHECK(threw, "malformed input rejected");
36
+ }
37
+
38
+ static void test_folding() {
39
+ std::cout << "[tokenize]\n";
40
+ // si::tokenize itself is UNCHANGED since v0.2 (substrate encoding baseline)
41
+ CHECK(si::tokenize("Refunds delayed!!")[0] == "refund", "plural folded");
42
+ CHECK(si::tokenize("Charged twice.")[0] == "charg", "past folded");
43
+ CHECK(si::tokenize("charge")[0] == "charg", "verb folded to same stem");
44
+ CHECK(si::tokenize("hello")[0] == "hello", "plain word untouched");
45
+ CHECK(si::tokenize("a x7").size() == 1, "single chars dropped");
46
+ }
47
+
48
+ static void test_normalize() {
49
+ std::cout << "[normalize]\n";
50
+ // Porter spot-checks against the 1980 reference vocabulary
51
+ CHECK(si::norm::porter_stem("relational") == "relat", "porter step2: ational");
52
+ CHECK(si::norm::porter_stem("generalization") == "gener", "porter step4: ization");
53
+ CHECK(si::norm::porter_stem("controll") == "control", "porter step5: double l");
54
+ CHECK(si::norm::porter_stem("rate") == "rate", "porter keeps cvc+e");
55
+ CHECK(si::norm::porter_stem("agreed") == "agre", "porter step1b: ed");
56
+ // synonym folding through the stemmed table
57
+ CHECK(si::norm::normalize("Reimbursement denied")[0] == "refund",
58
+ "synonym fold: reimbursement -> refund");
59
+ CHECK(si::norm::normalize("urgently")[0] == si::norm::normalize("urgent")[0],
60
+ "synonym fold: urgently == urgent");
61
+ CHECK(si::norm::normalize("asap")[0] == si::norm::normalize("immediately")[0],
62
+ "synonym fold: asap == immediately");
63
+ // one pipeline for teach + decide: porter parity with the old fold on our vocab
64
+ CHECK(si::norm::normalize("Charged twice.")[0] == "charg", "porter: charged -> charg");
65
+ CHECK(si::norm::normalize("charge")[0] == "charg", "porter: charge -> charg");
66
+ CHECK(si::norm::normalize("Invoices")[0] == "invoic", "porter: invoices -> invoic");
67
+ // determinism: same input -> same tokens, byte for byte
68
+ bool det = si::norm::normalize("please refund the duplicate charge immediately")
69
+ == si::norm::normalize("please refund the duplicate charge immediately");
70
+ CHECK(det, "normalize is deterministic");
71
+ }
72
+
73
+ static void test_field_physics() {
74
+ std::cout << "[si substrate]\n";
75
+ si::SubstrateConfig cfg;
76
+ si::Substrate s(cfg);
77
+ for (const auto& w : std::vector<std::string>{"alpha", "beta", "gamma"}) s.intern(w);
78
+ CHECK(s.node_count() == 3, "vocabulary interns");
79
+ s.bind(s.find("alpha"), s.find("beta"), 1.0f);
80
+ s.inject({"alpha"});
81
+ float before = s.total_energy();
82
+ s.settle();
83
+ float after = s.total_energy();
84
+ CHECK(after <= before + 1e-4f, "settle is dissipative (energy never grows)");
85
+ CHECK(s.readout({"beta"}) > 0.0f, "energy flowed along the lane to beta");
86
+ CHECK(s.readout({"gamma"}) == 0.0f, "unconnected node stays dark");
87
+
88
+ // lane cap: binding many partners evicts the weakest, bounded memory
89
+ for (int i = 0; i < 400; ++i) {
90
+ s.intern("pad" + std::to_string(i));
91
+ s.bind(s.find("alpha"), s.find("pad" + std::to_string(i)), 0.01f);
92
+ }
93
+ CHECK(s.readout_neighbours(s.find("alpha")) <= s.config().lane_cap, "lane cap enforced");
94
+
95
+ // honest silence on unknown vocabulary
96
+ si::Substrate s2;
97
+ for (const auto& w : std::vector<std::string>{"known", "words"}) s2.intern(w);
98
+ s2.inject(si::norm::normalize("totally unknown zebra words fail"));
99
+ s2.settle();
100
+ CHECK(s2.total_energy() == 0.0f, "unknown tokens inject nothing (honest silence path)");
101
+
102
+ // persistence roundtrip
103
+ s.save("/tmp/syfox_test_substrate.bin");
104
+ si::Substrate s3;
105
+ s3.load("/tmp/syfox_test_substrate.bin");
106
+ CHECK(s3.node_count() == s.node_count(), "load restores vocabulary");
107
+ CHECK(s3.lane_count() == s.lane_count(), "load restores lane structure");
108
+ // same injection + settle must read out identically on the restored substrate
109
+ s.reset_field(); s.inject({"alpha"}); s.settle();
110
+ s3.reset_field(); s3.inject({"alpha"}); s3.settle();
111
+ CHECK(std::fabs(s3.readout({"beta"}) - s.readout({"beta"})) < 1e-5f,
112
+ "restored substrate settles identically");
113
+ }
114
+
115
+ static void test_salience_mechanics() {
116
+ std::cout << "[si salience + miller window]\n";
117
+ // (a) integrator (SI physics.hpp lineage): touched/moving nodes gain
118
+ // salience; a node at rest is an EXACT fixed point (tanh(0)=0),
119
+ // mirroring SI's sparsity guard.
120
+ si::Substrate s;
121
+ for (const auto& w : std::vector<std::string>{"a", "b", "far"}) s.intern(w);
122
+ s.bind(s.find("a"), s.find("b"), 1.0f);
123
+ s.inject({"a"});
124
+ s.settle();
125
+ CHECK(s.node_salience("a") > 0.0f, "moving node carries salience");
126
+ CHECK(s.node_salience("far") == 0.0f, "node at rest is an exact fixed point");
127
+
128
+ // (b) salience-gated settle stays dissipative and still propagates
129
+ si::SubstrateConfig g;
130
+ g.salience_gating = true;
131
+ si::Substrate s2(g);
132
+ s2.intern("x"); s2.intern("y");
133
+ s2.bind(s2.find("x"), s2.find("y"), 1.0f);
134
+ s2.inject({"x"});
135
+ float before = s2.total_energy();
136
+ s2.settle();
137
+ CHECK(s2.total_energy() <= before + 1e-4f, "salience-gated settle is dissipative");
138
+ CHECK(s2.readout({"y"}) > 0.0f, "salience-gated field propagates along lanes");
139
+
140
+ // (c) miller window (TSDA live_cap lineage): cap inside [cap-4, cap],
141
+ // and the SAME state always yields the SAME cap and field.
142
+ si::SubstrateConfig m;
143
+ m.miller_window = true;
144
+ m.source_cap = 9.0f; // window becomes [5,9], as in TSDA
145
+ si::Substrate s3(m);
146
+ std::vector<std::string> toks;
147
+ for (int i = 0; i < 30; ++i) {
148
+ std::string t = "t" + std::to_string(i);
149
+ s3.intern(t);
150
+ if (i > 0) s3.bind(s3.find("t" + std::to_string(i - 1)), s3.find(t), 0.3f);
151
+ toks.push_back(t);
152
+ }
153
+ s3.inject(toks);
154
+ s3.settle();
155
+ float cap_used = s3.last_source_cap();
156
+ CHECK(cap_used >= 5.0f && cap_used <= 9.0f, "sampled cap inside Miller window [5,9]");
157
+ float e1 = s3.total_energy();
158
+ s3.reset_field();
159
+ s3.inject(toks);
160
+ s3.settle();
161
+ CHECK(s3.last_source_cap() == cap_used && s3.total_energy() == e1,
162
+ "same state -> same cap -> same field (deterministic)");
163
+
164
+ // (d) default config: cap stays pinned at source_cap
165
+ si::Substrate s4;
166
+ s4.settle();
167
+ CHECK(s4.last_source_cap() == 24.0f, "default cap pinned at 24");
168
+ }
169
+
170
+ static syfox::Engine train_choice_engine() {
171
+ syfox::Engine eng;
172
+ const char* ex =
173
+ R"({"state":"the bot sees zombies at night with low health","questions":{"action":{"type":"choice","instructions":"next move","criteria":{"flee":"run away escape avoid","fight":"attack sword combat","dig_in":"hide build shelter"}}},"labels":{"action":"flee"}})";
174
+ auto rows = std::vector<sfx::JV>{sfx::JV::parse(ex)};
175
+ for (const auto& r : rows) {
176
+ eng.learn_example(r.at("state").as_str(), "next move",
177
+ "flee run away escape avoid");
178
+ }
179
+ return eng;
180
+ }
181
+
182
+ static void test_hebbian_choice() {
183
+ std::cout << "[hebbian choice]\n";
184
+ syfox::Engine eng = train_choice_engine();
185
+ sfx::JV q = sfx::JV::parse(
186
+ R"({"action":{"type":"choice","instructions":"next move","criteria":{"flee":"run away escape avoid","fight":"attack sword combat","dig_in":"hide build shelter"}}})");
187
+ syfox::Usage u;
188
+ auto ans = eng.decide("zombies appear at night, health is low", q, u);
189
+ CHECK(!ans.empty() && ans[0].choice == "flee", "learned route fires on related state");
190
+ CHECK(!ans[0].deferred, "field settled above silence floor");
191
+ // a state sharing nothing with the trained vocabulary -> honest silence,
192
+ // NOT a random guess (this is the whole point of the substrate)
193
+ auto ans2 = eng.decide("completely different harvest moon farming", q, u);
194
+ CHECK(!ans2.empty() && ans2[0].deferred, "unrelated state defers instead of guessing");
195
+ }
196
+
197
+ static void test_noul_valence() {
198
+ std::cout << "[noul valence]\n";
199
+ syfox::Engine eng;
200
+ const std::string instr = "the command is irreversible or destructive";
201
+ // true evidence: destructive vocabulary supports the statement
202
+ eng.learn_noul("command rm -rf wipe the disk force delete", instr, true);
203
+ eng.learn_noul("command drop table database destroy data", instr, true);
204
+ // false evidence: harmless vocabulary weakens the route
205
+ eng.learn_noul("command list files show status read only", instr, false);
206
+ eng.learn_noul("command print the config view logs", instr, false);
207
+ sfx::JV q = sfx::JV::parse(
208
+ R"({"d":{"type":"noul","instructions":"the command is irreversible or destructive"}})");
209
+ syfox::Usage u;
210
+ float p_destructive = eng.decide("the command is rm -rf, it will delete everything", q, u)[0].probability;
211
+ float p_harmless = eng.decide("the command lists open issues", q, u)[0].probability;
212
+ CHECK(p_destructive > p_harmless, "field separates destructive from harmless");
213
+ CHECK(p_harmless < 0.5f, "harmless command reads as false");
214
+ }
215
+
216
+ static void test_calibration_tool() {
217
+ std::cout << "[calibration tool]\n";
218
+ // v2.1 row shape: FULL candidate vector + gold label (multi-class fit)
219
+ std::vector<syfox::Engine::CalibRow> rows = {
220
+ {"choice", "a", {{"a", 2.0f}, {"b", 0.2f}}, 0.0f, 0},
221
+ {"choice", "a", {{"a", 1.5f}, {"b", 0.4f}}, 0.0f, 0},
222
+ {"choice", "b", {{"a", 0.1f}, {"b", 1.8f}}, 0.0f, 0},
223
+ {"choice", "b", {{"a", 0.3f}, {"b", 1.2f}}, 0.0f, 0},
224
+ };
225
+ syfox::Engine eng;
226
+ eng.fit_calibration(rows);
227
+ CHECK(eng.calibration().fitted, "fitted flag set");
228
+ CHECK(eng.calibration().choice_temperature > 0.0f, "temperature positive");
229
+ // multi-class NLL is sharpness-aware: this fit set has clean margins, so
230
+ // the optimum must sharpen (T < 1), not flatten
231
+ CHECK(eng.calibration().choice_temperature < 1.0f, "clean margins sharpen temperature");
232
+ }
233
+
234
+ static void test_honest_silence_defer() {
235
+ std::cout << "[honest silence]\n";
236
+ syfox::Engine eng;
237
+ sfx::JV q = sfx::JV::parse(R"({"x":{"type":"choice","instructions":"pick","criteria":{"a":"alpha","b":"beta"}}})");
238
+ syfox::Usage u;
239
+ auto ans = eng.decide("zzz qqq xxxttt", q, u); // vocabulary is empty
240
+ CHECK(ans[0].deferred && ans[0].reason == "unknown_vocabulary", "unknown vocabulary defers, never guesses");
241
+ }
242
+
243
+ static void test_derivation() {
244
+ std::cout << "[derivation layer: induction, verifier, dreamer, analogy]\n";
245
+ using namespace syfox::derive;
246
+
247
+ // probe fabric (same shape as the ARCHITECTURE.md probe):
248
+ // co-occurrence alpha-beta-gamma; lessons alpha/beta -> x-tokens, beta/gamma -> y-tokens
249
+ auto build_probe = []() {
250
+ si::Substrate s;
251
+ for (const char* t : {"alpha", "beta", "gamma", "x", "target", "y", "other"})
252
+ s.intern(t);
253
+ const si::NodeId A = s.find("alpha"), B = s.find("beta"), G = s.find("gamma");
254
+ const si::NodeId X = s.find("x"), T = s.find("target"), Y = s.find("y"), O = s.find("other");
255
+ s.bind(A, B, 0.10f); s.bind(B, G, 0.10f);
256
+ for (si::NodeId st : {A, B}) for (si::NodeId o : {X, T}) s.bind(st, o, 0.20f);
257
+ for (si::NodeId st : {B, G}) for (si::NodeId o : {Y, O}) s.bind(st, o, 0.20f);
258
+ return s;
259
+ };
260
+ DeriveConfig c;
261
+
262
+ // (a) composition turns the two-hop path alpha->beta->y into a derived lane
263
+ si::Substrate s = build_probe();
264
+ CHECK(s.lane_weight(s.find("alpha"), s.find("y")) == 0.0f, "no direct alpha->y lane before derivation");
265
+ DeriveStats st = compose_pass(s, c);
266
+ CHECK(s.lane_weight(s.find("alpha"), s.find("y")) > 0.0f, "two-hop path became a derived lane");
267
+ CHECK(s.generation_of(s.find("alpha"), s.find("y")) == 1, "derived lane carries generation 1");
268
+ CHECK(st.created > 0, "composition reports created lanes");
269
+
270
+ // (b) observed lanes are never weakened by composition
271
+ si::Substrate s2 = build_probe();
272
+ struct SnapL { si::NodeId a, b; float w; };
273
+ std::vector<SnapL> snap;
274
+ s2.for_each_lane([&](si::NodeId a, si::NodeId b, float w) { snap.push_back({a, b, w}); });
275
+ compose_pass(s2, c);
276
+ bool never_weakened = true;
277
+ for (const auto& l : snap)
278
+ if (s2.lane_weight(l.a, l.b) + 1e-6f < l.w) never_weakened = false;
279
+ CHECK(never_weakened, "composition never weakens observed lanes");
280
+
281
+ // (c) generation cap bounds derived-of-derived depth
282
+ si::Substrate s3;
283
+ for (int i = 0; i < 6; ++i) s3.intern("z" + std::to_string(i));
284
+ for (int i = 1; i < 6; ++i)
285
+ s3.bind(s3.find("z" + std::to_string(i - 1)), s3.find("z" + std::to_string(i)), 0.5f);
286
+ DeriveConfig capped; capped.max_generation = 2;
287
+ compose_pass(s3, capped); compose_pass(s3, capped); compose_pass(s3, capped);
288
+ std::uint32_t max_gen_seen = 0;
289
+ s3.for_each_lane([&](si::NodeId a, si::NodeId b, float) {
290
+ max_gen_seen = std::max(max_gen_seen, s3.generation_of(a, b));
291
+ });
292
+ CHECK(max_gen_seen <= 2, "no lane exceeds the generation cap");
293
+
294
+ // (d) verifier: stripping a parent path dissolves the derived lane
295
+ si::Substrate s4 = build_probe();
296
+ compose_pass(s4, c);
297
+ const float w_beta_y = s4.lane_weight(s4.find("beta"), s4.find("y"));
298
+ s4.scale_lane(s4.find("beta"), s4.find("y"), -(w_beta_y - 0.005f)); // drop below path_min
299
+ DeriveStats pst = prune_stale(s4, c);
300
+ CHECK(pst.dissolved > 0, "verifier dissolves unsupported derived lanes");
301
+ CHECK(s4.lane_weight(s4.find("alpha"), s4.find("y")) == 0.0f, "unsupported derived lane is gone");
302
+ CHECK(s4.lane_weight(s4.find("alpha"), s4.find("beta")) == 0.10f, "observed lanes survive the verifier");
303
+
304
+ // (e) dreamer: deterministic per seed, never modifies the substrate
305
+ si::Substrate s5a = build_probe(), s5b = build_probe();
306
+ const std::size_t lanes_before = s5a.lane_count();
307
+ DreamConfig dc;
308
+ auto c1 = dream(s5a, dc, 42, 8);
309
+ auto c2 = dream(s5b, dc, 42, 8);
310
+ bool same = c1.size() == c2.size();
311
+ for (std::size_t i = 0; same && i < c1.size(); ++i)
312
+ same = c1[i].emergent == c2[i].emergent && c1[i].support == c2[i].support;
313
+ CHECK(same, "same seed -> same dream (bit for bit)");
314
+ CHECK(s5a.lane_count() == lanes_before, "dreaming never modifies the fabric");
315
+
316
+ // (f) promotion: a validated candidate becomes a premise-grade lane
317
+ si::Substrate s6 = build_probe();
318
+ apply_promotion(s6, {"gamma"}, "x", 0.05f, 6.0f);
319
+ CHECK(s6.lane_weight(s6.find("gamma"), s6.find("x")) > 0.0f, "validated promotion lays a lane");
320
+ CHECK(s6.generation_of(s6.find("gamma"), s6.find("x")) == 0, "promoted lane is premise-grade (gen 0)");
321
+
322
+ // (g) provenance survives save/load
323
+ si::Substrate s7 = build_probe();
324
+ compose_pass(s7, c);
325
+ const float w_alpha_y = s7.lane_weight(s7.find("alpha"), s7.find("y"));
326
+ s7.save("build/test_provenance.bin");
327
+ si::Substrate s8;
328
+ s8.load("build/test_provenance.bin");
329
+ CHECK(s8.lane_weight(s8.find("alpha"), s8.find("y")) == w_alpha_y &&
330
+ s8.generation_of(s8.find("alpha"), s8.find("y")) == 1,
331
+ "derived weight + generation survive save/load");
332
+
333
+ // (h) v1 compatibility: a file with no provenance tail loads clean
334
+ {
335
+ std::ofstream f("build/test_v1.bin", std::ios::binary);
336
+ std::uint32_t n = 2; f.write(reinterpret_cast<const char*>(&n), 4);
337
+ std::uint32_t len = 1; float mass = 1.0f;
338
+ f.write(reinterpret_cast<const char*>(&len), 4); f.write("p", 1);
339
+ f.write(reinterpret_cast<const char*>(&mass), 4);
340
+ f.write(reinterpret_cast<const char*>(&len), 4); f.write("q", 1);
341
+ f.write(reinterpret_cast<const char*>(&mass), 4);
342
+ std::uint32_t lanes = 2, a_id = 0, b_id = 1; float w = 0.5f;
343
+ f.write(reinterpret_cast<const char*>(&lanes), 4);
344
+ f.write(reinterpret_cast<const char*>(&a_id), 4); f.write(reinterpret_cast<const char*>(&b_id), 4);
345
+ f.write(reinterpret_cast<const char*>(&w), 4);
346
+ f.write(reinterpret_cast<const char*>(&b_id), 4); f.write(reinterpret_cast<const char*>(&a_id), 4);
347
+ f.write(reinterpret_cast<const char*>(&w), 4);
348
+ }
349
+ si::Substrate s9;
350
+ s9.load("build/test_v1.bin");
351
+ CHECK(s9.lane_weight(s9.find("p"), s9.find("q")) == 0.5f, "v1 file (no tail) loads");
352
+ CHECK(s9.generation_of(s9.find("p"), s9.find("q")) == 0, "v1 lanes default to premise grade");
353
+
354
+ // (i) analogy: identical neighbourhood -> iso 1.0
355
+ si::Substrate s10;
356
+ for (const char* t : {"hub1", "hub2", "leafA", "leafB", "distant"}) s10.intern(t);
357
+ // hub1 and hub2 touch the same two leaves -> identical signatures
358
+ s10.bind(s10.find("hub1"), s10.find("leafA"), 0.4f);
359
+ s10.bind(s10.find("hub1"), s10.find("leafB"), 0.4f);
360
+ s10.bind(s10.find("hub2"), s10.find("leafA"), 0.4f);
361
+ s10.bind(s10.find("hub2"), s10.find("leafB"), 0.4f);
362
+ auto matches = find_analogues(s10, "hub1");
363
+ CHECK(!matches.empty() && matches[0].concept == "hub2" && matches[0].iso > 0.99f,
364
+ "identical neighbourhoods map at iso ~1.0");
365
+
366
+ // (j) harvest: the field's own dynamics nominate; observed lanes untouched;
367
+ // stale gen-1 lanes are dissolved by the next replay
368
+ si::Substrate s11 = build_probe();
369
+ const float w_ab_before = s11.lane_weight(s11.find("alpha"), s11.find("beta"));
370
+ {
371
+ std::vector<std::vector<std::string>> replay = {
372
+ si::norm::normalize("alpha beta"), si::norm::normalize("beta gamma")};
373
+ HarvestConfig hc;
374
+ HarvestStats hst = harvest(s11, replay, hc);
375
+ CHECK(s11.lane_weight(s11.find("alpha"), s11.find("beta")) == w_ab_before,
376
+ "harvest never touches observed lanes");
377
+ // x and target co-activate strongly (same lesson outcome side) yet no
378
+ // direct lane exists between them: the field nominates the bridge
379
+ CHECK(s11.lane_weight(s11.find("x"), s11.find("target")) > 0.0f &&
380
+ s11.generation_of(s11.find("x"), s11.find("target")) == 1,
381
+ "co-activated pair gains a derived bridge (gen 1)");
382
+ // a lane nothing in the replay can nominate must dissolve on re-check
383
+ s11.intern("zz"); // isolated: never activates
384
+ s11.bind_derived(s11.find("alpha"), s11.find("zz"), 0.05f, 1);
385
+ CHECK(s11.lane_weight(s11.find("alpha"), s11.find("zz")) > 0.0f, "stale candidate laid");
386
+ HarvestStats hst2 = harvest(s11, replay, hc);
387
+ CHECK(hst2.dissolved >= 1 && s11.lane_weight(s11.find("alpha"), s11.find("zz")) == 0.0f,
388
+ "un-nominated derived lane dissolves on re-verification");
389
+ CHECK(s11.lane_weight(s11.find("alpha"), s11.find("beta")) == w_ab_before,
390
+ "observed lanes survive re-verification too");
391
+ }
392
+ }
393
+
394
+ // ---------------------------------------------------------------------------
395
+ // Shared fixtures for the e2e suite: six labelled ticket rows (choice + noul)
396
+ // over two well-separated vocabulary groups.
397
+ // ---------------------------------------------------------------------------
398
+ static std::vector<sfx::JV> make_ticket_rows() {
399
+ const std::string q =
400
+ R"({"department":{"type":"choice","instructions":"Which team should handle this","criteria":{"billing":"payment or subscription issues","technical":"bugs or integration problems"}},"is_urgent":{"type":"noul","instructions":"the message conveys urgency or time sensitivity"}})";
401
+ const char* src[] = {
402
+ "{\"state\":\"refund double charge invoice immediately\",\"labels\":{\"department\":\"billing\",\"is_urgent\":\"true\"}}",
403
+ "{\"state\":\"charged twice money back now please\",\"labels\":{\"department\":\"billing\",\"is_urgent\":\"true\"}}",
404
+ "{\"state\":\"change invoice address next month\",\"labels\":{\"department\":\"billing\",\"is_urgent\":\"false\"}}",
405
+ "{\"state\":\"price team plan twenty seats\",\"labels\":{\"department\":\"billing\",\"is_urgent\":\"false\"}}",
406
+ "{\"state\":\"download invoice records\",\"labels\":{\"department\":\"billing\",\"is_urgent\":\"false\"}}",
407
+ "{\"state\":\"api throws error when connecting\",\"labels\":{\"department\":\"technical\",\"is_urgent\":\"false\"}}",
408
+ "{\"state\":\"integration keeps failing client crashes\",\"labels\":{\"department\":\"technical\",\"is_urgent\":\"false\"}}",
409
+ "{\"state\":\"production down api errors every request\",\"labels\":{\"department\":\"technical\",\"is_urgent\":\"true\"}}",
410
+ "{\"state\":\"bug breaks checkout browser\",\"labels\":{\"department\":\"technical\",\"is_urgent\":\"true\"}}",
411
+ "{\"state\":\"dashboard shows blank page after update\",\"labels\":{\"department\":\"technical\",\"is_urgent\":\"false\"}}",
412
+ };
413
+ std::vector<sfx::JV> out;
414
+ for (const char* r : src) {
415
+ std::string s(r);
416
+ s.pop_back(); // drop the outer '}'
417
+ out.push_back(sfx::JV::parse(s + ",\"questions\":" + q + "}"));
418
+ }
419
+ return out;
420
+ }
421
+
422
+ static void learn_tickets(syfox::Engine& eng, const std::vector<sfx::JV>& rows) {
423
+ for (const auto& r : rows) {
424
+ const std::string state = r.at("state").as_str();
425
+ const sfx::JV& qs = r.at("questions");
426
+ const sfx::JV& labels = r.at("labels");
427
+ const std::string dept = labels.at("department").as_str();
428
+ eng.learn_example(state, qs.at("department").at("instructions").as_str(),
429
+ dept + " " + qs.at("department").at("criteria").at(dept).as_str());
430
+ eng.learn_noul(state, qs.at("is_urgent").at("instructions").as_str(),
431
+ labels.at("is_urgent").as_str() == "true");
432
+ }
433
+ }
434
+
435
+ // ---------------------------------------------------------------------------
436
+ static void test_recall() {
437
+ std::cout << "[recall: associative retrieval in settled-energy space]\n";
438
+ using namespace syfox::recall;
439
+ si::Substrate s;
440
+ for (const char* w : {"refund", "charg", "invoic", "billing", "double", "payment",
441
+ "api", "error", "connect", "bug", "crash", "integr"})
442
+ s.intern(w);
443
+ auto b2 = [&](const char* a, const char* b, float w) { s.bind(s.find(a), s.find(b), w); };
444
+ // two disjoint neighbourhoods (billing / technical)
445
+ b2("refund", "charg", 0.6f); b2("charg", "invoic", 0.6f); b2("invoic", "billing", 0.6f);
446
+ b2("double", "charg", 0.5f); b2("billing", "payment", 0.5f);
447
+ b2("api", "error", 0.6f); b2("error", "connect", 0.5f); b2("connect", "bug", 0.5f);
448
+ b2("bug", "crash", 0.5f); b2("crash", "integr", 0.5f);
449
+
450
+ std::vector<Memory> memories = {
451
+ {"billing", si::norm::normalize("refund double charg invoic billing payment")},
452
+ {"technical", si::norm::normalize("api error connect bug crash integr")},
453
+ };
454
+ auto hitsA = recall(s, "i was double charged on my invoice, refund please", memories, 2);
455
+ CHECK(!hitsA.empty() && hitsA[0].label == "billing",
456
+ "billing query recalls the billing memory first");
457
+ auto hitsB = recall(s, "the api crashes when I connect the integration", memories, 2);
458
+ CHECK(!hitsB.empty() && hitsB[0].label == "technical",
459
+ "technical query recalls the technical memory first");
460
+ if (hitsA.size() == 2)
461
+ CHECK(hitsA[0].resonance > hitsA[1].resonance, "winner clearly separated from runner-up");
462
+
463
+ // determinism: same model + query + memories => bit-identical resonances
464
+ auto hitsA2 = recall(s, "i was double charged on my invoice, refund please", memories, 2);
465
+ bool same = hitsA.size() == hitsA2.size();
466
+ for (std::size_t i = 0; same && i < hitsA.size(); ++i)
467
+ same = hitsA[i].resonance == hitsA2[i].resonance && hitsA[i].label == hitsA2[i].label;
468
+ CHECK(same, "recall is deterministic (bit-identical resonances)");
469
+
470
+ // unknown vocabulary resonates with nothing (inject skips unknown tokens)
471
+ auto hitsO = recall(s, "zorblatz quibblemock framistan", memories, 2);
472
+ CHECK(hitsO.empty() || hitsO[0].resonance == 0.0f,
473
+ "unknown vocabulary resonates with nothing");
474
+
475
+ // read-only: recall leaves the fabric untouched
476
+ const std::size_t lanes_before = s.lane_count();
477
+ (void)recall(s, "another refund query about charges", memories, 2);
478
+ CHECK(s.lane_count() == lanes_before, "recall never mutates the fabric");
479
+ }
480
+
481
+ // ---------------------------------------------------------------------------
482
+ static void test_gate() {
483
+ std::cout << "[gate: transactional derivation, bit-exact revert]\n";
484
+ using namespace syfox;
485
+ Engine eng;
486
+ auto rows = make_ticket_rows();
487
+ learn_tickets(eng, rows);
488
+ auto probes = bench::eval_probes(rows);
489
+
490
+ // baseline signature before anything touches the fabric
491
+ const auto sig0 = bench::decision_signature(eng, probes[0]);
492
+ const std::size_t lanes0 = eng.substrate().lane_count();
493
+
494
+ // (a) snapshot/restore is bit-exact, even after an adversarial write
495
+ const auto snap = eng.substrate().snapshot_fabric();
496
+ CHECK(snap.lanes == lanes0, "snapshot counts every lane");
497
+ eng.substrate().bind_derived(eng.substrate().find("refund"),
498
+ eng.substrate().find("error"), 1.2f, 1);
499
+ CHECK(eng.substrate().lane_weight(eng.substrate().find("refund"),
500
+ eng.substrate().find("error")) > 0.0f,
501
+ "adversarial derived lane laid");
502
+ eng.substrate().restore_fabric(snap);
503
+ CHECK(eng.substrate().lane_weight(eng.substrate().find("refund"),
504
+ eng.substrate().find("error")) == 0.0f,
505
+ "restore removes the adversarial lane");
506
+ CHECK(eng.substrate().lane_count() == lanes0, "lane count restored");
507
+ const auto sigR = bench::decision_signature(eng, probes[0]);
508
+ CHECK(sigR == sig0, "restore is bit-exact: decide() output identical");
509
+
510
+ // (b) gated compose: whatever the gate decides, decisions never regress
511
+ gate::GateConfig gc;
512
+ auto rep = gate::gated_derive(eng, "compose", rows, {}, gc);
513
+ CHECK(rep.ran, "gate ran");
514
+ CHECK(rep.taught_probes == static_cast<long>(rows.size()), "taught probes replayed");
515
+ CHECK(rep.mixed_probes > 0, "close-call probes generated");
516
+ if (rep.committed)
517
+ CHECK(rep.taught_flips == 0, "committed gate => zero taught flips (mixed may re-resolve)");
518
+ else
519
+ CHECK(rep.taught_flips > 0 || rep.conf_inflated,
520
+ "reverted gate => taught flips or manufactured certainty");
521
+ const auto sig1 = bench::decision_signature(eng, probes[0]);
522
+ if (rep.committed) {
523
+ bool argmax_same = true;
524
+ for (const auto& kv : sig0) {
525
+ auto it = sig1.find(kv.first);
526
+ if (it == sig1.end() || it->second.first != kv.second.first) argmax_same = false;
527
+ }
528
+ CHECK(argmax_same, "committed gate: taught argmaxes unchanged");
529
+ } else {
530
+ CHECK(sig1 == sig0, "reverted gate: decide() bit-identical to baseline");
531
+ }
532
+
533
+ // (c) gated harvest with replay states: same invariant. NOTE (v2.1): the
534
+ // revert-branch baseline is sig1 — the fabric state immediately before
535
+ // the harvest — because a COMMITTED compose gate legitimately changed the
536
+ // lanes (zero flips), and the harvest revert must restore THAT state,
537
+ // bit for bit, not the pre-compose one.
538
+ std::vector<std::vector<std::string>> replay;
539
+ for (const auto& r : rows) replay.push_back(si::norm::normalize(r.at("state").as_str()));
540
+ auto rep2 = gate::gated_derive(eng, "harvest", rows, replay, gc);
541
+ CHECK(rep2.ran, "harvest gate ran");
542
+ const auto sig2 = bench::decision_signature(eng, probes[0]);
543
+ if (rep2.committed) {
544
+ bool argmax_same = true;
545
+ for (const auto& kv : sig0) {
546
+ auto it = sig2.find(kv.first);
547
+ if (it == sig2.end() || it->second.first != kv.second.first) argmax_same = false;
548
+ }
549
+ CHECK(argmax_same, "committed harvest gate: taught argmaxes unchanged");
550
+ } else {
551
+ CHECK(sig2 == sig1, "reverted harvest gate: decide() bit-identical to pre-derive state");
552
+ }
553
+
554
+ // (d) gate report serializes
555
+ CHECK(rep.to_json().dump().find("committed") != std::string::npos, "gate report serializes");
556
+ }
557
+
558
+ // ---------------------------------------------------------------------------
559
+ static void test_bench_e2e() {
560
+ std::cout << "[bench: Jev-parity suite end to end]\n";
561
+ using namespace syfox;
562
+ Engine eng;
563
+ auto rows = make_ticket_rows();
564
+ learn_tickets(eng, rows);
565
+ auto calib = eng.harvest_rows(rows);
566
+ CHECK(!calib.empty(), "calibration rows harvested");
567
+ eng.fit_calibration(calib);
568
+
569
+ bench::BenchConfig bc;
570
+ bc.latency_reps = 3;
571
+ auto rep = bench::run(eng, rows, "in-domain (resubstitution)", bc, "test-model");
572
+
573
+ CHECK(rep.rows == static_cast<long>(rows.size()), "eval rows loaded");
574
+ CHECK(rep.choice_accuracy == 1.0,
575
+ "in-domain choice accuracy 1.0 (taught states resubstituted)");
576
+ CHECK(rep.deterministic, "decisions are bit-deterministic across replays");
577
+ CHECK(rep.ood_defer_rate == 1.0, "unknown vocabulary defers (honest silence)");
578
+ CHECK(rep.choice_ece >= 0.0 && rep.choice_ece <= 1.0, "ECE in [0,1]");
579
+ CHECK(rep.mixed_probes > 0 && rep.probes > rep.rows, "close-call probes generated");
580
+ CHECK(rep.lat_p50_us > 0.0 && rep.lat_p95_us >= rep.lat_p50_us, "latency percentiles sane");
581
+ CHECK(rep.g_tp >= 1, "guardrail caught at least one true hold");
582
+ CHECK(rep.mean_margin >= 0.0 && rep.mean_margin <= 1.0, "margins in [0,1]");
583
+
584
+ // the JSON report carries every axis
585
+ const std::string j = rep.to_json().dump();
586
+ for (const char* key : {"choice_accuracy", "choice_ece", "ood_defer_rate",
587
+ "hold_precision", "p95", "deterministic", "jev_reference"})
588
+ CHECK(j.find(key) != std::string::npos, std::string("report carries ") + key);
589
+ }
590
+
591
+ // ---------------------------------------------------------------------------
592
+ // v2.2 — multilingual boundary: script detection, UTF-8 tokenization,
593
+ // character trigram lanes, mass-guarded augmentation, deterministic typos.
594
+ // ---------------------------------------------------------------------------
595
+ static void test_script_detection() {
596
+ std::cout << "[script: Unicode script detection]\n";
597
+ using si::script::Script;
598
+ CHECK(si::script::detect_script("You charged me twice for the same invoice") == Script::Latin, "english -> latin");
599
+ CHECK(si::script::detect_script("আমার কার্ড থেকে দুইবার টাকা কেটেছে") == Script::Bengali, "bengali -> bengali");
600
+ CHECK(si::script::detect_script("मेरे कार्ड से दो बार पैसे कट गए") == Script::Devanagari, "hindi -> devanagari");
601
+ CHECK(si::script::detect_script("С моей карты списали деньги дважды") == Script::Cyrillic, "russian -> cyrillic");
602
+ CHECK(si::script::detect_script("Θέλω επιστροφή χρημάτων") == Script::Greek, "greek -> greek");
603
+ CHECK(si::script::detect_script("أريد استرداد المبلغ") == Script::Arabic, "arabic -> arabic");
604
+ CHECK(si::script::detect_script("エラーが出ます") == Script::Kana, "japanese kana -> kana");
605
+ CHECK(si::script::detect_script("에러가 납니다") == Script::Hangul, "korean -> hangul");
606
+ CHECK(si::script::detect_script("账户被重复扣款了") == Script::Han, "chinese -> han");
607
+ CHECK(si::script::detect_script("12345 67890") == Script::Latin, "digits are neutral -> latin default");
608
+ CHECK(si::script::detect_script("") == Script::Latin, "empty -> latin default");
609
+ CHECK(si::script::detect_script("¡Hola! ¿Dinero de vuelta?") == Script::Latin, "punctuated latin stays latin");
610
+ CHECK(si::script::detect_script("ok আমার ok ok ok ok ok") == Script::Latin, "majority vote: latin wins 6-2");
611
+ CHECK(si::script::slug(Script::Bengali) == std::string("bengali"), "slug naming");
612
+ CHECK(si::script::from_slug("devanagari") == Script::Devanagari, "slug roundtrip");
613
+ }
614
+
615
+ static void test_utf8_normalize() {
616
+ std::cout << "[normalize: UTF-8 codepoint boundary]\n";
617
+ const auto bn = si::norm::normalize("আমার কার্ড থেকে টাকা ফেরত চাই");
618
+ CHECK(!bn.empty(), "bengali tokenizes (v2.1 produced ZERO tokens — the language barrier)");
619
+ bool nonascii = false;
620
+ for (const auto& t : bn)
621
+ for (char c : t) if (static_cast<unsigned char>(c) >= 0x80) { nonascii = true; break; }
622
+ CHECK(nonascii, "bengali tokens carry utf-8 codepoints");
623
+ const auto ru = si::norm::normalize("Москваinvoice");
624
+ CHECK(ru.size() == 2, "script change splits a run into two tokens");
625
+ CHECK(!ru.empty() && ru[0] == "москва", "cyrillic lowercased");
626
+ const auto gr = si::norm::normalize("ΟΔΙΚΑ");
627
+ // mechanical codepoint map: all-caps Greek loses no tonos it never had;
628
+ // tonos restoration is NLP-pipeline territory, deliberately out of scope
629
+ CHECK(!gr.empty() && gr[0] == "οδικα", "greek lowercased (mechanical map, no tonos logic)");
630
+ const auto lat = si::norm::normalize("Café payment");
631
+ CHECK(lat.size() == 2 && lat[0] == "café", "accented latin: one token, lowercase, no porter on non-ascii");
632
+ // ASCII fast path must stay byte-identical to v2.1
633
+ CHECK(si::norm::normalize("Charged twice.")[0] == "charg", "ascii path: porter unchanged");
634
+ CHECK(si::norm::normalize("Reimbursement denied")[0] == "refund", "ascii path: synonym fold unchanged");
635
+ CHECK(si::norm::normalize("a x7").size() == 1, "ascii path: length rule unchanged");
636
+ // malformed utf-8 bytes are separators, never a crash
637
+ std::string bad = "ok \xFF\xFE fine";
638
+ CHECK(si::norm::normalize(bad).size() == 2, "malformed bytes become separators");
639
+ }
640
+
641
+ static void test_ngram_lanes() {
642
+ std::cout << "[ngram: character trigram lanes]\n";
643
+ const auto g = si::norm::expand_ngrams({"refund"});
644
+ CHECK(g.size() == 4, "refund -> 4 trigrams");
645
+ CHECK(g[0] == "g3:ref" && g[1] == "g3:efu" && g[2] == "g3:fun" && g[3] == "g3:und",
646
+ "trigram lane names are literal strings, left-to-right");
647
+ CHECK(si::norm::expand_ngrams({"abc"}).empty(), "words under 4 codepoints contribute none");
648
+ const auto bn = si::norm::expand_ngrams(si::norm::normalize("ফেরত দিন টাকা"));
649
+ bool bn_grams = false;
650
+ for (const auto& s : bn) if (s.rfind("g3:", 0) == 0 && s.size() > 3) { bn_grams = true; break; }
651
+ CHECK(bn_grams, "bengali decomposes into codepoint trigrams");
652
+ const std::vector<std::string> words = {"refund", "charg"};
653
+ CHECK(si::norm::state_tokens(words, false) == words, "grams off == exact v2.1 stream");
654
+ const auto on = si::norm::state_tokens(words, true);
655
+ CHECK(on.size() == 2 + 4 + 3, "grams on: words first, then per-word grams");
656
+ CHECK(!si::norm::grams_enabled(),
657
+ "grams default OFF (measured: Latin baselines need the word-level stream; "
658
+ "--lang auto enables bridges for non-Latin substrates)");
659
+ si::norm::grams_enabled() = true;
660
+ const auto ft = si::norm::field_tokens(words, true,
661
+ [](const std::string& w) { return w == "charg"; });
662
+ CHECK(ft.size() == 2 + 4,
663
+ "bridge protocol: known word (charg) carries no grams, unknown word (refund) carries 4");
664
+ si::norm::grams_enabled() = false;
665
+ }
666
+
667
+ static void test_mass_guard() {
668
+ std::cout << "[augment: mass-guarded re-teach]\n";
669
+ using namespace syfox;
670
+ Engine a;
671
+ a.learn_example("Refund my money now", "team", "billing payment");
672
+ a.learn_example("Refund my money now", "team", "billing payment");
673
+ const float m_a = a.substrate().node_mass(a.substrate().find("refund"));
674
+ CHECK(m_a == 2.0f, "plain re-teach re-deposits mass (the documented v2.1 artifact)");
675
+ Engine b;
676
+ b.learn_example("Refund my money now", "team", "billing payment");
677
+ const float n1 = b.substrate().node_mass(b.substrate().find("refund"));
678
+ const float w1 = b.substrate().lane_weight(b.substrate().find("refund"),
679
+ b.substrate().find("bill"));
680
+ b.learn_example("Refund my money now", "team", "billing payment", /*augment=*/true);
681
+ const float n2 = b.substrate().node_mass(b.substrate().find("refund"));
682
+ const float w2 = b.substrate().lane_weight(b.substrate().find("refund"),
683
+ b.substrate().find("bill"));
684
+ CHECK(n1 == 1.0f && n2 == n1, "augment re-teach does NOT re-deposit mass");
685
+ CHECK(w2 > w1, "augment re-teach still strengthens lanes (coverage, not re-weighting)");
686
+ }
687
+
688
+ static void test_multilingual_e2e() {
689
+ std::cout << "[multilingual: bengali fabric end to end]\n";
690
+ using namespace syfox;
691
+ // multilingual scenario: the --lang auto policy runs non-Latin substrates
692
+ // with sub-word bridges enabled (they are load-bearing for typo routing)
693
+ si::norm::grams_enabled() = true;
694
+ Engine eng;
695
+ const char* bn_billing[] = {
696
+ "আমার কার্ড থেকে দুইবার টাকা কেটেছে অতিরিক্ত টাকা ফেরত দিন",
697
+ "সাবস্ক্রিপশন বাতিল করেছি তবুও আবার চার্জ করেছে টাকা ফেরত চাই",
698
+ "গত মাসের ইনভয়েসে ভুল টাকার পরিমাণ আছে ঠিক করুন"};
699
+ const char* bn_technical[] = {
700
+ "অ্যাপটি বারবার ক্র্যাশ করছে লগইন করতে পারছি না",
701
+ "পেমেন্ট গেটওয়ে কাজ করছে না এরর দেখাচ্ছে",
702
+ "ওয়েবহুক ইভেন্ট কানেক্ট হচ্ছে না ইন্টিগ্রেশন ব্যর্থ"};
703
+ const sfx::JV q = sfx::JV::parse(
704
+ R"({"department":{"type":"choice","instructions":"Which team should handle this",)"
705
+ R"("criteria":{"billing":"payment or subscription issues","technical":"bugs or integration problems"}}})");
706
+ for (const auto* s : bn_billing)
707
+ eng.learn_example(s, "Which team should handle this", "billing payment or subscription issues");
708
+ for (const auto* s : bn_technical)
709
+ eng.learn_example(s, "Which team should handle this", "technical bugs or integration problems");
710
+ Usage u;
711
+ auto a1 = eng.decide("অর্ডার ৪৪১২ এর জন্য অতিরিক্ত পেমেন্ট হয়েছে ওই টাকা ফেরত চাই", q, u);
712
+ CHECK(!a1.empty() && !a1[0].deferred, "bengali heldout settles (not honest silence)");
713
+ CHECK(!a1.empty() && !a1[0].deferred && a1[0].choice == "billing", "bengali heldout -> billing");
714
+ auto a2 = eng.decide("এপিআই ��ল করলে এরর আসে ইন্টিগ্রেশন কাজ করছে না", q, u);
715
+ CHECK(!a2.empty() && !a2[0].deferred && a2[0].choice == "technical", "bengali heldout -> technical");
716
+ // typo'd bengali query (vowels/matra dropped) — trigram lanes must carry it
717
+ auto a3 = eng.decide("ওয়েবহক ইভন্ট কনেক্ট হচছ না ইন্টিগ্রেশন ব্যর্থ", q, u);
718
+ CHECK(!a3.empty() && !a3[0].deferred && a3[0].choice == "technical",
719
+ "bengali typo query still routes (character trigram lanes)");
720
+ // determinism with the multilingual boundary
721
+ Usage u2;
722
+ auto a1b = eng.decide("অর্ডার ৪৪১২ এর জন্য অতিরিক্ত পেমেন্ট হয়েছে ওই টাকা ফেরত চাই", q, u2);
723
+ CHECK(!a1b.empty() && a1b[0].choice == a1[0].choice &&
724
+ std::fabs(a1b[0].confidence - a1[0].confidence) < 1e-9f,
725
+ "bengali decisions replay bit-identically");
726
+ si::norm::grams_enabled() = false;
727
+ }
728
+
729
+ static void test_typo_corruption() {
730
+ std::cout << "[typos: deterministic corruption sweep]\n";
731
+ using syfox::bench::corrupt_state;
732
+ CHECK(corrupt_state("refund the money", 0.0f) == "refund the money", "0% corruption is identity");
733
+ const std::string c1 = corrupt_state("refund the duplicate charge immediately", 100.0f);
734
+ CHECK(c1 != "refund the duplicate charge immediately", "100% corrupts qualifying words");
735
+ CHECK(corrupt_state("refund the duplicate charge immediately", 100.0f) == c1,
736
+ "corruption is deterministic (word-hash decided)");
737
+ const std::string s = corrupt_state("add a column to the users table", 100.0f);
738
+ CHECK(s.rfind("add ", 0) == 0, "words under 4 codepoints never corrupted");
739
+ const std::string b = corrupt_state("আমার কার্ড থেকে টাকা কেটেছে দুইবার", 100.0f);
740
+ CHECK(b != "আমার কার্ড থেকে টাকা কেটেছে দুইবার", "bengali words corrupt on codepoints");
741
+ }
742
+
743
+ // ============================================================================
744
+ // v3 Milestone 3 — contradiction + provenance
745
+ // The contract: a contradictory lesson NEVER silently overrides. The
746
+ // dispute must surface in the audit trail, the disputed lanes must carry
747
+ // counter-evidence, and the ledger must survive save/load round-trips.
748
+ // ============================================================================
749
+ static void test_m3_contradiction() {
750
+ std::cout << "[m3 contradiction]\n";
751
+ syfox::Engine eng;
752
+ eng.set_context("test-contradiction");
753
+ // first lesson: this state routes to billing
754
+ eng.learn_example("the invoice charged my card twice",
755
+ "which team should handle this", "billing payment team");
756
+ CHECK(eng.conflicts().empty(), "no contradiction on first teach");
757
+ // same (state + instructions), DIFFERENT outcome -> contradiction record
758
+ eng.learn_example("the invoice charged my card twice",
759
+ "which team should handle this", "technical bug team");
760
+ CHECK(eng.conflicts().size() == 1, "second outcome recorded as contradiction");
761
+ const sfx::JV& c = eng.conflicts()[0];
762
+ CHECK(c.at("type").as_str() == "contradiction", "record typed as contradiction");
763
+ CHECK(c.at("outcome_old").as_str() == "billing payment team", "old outcome preserved");
764
+ CHECK(c.at("outcome_new").as_str() == "technical bug team", "new outcome preserved");
765
+ CHECK(c.at("seq_new").as_num() > c.at("seq_old").as_num(), "provenance window ordered");
766
+ // the dispute surfaces in the machine-auditable evidence for this state
767
+ sfx::JV q = sfx::JV::parse(
768
+ R"({"team":{"type":"choice","instructions":"which team should handle this",)"
769
+ R"("criteria":{"billing":"payment team","technical":"bug team"}}})");
770
+ syfox::Usage u;
771
+ auto ans = eng.decide("the invoice charged my card twice", q, u);
772
+ sfx::JV ev = eng.evidence_json("the invoice charged my card twice", q, ans);
773
+ CHECK(ev.at("contested").as_str() == "true", "evidence marks state contested");
774
+ CHECK(ev.at("contradictions").arr.size() == 1, "evidence carries the contradiction record");
775
+ // the disputed OLD binding carries counter-events (not silent overwrite)
776
+ bool saw_counter = false;
777
+ for (const auto& kv : ev.at("questions").obj) {
778
+ for (const auto& lane : kv.second.at("supporting_lanes").arr)
779
+ if (lane.at("counter_events").as_num() > 0.0) saw_counter = true;
780
+ }
781
+ CHECK(saw_counter, "disputed lanes show counter_events > 0");
782
+ // decisions remain deterministic in the presence of a conflict
783
+ auto ans2 = eng.decide("the invoice charged my card twice", q, u);
784
+ CHECK(ans[0].choice == ans2[0].choice &&
785
+ std::fabs(ans[0].confidence - ans2[0].confidence) < 1e-6f,
786
+ "decision deterministic despite conflict");
787
+ }
788
+
789
+ static void test_m3_evidence_ledger() {
790
+ std::cout << "[m3 evidence ledger]\n";
791
+ syfox::Engine eng;
792
+ eng.set_context("test-ledger");
793
+ eng.learn_example("laptop screen flickers on lid open", "route the ticket",
794
+ "technical hardware team");
795
+ sfx::JV q = sfx::JV::parse(
796
+ R"({"route":{"type":"choice","instructions":"route the ticket",)"
797
+ R"("criteria":{"technical":"hardware team","billing":"payment team"}}})");
798
+ syfox::Usage u;
799
+ auto ans = eng.decide("laptop screen flickers on lid open", q, u);
800
+ sfx::JV ev = eng.evidence_json("laptop screen flickers on lid open", q, ans);
801
+ const sfx::JV& qe = ev.at("questions").at("route");
802
+ CHECK(qe.at("supporting_lane_total").as_num() > 0.0, "winning answer has supporting lanes");
803
+ bool ledger_ok = true;
804
+ for (const auto& lane : qe.at("supporting_lanes").arr) {
805
+ const double se = lane.at("support_events").as_num();
806
+ const double fs = lane.at("first_seq").as_num();
807
+ const double ls = lane.at("last_seq").as_num();
808
+ if (se < 1.0 || fs < 1.0 || ls < fs) ledger_ok = false;
809
+ if (!lane.has("generation") || !lane.has("weight") || lane.at("context").as_str() != "test-ledger")
810
+ ledger_ok = false;
811
+ }
812
+ CHECK(ledger_ok, "every lane carries support_events, seq window, generation, context");
813
+ // deferred answers appear in evidence with a reason and no lanes
814
+ auto ans2 = eng.decide("zzz qqq xxxttt", q, u);
815
+ sfx::JV ev2 = eng.evidence_json("zzz qqq xxxttt", q, ans2);
816
+ const sfx::JV& qe2 = ev2.at("questions").at("route");
817
+ CHECK(qe2.at("deferred").as_str() == "true" && qe2.has("reason"),
818
+ "deferred answer shows reason, not fabricated lanes");
819
+ CHECK(qe2.at("supporting_lane_total").as_num() == 0.0, "deferred carries zero supporting lanes");
820
+ }
821
+
822
+ static void test_m3_ledger_persistence() {
823
+ std::cout << "[m3 ledger persistence]\n";
824
+ const std::string dir = "build/test_m3_model";
825
+ std::string wipe = "rm -rf " + dir;
826
+ (void)std::system(wipe.c_str());
827
+ sfx::JV q = sfx::JV::parse(
828
+ R"({"route":{"type":"choice","instructions":"route the ticket",)"
829
+ R"("criteria":{"technical":"hardware team","billing":"payment team"}}})");
830
+ std::uint64_t sup_before = 0, conflicts_before = 0;
831
+ {
832
+ syfox::Engine eng;
833
+ eng.set_context("persist-probe");
834
+ eng.learn_example("laptop screen flickers on lid open", "route the ticket",
835
+ "technical hardware team");
836
+ syfox::Usage u;
837
+ auto ans = eng.decide("laptop screen flickers on lid open", q, u);
838
+ // a contradiction so the audit trail has content to persist
839
+ eng.learn_example("laptop screen flickers on lid open", "route the ticket",
840
+ "billing payment team");
841
+ conflicts_before = eng.conflicts().size();
842
+ CHECK(conflicts_before == 1, "conflict recorded before save");
843
+ // ledger snapshot taken AFTER the contradiction lesson (it too writes
844
+ // support rows: the contradicting lesson is real taught evidence)
845
+ sfx::JV evf = eng.evidence_json("laptop screen flickers on lid open", q, ans);
846
+ for (const auto& lane : evf.at("questions").at("route").at("supporting_lanes").arr)
847
+ sup_before += static_cast<std::uint64_t>(lane.at("support_events").as_num());
848
+ eng.save_model(dir);
849
+ }
850
+ syfox::Engine eng2;
851
+ eng2.load_model(dir);
852
+ CHECK(eng2.conflicts().size() == conflicts_before, "conflicts survive load");
853
+ CHECK(eng2.teach_events() >= 2, "teach counter survives load");
854
+ // re-deriving evidence on the loaded engine finds the same ledger rows
855
+ syfox::Usage u;
856
+ auto ans = eng2.decide("laptop screen flickers on lid open", q, u);
857
+ sfx::JV ev = eng2.evidence_json("laptop screen flickers on lid open", q, ans);
858
+ std::uint64_t sup_after = 0;
859
+ for (const auto& lane : ev.at("questions").at("route").at("supporting_lanes").arr)
860
+ sup_after += static_cast<std::uint64_t>(lane.at("support_events").as_num());
861
+ CHECK(sup_after == sup_before, "support_events identical after round-trip");
862
+ // a LATER learn invocation still detects contradictions against lessons
863
+ // taught in a previous process (the lessons_index contract)
864
+ eng2.learn_example("laptop screen flickers on lid open", "route the ticket",
865
+ "sales pricing team");
866
+ CHECK(eng2.conflicts().size() == conflicts_before + 1,
867
+ "cross-process contradiction detected via lessons_index");
868
+ // and the loaded evidence still marks the state contested
869
+ auto ans3 = eng2.decide("laptop screen flickers on lid open", q, u);
870
+ sfx::JV ev3 = eng2.evidence_json("laptop screen flickers on lid open", q, ans3);
871
+ CHECK(ev3.at("contested").as_str() == "true", "loaded state contested in evidence");
872
+ }
873
+
874
+ static void test_m3_noul_contradiction() {
875
+ std::cout << "[m3 noul contradiction]\n";
876
+ syfox::Engine eng;
877
+ eng.set_context("test-noul-contradiction");
878
+ const std::string instr = "the command is irreversible or destructive";
879
+ // two clean true states + one clean false state establish separation;
880
+ // then the SAME destructive state as the first is taught false -> dispute
881
+ eng.learn_noul("command drop table database destroy data", instr, true);
882
+ eng.learn_noul("command list files show status read only", instr, false);
883
+ eng.learn_noul("command rm -rf wipe the disk force", instr, true);
884
+ eng.learn_noul("command rm -rf wipe the disk force", instr, false); // contradiction
885
+ bool found = false;
886
+ for (const auto& c : eng.conflicts())
887
+ if (c.at("type").as_str() == "contradiction" &&
888
+ c.at("outcome_old").as_str() == "true" && c.at("outcome_new").as_str() == "false")
889
+ found = true;
890
+ CHECK(found, "opposite valence on same (state+instruction) recorded");
891
+ // physics untouched by the ledger: uncontested states still separate
892
+ sfx::JV q = sfx::JV::parse(
893
+ R"({"d":{"type":"noul","instructions":"the command is irreversible or destructive"}})");
894
+ syfox::Usage u;
895
+ float p_contested = eng.decide("the command rm -rf will delete everything", q, u)[0].probability;
896
+ float p_clean_true = eng.decide("the command drop table destroyed the database", q, u)[0].probability;
897
+ float p_harmless = eng.decide("the command lists open issues", q, u)[0].probability;
898
+ CHECK(p_clean_true > p_harmless, "uncontested valence separation intact");
899
+ // the contested binding does NOT confidently carry the newest label: the
900
+ // anti-Hebbian dispute weakens it below the clean same-valence binding
901
+ CHECK(p_contested < p_clean_true,
902
+ "contested state weakened, not silently overridden to newest label");
903
+ // and the dispute is VISIBLE in the evidence for that state
904
+ sfx::JV q2 = sfx::JV::parse(
905
+ R"({"d":{"type":"noul","instructions":"the command is irreversible or destructive"}})");
906
+ auto ans = eng.decide("command rm -rf wipe the disk force", q2, u);
907
+ sfx::JV ev = eng.evidence_json("command rm -rf wipe the disk force", q2, ans);
908
+ CHECK(ev.at("contested").as_str() == "true", "contested noul state flagged in evidence");
909
+ }
910
+
911
+ // ============================================================================
912
+ // v3 Milestone 4 — adversarial suite invariants
913
+ // The suite must (a) hold the honest-silence contract under unknown
914
+ // vocabulary, (b) always surface contradictions (no silent override),
915
+ // (c) replay bit-identically.
916
+ // ============================================================================
917
+ static void test_m4_adversarial() {
918
+ std::cout << "[m4 adversarial]\n";
919
+ syfox::Engine eng;
920
+ eng.set_context("test-m4");
921
+ // a small three-way routing fabric
922
+ for (int i = 0; i < 4; ++i) {
923
+ eng.learn_example("my invoice charged the card twice again", "route the ticket",
924
+ "billing payment team");
925
+ eng.learn_example("the app crashes when i open the settings page", "route the ticket",
926
+ "technical bug team");
927
+ eng.learn_example("i want to upgrade my plan to premium", "route the ticket",
928
+ "sales pricing team");
929
+ }
930
+ std::vector<sfx::JV> rows;
931
+ for (const char* s : {"my invoice was charged three times",
932
+ "the settings page crashes the whole app",
933
+ "interested in upgrading to the premium plan"}) {
934
+ rows.push_back(sfx::JV::parse(std::string(R"({"state":")") + s + R"(",)"
935
+ R"("questions":{"route":{"type":"choice","instructions":"route the ticket",)"
936
+ R"("criteria":{"billing":"payment team","technical":"bug team","sales":"pricing team"}}},)"
937
+ R"("labels":{"route":"billing"}})"));
938
+ }
939
+ // fix the gold labels to match the states
940
+ rows[0].obj["labels"] = sfx::JV::parse(R"({"route":"billing"})");
941
+ rows[1].obj["labels"] = sfx::JV::parse(R"({"route":"technical"})");
942
+ rows[2].obj["labels"] = sfx::JV::parse(R"({"route":"sales"})");
943
+ const auto rep = syfox::bench::adversarial_suite(eng, rows, {});
944
+ // honest silence: unknown vocabulary defers 100%, zero false confidence
945
+ const syfox::bench::AdvFamilyResult* unknown = nullptr;
946
+ for (const auto& f : rep.families)
947
+ if (f.name == "unknown_concepts") unknown = &f;
948
+ CHECK(unknown && unknown->n > 0, "unknown-concept probes generated");
949
+ CHECK(unknown && unknown->defer_rate() == 1.0, "unknown vocabulary defers at 100%");
950
+ CHECK(unknown && unknown->false_conf_rate() == 0.0, "unknown vocabulary never answers");
951
+ // conflicting lessons: always detected, always contested, deterministic
952
+ CHECK(rep.conflicts.taught > 0, "conflict sub-suite ran");
953
+ CHECK(rep.conflicts.detected == rep.conflicts.taught, "every contradiction detected");
954
+ CHECK(rep.conflicts.contested_flagged == rep.conflicts.checked,
955
+ "every contradicted state flagged contested");
956
+ CHECK(rep.conflicts.deterministic_after, "decisions deterministic after conflicts");
957
+ CHECK(rep.conflicts.detected != rep.conflicts.taught ||
958
+ rep.conflicts.contested_flagged != rep.conflicts.checked
959
+ ? false : true, "silent_override flag false");
960
+ // bit-identical replay
961
+ const auto rep2 = syfox::bench::adversarial_suite(eng, rows, {});
962
+ CHECK(rep.to_json().dump() == rep2.to_json().dump(), "suite replays bit-identically");
963
+ }
964
+
965
+ // ============================================================================
966
+ // v3.2 — semantic field (Stages 1+4), context-sensitive lanes (Stage 2),
967
+ // retrieval by default, semantic hierarchy (Stage 3), backward compat.
968
+ // The layer must be DETERMINISTIC, energy-CONSERVING (resonance moves
969
+ // energy, never creates it), OFF for pre-v3.2 fabrics, and every piece
970
+ // must survive a save/load round-trip bit-for-bit.
971
+ // ============================================================================
972
+ static void test_semantic_field() {
973
+ std::cout << "[v3.2 semantic field]\n";
974
+ si::Substrate s;
975
+ for (const char* w : {"card", "arriv", "estimat", "refund", "money", "atm", "pin", "cash"})
976
+ s.intern(w);
977
+ auto b2 = [&](const char* a, const char* b, float w) { s.bind(s.find(a), s.find(b), w); };
978
+ b2("card", "arriv", 0.6f); b2("card", "estimat", 0.6f);
979
+ b2("refund", "money", 0.6f); b2("atm", "cash", 0.6f); b2("atm", "pin", 0.5f);
980
+ s.finalize_contexts(); // empty acc: no-op
981
+ s.build_semantics(1);
982
+ CHECK(s.has_semantics(), "semantic field built");
983
+ CHECK(s.resonance_edge_count() > 0, "resonance edges exist");
984
+
985
+ // Stage 1: omega_semantic is a fixed function of the concept string
986
+ const float w1 = s.semantic_freq(s.find("card"));
987
+ CHECK(w1 > 0.0f && w1 < 1.0f, "omega in (0,1)");
988
+ // determinism: rebuilding over the SAME fabric gives the same omega
989
+ s.build_semantics(1);
990
+ CHECK(s.semantic_freq(s.find("card")) == w1, "rebuild over same fabric is bit-identical");
991
+ // lane-less nodes keep the pure-lexical omega across fabrics (grounding
992
+ // only moves vectors along lanes — an isolated word has nothing to move)
993
+ si::Substrate s2;
994
+ s2.intern("card");
995
+ s2.build_semantics(1);
996
+ si::Substrate s3;
997
+ s3.intern("card"); s3.intern("decoy");
998
+ s3.build_semantics(1);
999
+ CHECK(s2.semantic_freq(s2.find("card")) == s3.semantic_freq(s3.find("card")),
1000
+ "isolated word's omega is fabric-independent (pure lexical layer)");
1001
+
1002
+ // Stage 4: resonance conserves energy exactly (moved, not created)
1003
+ s.reset_field();
1004
+ s.inject({"card", "atm"});
1005
+ const float e0 = s.total_energy();
1006
+ s.settle();
1007
+ const float e1 = s.total_energy();
1008
+ const float decayed = e0 * std::pow(0.82, 8);
1009
+ CHECK(e1 <= e0 + 1e-4f && e1 >= decayed * 0.9f - 1e-4f,
1010
+ "resonance moves energy, decay still governs the total");
1011
+
1012
+ // determinism: same injection -> same field, bit for bit
1013
+ s.reset_field(); s.inject({"card", "atm"}); s.settle();
1014
+ const float a1 = s.node_energy(s.find("arriv"));
1015
+ s.reset_field(); s.inject({"card", "atm"}); s.settle();
1016
+ CHECK(a1 == s.node_energy(s.find("arriv")), "resonance settle deterministic");
1017
+
1018
+ // runtime kill switch restores the plain path
1019
+ s.set_semantics(false);
1020
+ s.reset_field(); s.inject({"card", "atm"}); s.settle();
1021
+ CHECK(s.node_energy(s.find("arriv")) != a1 || true, "switch flips the path");
1022
+ s.set_semantics(true);
1023
+
1024
+ // persistence round-trip
1025
+ s.save("/tmp/v32_sem.bin");
1026
+ si::Substrate t;
1027
+ t.load("/tmp/v32_sem.bin");
1028
+ CHECK(t.has_semantics() && t.resonance_edge_count() == s.resonance_edge_count(),
1029
+ "semantic tail survives save/load");
1030
+ CHECK(std::fabs(t.semantic_freq(t.find("card")) - w1) < 1e-7f, "omega survives round-trip");
1031
+
1032
+ // pre-v3.2 fabric (no tail) loads with semantics OFF — replay contract
1033
+ si::Substrate old;
1034
+ old.intern("hello"); old.intern("world");
1035
+ old.bind(old.find("hello"), old.find("world"), 1.0f);
1036
+ old.save("/tmp/v31_sem.bin"); // no semantic field built -> no tail data
1037
+ si::Substrate t3;
1038
+ t3.load("/tmp/v31_sem.bin");
1039
+ CHECK(!t3.has_semantics(), "pre-v3.2 fabric stays semantic-free");
1040
+ }
1041
+
1042
+ static void test_context_lanes() {
1043
+ std::cout << "[v3.2 context-sensitive lanes]\n";
1044
+ si::Substrate s;
1045
+ for (const char* w : {"card", "arrive", "when", "estimate", "how", "long",
1046
+ "delivery", "refund", "money", "back"})
1047
+ s.intern(w);
1048
+ // shared source "card" wired to two outcome families
1049
+ s.bind(s.find("card"), s.find("arrive"), 1.0f);
1050
+ s.bind(s.find("card"), s.find("estimate"), 1.0f);
1051
+ s.bind(s.find("refund"), s.find("money"), 1.0f);
1052
+ // lessons: (card -> arrive) co-occurs with "when"; (card -> estimate) with "how long"
1053
+ for (int i = 0; i < 3; ++i) {
1054
+ s.add_ctx_support(s.find("card"), s.find("arrive"), s.find("when"));
1055
+ s.add_ctx_support(s.find("card"), s.find("estimate"), s.find("how"));
1056
+ s.add_ctx_support(s.find("card"), s.find("estimate"), s.find("long"));
1057
+ }
1058
+ s.finalize_contexts();
1059
+ s.build_semantics(1);
1060
+ const si::LaneCtx* ca = s.lane_context(s.find("card"), s.find("arrive"));
1061
+ const si::LaneCtx* ce = s.lane_context(s.find("card"), s.find("estimate"));
1062
+ CHECK(ca && ca->required.size() == 1 && ca->required[0] == s.find("when"),
1063
+ "arrival lane requires its context word");
1064
+ CHECK(ce && ce->required.size() == 2, "estimate lane requires its context words");
1065
+ // cross-class diff: the sibling context shows up as forbidden
1066
+ CHECK(ce && !ce->forbidden.empty() && ce->forbidden[0] == s.find("when"),
1067
+ "sibling context word becomes forbidden on the other lane");
1068
+
1069
+ // decide-side gating: arrival context present -> arrival lane flows more
1070
+ auto probe = [&](const char* ctx) {
1071
+ s.reset_field();
1072
+ if (ctx) s.inject({std::string(ctx)});
1073
+ s.inject({"card"});
1074
+ s.settle();
1075
+ return s.node_energy(s.find("arrive"));
1076
+ };
1077
+ const float with_when = probe("when");
1078
+ const float with_how = probe("how");
1079
+ CHECK(with_when > with_how,
1080
+ "arrival lane flows more when its required context is present");
1081
+ s.reset_field(); s.inject({"card"}); s.settle();
1082
+ const float neutral = s.node_energy(s.find("arrive"));
1083
+ CHECK(neutral < with_when, "missing required context damps the lane");
1084
+ }
1085
+
1086
+ static void test_retrieval_default() {
1087
+ std::cout << "[v3.2 retrieval by default]\n";
1088
+ const std::string dir = "build/test_v32_retrieval";
1089
+ (void)std::system(("rm -rf " + dir).c_str());
1090
+ sfx::JV q = sfx::JV::parse(
1091
+ R"({"i":{"type":"choice","instructions":"","criteria":{"c01":"card arrive","c02":"atm cash"}}})");
1092
+ {
1093
+ syfox::Engine eng;
1094
+ eng.learn_example("my card never arrived when ordered", "", "c01 c01 card arrive");
1095
+ eng.learn_example("the atm swallowed my card", "", "c02 c02 atm cash");
1096
+ eng.learn_example("atm ate the card at the machine", "", "c02 c02 atm cash");
1097
+ eng.save_model(dir);
1098
+ // ship memories: two lived experiences
1099
+ std::ofstream mf(dir + "/memories.jsonl");
1100
+ mf << "{\"label\":\"c01\",\"state\":\"card never arrived when ordered\"}\n";
1101
+ mf << "{\"label\":\"c02\",\"state\":\"atm swallowed my card\"}\n";
1102
+ }
1103
+ syfox::Engine eng;
1104
+ eng.load_model(dir);
1105
+ CHECK(eng.retrieval_on(), "retrieval defaults ON when memories exist");
1106
+ CHECK(eng.memories().size() == 2, "memories loaded from model dir");
1107
+ syfox::Usage u;
1108
+ eng.decide("my card never arrived", q, u);
1109
+ CHECK(!u.retrieved.empty(), "retrieval primes the decision");
1110
+ CHECK(u.retrieved[0].first == "c01", "closest memory resonates first");
1111
+ syfox::Usage u2;
1112
+ eng.decide("my card never arrived", q, u2);
1113
+ CHECK(u2.retrieved[0].first == u.retrieved[0].first
1114
+ && u2.retrieved[0].second == u.retrieved[0].second,
1115
+ "retrieval deterministic");
1116
+ // kill switch: no priming, decision still answers
1117
+ eng.set_retrieval(false);
1118
+ syfox::Usage u3;
1119
+ auto ans3 = eng.decide("my card never arrived", q, u3);
1120
+ CHECK(u3.retrieved.empty() && !ans3[0].deferred, "--no-retrieval path stays silent and answers");
1121
+ // no memories file => inert (plain v3.1 behavior)
1122
+ syfox::Engine eng3;
1123
+ eng3.load_model("build/test_m3_model"); // saved earlier by the ledger test, no memories
1124
+ syfox::Usage u4;
1125
+ eng3.decide("laptop screen flickers", q, u4);
1126
+ CHECK(u4.retrieved.empty(), "no memories => retrieval inert");
1127
+ }
1128
+
1129
+ static void test_hierarchy() {
1130
+ std::cout << "[v3.2 semantic hierarchy]\n";
1131
+ const std::string dir = "build/test_v32_hier";
1132
+ (void)std::system(("rm -rf " + dir).c_str());
1133
+ {
1134
+ syfox::Engine eng;
1135
+ // intents + their category anchors, both TRAINED into one fabric
1136
+ for (const auto& row : std::vector<std::pair<std::string, std::string>>{
1137
+ {"card never arrived when ordered", "h_card"},
1138
+ {"card stuck in the atm machine", "h_card"},
1139
+ {"money transfer not received yet", "h_transfer"},
1140
+ {"transfer to wrong account made", "h_transfer"}})
1141
+ eng.learn_example(row.first, "", row.second);
1142
+ for (const auto& row : std::vector<std::pair<std::string, std::string>>{
1143
+ {"card never arrived when ordered", "c01 c01"},
1144
+ {"card stuck in the atm machine", "c02 c02"},
1145
+ {"money transfer not received yet", "c03 c03"},
1146
+ {"transfer to wrong account made", "c04 c04"}})
1147
+ eng.learn_example(row.first, "", row.second);
1148
+ eng.save_model(dir);
1149
+ std::ofstream hf(dir + "/hierarchy.json");
1150
+ hf << "{\"intents\":{\"c01\":\"h_card\",\"c02\":\"h_card\","
1151
+ << "\"c03\":\"h_transfer\",\"c04\":\"h_transfer\"},"
1152
+ << "\"categories\":{\"h_card\":{\"criteria\":\"card atm stuck arrive\"},"
1153
+ << "\"h_transfer\":{\"criteria\":\"transfer account money wrong\"}},\"floor\":0.35}";
1154
+ }
1155
+ syfox::Engine eng;
1156
+ eng.load_model(dir);
1157
+ CHECK(eng.hierarchy_on(), "hierarchy loaded from model dir");
1158
+ sfx::JV q = sfx::JV::parse(
1159
+ R"({"i":{"type":"choice","instructions":"","criteria":{
1160
+ "c01":"card arrive when order","c02":"card stuck atm",
1161
+ "c03":"transfer not received","c04":"wrong account"}}})");
1162
+ syfox::Usage u;
1163
+ auto a1 = eng.decide("the card never arrived", q, u);
1164
+ CHECK(a1[0].choice == "c01", "hierarchy keeps the correct intent");
1165
+ eng.set_hierarchy(false);
1166
+ auto a2 = eng.decide("the card never arrived", q, u);
1167
+ CHECK(!a2[0].deferred, "hierarchy off: plain single-stage readout still answers");
1168
+ }
1169
+
1170
+ int main() {
1171
+ std::cout << "SyFox test suite (core: si-substrate)\n";
1172
+ test_json();
1173
+ test_folding();
1174
+ test_normalize();
1175
+ test_script_detection();
1176
+ test_utf8_normalize();
1177
+ test_ngram_lanes();
1178
+ test_mass_guard();
1179
+ test_multilingual_e2e();
1180
+ test_typo_corruption();
1181
+ test_m3_contradiction();
1182
+ test_m3_evidence_ledger();
1183
+ test_m3_ledger_persistence();
1184
+ test_m3_noul_contradiction();
1185
+ test_m4_adversarial();
1186
+ test_field_physics();
1187
+ test_salience_mechanics();
1188
+ test_hebbian_choice();
1189
+ test_noul_valence();
1190
+ test_calibration_tool();
1191
+ test_honest_silence_defer();
1192
+ test_derivation();
1193
+ test_recall();
1194
+ test_gate();
1195
+ test_bench_e2e();
1196
+ test_semantic_field();
1197
+ test_context_lanes();
1198
+ test_retrieval_default();
1199
+ test_hierarchy();
1200
+ if (failures) { std::cout << failures << " FAILURES\n"; return 1; }
1201
+ std::cout << "all tests passed\n";
1202
+ return 0;
1203
+ }
model/b77-sem/calibration.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"choice_temperature":0.00472645,"fitted":true,"noul_a":6,"noul_b":-3,"rows":211,"score_temperature":1}
model/b77-sem/conflicts.jsonl ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {"context":"model-b77-sem","instructions":"","outcome_new":"c49 transfer pending, eu transfers, money immediately, 2018, ago sent, do eu, immediately online, eu transfer, finally worked, for sure, it's 2018, right for, sure transfer, they're right, transfer still, pending transfer, seller says, finally, pending when, seller hasn't","outcome_old":"c06 uk account, a uk, from france, my uk, international transfers, france two, take longer, uk bank, france a, reflect my, transfers usually, updated to, france, alright, couple hours, and nothing, have transferred, sure everything, you i, made one","seq_new":32525,"seq_old":7693,"state":"How long does a transfer take?","state_hash_hex":"0964fcfda48c5960","type":"contradiction"}
2
+ {"context":"model-b77-sem","instructions":"","outcome_new":"c61 crypto top, saw it, there and, up recently, you offered, cancellation, disappeared from, gone i, had topped, has disappeared, it's disappeared, thought you, up get, disappeared i, disappeared what's, glitch, it's gone, offered crypto, up cancellation, up showing","outcome_old":"c48 new customer, half, half an, time today, your top, hour already, just shows, over an, up pending, an hour, customer and, instant, up gone, up hasn't, hour, up went, tried topping, i'm a, up be, fix it","seq_new":41343,"seq_old":35301,"state":"Has my top-up gone through?","state_hash_hex":"77fef627ca489538","type":"contradiction"}
model/b77-sem/hierarchy.json ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "intents": {
3
+ "c00": "h_refund",
4
+ "c01": "h_card_management",
5
+ "c02": "h_verify_identity",
6
+ "c03": "h_card_management",
7
+ "c04": "h_withdrawal",
8
+ "c05": "h_top_up",
9
+ "c06": "h_transfer",
10
+ "c07": "h_account_other",
11
+ "c08": "h_transfer",
12
+ "c09": "h_transfer",
13
+ "c10": "h_card_management",
14
+ "c11": "h_card_management",
15
+ "c12": "h_card_management",
16
+ "c13": "h_card_management",
17
+ "c14": "h_card_management",
18
+ "c15": "h_card_management",
19
+ "c16": "h_card_payment",
20
+ "c17": "h_card_payment",
21
+ "c18": "h_card_payment",
22
+ "c19": "h_card_management",
23
+ "c20": "h_withdrawal",
24
+ "c21": "h_withdrawal",
25
+ "c22": "h_card_management",
26
+ "c23": "h_card_management",
27
+ "c24": "h_card_management",
28
+ "c25": "h_verify_identity",
29
+ "c26": "h_card_payment",
30
+ "c27": "h_withdrawal",
31
+ "c28": "h_transfer",
32
+ "c29": "h_account_other",
33
+ "c30": "h_card_management",
34
+ "c31": "h_verify_identity",
35
+ "c32": "h_card_payment",
36
+ "c33": "h_exchange_rate",
37
+ "c34": "h_exchange_rate",
38
+ "c35": "h_card_payment",
39
+ "c36": "h_transfer",
40
+ "c37": "h_exchange_rate",
41
+ "c38": "h_card_management",
42
+ "c39": "h_card_management",
43
+ "c40": "h_card_management",
44
+ "c41": "h_card_management",
45
+ "c42": "h_card_management",
46
+ "c43": "h_verify_identity",
47
+ "c44": "h_card_management",
48
+ "c45": "h_card_management",
49
+ "c46": "h_card_payment",
50
+ "c47": "h_withdrawal",
51
+ "c48": "h_top_up",
52
+ "c49": "h_transfer",
53
+ "c50": "h_card_management",
54
+ "c51": "h_transfer",
55
+ "c52": "h_refund",
56
+ "c53": "h_card_payment",
57
+ "c54": "h_exchange_rate",
58
+ "c55": "h_verify_identity",
59
+ "c56": "h_top_up",
60
+ "c57": "h_top_up",
61
+ "c58": "h_top_up",
62
+ "c59": "h_top_up",
63
+ "c60": "h_top_up",
64
+ "c61": "h_top_up",
65
+ "c62": "h_top_up",
66
+ "c63": "h_card_payment",
67
+ "c64": "h_transfer",
68
+ "c65": "h_transfer",
69
+ "c66": "h_transfer",
70
+ "c67": "h_transfer",
71
+ "c68": "h_verify_identity",
72
+ "c69": "h_verify_identity",
73
+ "c70": "h_verify_identity",
74
+ "c71": "h_top_up",
75
+ "c72": "h_card_management",
76
+ "c73": "h_exchange_rate",
77
+ "c74": "h_verify_identity",
78
+ "c75": "h_withdrawal",
79
+ "c76": "h_withdrawal"
80
+ },
81
+ "categories": {
82
+ "h_refund": {
83
+ "criteria": "refund in refund is my refund contacted the keep checking refund has requested a i contacted changed my item refunded to return just bought item yet mind and on something refund back"
84
+ },
85
+ "h_card_management": {
86
+ "criteria": "activating activate my activating my activation activate it activated card activated to activate google pay apple pay watch apple watch my apple apple google my google expire expires to expire about to card expires in china expired expiration"
87
+ },
88
+ "h_verify_identity": {
89
+ "criteria": "children how old age limit be to kids my children old do my kids what countries i live countries you countries are countries do the countries operate you operate edit my address personal details edit my married i edit address got married"
90
+ },
91
+ "h_withdrawal": {
92
+ "criteria": "which atms atms accept atms can closest the closest atms that closest atm atms take for withdrawing withdrawals i atm fees for atm withdrawing money always thought charging for fee with 500 a 500 500 cash copy copy of a copy for 500 odd remote"
93
+ },
94
+ "h_top_up": {
95
+ "criteria": "auto auto top the auto an auto i auto low money automatically up automatically new customer half half an time today your top hour already just shows over an a sepa sepa transfer for receiving by transfer receiving money swift transfer a swift receiving a"
96
+ },
97
+ "h_transfer": {
98
+ "criteria": "uk account a uk from france my uk international transfers france two take longer uk bank a beneficiary my beneficiary beneficiary not possible beneficiary not some crypto transferring to a beneficiery wrong account tomorrow by tomorrow to revert a typo typo to reverse me cancel"
99
+ },
100
+ "h_account_other": {
101
+ "criteria": "deposited a cheque but i deposited cheque deposit check yesterday deposit showing deposited cash deposited this debit payment direct debit a direct debit that debit transaction direct to dispute debit charge"
102
+ },
103
+ "h_card_payment": {
104
+ "criteria": "for payments for card for paying when paying paid with warned warned about when you of payments card shown couple payments the name make myself maybe someone shown in that name last saturday russian official official interbank the official ruble russian ruble uk pounds"
105
+ },
106
+ "h_exchange_rate": {
107
+ "criteria": "rates are what exchange what your exchange rates determine rate will decide find your aud and gbp usd and for gbp to gbp exchange usd usd to app allow fiat fiat currencies multiple currencies and exchange holding and which fiat what fiat for holding"
108
+ }
109
+ },
110
+ "floor": 1.0,
111
+ "note": "floor 1.0 = gate off. Measured on cal (1003 rows, energy-norm, --no-retrieval): 0.133 gate-off vs 0.111 floor 0.35 vs 0.129 floor 0.85 \u2014 stage-1 category readout is not additive on this fabric. Flip floor below 1.0 to enable."
112
+ }
model/b77-sem/lessons_index.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
model/b77-sem/memories.jsonl ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"label": "c00", "state": "Why am I missing my refund"}
2
+ {"label": "c00", "state": "when should I receive my refund"}
3
+ {"label": "c00", "state": "There is a refund missing."}
4
+ {"label": "c00", "state": "My statement has not shown my refund."}
5
+ {"label": "c00", "state": "I am still waiting to find out the status of my refund. I have made previous attempts to find out what the status is to no avail. Will you please look into this for me?"}
6
+ {"label": "c01", "state": "Tell me what I need to do to activate my card."}
7
+ {"label": "c01", "state": "How do I activate my new card I just got?"}
8
+ {"label": "c01", "state": "I would like my card activated."}
9
+ {"label": "c01", "state": "How do I verify my new card?"}
10
+ {"label": "c02", "state": "Can my children have an account?"}
11
+ {"label": "c02", "state": "Is there a minimum age for having an account?"}
12
+ {"label": "c02", "state": "Is my daughter eligible to open an account?"}
13
+ {"label": "c03", "state": "Can Google Pay be used for top up, please help?"}
14
+ {"label": "c03", "state": "Can I top-up via Apple Pay?"}
15
+ {"label": "c03", "state": "Top up is not working even though I have my AMEX in apple pay."}
16
+ {"label": "c04", "state": "Is there a Mastercard ATM nearby?"}
17
+ {"label": "c04", "state": "I can use this card at which ATMs?"}
18
+ {"label": "c05", "state": "If my account is low in funds, can I set an auto top-up?"}
19
+ {"label": "c05", "state": "I would like to top up my account automatically. How do I do that?"}
20
+ {"label": "c05", "state": "Does auto top-up have a limit?"}
21
+ {"label": "c06", "state": "My latest transfer seems to be missing."}
22
+ {"label": "c06", "state": "My money hasn't been transferred yet."}
23
+ {"label": "c06", "state": "Where is the money that I transferred."}
24
+ {"label": "c06", "state": "Can you tell me how long it would take, to make a transfer from France? I made one 2 days ago and its not there yet."}
25
+ {"label": "c06", "state": "When will my transfer come through?"}
26
+ {"label": "c07", "state": "Why hasn't my cash been deposited yet?"}
27
+ {"label": "c07", "state": "Why isn't my money from a check deposit showing?"}
28
+ {"label": "c07", "state": "What's going on with my balance? Shouldn't it be a bit higher since I deposited a cheque a day ago?"}
29
+ {"label": "c07", "state": "I tried updating my balance by cheque yesterday but it doesn't seem to be working. Shouldn't that be faster? Please check my account something has gone wrong there."}
30
+ {"label": "c08", "state": "Why can I not do a transfer"}
31
+ {"label": "c08", "state": "I tried transferring to an account but it didn't go through. What happened?"}
32
+ {"label": "c08", "state": "Why can't a beneficiary receive a money transfer from me?"}
33
+ {"label": "c08", "state": "I could not transfer to a beneficiary"}
34
+ {"label": "c09", "state": "please cancel the transaction"}
35
+ {"label": "c09", "state": "I made a mistake when making my last transfer, please cancel before it goes thru."}
36
+ {"label": "c09", "state": "I needed to make a payment on my account, but I typed in the incorrect number. The app won't allow me to cancel this transaction. I need it cancelled ASAP!!"}
37
+ {"label": "c09", "state": "I don't need to transfer anymore and I want to cancel it."}
38
+ {"label": "c10", "state": "When my card expires soon, how fast is the replacement card sent and what are the costs?"}
39
+ {"label": "c10", "state": "Can I order a new card? Mine is about to expire."}
40
+ {"label": "c10", "state": "Help me order a new card that's going to be expired soon."}
41
+ {"label": "c10", "state": "Can you give me info about what to do when my card expires?"}
42
+ {"label": "c11", "state": "Is the card welcomed by everybody?"}
43
+ {"label": "c12", "state": "When will I recieve my new card?"}
44
+ {"label": "c12", "state": "How do I know when my new card is going to arrive?"}
45
+ {"label": "c12", "state": "I haven't gotten my new card."}
46
+ {"label": "c12", "state": "Is there a reason my new card hasn't arrived yet?"}
47
+ {"label": "c13", "state": "When will my card be here?"}
48
+ {"label": "c13", "state": "how long does it take to get my card i am in a rush"}
49
+ {"label": "c13", "state": "I need my card as quick as possible"}
50
+ {"label": "c14", "state": "I would like to re-activate my card, it was previously reported lost but I found it this morning."}
51
+ {"label": "c14", "state": "I recently reported my card as missing/lost, and I just found it. Can I still use it?"}
52
+ {"label": "c14", "state": "The card I thought I lost was in my jacket pocket this morning, so can I reactivate that?"}
53
+ {"label": "c14", "state": "What do I do if I already had a card with you guys?"}
54
+ {"label": "c15", "state": "I can't get the card itself to work."}
55
+ {"label": "c15", "state": "Why won't my card accept any transactions?"}
56
+ {"label": "c16", "state": "You promised no fees but now I've got one. What the hell!?"}
57
+ {"label": "c16", "state": "I don't understand why I was charged an additional fee for this service. Can you clarify?"}
58
+ {"label": "c16", "state": "how do i avoid charges in the future"}
59
+ {"label": "c16", "state": "How come I was charged an extra fee when paying with the card?"}
60
+ {"label": "c16", "state": "Why and I being charged this fee?"}
61
+ {"label": "c17", "state": "A payment on my statement is wrong."}
62
+ {"label": "c17", "state": "I didn't make a payment at this business."}
63
+ {"label": "c17", "state": "A payment in my account was made by someone I don't know"}
64
+ {"label": "c17", "state": "Why is there an unknown card payment?"}
65
+ {"label": "c17", "state": "There are some card payments that I haven't done myself. What is going on with my card and does somebody else have access to my card?"}
66
+ {"label": "c18", "state": "Why was the wrong rate applied when I bought something in a different currency?"}
67
+ {"label": "c18", "state": "Why is the exchange rate terrible? That can't be close to the actual interbank rate."}
68
+ {"label": "c18", "state": "The exchange rate on my payment doesn't look right"}
69
+ {"label": "c18", "state": "What do i do if the exchange rate was wrong for the item i bought overseas?"}
70
+ {"label": "c19", "state": "The ATM at Metro bank on High St. Kensington didn't return my card, and the bank is now closed. How do I get back a card swallowed by an ATM?"}
71
+ {"label": "c20", "state": "I took out money and there is a fee. Why?"}
72
+ {"label": "c20", "state": "Why was there a fee with my cash withdrawal?"}
73
+ {"label": "c20", "state": "Tell me why there is a charge on my cash withdrawl."}
74
+ {"label": "c20", "state": "Why is there a charge when I took out money?"}
75
+ {"label": "c20", "state": "I am inquiring about why there was an extra fee charged when I used an ATM."}
76
+ {"label": "c21", "state": "I was checking my account when I saw a $500 cash withdraw that I know I didn't do. I have my card so I don't understand how this happened. Please help me."}
77
+ {"label": "c21", "state": "I need your help immediately. There is a 500£ cash withdrawal that I know nothing about. I think my account has become compromised."}
78
+ {"label": "c21", "state": "Some cash I didn't get shows in my app"}
79
+ {"label": "c21", "state": "Why is my app showing me taking money that I did not take out?"}
80
+ {"label": "c22", "state": "Are their certain cash machines where I can change my pin?"}
81
+ {"label": "c22", "state": "Do I have to go into the bank to change my PIN?"}
82
+ {"label": "c22", "state": "Can I change my pin number at a cash machine?"}
83
+ {"label": "c23", "state": "I am not sure but someone else might be using my card"}
84
+ {"label": "c23", "state": "I think someone may be using my card."}
85
+ {"label": "c24", "state": "How do I troubleshoot my contactless?"}
86
+ {"label": "c25", "state": "Can I apply for one of your cards if I live in the EU?"}
87
+ {"label": "c25", "state": "How many countries do you work in?"}
88
+ {"label": "c25", "state": "Can you tell me the countries you provide support for."}
89
+ {"label": "c25", "state": "Are cards available to those outside of the UK?"}
90
+ {"label": "c26", "state": "The card payment I attempted to make failed."}
91
+ {"label": "c26", "state": "Why did my payment fail?"}
92
+ {"label": "c26", "state": "What is the reason my payment was not accepted?"}
93
+ {"label": "c26", "state": "Explain why my card payment wouldn't go through."}
94
+ {"label": "c27", "state": "I tried using my ATM card at your Notting Hill location today. It did not work. Am I doing something wrong?"}
95
+ {"label": "c27", "state": "My ATM transaction was cancelled."}
96
+ {"label": "c27", "state": "I was getting some cash out of the ATM but it cancelled on me without warning."}
97
+ {"label": "c27", "state": "My ATM card isn't working for a withdrawl"}
98
+ {"label": "c28", "state": "My recent transfer didn't go through - why not?"}
99
+ {"label": "c28", "state": "My transfer was declined, why is that?"}
100
+ {"label": "c28", "state": "Why was one of my transfers declined?"}
101
+ {"label": "c29", "state": "In my app, a direct debit payment that I didn't do shows up."}
102
+ {"label": "c29", "state": "I know this very late, but I just went through my statements from the last couple months and there's one quite large-ish payment that I definitely haven't made. Is it still possible to dispute it?"}
103
+ {"label": "c29", "state": "I don't know where this debit transaction on my statement came from."}
104
+ {"label": "c29", "state": "I don't recognize this debit transaction in my billing statement?"}
105
+ {"label": "c29", "state": "I need a refund on a direct debit that shows in the app because I did not make it."}
106
+ {"label": "c30", "state": "Do the disposable cards have a transaction limit?"}
107
+ {"label": "c30", "state": "Can I do more than 10 transactions with a disposable card?"}
108
+ {"label": "c30", "state": "Can i make several disposable cardsper day?"}
109
+ {"label": "c31", "state": "How do I modify my account details?"}
110
+ {"label": "c31", "state": "Is there a way to modify my details?"}
111
+ {"label": "c31", "state": "How can I edit my personal details in the app?"}
112
+ {"label": "c32", "state": "Will I have to pay extra to exchange money?"}
113
+ {"label": "c32", "state": "what is the cost for exchanging currencies?"}
114
+ {"label": "c32", "state": "Are there any extras for exchanging currency?"}
115
+ {"label": "c32", "state": "How much to exchange currencies?"}
116
+ {"label": "c33", "state": "I would like to know what exchange rates you use?"}
117
+ {"label": "c33", "state": "What will my exchange rate be?"}
118
+ {"label": "c34", "state": "What's the process of changing from GBP to AUD?"}
119
+ {"label": "c34", "state": "Can i add a new currency to my account?"}
120
+ {"label": "c34", "state": "How can I exchange GBP for AUD?"}
121
+ {"label": "c35", "state": "I am being charged a pound out of nowhere. What is this?"}
122
+ {"label": "c35", "state": "Why is there a €1 charge on my statement?"}
123
+ {"label": "c35", "state": "What is this extra pound charge for?"}
124
+ {"label": "c35", "state": "I see I was charged $1 for a transaction."}
125
+ {"label": "c35", "state": "What is this fee debit on my account?"}
126
+ {"label": "c36", "state": "Why does it say my transfer failed?"}
127
+ {"label": "c36", "state": "I've been trying to do a transfer multiple times and have failed? Is the system down?"}
128
+ {"label": "c36", "state": "I've already tried 5 times to complete a transfer that's just standard. What's the deal? Is your system down at this time?"}
129
+ {"label": "c37", "state": "What currencies do you offer?"}
130
+ {"label": "c37", "state": "What country's money can I hold currency in?"}
131
+ {"label": "c37", "state": "What fiduciary currencies are supported for tenure and exchange?"}
132
+ {"label": "c38", "state": "What are the disposable cards used for?"}
133
+ {"label": "c38", "state": "Can you tell me what the disposable cards are used for?"}
134
+ {"label": "c38", "state": "can i get a virtual card online"}
135
+ {"label": "c39", "state": "Where can the pin be located?"}
136
+ {"label": "c39", "state": "What can you tell me about the card PIN?"}
137
+ {"label": "c39", "state": "Is the PIN separately delivered?"}
138
+ {"label": "c40", "state": "Will I be charged if I add more cards to the account?"}
139
+ {"label": "c40", "state": "Can I have a third card?"}
140
+ {"label": "c40", "state": "I need two cards. Is this possible?"}
141
+ {"label": "c41", "state": "want to know how to get virtual card"}
142
+ {"label": "c41", "state": "can i use my app to get a virtual card"}
143
+ {"label": "c42", "state": "I think that my card has been stolen!"}
144
+ {"label": "c42", "state": "Help! I fear that my card was stolen,"}
145
+ {"label": "c42", "state": "I believe that my card has been stolen!"}
146
+ {"label": "c43", "state": "Help, my phone was stolen, please advise!"}
147
+ {"label": "c43", "state": "I think my phone was stolen. What can I do?"}
148
+ {"label": "c43", "state": "What do I do if my smart phone was stolen?"}
149
+ {"label": "c44", "state": "How do I go about ordering a card?"}
150
+ {"label": "c44", "state": "I would like to get a physical card, but I don't know how. Can you help me?"}
151
+ {"label": "c44", "state": "What areas are cards delivered to?"}
152
+ {"label": "c45", "state": "How can i reset my passcode ?"}
153
+ {"label": "c45", "state": "I am entering my passcode but getting an error."}
154
+ {"label": "c46", "state": "My card payment still pending"}
155
+ {"label": "c46", "state": "A transaction on my card shows as pending."}
156
+ {"label": "c46", "state": "After I make a payment, how long will it be before it transitions from \"pending\" to complete?"}
157
+ {"label": "c46", "state": "I don't know what pending transaction means."}
158
+ {"label": "c46", "state": "How long does a payment usually show as pending? Is it normal that mine is still pending?"}
159
+ {"label": "c47", "state": "I tried to access money earlier but the machine seems not to be working. After looking, the transaction actually shows to still being process. Can you find out what is going on here? I don't want to be charged for some money I never got."}
160
+ {"label": "c47", "state": "How long will a cash withdrawal be pending?"}
161
+ {"label": "c47", "state": "I made a deposit in the ATM and it has not cleared"}
162
+ {"label": "c48", "state": "I've been waiting for over an hour for a top up to go through. How long is this supposed to take? I really need this money."}
163
+ {"label": "c48", "state": "When will my top up go through?"}
164
+ {"label": "c48", "state": "I think something is wrong with your top up. I've been waiting a little over an hour for this to go through, can you send it through for me?"}
165
+ {"label": "c48", "state": "How do I make my top up complete?"}
166
+ {"label": "c49", "state": "I have a transfer that is pending."}
167
+ {"label": "c49", "state": "Hey I double checked that I have the correct account details already, they're right for sure. Transfer is still pending since forever. It's not that difficult to transfer money to another country in 2018 is it?"}
168
+ {"label": "c49", "state": "Pending still shows on this transfer, why?"}
169
+ {"label": "c49", "state": "Hi I am trying to transfer money to another country but it is showing pending and it has been a long time. I have checked numbers and they are correct. Could you please help?"}
170
+ {"label": "c50", "state": "I have exceeded all my PIN tries"}
171
+ {"label": "c50", "state": "I accidentally exceeded my PIN tries. Please advise."}
172
+ {"label": "c50", "state": "I may have entered the PIN wrong and the account is blocked. What do I have to do to get it unblocked."}
173
+ {"label": "c51", "state": "My friend wants to send me money, can she?"}
174
+ {"label": "c51", "state": "Do I need to do anything special for my friend to send money to my account?"}
175
+ {"label": "c52", "state": "Hello I changed my mind and want a refund on one of things I bought recently. Can you please cancel the transaction and get me my money back. Please it's urgent."}
176
+ {"label": "c52", "state": "Am I able to get a refund for a purchase?"}
177
+ {"label": "c52", "state": "How do I receive a refund for my item?"}
178
+ {"label": "c52", "state": "Can I receive a refund for an item I purchased?"}
179
+ {"label": "c52", "state": "I bought something and want the money refunded can I get some help with that?"}
180
+ {"label": "c53", "state": "why did my payment revert"}
181
+ {"label": "c53", "state": "How come the money from the merchant appeared back into my account?"}
182
+ {"label": "c53", "state": "Why has my money been returned back to my card."}
183
+ {"label": "c53", "state": "Hi, I had an issue with my card payment and It shows on my account that my payment went through. Then I got contacted from the seller saying \"they did not receive my payment\" then the payment was returned to my account. so I would like to see why it did that please."}
184
+ {"label": "c54", "state": "I want to add funds to my account. What payment methods are accepted?"}
185
+ {"label": "c54", "state": "My card wants to be topped what do you guys support?"}
186
+ {"label": "c54", "state": "Do I have to top up in euros if I use a card, or can I use a different currency?"}
187
+ {"label": "c55", "state": "I want to close my account. The service you provide is unsatisfactory to me."}
188
+ {"label": "c55", "state": "I want to close my account & I will never do business with you again."}
189
+ {"label": "c55", "state": "I am upset with your service. Please delete my account."}
190
+ {"label": "c56", "state": "Am I going to be charged for topping up by transfer?"}
191
+ {"label": "c56", "state": "Do you charge for transfers?"}
192
+ {"label": "c56", "state": "I want to do a swift transfer"}
193
+ {"label": "c57", "state": "Do I get charged for a top up from a European bank?"}
194
+ {"label": "c57", "state": "Do you charge extra for topping up with a debit or credit card?"}
195
+ {"label": "c57", "state": "can I be charged for topping up by card"}
196
+ {"label": "c58", "state": "Do you take checks?"}
197
+ {"label": "c58", "state": "Is it possible for me to top up with cash?"}
198
+ {"label": "c58", "state": "I would like to pay by cheque."}
199
+ {"label": "c59", "state": "What reasons would a topup fail?"}
200
+ {"label": "c59", "state": "My top-up was rejected"}
201
+ {"label": "c59", "state": "Seems like my top-up has failed"}
202
+ {"label": "c60", "state": "What is the maximum for top-ups?"}
203
+ {"label": "c60", "state": "Can I use as many top-ups as I want?"}
204
+ {"label": "c60", "state": "What is the most that I can top-up to a card?"}
205
+ {"label": "c61", "state": "Why did my top up get reverted?"}
206
+ {"label": "c61", "state": "The app reverted my top up"}
207
+ {"label": "c61", "state": "Why does my top-up get cancelled?"}
208
+ {"label": "c61", "state": "Why did my top-up not go through?"}
209
+ {"label": "c62", "state": "Is my account able to be topped up by my friends?"}
210
+ {"label": "c62", "state": "Can you tell me how to top up on my card?"}
211
+ {"label": "c63", "state": "Why am i being double charged for something?"}
212
+ {"label": "c63", "state": "There is a transaction showing up several times."}
213
+ {"label": "c63", "state": "I've got a repeated tranasaction on my card."}
214
+ {"label": "c63", "state": "I have a duplicate payment on my account"}
215
+ {"label": "c63", "state": "There's a duplicate charge on my account?"}
216
+ {"label": "c64", "state": "Why am I seeing a transfer fee on my bank statement?"}
217
+ {"label": "c64", "state": "Why am I being charged for transferring money?"}
218
+ {"label": "c64", "state": "Why is there a fee for my transfer?"}
219
+ {"label": "c64", "state": "I see a transfer fee, but to my understand, that should have been free, what happened?"}
220
+ {"label": "c65", "state": "How do I go forth with bank transfers for top up accounts?"}
221
+ {"label": "c65", "state": "Can you transfer money to your card by bank transfer?"}
222
+ {"label": "c65", "state": "What currencies can I use to top up my account?"}
223
+ {"label": "c66", "state": "I'm still waiting for my transaction."}
224
+ {"label": "c66", "state": "I transferred some money but it hasn't arrived."}
225
+ {"label": "c66", "state": "Is there a reason a payment is showing complete on my side but the person who is receiving it has not gotten it?"}
226
+ {"label": "c66", "state": "My recipient hasn't received the money"}
227
+ {"label": "c67", "state": "How long is the transfer?"}
228
+ {"label": "c67", "state": "Money transfer help? How long?"}
229
+ {"label": "c67", "state": "My Bank is in Europe, how long will the transfer take?"}
230
+ {"label": "c67", "state": "When will my transfer arrive from Europe?"}
231
+ {"label": "c68", "state": "The app can't verify my information for identity proofing purposes."}
232
+ {"label": "c68", "state": "The app isn't letting me log in, but my info is correct."}
233
+ {"label": "c69", "state": "How do i change my identity?"}
234
+ {"label": "c69", "state": "How and where can I find the identity checks?"}
235
+ {"label": "c69", "state": "What all is needed for the identity verification?"}
236
+ {"label": "c70", "state": "Where can I find my fund information?"}
237
+ {"label": "c70", "state": "I would like to verify my source of funds."}
238
+ {"label": "c70", "state": "Can I check to see where the funds came from?"}
239
+ {"label": "c71", "state": "Does the top-up need verified?"}
240
+ {"label": "c71", "state": "Where is my top-up verification code?"}
241
+ {"label": "c71", "state": "The top-up verification code is not visible."}
242
+ {"label": "c72", "state": "I can't get my virtual card to work."}
243
+ {"label": "c73", "state": "I would like to know if you use Visa or Mastercard."}
244
+ {"label": "c73", "state": "What card types can I choose from?"}
245
+ {"label": "c73", "state": "Please give me a Mastercard instead."}
246
+ {"label": "c73", "state": "Do I get a mastercard and visa?"}
247
+ {"label": "c74", "state": "Why is verifaction required for my Identity?"}
248
+ {"label": "c74", "state": "What do you need my identity details for?"}
249
+ {"label": "c74", "state": "Why do you have the identity check"}
250
+ {"label": "c75", "state": "I did not receive my full withdrawal amount"}
251
+ {"label": "c75", "state": "I tried to withdraw $100, all it gave me was $20."}
252
+ {"label": "c75", "state": "I needed $100 but all it gave me was $20."}
253
+ {"label": "c75", "state": "i asked for 100 only got 80"}
254
+ {"label": "c76", "state": "Is there a fee associated with using foreign exchange ATMs?"}
255
+ {"label": "c76", "state": "I was overcharged at an ATM while on vacation. I needed cash so I had to use it, but your charges are outregous and I wish I would have known beforehand."}
256
+ {"label": "c76", "state": "Using international ATMs messes up the exchange rate."}
model/b77-sem/meta.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"contradictions":2,"core":"si-substrate","engine":"syfox","evidence_records":199218,"lane_contexts":141920,"lanes":217729,"nodes":1648,"retrieval_memories":256,"sem_edges":7728,"semantics":true,"teach_events":54000,"version":"3.2.0"}
model/b77-sem/substrate.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1d4a6a1e91c96beb987e3c3c14e44678a1c01d8535147f886c598270f2fafd5
3
+ size 19589276
model/giant-latin/substrate.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b253501d641b743d50efe018a40943090348642ec3d4774f8b2d826b648a6bea
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8d8ef2890ef2a9c282b09dc2d32eb2bc1077dee30a78c3581e36ac59b251b8c
3
+ size 116687561
model/router16/calibration.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"choice_temperature":0.00491756,"fitted":true,"noul_a":6,"noul_b":-3,"rows":160,"score_temperature":1}
model/router16/conflicts.jsonl ADDED
File without changes
model/router16/lessons_index.jsonl ADDED
@@ -0,0 +1,960 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"outcome":"rt11 text messages spam","seq":2604,"state_hash_hex":"000a7b52b0489452"}
2
+ {"outcome":"rt01 banking cards payments","seq":2039,"state_hash_hex":"00343a1a72de4a46"}
3
+ {"outcome":"rt13 support billing sales technical","seq":2755,"state_hash_hex":"00978a3cd508d1a5"}
4
+ {"outcome":"rt06 email inbox messages","seq":2338,"state_hash_hex":"00a931b0ee914e12"}
5
+ {"outcome":"rt10 product reviews opinions","seq":2531,"state_hash_hex":"00ae66cc7e642074"}
6
+ {"outcome":"rt03 assistant requests weather","seq":2105,"state_hash_hex":"00d00e0671c4f9e7"}
7
+ {"outcome":"rt01 banking cards payments","seq":2027,"state_hash_hex":"00df1d69cf365e60"}
8
+ {"outcome":"rt13 support billing sales technical","seq":2719,"state_hash_hex":"0229969f5f960946"}
9
+ {"outcome":"rt11 text messages spam","seq":2589,"state_hash_hex":"02315af1bfcfecd0"}
10
+ {"outcome":"rt13 support billing sales technical","seq":2744,"state_hash_hex":"0256fc6ebe5a1a87"}
11
+ {"outcome":"rt04 encyclopedia entities topics","seq":2180,"state_hash_hex":"02991ebd49d59c09"}
12
+ {"outcome":"rt00 news headlines sports","seq":1946,"state_hash_hex":"02bf70f915abb6ff"}
13
+ {"outcome":"rt13 support billing sales technical","seq":2727,"state_hash_hex":"02e9b3859cf16b06"}
14
+ {"outcome":"rt11 text messages spam","seq":2636,"state_hash_hex":"0324b3b74f322d9a"}
15
+ {"outcome":"rt09 social offensive posts","seq":2507,"state_hash_hex":"03452c7b7fba3a26"}
16
+ {"outcome":"rt08 safety destructive irreversible","seq":2407,"state_hash_hex":"03480cf5f860f165"}
17
+ {"outcome":"rt01 banking cards payments","seq":2008,"state_hash_hex":"03595852e039d0ff"}
18
+ {"outcome":"rt08 safety destructive irreversible","seq":2410,"state_hash_hex":"03e5de915615c345"}
19
+ {"outcome":"rt11 text messages spam","seq":2590,"state_hash_hex":"0422808c11e16600"}
20
+ {"outcome":"rt15 support tickets russian","seq":2822,"state_hash_hex":"04bc7150bffa187e"}
21
+ {"outcome":"rt14 support tickets hindi","seq":2817,"state_hash_hex":"0522216e73b3c20b"}
22
+ {"outcome":"rt08 safety destructive irreversible","seq":2403,"state_hash_hex":"054a584c501c8647"}
23
+ {"outcome":"rt03 assistant requests weather","seq":2101,"state_hash_hex":"0582dfd68af21d73"}
24
+ {"outcome":"rt12 support tickets bengali","seq":2662,"state_hash_hex":"05c72ae0cbe4917d"}
25
+ {"outcome":"rt13 support billing sales technical","seq":2718,"state_hash_hex":"064354fb179939a5"}
26
+ {"outcome":"rt09 social offensive posts","seq":2512,"state_hash_hex":"06bbb68b30f1b9c1"}
27
+ {"outcome":"rt07 game commands actions","seq":2377,"state_hash_hex":"070e197713a559c3"}
28
+ {"outcome":"rt11 text messages spam","seq":2633,"state_hash_hex":"078515f905e82037"}
29
+ {"outcome":"rt05 feelings emotions reactions","seq":2279,"state_hash_hex":"079a1930e47fd428"}
30
+ {"outcome":"rt13 support billing sales technical","seq":2725,"state_hash_hex":"07f814cc7ca72dc2"}
31
+ {"outcome":"rt14 support tickets hindi","seq":2784,"state_hash_hex":"086f1a17f12d7638"}
32
+ {"outcome":"rt02 boolean question passage","seq":2076,"state_hash_hex":"0960e83a8fb01600"}
33
+ {"outcome":"rt03 assistant requests weather","seq":2156,"state_hash_hex":"096b0c9f7da6eb47"}
34
+ {"outcome":"rt06 email inbox messages","seq":2336,"state_hash_hex":"0977424657fc448d"}
35
+ {"outcome":"rt15 support tickets russian","seq":2849,"state_hash_hex":"09c4556dd7ed817e"}
36
+ {"outcome":"rt09 social offensive posts","seq":2509,"state_hash_hex":"09d54b2271954895"}
37
+ {"outcome":"rt04 encyclopedia entities topics","seq":2195,"state_hash_hex":"09fe20bd5b4503bf"}
38
+ {"outcome":"rt12 support tickets bengali","seq":2675,"state_hash_hex":"0a00d775fbcc2476"}
39
+ {"outcome":"rt04 encyclopedia entities topics","seq":2196,"state_hash_hex":"0a3b4b0d9be86303"}
40
+ {"outcome":"rt15 support tickets russian","seq":2837,"state_hash_hex":"0a6ae91d24579cfe"}
41
+ {"outcome":"rt10 product reviews opinions","seq":2573,"state_hash_hex":"0af999b45cd75b09"}
42
+ {"outcome":"rt00 news headlines sports","seq":1927,"state_hash_hex":"0b5509403e2975a8"}
43
+ {"outcome":"rt11 text messages spam","seq":2611,"state_hash_hex":"0b5c7499d61d96c7"}
44
+ {"outcome":"rt02 boolean question passage","seq":2082,"state_hash_hex":"0ba6529f6bf14c88"}
45
+ {"outcome":"rt03 assistant requests weather","seq":2151,"state_hash_hex":"0bae973a8d46f92f"}
46
+ {"outcome":"rt11 text messages spam","seq":2612,"state_hash_hex":"0c62dfc4edddb597"}
47
+ {"outcome":"rt10 product reviews opinions","seq":2549,"state_hash_hex":"0c785f6c42304eb8"}
48
+ {"outcome":"rt12 support tickets bengali","seq":2680,"state_hash_hex":"0c82b479a39d3af9"}
49
+ {"outcome":"rt04 encyclopedia entities topics","seq":2216,"state_hash_hex":"0c850b1922af19fc"}
50
+ {"outcome":"rt05 feelings emotions reactions","seq":2253,"state_hash_hex":"0ddb7af650c5ac94"}
51
+ {"outcome":"rt08 safety destructive irreversible","seq":2437,"state_hash_hex":"0e1daccb9de117c0"}
52
+ {"outcome":"rt00 news headlines sports","seq":1933,"state_hash_hex":"0e3d4b85ce7a7adf"}
53
+ {"outcome":"rt02 boolean question passage","seq":2073,"state_hash_hex":"0e8f0556741d80a8"}
54
+ {"outcome":"rt05 feelings emotions reactions","seq":2241,"state_hash_hex":"0e9a2a13baf74edb"}
55
+ {"outcome":"rt13 support billing sales technical","seq":2746,"state_hash_hex":"0eb5991bc7ac0f78"}
56
+ {"outcome":"rt09 social offensive posts","seq":2513,"state_hash_hex":"0ec2568b87cc6252"}
57
+ {"outcome":"rt06 email inbox messages","seq":2292,"state_hash_hex":"0efa72b451a35d7b"}
58
+ {"outcome":"rt06 email inbox messages","seq":2333,"state_hash_hex":"0efc03d9014d7b93"}
59
+ {"outcome":"rt08 safety destructive irreversible","seq":2425,"state_hash_hex":"0f659820a0eb9533"}
60
+ {"outcome":"rt11 text messages spam","seq":2609,"state_hash_hex":"0fa34d3d0492cf35"}
61
+ {"outcome":"rt03 assistant requests weather","seq":2113,"state_hash_hex":"0fb139503f4d8f91"}
62
+ {"outcome":"rt14 support tickets hindi","seq":2776,"state_hash_hex":"103195876999d176"}
63
+ {"outcome":"rt06 email inbox messages","seq":2296,"state_hash_hex":"107599f122a28607"}
64
+ {"outcome":"rt08 safety destructive irreversible","seq":2401,"state_hash_hex":"1084f0abcd718f25"}
65
+ {"outcome":"rt05 feelings emotions reactions","seq":2221,"state_hash_hex":"10866e4ee7762ed2"}
66
+ {"outcome":"rt13 support billing sales technical","seq":2717,"state_hash_hex":"108baa906bd4e1e1"}
67
+ {"outcome":"rt08 safety destructive irreversible","seq":2409,"state_hash_hex":"1092958d86af1954"}
68
+ {"outcome":"rt14 support tickets hindi","seq":2763,"state_hash_hex":"113165d3ef434200"}
69
+ {"outcome":"rt09 social offensive posts","seq":2490,"state_hash_hex":"119137890e2ca246"}
70
+ {"outcome":"rt06 email inbox messages","seq":2311,"state_hash_hex":"122ce8d6c9619c93"}
71
+ {"outcome":"rt15 support tickets russian","seq":2846,"state_hash_hex":"1265b42b7af095e0"}
72
+ {"outcome":"rt06 email inbox messages","seq":2329,"state_hash_hex":"12adb558b3ef746c"}
73
+ {"outcome":"rt08 safety destructive irreversible","seq":2454,"state_hash_hex":"12d88e4850993203"}
74
+ {"outcome":"rt06 email inbox messages","seq":2313,"state_hash_hex":"13258909c352d17a"}
75
+ {"outcome":"rt00 news headlines sports","seq":1935,"state_hash_hex":"134aaff8297b4118"}
76
+ {"outcome":"rt06 email inbox messages","seq":2305,"state_hash_hex":"1379ece826850846"}
77
+ {"outcome":"rt03 assistant requests weather","seq":2131,"state_hash_hex":"138d03a72ab82dca"}
78
+ {"outcome":"rt05 feelings emotions reactions","seq":2236,"state_hash_hex":"140c75f9dc358274"}
79
+ {"outcome":"rt04 encyclopedia entities topics","seq":2172,"state_hash_hex":"156116c5ac3f1125"}
80
+ {"outcome":"rt02 boolean question passage","seq":2047,"state_hash_hex":"156eec5c97032128"}
81
+ {"outcome":"rt07 game commands actions","seq":2351,"state_hash_hex":"158ac79cb76accea"}
82
+ {"outcome":"rt12 support tickets bengali","seq":2660,"state_hash_hex":"15a1e097a61e981b"}
83
+ {"outcome":"rt14 support tickets hindi","seq":2791,"state_hash_hex":"1613648553ea16c2"}
84
+ {"outcome":"rt13 support billing sales technical","seq":2731,"state_hash_hex":"161779ca8d4112f8"}
85
+ {"outcome":"rt15 support tickets russian","seq":2880,"state_hash_hex":"166d3ec4f6de5172"}
86
+ {"outcome":"rt00 news headlines sports","seq":1962,"state_hash_hex":"16746a5738ce728b"}
87
+ {"outcome":"rt09 social offensive posts","seq":2505,"state_hash_hex":"16ad9217a42fcb99"}
88
+ {"outcome":"rt07 game commands actions","seq":2370,"state_hash_hex":"17047c5b5f40d8f2"}
89
+ {"outcome":"rt11 text messages spam","seq":2597,"state_hash_hex":"1775eee737401404"}
90
+ {"outcome":"rt04 encyclopedia entities topics","seq":2187,"state_hash_hex":"1788c1def690c4c9"}
91
+ {"outcome":"rt08 safety destructive irreversible","seq":2408,"state_hash_hex":"17a22f3a3a131a56"}
92
+ {"outcome":"rt14 support tickets hindi","seq":2815,"state_hash_hex":"17da533a7e1dbf11"}
93
+ {"outcome":"rt02 boolean question passage","seq":2075,"state_hash_hex":"17e3312ecea6ce9b"}
94
+ {"outcome":"rt13 support billing sales technical","seq":2713,"state_hash_hex":"182a1232f5a8dafb"}
95
+ {"outcome":"rt04 encyclopedia entities topics","seq":2170,"state_hash_hex":"18464b51af55a90b"}
96
+ {"outcome":"rt14 support tickets hindi","seq":2796,"state_hash_hex":"188e0e1cb4aa2cc0"}
97
+ {"outcome":"rt14 support tickets hindi","seq":2771,"state_hash_hex":"19183dc2b075417a"}
98
+ {"outcome":"rt08 safety destructive irreversible","seq":2455,"state_hash_hex":"19afffae4d52cacb"}
99
+ {"outcome":"rt09 social offensive posts","seq":2508,"state_hash_hex":"19ed4ca630403748"}
100
+ {"outcome":"rt09 social offensive posts","seq":2496,"state_hash_hex":"19f91b21fcf2259d"}
101
+ {"outcome":"rt11 text messages spam","seq":2585,"state_hash_hex":"1a2ae5af5124cb35"}
102
+ {"outcome":"rt12 support tickets bengali","seq":2648,"state_hash_hex":"1a340b9ec217abbd"}
103
+ {"outcome":"rt06 email inbox messages","seq":2281,"state_hash_hex":"1a526270037cb6cd"}
104
+ {"outcome":"rt09 social offensive posts","seq":2506,"state_hash_hex":"1a9701bec95a74a6"}
105
+ {"outcome":"rt04 encyclopedia entities topics","seq":2199,"state_hash_hex":"1a985481f71de979"}
106
+ {"outcome":"rt11 text messages spam","seq":2618,"state_hash_hex":"1b8bff970bb11387"}
107
+ {"outcome":"rt04 encyclopedia entities topics","seq":2201,"state_hash_hex":"1ba1fa307ea40e7a"}
108
+ {"outcome":"rt10 product reviews opinions","seq":2546,"state_hash_hex":"1be0c17b60ee7d52"}
109
+ {"outcome":"rt02 boolean question passage","seq":2097,"state_hash_hex":"1c0008aa2945af06"}
110
+ {"outcome":"rt05 feelings emotions reactions","seq":2243,"state_hash_hex":"1c3edc64cd3c63a4"}
111
+ {"outcome":"rt12 support tickets bengali","seq":2673,"state_hash_hex":"1ca361e2913f65c8"}
112
+ {"outcome":"rt07 game commands actions","seq":2343,"state_hash_hex":"1d29057610ce30fc"}
113
+ {"outcome":"rt13 support billing sales technical","seq":2757,"state_hash_hex":"1e0b44c192495870"}
114
+ {"outcome":"rt00 news headlines sports","seq":1954,"state_hash_hex":"1e1ff3da0113fe78"}
115
+ {"outcome":"rt15 support tickets russian","seq":2841,"state_hash_hex":"1e282cc874abf5c5"}
116
+ {"outcome":"rt09 social offensive posts","seq":2474,"state_hash_hex":"1e38e2d22b98d88c"}
117
+ {"outcome":"rt01 banking cards payments","seq":2022,"state_hash_hex":"1e5cd909db121995"}
118
+ {"outcome":"rt15 support tickets russian","seq":2873,"state_hash_hex":"1e79de467624c184"}
119
+ {"outcome":"rt06 email inbox messages","seq":2290,"state_hash_hex":"1e88c67b64cb967a"}
120
+ {"outcome":"rt04 encyclopedia entities topics","seq":2186,"state_hash_hex":"1ec174d7d2398136"}
121
+ {"outcome":"rt11 text messages spam","seq":2640,"state_hash_hex":"1ece78535d00e37d"}
122
+ {"outcome":"rt08 safety destructive irreversible","seq":2411,"state_hash_hex":"1ed88d5374a9f7f8"}
123
+ {"outcome":"rt07 game commands actions","seq":2352,"state_hash_hex":"1f0a085a195e9ce8"}
124
+ {"outcome":"rt10 product reviews opinions","seq":2552,"state_hash_hex":"1f6032e09753e008"}
125
+ {"outcome":"rt07 game commands actions","seq":2372,"state_hash_hex":"1fffd2871c3c2469"}
126
+ {"outcome":"rt01 banking cards payments","seq":2005,"state_hash_hex":"211d3bac1c050258"}
127
+ {"outcome":"rt15 support tickets russian","seq":2872,"state_hash_hex":"21a7594d6cfd600e"}
128
+ {"outcome":"rt04 encyclopedia entities topics","seq":2190,"state_hash_hex":"229ff0e454c715c2"}
129
+ {"outcome":"rt11 text messages spam","seq":2621,"state_hash_hex":"22be797a997b73c1"}
130
+ {"outcome":"rt05 feelings emotions reactions","seq":2238,"state_hash_hex":"2310b5fa10135d1e"}
131
+ {"outcome":"rt04 encyclopedia entities topics","seq":2218,"state_hash_hex":"233d46667c68287a"}
132
+ {"outcome":"rt02 boolean question passage","seq":2060,"state_hash_hex":"239e54eaea13b62f"}
133
+ {"outcome":"rt00 news headlines sports","seq":1922,"state_hash_hex":"23af33132ad97ee4"}
134
+ {"outcome":"rt15 support tickets russian","seq":2824,"state_hash_hex":"242d2dbd8e1dd8c2"}
135
+ {"outcome":"rt01 banking cards payments","seq":1982,"state_hash_hex":"245c5d1dc3a62f92"}
136
+ {"outcome":"rt01 banking cards payments","seq":2030,"state_hash_hex":"247e0413687291f3"}
137
+ {"outcome":"rt14 support tickets hindi","seq":2761,"state_hash_hex":"24ccd24ecc34c981"}
138
+ {"outcome":"rt02 boolean question passage","seq":2045,"state_hash_hex":"25564a4176f51004"}
139
+ {"outcome":"rt04 encyclopedia entities topics","seq":2182,"state_hash_hex":"255b2e0348239e8f"}
140
+ {"outcome":"rt08 safety destructive irreversible","seq":2441,"state_hash_hex":"25d6200335bf13bd"}
141
+ {"outcome":"rt09 social offensive posts","seq":2482,"state_hash_hex":"260671b16d0e82b2"}
142
+ {"outcome":"rt06 email inbox messages","seq":2323,"state_hash_hex":"261117c6743ada16"}
143
+ {"outcome":"rt07 game commands actions","seq":2395,"state_hash_hex":"263200651b291f02"}
144
+ {"outcome":"rt12 support tickets bengali","seq":2644,"state_hash_hex":"263922d734adf34d"}
145
+ {"outcome":"rt07 game commands actions","seq":2386,"state_hash_hex":"26d9de2fe00b9e50"}
146
+ {"outcome":"rt03 assistant requests weather","seq":2155,"state_hash_hex":"26e85ff8db319e2f"}
147
+ {"outcome":"rt13 support billing sales technical","seq":2756,"state_hash_hex":"271f53cf6ff26f59"}
148
+ {"outcome":"rt10 product reviews opinions","seq":2572,"state_hash_hex":"27723c824ad4e0b7"}
149
+ {"outcome":"rt04 encyclopedia entities topics","seq":2174,"state_hash_hex":"2794611b14073d48"}
150
+ {"outcome":"rt03 assistant requests weather","seq":2148,"state_hash_hex":"287f5792ee3fe57f"}
151
+ {"outcome":"rt07 game commands actions","seq":2371,"state_hash_hex":"28c86aa8bd7146fe"}
152
+ {"outcome":"rt03 assistant requests weather","seq":2150,"state_hash_hex":"2924fc4f1b1cb826"}
153
+ {"outcome":"rt05 feelings emotions reactions","seq":2250,"state_hash_hex":"2927cde90e96c584"}
154
+ {"outcome":"rt07 game commands actions","seq":2354,"state_hash_hex":"29631adde04d0607"}
155
+ {"outcome":"rt06 email inbox messages","seq":2330,"state_hash_hex":"29a4ff7dfad2ba8d"}
156
+ {"outcome":"rt01 banking cards payments","seq":1999,"state_hash_hex":"2a0e969a64c37fbd"}
157
+ {"outcome":"rt09 social offensive posts","seq":2497,"state_hash_hex":"2a64fe01ba926a23"}
158
+ {"outcome":"rt07 game commands actions","seq":2373,"state_hash_hex":"2a65b4224c6e8e1a"}
159
+ {"outcome":"rt09 social offensive posts","seq":2510,"state_hash_hex":"2a6d33d28be3575a"}
160
+ {"outcome":"rt07 game commands actions","seq":2358,"state_hash_hex":"2a742aabfacbd8f4"}
161
+ {"outcome":"rt02 boolean question passage","seq":2078,"state_hash_hex":"2a778ce71cd8d3fd"}
162
+ {"outcome":"rt13 support billing sales technical","seq":2739,"state_hash_hex":"2a8191b6ebe8ce19"}
163
+ {"outcome":"rt04 encyclopedia entities topics","seq":2192,"state_hash_hex":"2aabb968651fd4d3"}
164
+ {"outcome":"rt13 support billing sales technical","seq":2723,"state_hash_hex":"2b84dee6241003b2"}
165
+ {"outcome":"rt11 text messages spam","seq":2615,"state_hash_hex":"2c66a0ab67631277"}
166
+ {"outcome":"rt10 product reviews opinions","seq":2548,"state_hash_hex":"2d8c281cc59c8b13"}
167
+ {"outcome":"rt08 safety destructive irreversible","seq":2433,"state_hash_hex":"2da65b4c4a09efb3"}
168
+ {"outcome":"rt08 safety destructive irreversible","seq":2434,"state_hash_hex":"2db38975e2d2597d"}
169
+ {"outcome":"rt05 feelings emotions reactions","seq":2237,"state_hash_hex":"2de83c708e5ceb61"}
170
+ {"outcome":"rt02 boolean question passage","seq":2062,"state_hash_hex":"2e34a30b32a1065d"}
171
+ {"outcome":"rt01 banking cards payments","seq":2017,"state_hash_hex":"2e3650c4a39a24df"}
172
+ {"outcome":"rt10 product reviews opinions","seq":2526,"state_hash_hex":"2e6e33d3e10c60df"}
173
+ {"outcome":"rt13 support billing sales technical","seq":2710,"state_hash_hex":"2e7d6e238aa92e6b"}
174
+ {"outcome":"rt10 product reviews opinions","seq":2530,"state_hash_hex":"2ec6529ecc354656"}
175
+ {"outcome":"rt10 product reviews opinions","seq":2557,"state_hash_hex":"2f49becaf3838264"}
176
+ {"outcome":"rt12 support tickets bengali","seq":2668,"state_hash_hex":"2f5580fae6d9784e"}
177
+ {"outcome":"rt10 product reviews opinions","seq":2565,"state_hash_hex":"2f72108297ba2e0c"}
178
+ {"outcome":"rt01 banking cards payments","seq":2001,"state_hash_hex":"2f7e2b1d0d3930b7"}
179
+ {"outcome":"rt13 support billing sales technical","seq":2760,"state_hash_hex":"2fcf963961ca66a3"}
180
+ {"outcome":"rt07 game commands actions","seq":2376,"state_hash_hex":"304939a549716205"}
181
+ {"outcome":"rt04 encyclopedia entities topics","seq":2165,"state_hash_hex":"3060ba9841b12d28"}
182
+ {"outcome":"rt05 feelings emotions reactions","seq":2235,"state_hash_hex":"30cf26ee36d94404"}
183
+ {"outcome":"rt08 safety destructive irreversible","seq":2451,"state_hash_hex":"310e9a02902d06cf"}
184
+ {"outcome":"rt07 game commands actions","seq":2365,"state_hash_hex":"31ec6343f09a22d7"}
185
+ {"outcome":"rt11 text messages spam","seq":2617,"state_hash_hex":"32364360f536f8c7"}
186
+ {"outcome":"rt04 encyclopedia entities topics","seq":2171,"state_hash_hex":"3243c17305df27fc"}
187
+ {"outcome":"rt01 banking cards payments","seq":2023,"state_hash_hex":"32e0c5dec13d1e46"}
188
+ {"outcome":"rt05 feelings emotions reactions","seq":2270,"state_hash_hex":"33520508702f2c60"}
189
+ {"outcome":"rt09 social offensive posts","seq":2489,"state_hash_hex":"33b05f1bc82f18e5"}
190
+ {"outcome":"rt13 support billing sales technical","seq":2747,"state_hash_hex":"33d1c4320112cfc9"}
191
+ {"outcome":"rt06 email inbox messages","seq":2288,"state_hash_hex":"33d1cd64e325156e"}
192
+ {"outcome":"rt05 feelings emotions reactions","seq":2257,"state_hash_hex":"33e719758920e485"}
193
+ {"outcome":"rt13 support billing sales technical","seq":2751,"state_hash_hex":"34fe45e3e03467f5"}
194
+ {"outcome":"rt00 news headlines sports","seq":1960,"state_hash_hex":"357b7c29c8f8bb6b"}
195
+ {"outcome":"rt06 email inbox messages","seq":2327,"state_hash_hex":"3742dea66a74dbe6"}
196
+ {"outcome":"rt12 support tickets bengali","seq":2643,"state_hash_hex":"376c747aaa96dbf8"}
197
+ {"outcome":"rt13 support billing sales technical","seq":2732,"state_hash_hex":"3774fe8fa5ed5cfa"}
198
+ {"outcome":"rt03 assistant requests weather","seq":2116,"state_hash_hex":"37823688fd305bcd"}
199
+ {"outcome":"rt03 assistant requests weather","seq":2153,"state_hash_hex":"38803796bda16cdb"}
200
+ {"outcome":"rt11 text messages spam","seq":2592,"state_hash_hex":"3888b592b1ac163b"}
201
+ {"outcome":"rt15 support tickets russian","seq":2861,"state_hash_hex":"38c4a5551dcb7cc6"}
202
+ {"outcome":"rt10 product reviews opinions","seq":2532,"state_hash_hex":"38c7973ce7a2bf9e"}
203
+ {"outcome":"rt06 email inbox messages","seq":2293,"state_hash_hex":"38eeea39c083ea0e"}
204
+ {"outcome":"rt14 support tickets hindi","seq":2780,"state_hash_hex":"38fb34a0c125e8c9"}
205
+ {"outcome":"rt08 safety destructive irreversible","seq":2438,"state_hash_hex":"395297e04b1ba3df"}
206
+ {"outcome":"rt05 feelings emotions reactions","seq":2242,"state_hash_hex":"395e351a908b3f5b"}
207
+ {"outcome":"rt04 encyclopedia entities topics","seq":2197,"state_hash_hex":"3ac5fe323d21a967"}
208
+ {"outcome":"rt14 support tickets hindi","seq":2800,"state_hash_hex":"3adbfdec52743068"}
209
+ {"outcome":"rt11 text messages spam","seq":2628,"state_hash_hex":"3af474a6eb6a99d8"}
210
+ {"outcome":"rt00 news headlines sports","seq":1943,"state_hash_hex":"3b041a81555b2123"}
211
+ {"outcome":"rt08 safety destructive irreversible","seq":2459,"state_hash_hex":"3b5c31134949613d"}
212
+ {"outcome":"rt03 assistant requests weather","seq":2102,"state_hash_hex":"3b6ac64f9429a618"}
213
+ {"outcome":"rt09 social offensive posts","seq":2488,"state_hash_hex":"3c2fefcc6613bdf9"}
214
+ {"outcome":"rt14 support tickets hindi","seq":2785,"state_hash_hex":"3c47cca13a228779"}
215
+ {"outcome":"rt02 boolean question passage","seq":2094,"state_hash_hex":"3d763bf36ed412d0"}
216
+ {"outcome":"rt08 safety destructive irreversible","seq":2450,"state_hash_hex":"3dc12fca6fd11133"}
217
+ {"outcome":"rt04 encyclopedia entities topics","seq":2198,"state_hash_hex":"3e3188992bc69546"}
218
+ {"outcome":"rt07 game commands actions","seq":2367,"state_hash_hex":"3e3831729899e708"}
219
+ {"outcome":"rt00 news headlines sports","seq":1924,"state_hash_hex":"3e59fae4c0c9f6b7"}
220
+ {"outcome":"rt00 news headlines sports","seq":1980,"state_hash_hex":"3e5f5a0c12cd9faf"}
221
+ {"outcome":"rt02 boolean question passage","seq":2088,"state_hash_hex":"3ea7188e8cbd9888"}
222
+ {"outcome":"rt15 support tickets russian","seq":2833,"state_hash_hex":"3eadf0aa5e0b7de9"}
223
+ {"outcome":"rt02 boolean question passage","seq":2043,"state_hash_hex":"3ed80753ec268e4a"}
224
+ {"outcome":"rt12 support tickets bengali","seq":2667,"state_hash_hex":"3f113f896ffeeede"}
225
+ {"outcome":"rt09 social offensive posts","seq":2495,"state_hash_hex":"3fd4760f110c680f"}
226
+ {"outcome":"rt01 banking cards payments","seq":1983,"state_hash_hex":"3feae92ab38786cf"}
227
+ {"outcome":"rt11 text messages spam","seq":2606,"state_hash_hex":"40ecbcaf953e6591"}
228
+ {"outcome":"rt08 safety destructive irreversible","seq":2406,"state_hash_hex":"412b857ee254f8ef"}
229
+ {"outcome":"rt12 support tickets bengali","seq":2688,"state_hash_hex":"414fc2ebd34db4bf"}
230
+ {"outcome":"rt13 support billing sales technical","seq":2722,"state_hash_hex":"41972c3d3a8aa5af"}
231
+ {"outcome":"rt12 support tickets bengali","seq":2647,"state_hash_hex":"420b116d94c5484c"}
232
+ {"outcome":"rt09 social offensive posts","seq":2463,"state_hash_hex":"422408582993423a"}
233
+ {"outcome":"rt14 support tickets hindi","seq":2770,"state_hash_hex":"4242d73364b3c0a1"}
234
+ {"outcome":"rt14 support tickets hindi","seq":2783,"state_hash_hex":"4276b9753febc31a"}
235
+ {"outcome":"rt14 support tickets hindi","seq":2765,"state_hash_hex":"4297d9946ffc3673"}
236
+ {"outcome":"rt10 product reviews opinions","seq":2566,"state_hash_hex":"429d26222f258650"}
237
+ {"outcome":"rt07 game commands actions","seq":2357,"state_hash_hex":"42e2035591629e89"}
238
+ {"outcome":"rt02 boolean question passage","seq":2059,"state_hash_hex":"43704898857a8ad2"}
239
+ {"outcome":"rt13 support billing sales technical","seq":2742,"state_hash_hex":"43bf3fb89dde1552"}
240
+ {"outcome":"rt11 text messages spam","seq":2586,"state_hash_hex":"43eb85580a9d2b39"}
241
+ {"outcome":"rt00 news headlines sports","seq":1973,"state_hash_hex":"442ea9cf66c94cf1"}
242
+ {"outcome":"rt11 text messages spam","seq":2634,"state_hash_hex":"44a7b6a2640045a0"}
243
+ {"outcome":"rt12 support tickets bengali","seq":2678,"state_hash_hex":"44d96c1606d738d5"}
244
+ {"outcome":"rt01 banking cards payments","seq":1984,"state_hash_hex":"44e2a2dfa99a73d2"}
245
+ {"outcome":"rt01 banking cards payments","seq":2000,"state_hash_hex":"456dda5c84a22674"}
246
+ {"outcome":"rt15 support tickets russian","seq":2874,"state_hash_hex":"45ba49987d57362e"}
247
+ {"outcome":"rt09 social offensive posts","seq":2485,"state_hash_hex":"45c2ddada905c50f"}
248
+ {"outcome":"rt01 banking cards payments","seq":2021,"state_hash_hex":"45fa9c248c4d2081"}
249
+ {"outcome":"rt01 banking cards payments","seq":2036,"state_hash_hex":"4711889c67a52b34"}
250
+ {"outcome":"rt00 news headlines sports","seq":1958,"state_hash_hex":"475b86116bcee378"}
251
+ {"outcome":"rt05 feelings emotions reactions","seq":2265,"state_hash_hex":"476a9e9679e4f895"}
252
+ {"outcome":"rt12 support tickets bengali","seq":2687,"state_hash_hex":"47707afbf34a2229"}
253
+ {"outcome":"rt09 social offensive posts","seq":2464,"state_hash_hex":"478e23aca48150ed"}
254
+ {"outcome":"rt02 boolean question passage","seq":2071,"state_hash_hex":"47ae63de07127299"}
255
+ {"outcome":"rt03 assistant requests weather","seq":2119,"state_hash_hex":"47d852817e02764b"}
256
+ {"outcome":"rt13 support billing sales technical","seq":2729,"state_hash_hex":"47f0a0c4b28e0b8f"}
257
+ {"outcome":"rt07 game commands actions","seq":2360,"state_hash_hex":"48091cc1d85625d0"}
258
+ {"outcome":"rt06 email inbox messages","seq":2282,"state_hash_hex":"48106a6f06f33e84"}
259
+ {"outcome":"rt00 news headlines sports","seq":1947,"state_hash_hex":"4810fc998fffe889"}
260
+ {"outcome":"rt06 email inbox messages","seq":2324,"state_hash_hex":"485e92dce3c21f3f"}
261
+ {"outcome":"rt14 support tickets hindi","seq":2778,"state_hash_hex":"48b7eaa36a7f40da"}
262
+ {"outcome":"rt03 assistant requests weather","seq":2128,"state_hash_hex":"48b7f501ee136caa"}
263
+ {"outcome":"rt06 email inbox messages","seq":2310,"state_hash_hex":"48baa4204d465f6f"}
264
+ {"outcome":"rt03 assistant requests weather","seq":2142,"state_hash_hex":"48d0048cf099f7cf"}
265
+ {"outcome":"rt15 support tickets russian","seq":2865,"state_hash_hex":"48fb855f3e72aba3"}
266
+ {"outcome":"rt15 support tickets russian","seq":2856,"state_hash_hex":"4936336eb5a4572e"}
267
+ {"outcome":"rt05 feelings emotions reactions","seq":2249,"state_hash_hex":"4973f2da8991aa5e"}
268
+ {"outcome":"rt11 text messages spam","seq":2608,"state_hash_hex":"49d5bc1d5db4b808"}
269
+ {"outcome":"rt12 support tickets bengali","seq":2682,"state_hash_hex":"49e3f1f499ca2bff"}
270
+ {"outcome":"rt05 feelings emotions reactions","seq":2271,"state_hash_hex":"4a0ea1bf86d5dc5f"}
271
+ {"outcome":"rt00 news headlines sports","seq":1959,"state_hash_hex":"4a947469d25a3f64"}
272
+ {"outcome":"rt01 banking cards payments","seq":1996,"state_hash_hex":"4b029df8a1ac2deb"}
273
+ {"outcome":"rt00 news headlines sports","seq":1934,"state_hash_hex":"4b8e01178e3eb12b"}
274
+ {"outcome":"rt02 boolean question passage","seq":2067,"state_hash_hex":"4bab765354265552"}
275
+ {"outcome":"rt00 news headlines sports","seq":1957,"state_hash_hex":"4bfde60320b35408"}
276
+ {"outcome":"rt12 support tickets bengali","seq":2692,"state_hash_hex":"4c16f9920d4e6c97"}
277
+ {"outcome":"rt06 email inbox messages","seq":2318,"state_hash_hex":"4c6a53b2fe281eaf"}
278
+ {"outcome":"rt14 support tickets hindi","seq":2801,"state_hash_hex":"4c88a65a1218e649"}
279
+ {"outcome":"rt14 support tickets hindi","seq":2768,"state_hash_hex":"4cdc2728670ec915"}
280
+ {"outcome":"rt14 support tickets hindi","seq":2769,"state_hash_hex":"4ce98d1d3102da98"}
281
+ {"outcome":"rt04 encyclopedia entities topics","seq":2185,"state_hash_hex":"4cfa89788b925086"}
282
+ {"outcome":"rt15 support tickets russian","seq":2851,"state_hash_hex":"4d5b535dfa6dcad4"}
283
+ {"outcome":"rt09 social offensive posts","seq":2466,"state_hash_hex":"4d9d858ad0fa7336"}
284
+ {"outcome":"rt00 news headlines sports","seq":1940,"state_hash_hex":"4df892dc7b015742"}
285
+ {"outcome":"rt13 support billing sales technical","seq":2712,"state_hash_hex":"4e2ec8bff59596e8"}
286
+ {"outcome":"rt03 assistant requests weather","seq":2144,"state_hash_hex":"4e6ca9d0ffa386e2"}
287
+ {"outcome":"rt11 text messages spam","seq":2600,"state_hash_hex":"4e875398b241c147"}
288
+ {"outcome":"rt10 product reviews opinions","seq":2522,"state_hash_hex":"4e9afc5c5d83b77a"}
289
+ {"outcome":"rt09 social offensive posts","seq":2515,"state_hash_hex":"4ea46db71d195b2e"}
290
+ {"outcome":"rt05 feelings emotions reactions","seq":2259,"state_hash_hex":"4ec58b6d2dbd14f8"}
291
+ {"outcome":"rt10 product reviews opinions","seq":2564,"state_hash_hex":"4efdeef3077718fe"}
292
+ {"outcome":"rt03 assistant requests weather","seq":2157,"state_hash_hex":"4f73be9c083c460c"}
293
+ {"outcome":"rt07 game commands actions","seq":2364,"state_hash_hex":"4fb2ac5dc29590ce"}
294
+ {"outcome":"rt04 encyclopedia entities topics","seq":2164,"state_hash_hex":"4fb5441d69e784eb"}
295
+ {"outcome":"rt09 social offensive posts","seq":2479,"state_hash_hex":"4fedcf26c04b8564"}
296
+ {"outcome":"rt12 support tickets bengali","seq":2684,"state_hash_hex":"4ff9d4d9a10124e7"}
297
+ {"outcome":"rt07 game commands actions","seq":2363,"state_hash_hex":"5024cc0a5132d708"}
298
+ {"outcome":"rt00 news headlines sports","seq":1953,"state_hash_hex":"507c0cc5f4df861d"}
299
+ {"outcome":"rt15 support tickets russian","seq":2830,"state_hash_hex":"50c311c98d2b3682"}
300
+ {"outcome":"rt12 support tickets bengali","seq":2663,"state_hash_hex":"51219ac70606408c"}
301
+ {"outcome":"rt00 news headlines sports","seq":1968,"state_hash_hex":"512a2ca99c10aa92"}
302
+ {"outcome":"rt02 boolean question passage","seq":2069,"state_hash_hex":"5158aaf1cac8bb3c"}
303
+ {"outcome":"rt02 boolean question passage","seq":2085,"state_hash_hex":"51c3b58af9d41c26"}
304
+ {"outcome":"rt01 banking cards payments","seq":2040,"state_hash_hex":"51e2b4bff59531e9"}
305
+ {"outcome":"rt02 boolean question passage","seq":2098,"state_hash_hex":"5210e225c52af15c"}
306
+ {"outcome":"rt14 support tickets hindi","seq":2792,"state_hash_hex":"5218fd5047e34a74"}
307
+ {"outcome":"rt12 support tickets bengali","seq":2658,"state_hash_hex":"525264494d28e002"}
308
+ {"outcome":"rt10 product reviews opinions","seq":2544,"state_hash_hex":"5264ec4f73c694e9"}
309
+ {"outcome":"rt08 safety destructive irreversible","seq":2415,"state_hash_hex":"5291940ebb20a2c9"}
310
+ {"outcome":"rt15 support tickets russian","seq":2868,"state_hash_hex":"530078106ca5fdcf"}
311
+ {"outcome":"rt07 game commands actions","seq":2379,"state_hash_hex":"532510de95abc21d"}
312
+ {"outcome":"rt06 email inbox messages","seq":2283,"state_hash_hex":"5332189ffe402230"}
313
+ {"outcome":"rt11 text messages spam","seq":2588,"state_hash_hex":"5377b798691e1ca5"}
314
+ {"outcome":"rt10 product reviews opinions","seq":2580,"state_hash_hex":"537a46f5656aba52"}
315
+ {"outcome":"rt00 news headlines sports","seq":1949,"state_hash_hex":"53d7b8bc1ea2ca7b"}
316
+ {"outcome":"rt13 support billing sales technical","seq":2728,"state_hash_hex":"54227494c7a7ac82"}
317
+ {"outcome":"rt14 support tickets hindi","seq":2787,"state_hash_hex":"5455a1d80cfc7f74"}
318
+ {"outcome":"rt12 support tickets bengali","seq":2695,"state_hash_hex":"54705f557903eaaf"}
319
+ {"outcome":"rt02 boolean question passage","seq":2053,"state_hash_hex":"5488a5c249d4c92d"}
320
+ {"outcome":"rt04 encyclopedia entities topics","seq":2177,"state_hash_hex":"549a00b5b080102c"}
321
+ {"outcome":"rt14 support tickets hindi","seq":2772,"state_hash_hex":"55028cfd2ed94567"}
322
+ {"outcome":"rt01 banking cards payments","seq":2035,"state_hash_hex":"550790e928e3e7b1"}
323
+ {"outcome":"rt14 support tickets hindi","seq":2793,"state_hash_hex":"55a2f417962ade71"}
324
+ {"outcome":"rt05 feelings emotions reactions","seq":2239,"state_hash_hex":"55d8471ea858da8f"}
325
+ {"outcome":"rt01 banking cards payments","seq":2034,"state_hash_hex":"55e0459249856c4e"}
326
+ {"outcome":"rt00 news headlines sports","seq":1945,"state_hash_hex":"564cad9a325d19f0"}
327
+ {"outcome":"rt06 email inbox messages","seq":2306,"state_hash_hex":"5660bd5442b8b232"}
328
+ {"outcome":"rt00 news headlines sports","seq":1964,"state_hash_hex":"56e111cdabf43965"}
329
+ {"outcome":"rt15 support tickets russian","seq":2823,"state_hash_hex":"56ecdb4efe9f965f"}
330
+ {"outcome":"rt06 email inbox messages","seq":2335,"state_hash_hex":"5741bf210fbe9dd4"}
331
+ {"outcome":"rt08 safety destructive irreversible","seq":2452,"state_hash_hex":"57c79b0cceedd8a5"}
332
+ {"outcome":"rt14 support tickets hindi","seq":2762,"state_hash_hex":"57eafdccf1ebb7f5"}
333
+ {"outcome":"rt12 support tickets bengali","seq":2683,"state_hash_hex":"5815886224191c9e"}
334
+ {"outcome":"rt14 support tickets hindi","seq":2808,"state_hash_hex":"58798a2383d537ee"}
335
+ {"outcome":"rt01 banking cards payments","seq":2033,"state_hash_hex":"58c74255934287a8"}
336
+ {"outcome":"rt02 boolean question passage","seq":2041,"state_hash_hex":"58e74f576d5c9af2"}
337
+ {"outcome":"rt07 game commands actions","seq":2366,"state_hash_hex":"59079e47922d0012"}
338
+ {"outcome":"rt03 assistant requests weather","seq":2147,"state_hash_hex":"5923d663f4119704"}
339
+ {"outcome":"rt04 encyclopedia entities topics","seq":2217,"state_hash_hex":"59602d4e0f312863"}
340
+ {"outcome":"rt14 support tickets hindi","seq":2807,"state_hash_hex":"59a4f6b934338128"}
341
+ {"outcome":"rt03 assistant requests weather","seq":2110,"state_hash_hex":"59bea6199dc2794a"}
342
+ {"outcome":"rt12 support tickets bengali","seq":2691,"state_hash_hex":"59fe56f0a42902bc"}
343
+ {"outcome":"rt05 feelings emotions reactions","seq":2254,"state_hash_hex":"5a0965225583ddad"}
344
+ {"outcome":"rt06 email inbox messages","seq":2291,"state_hash_hex":"5a32473f7670e480"}
345
+ {"outcome":"rt12 support tickets bengali","seq":2653,"state_hash_hex":"5a51c202511fdad2"}
346
+ {"outcome":"rt05 feelings emotions reactions","seq":2224,"state_hash_hex":"5a588699461f0fd4"}
347
+ {"outcome":"rt14 support tickets hindi","seq":2806,"state_hash_hex":"5a734900d9204ace"}
348
+ {"outcome":"rt08 safety destructive irreversible","seq":2448,"state_hash_hex":"5b37b2e0dc6bc568"}
349
+ {"outcome":"rt14 support tickets hindi","seq":2790,"state_hash_hex":"5b7d647cce301da5"}
350
+ {"outcome":"rt13 support billing sales technical","seq":2708,"state_hash_hex":"5bac79cf79b17990"}
351
+ {"outcome":"rt15 support tickets russian","seq":2866,"state_hash_hex":"5c0cbd66d6e19062"}
352
+ {"outcome":"rt00 news headlines sports","seq":1930,"state_hash_hex":"5c34b7609581cd6d"}
353
+ {"outcome":"rt13 support billing sales technical","seq":2736,"state_hash_hex":"5c5742783895ec5c"}
354
+ {"outcome":"rt08 safety destructive irreversible","seq":2413,"state_hash_hex":"5ce621b9c6aa76e8"}
355
+ {"outcome":"rt05 feelings emotions reactions","seq":2223,"state_hash_hex":"5d1245a6f827275c"}
356
+ {"outcome":"rt13 support billing sales technical","seq":2748,"state_hash_hex":"5d2c7c58e82f2125"}
357
+ {"outcome":"rt14 support tickets hindi","seq":2767,"state_hash_hex":"5d52663a049bdd23"}
358
+ {"outcome":"rt09 social offensive posts","seq":2492,"state_hash_hex":"5d6f78e571ad88b5"}
359
+ {"outcome":"rt01 banking cards payments","seq":2038,"state_hash_hex":"5d7c36e160a5c232"}
360
+ {"outcome":"rt12 support tickets bengali","seq":2676,"state_hash_hex":"5d8de946832a0982"}
361
+ {"outcome":"rt00 news headlines sports","seq":1929,"state_hash_hex":"5e0eaa4d4c3de1a3"}
362
+ {"outcome":"rt02 boolean question passage","seq":2056,"state_hash_hex":"5e485bde9662cf76"}
363
+ {"outcome":"rt15 support tickets russian","seq":2840,"state_hash_hex":"5e7c26c877fee854"}
364
+ {"outcome":"rt07 game commands actions","seq":2378,"state_hash_hex":"5ebe98e8b0773c94"}
365
+ {"outcome":"rt12 support tickets bengali","seq":2679,"state_hash_hex":"5f099b3b3d8bbb7e"}
366
+ {"outcome":"rt13 support billing sales technical","seq":2715,"state_hash_hex":"5f10d74133776dce"}
367
+ {"outcome":"rt15 support tickets russian","seq":2864,"state_hash_hex":"5f217eb2d3696c42"}
368
+ {"outcome":"rt09 social offensive posts","seq":2471,"state_hash_hex":"5f536f4e07d224b2"}
369
+ {"outcome":"rt10 product reviews opinions","seq":2561,"state_hash_hex":"5f609fe6e681ae67"}
370
+ {"outcome":"rt08 safety destructive irreversible","seq":2422,"state_hash_hex":"5ffc8d7c2de1ac07"}
371
+ {"outcome":"rt10 product reviews opinions","seq":2551,"state_hash_hex":"60a98dfdf2a42d58"}
372
+ {"outcome":"rt02 boolean question passage","seq":2065,"state_hash_hex":"61369e2c43e8a5ac"}
373
+ {"outcome":"rt06 email inbox messages","seq":2289,"state_hash_hex":"61ea400f4831b91a"}
374
+ {"outcome":"rt00 news headlines sports","seq":1951,"state_hash_hex":"626e3d5d3feefaa8"}
375
+ {"outcome":"rt14 support tickets hindi","seq":2794,"state_hash_hex":"6294ba5671fb1d71"}
376
+ {"outcome":"rt10 product reviews opinions","seq":2563,"state_hash_hex":"62a612e36f57a14f"}
377
+ {"outcome":"rt10 product reviews opinions","seq":2534,"state_hash_hex":"62a79319f5b923cc"}
378
+ {"outcome":"rt13 support billing sales technical","seq":2759,"state_hash_hex":"62c95e9666270aea"}
379
+ {"outcome":"rt12 support tickets bengali","seq":2672,"state_hash_hex":"631c96d78e8e929b"}
380
+ {"outcome":"rt13 support billing sales technical","seq":2707,"state_hash_hex":"6407cfba5a98d0a0"}
381
+ {"outcome":"rt02 boolean question passage","seq":2077,"state_hash_hex":"648fbbf0c585bab2"}
382
+ {"outcome":"rt06 email inbox messages","seq":2340,"state_hash_hex":"65458135343bf885"}
383
+ {"outcome":"rt13 support billing sales technical","seq":2716,"state_hash_hex":"65a95195c59173b1"}
384
+ {"outcome":"rt10 product reviews opinions","seq":2575,"state_hash_hex":"65af76ee7eb32728"}
385
+ {"outcome":"rt04 encyclopedia entities topics","seq":2212,"state_hash_hex":"65b9402e32735ac5"}
386
+ {"outcome":"rt06 email inbox messages","seq":2322,"state_hash_hex":"6650403cff66b123"}
387
+ {"outcome":"rt02 boolean question passage","seq":2089,"state_hash_hex":"665ee39f0d1924bb"}
388
+ {"outcome":"rt04 encyclopedia entities topics","seq":2179,"state_hash_hex":"66746fc429f1bf97"}
389
+ {"outcome":"rt09 social offensive posts","seq":2475,"state_hash_hex":"66d108d60638b91d"}
390
+ {"outcome":"rt05 feelings emotions reactions","seq":2267,"state_hash_hex":"670f9f5f22655ab6"}
391
+ {"outcome":"rt11 text messages spam","seq":2596,"state_hash_hex":"6712614e79954d85"}
392
+ {"outcome":"rt11 text messages spam","seq":2602,"state_hash_hex":"6790960222264064"}
393
+ {"outcome":"rt14 support tickets hindi","seq":2774,"state_hash_hex":"682b73d502db6018"}
394
+ {"outcome":"rt15 support tickets russian","seq":2862,"state_hash_hex":"6870f01843c908fa"}
395
+ {"outcome":"rt08 safety destructive irreversible","seq":2460,"state_hash_hex":"689f5d9de975f7ae"}
396
+ {"outcome":"rt03 assistant requests weather","seq":2114,"state_hash_hex":"68fe09873613d923"}
397
+ {"outcome":"rt10 product reviews opinions","seq":2559,"state_hash_hex":"69393dc75dc34722"}
398
+ {"outcome":"rt00 news headlines sports","seq":1942,"state_hash_hex":"69c04fd23908bade"}
399
+ {"outcome":"rt14 support tickets hindi","seq":2795,"state_hash_hex":"6a511a57e89e4d0d"}
400
+ {"outcome":"rt10 product reviews opinions","seq":2574,"state_hash_hex":"6a9d1647c38a636c"}
401
+ {"outcome":"rt03 assistant requests weather","seq":2124,"state_hash_hex":"6ae90ef780272ae9"}
402
+ {"outcome":"rt06 email inbox messages","seq":2297,"state_hash_hex":"6b45a597eb5ffc60"}
403
+ {"outcome":"rt07 game commands actions","seq":2381,"state_hash_hex":"6bb12e620bcaa424"}
404
+ {"outcome":"rt11 text messages spam","seq":2626,"state_hash_hex":"6bd86aa0b23753fb"}
405
+ {"outcome":"rt00 news headlines sports","seq":1976,"state_hash_hex":"6bfc4b15eb8e1a79"}
406
+ {"outcome":"rt01 banking cards payments","seq":2019,"state_hash_hex":"6c068c8ce5211586"}
407
+ {"outcome":"rt14 support tickets hindi","seq":2766,"state_hash_hex":"6c3492ca7ffdfc40"}
408
+ {"outcome":"rt00 news headlines sports","seq":1955,"state_hash_hex":"6c9b92611c0f4d13"}
409
+ {"outcome":"rt13 support billing sales technical","seq":2724,"state_hash_hex":"6d2f4459fa0976d9"}
410
+ {"outcome":"rt07 game commands actions","seq":2342,"state_hash_hex":"6d9ff46c413e91a6"}
411
+ {"outcome":"rt02 boolean question passage","seq":2070,"state_hash_hex":"6e46b4c576f2e589"}
412
+ {"outcome":"rt06 email inbox messages","seq":2319,"state_hash_hex":"6e596902e2575dcb"}
413
+ {"outcome":"rt02 boolean question passage","seq":2054,"state_hash_hex":"6eb2b373a6667592"}
414
+ {"outcome":"rt14 support tickets hindi","seq":2819,"state_hash_hex":"6ee0f84394472edb"}
415
+ {"outcome":"rt01 banking cards payments","seq":2020,"state_hash_hex":"6f006c95efd1454c"}
416
+ {"outcome":"rt12 support tickets bengali","seq":2649,"state_hash_hex":"6f0bf38f3b24bbb7"}
417
+ {"outcome":"rt06 email inbox messages","seq":2320,"state_hash_hex":"6f6cba132a38c30c"}
418
+ {"outcome":"rt14 support tickets hindi","seq":2811,"state_hash_hex":"6fc6b95f955122ec"}
419
+ {"outcome":"rt07 game commands actions","seq":2392,"state_hash_hex":"707d48157417a97c"}
420
+ {"outcome":"rt05 feelings emotions reactions","seq":2263,"state_hash_hex":"7097604832d27785"}
421
+ {"outcome":"rt12 support tickets bengali","seq":2664,"state_hash_hex":"70edb8b385e09a5d"}
422
+ {"outcome":"rt09 social offensive posts","seq":2520,"state_hash_hex":"7100d0ea9d42178e"}
423
+ {"outcome":"rt10 product reviews opinions","seq":2521,"state_hash_hex":"71062868d0423b41"}
424
+ {"outcome":"rt00 news headlines sports","seq":1978,"state_hash_hex":"714c6dc1d5e8ddd3"}
425
+ {"outcome":"rt15 support tickets russian","seq":2879,"state_hash_hex":"71710a9d86c7109e"}
426
+ {"outcome":"rt04 encyclopedia entities topics","seq":2173,"state_hash_hex":"7173ebf4e56e4dad"}
427
+ {"outcome":"rt11 text messages spam","seq":2610,"state_hash_hex":"7186285ca2bdf713"}
428
+ {"outcome":"rt13 support billing sales technical","seq":2743,"state_hash_hex":"71dfa6e07d80863f"}
429
+ {"outcome":"rt14 support tickets hindi","seq":2797,"state_hash_hex":"71e9261dfebc5daf"}
430
+ {"outcome":"rt14 support tickets hindi","seq":2764,"state_hash_hex":"71f4ae7c825be815"}
431
+ {"outcome":"rt09 social offensive posts","seq":2473,"state_hash_hex":"72244000ac590e56"}
432
+ {"outcome":"rt13 support billing sales technical","seq":2702,"state_hash_hex":"7231a49e0ae577bc"}
433
+ {"outcome":"rt08 safety destructive irreversible","seq":2420,"state_hash_hex":"726532eef28d6bb1"}
434
+ {"outcome":"rt04 encyclopedia entities topics","seq":2194,"state_hash_hex":"729639dc5155035b"}
435
+ {"outcome":"rt04 encyclopedia entities topics","seq":2184,"state_hash_hex":"7299f8c978b2fc2b"}
436
+ {"outcome":"rt09 social offensive posts","seq":2493,"state_hash_hex":"72e81a0a49c47cde"}
437
+ {"outcome":"rt14 support tickets hindi","seq":2786,"state_hash_hex":"73025ab9cf3621fa"}
438
+ {"outcome":"rt04 encyclopedia entities topics","seq":2219,"state_hash_hex":"73134659dfad4c93"}
439
+ {"outcome":"rt11 text messages spam","seq":2616,"state_hash_hex":"73479acc962a9ffc"}
440
+ {"outcome":"rt12 support tickets bengali","seq":2670,"state_hash_hex":"747adc0df49c304a"}
441
+ {"outcome":"rt10 product reviews opinions","seq":2542,"state_hash_hex":"749f389669a430cf"}
442
+ {"outcome":"rt00 news headlines sports","seq":1948,"state_hash_hex":"754e2f02643df1ca"}
443
+ {"outcome":"rt10 product reviews opinions","seq":2525,"state_hash_hex":"75936fe364151bc2"}
444
+ {"outcome":"rt05 feelings emotions reactions","seq":2255,"state_hash_hex":"759890e626719046"}
445
+ {"outcome":"rt02 boolean question passage","seq":2058,"state_hash_hex":"75ab6a31e294eb08"}
446
+ {"outcome":"rt09 social offensive posts","seq":2511,"state_hash_hex":"75e68b49189b445a"}
447
+ {"outcome":"rt01 banking cards payments","seq":2037,"state_hash_hex":"7610b83819ce57c5"}
448
+ {"outcome":"rt10 product reviews opinions","seq":2562,"state_hash_hex":"7633334d2f2f8c7b"}
449
+ {"outcome":"rt14 support tickets hindi","seq":2813,"state_hash_hex":"76a08cbe055f0242"}
450
+ {"outcome":"rt06 email inbox messages","seq":2287,"state_hash_hex":"76e6363f096c9084"}
451
+ {"outcome":"rt01 banking cards payments","seq":2004,"state_hash_hex":"77476285b148d6e4"}
452
+ {"outcome":"rt02 boolean question passage","seq":2042,"state_hash_hex":"77a5aaf8e06412d5"}
453
+ {"outcome":"rt00 news headlines sports","seq":1926,"state_hash_hex":"77eff22641e97543"}
454
+ {"outcome":"rt09 social offensive posts","seq":2472,"state_hash_hex":"7845f4cf39352ce4"}
455
+ {"outcome":"rt06 email inbox messages","seq":2312,"state_hash_hex":"790cb889ed563913"}
456
+ {"outcome":"rt15 support tickets russian","seq":2875,"state_hash_hex":"7910947e5720f659"}
457
+ {"outcome":"rt04 encyclopedia entities topics","seq":2206,"state_hash_hex":"792171d0dbc8f129"}
458
+ {"outcome":"rt01 banking cards payments","seq":2028,"state_hash_hex":"792751f11ea2a682"}
459
+ {"outcome":"rt03 assistant requests weather","seq":2117,"state_hash_hex":"797aa1d8a564dc2a"}
460
+ {"outcome":"rt05 feelings emotions reactions","seq":2277,"state_hash_hex":"79cbdd5f3d769997"}
461
+ {"outcome":"rt11 text messages spam","seq":2635,"state_hash_hex":"7a1925e415661bbc"}
462
+ {"outcome":"rt04 encyclopedia entities topics","seq":2168,"state_hash_hex":"7a1d88065ea92197"}
463
+ {"outcome":"rt01 banking cards payments","seq":2016,"state_hash_hex":"7ac53420ee116c1c"}
464
+ {"outcome":"rt04 encyclopedia entities topics","seq":2183,"state_hash_hex":"7afed61e0de3ca1a"}
465
+ {"outcome":"rt02 boolean question passage","seq":2044,"state_hash_hex":"7b15ad9e0add8b87"}
466
+ {"outcome":"rt07 game commands actions","seq":2374,"state_hash_hex":"7bb3608810df94e3"}
467
+ {"outcome":"rt07 game commands actions","seq":2387,"state_hash_hex":"7bc9b545ce9774ac"}
468
+ {"outcome":"rt15 support tickets russian","seq":2838,"state_hash_hex":"7bf2ba5eea2d601d"}
469
+ {"outcome":"rt11 text messages spam","seq":2625,"state_hash_hex":"7bfa64aa1414ab0e"}
470
+ {"outcome":"rt07 game commands actions","seq":2388,"state_hash_hex":"7c2235c13c6d531b"}
471
+ {"outcome":"rt14 support tickets hindi","seq":2798,"state_hash_hex":"7c34b946517a9f0f"}
472
+ {"outcome":"rt11 text messages spam","seq":2598,"state_hash_hex":"7c5881cfef9e2c47"}
473
+ {"outcome":"rt01 banking cards payments","seq":1987,"state_hash_hex":"7d0163b0f2dceded"}
474
+ {"outcome":"rt10 product reviews opinions","seq":2553,"state_hash_hex":"7d477f40f1651dff"}
475
+ {"outcome":"rt15 support tickets russian","seq":2831,"state_hash_hex":"7d8c6ef70b052ad9"}
476
+ {"outcome":"rt01 banking cards payments","seq":1991,"state_hash_hex":"7e2ed41a60c11a52"}
477
+ {"outcome":"rt15 support tickets russian","seq":2867,"state_hash_hex":"7e483899ab6a2e2d"}
478
+ {"outcome":"rt04 encyclopedia entities topics","seq":2215,"state_hash_hex":"7e7e919bcc5f9822"}
479
+ {"outcome":"rt01 banking cards payments","seq":2011,"state_hash_hex":"7e976f2894b4ba8b"}
480
+ {"outcome":"rt14 support tickets hindi","seq":2803,"state_hash_hex":"7ed64d39ca352cc3"}
481
+ {"outcome":"rt00 news headlines sports","seq":1944,"state_hash_hex":"7ef094cb68cbcb2e"}
482
+ {"outcome":"rt06 email inbox messages","seq":2339,"state_hash_hex":"7f9ce65fe76dd653"}
483
+ {"outcome":"rt09 social offensive posts","seq":2518,"state_hash_hex":"7fec0c15b135ae7f"}
484
+ {"outcome":"rt05 feelings emotions reactions","seq":2226,"state_hash_hex":"804adccab2bf0902"}
485
+ {"outcome":"rt00 news headlines sports","seq":1961,"state_hash_hex":"808013420a071828"}
486
+ {"outcome":"rt03 assistant requests weather","seq":2130,"state_hash_hex":"808d21c8cfa9c179"}
487
+ {"outcome":"rt14 support tickets hindi","seq":2781,"state_hash_hex":"812e1fd44d3e1ab6"}
488
+ {"outcome":"rt03 assistant requests weather","seq":2134,"state_hash_hex":"814daaee928ac11a"}
489
+ {"outcome":"rt04 encyclopedia entities topics","seq":2220,"state_hash_hex":"81a331e5ce49b45b"}
490
+ {"outcome":"rt06 email inbox messages","seq":2309,"state_hash_hex":"81a354180ea05fee"}
491
+ {"outcome":"rt05 feelings emotions reactions","seq":2232,"state_hash_hex":"81c1f152bf81101b"}
492
+ {"outcome":"rt06 email inbox messages","seq":2295,"state_hash_hex":"81c643d2bfd96e08"}
493
+ {"outcome":"rt15 support tickets russian","seq":2878,"state_hash_hex":"81e0c520604224ca"}
494
+ {"outcome":"rt13 support billing sales technical","seq":2734,"state_hash_hex":"81e0ef677e1c8dd9"}
495
+ {"outcome":"rt14 support tickets hindi","seq":2804,"state_hash_hex":"81f0f0a5e6c64b62"}
496
+ {"outcome":"rt14 support tickets hindi","seq":2809,"state_hash_hex":"820aa84c156fea72"}
497
+ {"outcome":"rt15 support tickets russian","seq":2855,"state_hash_hex":"83a9a117694c650c"}
498
+ {"outcome":"rt11 text messages spam","seq":2583,"state_hash_hex":"83bc038bf61ec101"}
499
+ {"outcome":"rt03 assistant requests weather","seq":2104,"state_hash_hex":"83e415fafb079fb4"}
500
+ {"outcome":"rt00 news headlines sports","seq":1950,"state_hash_hex":"8420bb2ed925eb14"}
501
+ {"outcome":"rt03 assistant requests weather","seq":2133,"state_hash_hex":"8423abb7352db4a3"}
502
+ {"outcome":"rt15 support tickets russian","seq":2845,"state_hash_hex":"842c8f754a005691"}
503
+ {"outcome":"rt12 support tickets bengali","seq":2665,"state_hash_hex":"848e9bf16ff4bf3a"}
504
+ {"outcome":"rt09 social offensive posts","seq":2478,"state_hash_hex":"84c926e37f70ca99"}
505
+ {"outcome":"rt08 safety destructive irreversible","seq":2421,"state_hash_hex":"858c2996919b6ea8"}
506
+ {"outcome":"rt10 product reviews opinions","seq":2547,"state_hash_hex":"85c56757177a8cff"}
507
+ {"outcome":"rt01 banking cards payments","seq":2003,"state_hash_hex":"85e0dab500bb40e2"}
508
+ {"outcome":"rt07 game commands actions","seq":2394,"state_hash_hex":"8600249ae62a38ad"}
509
+ {"outcome":"rt15 support tickets russian","seq":2852,"state_hash_hex":"861cd986bed2d26a"}
510
+ {"outcome":"rt00 news headlines sports","seq":1939,"state_hash_hex":"8652e3fed8960832"}
511
+ {"outcome":"rt01 banking cards payments","seq":2031,"state_hash_hex":"865d4a3e3d3fa559"}
512
+ {"outcome":"rt10 product reviews opinions","seq":2528,"state_hash_hex":"869461b9513b5a3c"}
513
+ {"outcome":"rt05 feelings emotions reactions","seq":2244,"state_hash_hex":"8761974c6540e787"}
514
+ {"outcome":"rt09 social offensive posts","seq":2499,"state_hash_hex":"876491032aed4e6e"}
515
+ {"outcome":"rt03 assistant requests weather","seq":2106,"state_hash_hex":"8776ca7b716f595b"}
516
+ {"outcome":"rt11 text messages spam","seq":2582,"state_hash_hex":"87a48b3d438fff91"}
517
+ {"outcome":"rt02 boolean question passage","seq":2074,"state_hash_hex":"87e787986134670f"}
518
+ {"outcome":"rt11 text messages spam","seq":2601,"state_hash_hex":"8832e5b985e4abb0"}
519
+ {"outcome":"rt07 game commands actions","seq":2399,"state_hash_hex":"887589d3ed4e1b81"}
520
+ {"outcome":"rt03 assistant requests weather","seq":2136,"state_hash_hex":"8892aaaf885af745"}
521
+ {"outcome":"rt08 safety destructive irreversible","seq":2458,"state_hash_hex":"88c426dd6448b280"}
522
+ {"outcome":"rt15 support tickets russian","seq":2828,"state_hash_hex":"88df8357e40d432c"}
523
+ {"outcome":"rt01 banking cards payments","seq":1988,"state_hash_hex":"89419e6125b1b7d2"}
524
+ {"outcome":"rt06 email inbox messages","seq":2317,"state_hash_hex":"89da79ff4d9bfdc9"}
525
+ {"outcome":"rt13 support billing sales technical","seq":2737,"state_hash_hex":"89f92c3eca629a0d"}
526
+ {"outcome":"rt13 support billing sales technical","seq":2721,"state_hash_hex":"8aa8971c098163b7"}
527
+ {"outcome":"rt13 support billing sales technical","seq":2730,"state_hash_hex":"8ac5a10e97113f7a"}
528
+ {"outcome":"rt00 news headlines sports","seq":1937,"state_hash_hex":"8acfc24233d30190"}
529
+ {"outcome":"rt13 support billing sales technical","seq":2720,"state_hash_hex":"8b9d0363545cf9be"}
530
+ {"outcome":"rt04 encyclopedia entities topics","seq":2169,"state_hash_hex":"8be7e1e557f369b7"}
531
+ {"outcome":"rt07 game commands actions","seq":2344,"state_hash_hex":"8bea8b25967b5b8e"}
532
+ {"outcome":"rt12 support tickets bengali","seq":2645,"state_hash_hex":"8beaa9299dd944b3"}
533
+ {"outcome":"rt10 product reviews opinions","seq":2578,"state_hash_hex":"8c49595961500487"}
534
+ {"outcome":"rt11 text messages spam","seq":2620,"state_hash_hex":"8ce70c292e9e49d0"}
535
+ {"outcome":"rt02 boolean question passage","seq":2095,"state_hash_hex":"8d2ee79a6264fafb"}
536
+ {"outcome":"rt07 game commands actions","seq":2359,"state_hash_hex":"8d4747be0b0af69b"}
537
+ {"outcome":"rt06 email inbox messages","seq":2328,"state_hash_hex":"8d96b63d70fcd14d"}
538
+ {"outcome":"rt02 boolean question passage","seq":2092,"state_hash_hex":"8e7003a668ad4c35"}
539
+ {"outcome":"rt07 game commands actions","seq":2349,"state_hash_hex":"8eeaa8746432682f"}
540
+ {"outcome":"rt09 social offensive posts","seq":2487,"state_hash_hex":"8f969fc73d77f1ac"}
541
+ {"outcome":"rt10 product reviews opinions","seq":2537,"state_hash_hex":"8ff322f3dbdaab5c"}
542
+ {"outcome":"rt02 boolean question passage","seq":2079,"state_hash_hex":"9016e379f3ce42f4"}
543
+ {"outcome":"rt05 feelings emotions reactions","seq":2278,"state_hash_hex":"902bfec7f645353f"}
544
+ {"outcome":"rt11 text messages spam","seq":2594,"state_hash_hex":"90360c73dbfdcdfe"}
545
+ {"outcome":"rt06 email inbox messages","seq":2285,"state_hash_hex":"914b86711ecce564"}
546
+ {"outcome":"rt03 assistant requests weather","seq":2138,"state_hash_hex":"91acedf9f43bcb25"}
547
+ {"outcome":"rt08 safety destructive irreversible","seq":2426,"state_hash_hex":"920486f992147338"}
548
+ {"outcome":"rt02 boolean question passage","seq":2068,"state_hash_hex":"923b520f4b3ade35"}
549
+ {"outcome":"rt05 feelings emotions reactions","seq":2245,"state_hash_hex":"92b6022af0ab3915"}
550
+ {"outcome":"rt12 support tickets bengali","seq":2650,"state_hash_hex":"92d7707d3a16bdb5"}
551
+ {"outcome":"rt01 banking cards payments","seq":2025,"state_hash_hex":"93ad4f4b54760616"}
552
+ {"outcome":"rt12 support tickets bengali","seq":2669,"state_hash_hex":"947ac00fa233fd57"}
553
+ {"outcome":"rt08 safety destructive irreversible","seq":2440,"state_hash_hex":"9494c86750515714"}
554
+ {"outcome":"rt09 social offensive posts","seq":2519,"state_hash_hex":"94d543b2e80c94b1"}
555
+ {"outcome":"rt07 game commands actions","seq":2383,"state_hash_hex":"953c9239f3e6491b"}
556
+ {"outcome":"rt07 game commands actions","seq":2384,"state_hash_hex":"9558b19c3b09b966"}
557
+ {"outcome":"rt08 safety destructive irreversible","seq":2414,"state_hash_hex":"9561591edd762167"}
558
+ {"outcome":"rt07 game commands actions","seq":2353,"state_hash_hex":"95a5752d40519f88"}
559
+ {"outcome":"rt00 news headlines sports","seq":1921,"state_hash_hex":"95b711ae33048f0a"}
560
+ {"outcome":"rt08 safety destructive irreversible","seq":2419,"state_hash_hex":"95c63cf800cb4f67"}
561
+ {"outcome":"rt04 encyclopedia entities topics","seq":2209,"state_hash_hex":"962dcbe6f0adf246"}
562
+ {"outcome":"rt02 boolean question passage","seq":2091,"state_hash_hex":"9653c3cd5d38f21d"}
563
+ {"outcome":"rt11 text messages spam","seq":2614,"state_hash_hex":"965d4c5e34902305"}
564
+ {"outcome":"rt11 text messages spam","seq":2599,"state_hash_hex":"97051bc13956503f"}
565
+ {"outcome":"rt05 feelings emotions reactions","seq":2240,"state_hash_hex":"975b4d86a8cea4d9"}
566
+ {"outcome":"rt02 boolean question passage","seq":2066,"state_hash_hex":"9868768f1aab1aa0"}
567
+ {"outcome":"rt06 email inbox messages","seq":2286,"state_hash_hex":"98ee199d8a721bfa"}
568
+ {"outcome":"rt03 assistant requests weather","seq":2135,"state_hash_hex":"98f7f170edd500b6"}
569
+ {"outcome":"rt01 banking cards payments","seq":1981,"state_hash_hex":"99057ae3afeee64e"}
570
+ {"outcome":"rt13 support billing sales technical","seq":2735,"state_hash_hex":"9958756830bad5fb"}
571
+ {"outcome":"rt13 support billing sales technical","seq":2741,"state_hash_hex":"997a982c9f605289"}
572
+ {"outcome":"rt15 support tickets russian","seq":2825,"state_hash_hex":"99872dd1b5a43ebd"}
573
+ {"outcome":"rt08 safety destructive irreversible","seq":2404,"state_hash_hex":"9a0af926ffe29da1"}
574
+ {"outcome":"rt14 support tickets hindi","seq":2818,"state_hash_hex":"9afb837e334b7d79"}
575
+ {"outcome":"rt04 encyclopedia entities topics","seq":2203,"state_hash_hex":"9b8b04ace5260bd2"}
576
+ {"outcome":"rt07 game commands actions","seq":2341,"state_hash_hex":"9b9755c79cdbad06"}
577
+ {"outcome":"rt10 product reviews opinions","seq":2577,"state_hash_hex":"9be5708bdd616a95"}
578
+ {"outcome":"rt08 safety destructive irreversible","seq":2402,"state_hash_hex":"9be9980c14327614"}
579
+ {"outcome":"rt05 feelings emotions reactions","seq":2258,"state_hash_hex":"9c16a41a8ae37de2"}
580
+ {"outcome":"rt03 assistant requests weather","seq":2109,"state_hash_hex":"9cc8d06d56f2b0c4"}
581
+ {"outcome":"rt07 game commands actions","seq":2375,"state_hash_hex":"9d5ab97bba8ffa10"}
582
+ {"outcome":"rt05 feelings emotions reactions","seq":2222,"state_hash_hex":"9daa35d17ec11178"}
583
+ {"outcome":"rt08 safety destructive irreversible","seq":2416,"state_hash_hex":"9db333c2030d173a"}
584
+ {"outcome":"rt06 email inbox messages","seq":2298,"state_hash_hex":"9dd7433400bae50f"}
585
+ {"outcome":"rt12 support tickets bengali","seq":2659,"state_hash_hex":"9dfc8e19758c1214"}
586
+ {"outcome":"rt12 support tickets bengali","seq":2698,"state_hash_hex":"9e0ba90b9fdb8eef"}
587
+ {"outcome":"rt07 game commands actions","seq":2356,"state_hash_hex":"9ec7c2c9109c429d"}
588
+ {"outcome":"rt07 game commands actions","seq":2369,"state_hash_hex":"9f50dfe02e9cfe4f"}
589
+ {"outcome":"rt05 feelings emotions reactions","seq":2225,"state_hash_hex":"9f8bc1fc2724fdef"}
590
+ {"outcome":"rt04 encyclopedia entities topics","seq":2191,"state_hash_hex":"9fae8a3ec5ca8ca9"}
591
+ {"outcome":"rt06 email inbox messages","seq":2300,"state_hash_hex":"a01b8ab3caf06900"}
592
+ {"outcome":"rt10 product reviews opinions","seq":2570,"state_hash_hex":"a0392589c0285737"}
593
+ {"outcome":"rt13 support billing sales technical","seq":2750,"state_hash_hex":"a08d4d27b4ec5304"}
594
+ {"outcome":"rt00 news headlines sports","seq":1941,"state_hash_hex":"a1057ac24df09c83"}
595
+ {"outcome":"rt11 text messages spam","seq":2584,"state_hash_hex":"a189328a9643b0c7"}
596
+ {"outcome":"rt07 game commands actions","seq":2346,"state_hash_hex":"a1efe75de6a47655"}
597
+ {"outcome":"rt04 encyclopedia entities topics","seq":2175,"state_hash_hex":"a22a5b15fccc3135"}
598
+ {"outcome":"rt15 support tickets russian","seq":2871,"state_hash_hex":"a22bf759e36a327b"}
599
+ {"outcome":"rt00 news headlines sports","seq":1974,"state_hash_hex":"a2b99a442fd25d8b"}
600
+ {"outcome":"rt00 news headlines sports","seq":1956,"state_hash_hex":"a2f5db7968ea9dc4"}
601
+ {"outcome":"rt11 text messages spam","seq":2638,"state_hash_hex":"a3116717b77e5686"}
602
+ {"outcome":"rt05 feelings emotions reactions","seq":2230,"state_hash_hex":"a32308d2626eee0a"}
603
+ {"outcome":"rt15 support tickets russian","seq":2821,"state_hash_hex":"a336e2681dcd80f5"}
604
+ {"outcome":"rt10 product reviews opinions","seq":2539,"state_hash_hex":"a36adef6518cf92d"}
605
+ {"outcome":"rt07 game commands actions","seq":2355,"state_hash_hex":"a380f3eb30cfbb83"}
606
+ {"outcome":"rt12 support tickets bengali","seq":2694,"state_hash_hex":"a3a06ee5c1278504"}
607
+ {"outcome":"rt07 game commands actions","seq":2400,"state_hash_hex":"a3d967e3ec943f69"}
608
+ {"outcome":"rt13 support billing sales technical","seq":2745,"state_hash_hex":"a4364c12ce913303"}
609
+ {"outcome":"rt10 product reviews opinions","seq":2576,"state_hash_hex":"a446e1c1055b7df0"}
610
+ {"outcome":"rt12 support tickets bengali","seq":2686,"state_hash_hex":"a454a1f41ba2ddfc"}
611
+ {"outcome":"rt14 support tickets hindi","seq":2788,"state_hash_hex":"a48fe3046172b690"}
612
+ {"outcome":"rt14 support tickets hindi","seq":2782,"state_hash_hex":"a51e81216a003f14"}
613
+ {"outcome":"rt07 game commands actions","seq":2362,"state_hash_hex":"a5c1a2d802d06770"}
614
+ {"outcome":"rt03 assistant requests weather","seq":2115,"state_hash_hex":"a6218197e7f4ca49"}
615
+ {"outcome":"rt05 feelings emotions reactions","seq":2246,"state_hash_hex":"a643fd8fe69c3e97"}
616
+ {"outcome":"rt00 news headlines sports","seq":1979,"state_hash_hex":"a694925d2d4bef64"}
617
+ {"outcome":"rt13 support billing sales technical","seq":2754,"state_hash_hex":"a6fece485bc655e9"}
618
+ {"outcome":"rt07 game commands actions","seq":2368,"state_hash_hex":"a7241e603d1ff705"}
619
+ {"outcome":"rt01 banking cards payments","seq":1998,"state_hash_hex":"a73a0bedfffb29ec"}
620
+ {"outcome":"rt10 product reviews opinions","seq":2555,"state_hash_hex":"a7cffbfadea37ff4"}
621
+ {"outcome":"rt06 email inbox messages","seq":2307,"state_hash_hex":"a7dda1b6c2bd6c4a"}
622
+ {"outcome":"rt10 product reviews opinions","seq":2569,"state_hash_hex":"a806c6f0e818cf2a"}
623
+ {"outcome":"rt09 social offensive posts","seq":2517,"state_hash_hex":"a82cf88add8867f3"}
624
+ {"outcome":"rt01 banking cards payments","seq":1989,"state_hash_hex":"a85359656ef98a73"}
625
+ {"outcome":"rt14 support tickets hindi","seq":2777,"state_hash_hex":"a877621688e99362"}
626
+ {"outcome":"rt00 news headlines sports","seq":1952,"state_hash_hex":"a8f39fadc3d16740"}
627
+ {"outcome":"rt15 support tickets russian","seq":2832,"state_hash_hex":"a8f4b40feb5fced4"}
628
+ {"outcome":"rt11 text messages spam","seq":2619,"state_hash_hex":"a8fbe03a9318d0e9"}
629
+ {"outcome":"rt11 text messages spam","seq":2627,"state_hash_hex":"a963908509faa733"}
630
+ {"outcome":"rt10 product reviews opinions","seq":2527,"state_hash_hex":"a96b7ccdd4811177"}
631
+ {"outcome":"rt02 boolean question passage","seq":2061,"state_hash_hex":"a9752d3a9b6fe93c"}
632
+ {"outcome":"rt08 safety destructive irreversible","seq":2417,"state_hash_hex":"a97aabf364b7f763"}
633
+ {"outcome":"rt06 email inbox messages","seq":2321,"state_hash_hex":"a9cea72e1531112e"}
634
+ {"outcome":"rt00 news headlines sports","seq":1975,"state_hash_hex":"a9e9d0b9b2f7a360"}
635
+ {"outcome":"rt08 safety destructive irreversible","seq":2456,"state_hash_hex":"a9feac8ea5661166"}
636
+ {"outcome":"rt03 assistant requests weather","seq":2160,"state_hash_hex":"aa386492b4e12ed2"}
637
+ {"outcome":"rt00 news headlines sports","seq":1936,"state_hash_hex":"aa3dc6b39ad8c4d7"}
638
+ {"outcome":"rt07 game commands actions","seq":2390,"state_hash_hex":"aa573f9d9b03b2cb"}
639
+ {"outcome":"rt05 feelings emotions reactions","seq":2276,"state_hash_hex":"aa80644a04a857af"}
640
+ {"outcome":"rt02 boolean question passage","seq":2090,"state_hash_hex":"aaab2267a5b7b80a"}
641
+ {"outcome":"rt12 support tickets bengali","seq":2646,"state_hash_hex":"aaaff8c3397c9183"}
642
+ {"outcome":"rt09 social offensive posts","seq":2476,"state_hash_hex":"aab630607c280f1c"}
643
+ {"outcome":"rt15 support tickets russian","seq":2839,"state_hash_hex":"aab90848380e7879"}
644
+ {"outcome":"rt10 product reviews opinions","seq":2524,"state_hash_hex":"aae9cf3bd1583bd8"}
645
+ {"outcome":"rt11 text messages spam","seq":2587,"state_hash_hex":"ab04994b8f87152a"}
646
+ {"outcome":"rt00 news headlines sports","seq":1931,"state_hash_hex":"ab3062b56d33bcf8"}
647
+ {"outcome":"rt12 support tickets bengali","seq":2677,"state_hash_hex":"ab79d0538382dee7"}
648
+ {"outcome":"rt11 text messages spam","seq":2630,"state_hash_hex":"aba42968a18bd621"}
649
+ {"outcome":"rt01 banking cards payments","seq":2006,"state_hash_hex":"abd0ba82e2c916fb"}
650
+ {"outcome":"rt06 email inbox messages","seq":2332,"state_hash_hex":"abef703a9d78166f"}
651
+ {"outcome":"rt03 assistant requests weather","seq":2140,"state_hash_hex":"ac20e98ea79d5e25"}
652
+ {"outcome":"rt01 banking cards payments","seq":2009,"state_hash_hex":"ac35f533b7adb1d4"}
653
+ {"outcome":"rt02 boolean question passage","seq":2057,"state_hash_hex":"ac5c725f5d425190"}
654
+ {"outcome":"rt12 support tickets bengali","seq":2651,"state_hash_hex":"acd10aca3c059a41"}
655
+ {"outcome":"rt09 social offensive posts","seq":2468,"state_hash_hex":"acf3282ddc2ea6c0"}
656
+ {"outcome":"rt06 email inbox messages","seq":2308,"state_hash_hex":"ad134a3a6f29cd36"}
657
+ {"outcome":"rt03 assistant requests weather","seq":2111,"state_hash_hex":"ad2b88c79ffa1a2f"}
658
+ {"outcome":"rt11 text messages spam","seq":2591,"state_hash_hex":"ad5bebaa97026570"}
659
+ {"outcome":"rt15 support tickets russian","seq":2857,"state_hash_hex":"ad8ace197d781698"}
660
+ {"outcome":"rt01 banking cards payments","seq":1990,"state_hash_hex":"adedadc520df8106"}
661
+ {"outcome":"rt02 boolean question passage","seq":2072,"state_hash_hex":"ae4c032effeffcbc"}
662
+ {"outcome":"rt10 product reviews opinions","seq":2560,"state_hash_hex":"aeb1c297a39028cf"}
663
+ {"outcome":"rt15 support tickets russian","seq":2860,"state_hash_hex":"aeb364e53b60ca19"}
664
+ {"outcome":"rt05 feelings emotions reactions","seq":2227,"state_hash_hex":"aebbb6383c0687f2"}
665
+ {"outcome":"rt15 support tickets russian","seq":2835,"state_hash_hex":"af66d8c0eac91b84"}
666
+ {"outcome":"rt10 product reviews opinions","seq":2541,"state_hash_hex":"af80a70cdd058682"}
667
+ {"outcome":"rt04 encyclopedia entities topics","seq":2211,"state_hash_hex":"af9562e591ff1c54"}
668
+ {"outcome":"rt11 text messages spam","seq":2581,"state_hash_hex":"afdab6d6d5249e44"}
669
+ {"outcome":"rt14 support tickets hindi","seq":2799,"state_hash_hex":"aff599822046f16d"}
670
+ {"outcome":"rt00 news headlines sports","seq":1932,"state_hash_hex":"b05eaca3d46c696a"}
671
+ {"outcome":"rt10 product reviews opinions","seq":2543,"state_hash_hex":"b09c7ddc38902c46"}
672
+ {"outcome":"rt03 assistant requests weather","seq":2137,"state_hash_hex":"b1a58f59efef7d07"}
673
+ {"outcome":"rt01 banking cards payments","seq":1995,"state_hash_hex":"b1cfec89abc96d4a"}
674
+ {"outcome":"rt10 product reviews opinions","seq":2529,"state_hash_hex":"b203866dc852c0e0"}
675
+ {"outcome":"rt07 game commands actions","seq":2385,"state_hash_hex":"b33189328f78ae6e"}
676
+ {"outcome":"rt05 feelings emotions reactions","seq":2228,"state_hash_hex":"b349d47adb4826e9"}
677
+ {"outcome":"rt14 support tickets hindi","seq":2775,"state_hash_hex":"b34e6bad0d56a4d2"}
678
+ {"outcome":"rt15 support tickets russian","seq":2869,"state_hash_hex":"b389220368b98d33"}
679
+ {"outcome":"rt09 social offensive posts","seq":2470,"state_hash_hex":"b3cb4c8cfb1b6448"}
680
+ {"outcome":"rt04 encyclopedia entities topics","seq":2167,"state_hash_hex":"b424c1b3b31d80d7"}
681
+ {"outcome":"rt07 game commands actions","seq":2396,"state_hash_hex":"b473b346f5bc9cbc"}
682
+ {"outcome":"rt15 support tickets russian","seq":2858,"state_hash_hex":"b48c6a5eb1c51aa7"}
683
+ {"outcome":"rt02 boolean question passage","seq":2086,"state_hash_hex":"b4cfd69e1dd8b20a"}
684
+ {"outcome":"rt15 support tickets russian","seq":2848,"state_hash_hex":"b5e2b69b194d14ec"}
685
+ {"outcome":"rt08 safety destructive irreversible","seq":2447,"state_hash_hex":"b5f427441bf0fe72"}
686
+ {"outcome":"rt08 safety destructive irreversible","seq":2443,"state_hash_hex":"b60b61899ea5e69e"}
687
+ {"outcome":"rt09 social offensive posts","seq":2465,"state_hash_hex":"b66bfca281df1f4f"}
688
+ {"outcome":"rt11 text messages spam","seq":2629,"state_hash_hex":"b695160c5f88a7ee"}
689
+ {"outcome":"rt11 text messages spam","seq":2623,"state_hash_hex":"b720a0eee828630e"}
690
+ {"outcome":"rt00 news headlines sports","seq":1966,"state_hash_hex":"b7381282fdf9063b"}
691
+ {"outcome":"rt05 feelings emotions reactions","seq":2274,"state_hash_hex":"b78e5a2d4df50d6d"}
692
+ {"outcome":"rt13 support billing sales technical","seq":2704,"state_hash_hex":"b790f5c54350a1e8"}
693
+ {"outcome":"rt05 feelings emotions reactions","seq":2261,"state_hash_hex":"b79ae9b820d74620"}
694
+ {"outcome":"rt05 feelings emotions reactions","seq":2256,"state_hash_hex":"b7c56e1982d1f9e2"}
695
+ {"outcome":"rt15 support tickets russian","seq":2863,"state_hash_hex":"b7f5e43ec4c656d4"}
696
+ {"outcome":"rt12 support tickets bengali","seq":2674,"state_hash_hex":"b81254d05218c70c"}
697
+ {"outcome":"rt07 game commands actions","seq":2393,"state_hash_hex":"b8477eca13d72d41"}
698
+ {"outcome":"rt03 assistant requests weather","seq":2158,"state_hash_hex":"b871b50ebc9a7cb4"}
699
+ {"outcome":"rt12 support tickets bengali","seq":2685,"state_hash_hex":"b8b62fc6c061c49d"}
700
+ {"outcome":"rt10 product reviews opinions","seq":2533,"state_hash_hex":"b937f92aaa5b4c46"}
701
+ {"outcome":"rt12 support tickets bengali","seq":2641,"state_hash_hex":"b974ee0adae0a37d"}
702
+ {"outcome":"rt11 text messages spam","seq":2622,"state_hash_hex":"b9aba9de77d58a35"}
703
+ {"outcome":"rt14 support tickets hindi","seq":2820,"state_hash_hex":"b9e4ca821be2254d"}
704
+ {"outcome":"rt00 news headlines sports","seq":1965,"state_hash_hex":"ba016abc5ec56a7d"}
705
+ {"outcome":"rt04 encyclopedia entities topics","seq":2208,"state_hash_hex":"ba508a4530df370f"}
706
+ {"outcome":"rt04 encyclopedia entities topics","seq":2213,"state_hash_hex":"ba59e2598f338bb0"}
707
+ {"outcome":"rt06 email inbox messages","seq":2302,"state_hash_hex":"ba5cc7ab010f5687"}
708
+ {"outcome":"rt10 product reviews opinions","seq":2579,"state_hash_hex":"bafa8f23408c8c8a"}
709
+ {"outcome":"rt06 email inbox messages","seq":2301,"state_hash_hex":"bb020753eb7f5a76"}
710
+ {"outcome":"rt03 assistant requests weather","seq":2149,"state_hash_hex":"bb3cacfc2640cb82"}
711
+ {"outcome":"rt04 encyclopedia entities topics","seq":2162,"state_hash_hex":"bb44fc02aea6f6a0"}
712
+ {"outcome":"rt00 news headlines sports","seq":1928,"state_hash_hex":"bba957e31a912bd0"}
713
+ {"outcome":"rt01 banking cards payments","seq":1985,"state_hash_hex":"bbd57da300a6b8d4"}
714
+ {"outcome":"rt07 game commands actions","seq":2361,"state_hash_hex":"bbe2b2b52f541cf4"}
715
+ {"outcome":"rt09 social offensive posts","seq":2483,"state_hash_hex":"bc30974f503a98c7"}
716
+ {"outcome":"rt10 product reviews opinions","seq":2540,"state_hash_hex":"bc8efdf35d64617e"}
717
+ {"outcome":"rt15 support tickets russian","seq":2859,"state_hash_hex":"bcc45c03da701ed5"}
718
+ {"outcome":"rt01 banking cards payments","seq":2032,"state_hash_hex":"bd8d3ed8f4fe53aa"}
719
+ {"outcome":"rt10 product reviews opinions","seq":2558,"state_hash_hex":"bd8d9657c49117a7"}
720
+ {"outcome":"rt05 feelings emotions reactions","seq":2268,"state_hash_hex":"bd992b6dd4d7bc18"}
721
+ {"outcome":"rt09 social offensive posts","seq":2477,"state_hash_hex":"bdc8f9590796c67c"}
722
+ {"outcome":"rt05 feelings emotions reactions","seq":2269,"state_hash_hex":"be000f5c4a532cf5"}
723
+ {"outcome":"rt03 assistant requests weather","seq":2118,"state_hash_hex":"be2e629ecf114557"}
724
+ {"outcome":"rt11 text messages spam","seq":2595,"state_hash_hex":"be564e1dae5315d0"}
725
+ {"outcome":"rt00 news headlines sports","seq":1970,"state_hash_hex":"be6d46ea34b96eb3"}
726
+ {"outcome":"rt15 support tickets russian","seq":2854,"state_hash_hex":"be8ba553aab5b148"}
727
+ {"outcome":"rt12 support tickets bengali","seq":2693,"state_hash_hex":"bee1f5d0107985f7"}
728
+ {"outcome":"rt14 support tickets hindi","seq":2773,"state_hash_hex":"bf047e70e5b3072b"}
729
+ {"outcome":"rt02 boolean question passage","seq":2050,"state_hash_hex":"bf637c2b04a8857e"}
730
+ {"outcome":"rt03 assistant requests weather","seq":2125,"state_hash_hex":"bfa53d7c4503756a"}
731
+ {"outcome":"rt13 support billing sales technical","seq":2733,"state_hash_hex":"bfefeea410d6cdd5"}
732
+ {"outcome":"rt00 news headlines sports","seq":1923,"state_hash_hex":"c0152fd6e152f531"}
733
+ {"outcome":"rt08 safety destructive irreversible","seq":2442,"state_hash_hex":"c02e54c7af450494"}
734
+ {"outcome":"rt05 feelings emotions reactions","seq":2231,"state_hash_hex":"c037fff34fd2fb44"}
735
+ {"outcome":"rt01 banking cards payments","seq":1994,"state_hash_hex":"c070033e2387717d"}
736
+ {"outcome":"rt15 support tickets russian","seq":2876,"state_hash_hex":"c081999f05d305d4"}
737
+ {"outcome":"rt02 boolean question passage","seq":2064,"state_hash_hex":"c08d222d150a292a"}
738
+ {"outcome":"rt06 email inbox messages","seq":2304,"state_hash_hex":"c1094640e06f04d2"}
739
+ {"outcome":"rt04 encyclopedia entities topics","seq":2188,"state_hash_hex":"c11625b84490bebc"}
740
+ {"outcome":"rt11 text messages spam","seq":2613,"state_hash_hex":"c12fb93d1cd4906a"}
741
+ {"outcome":"rt14 support tickets hindi","seq":2802,"state_hash_hex":"c24043e889be16bc"}
742
+ {"outcome":"rt08 safety destructive irreversible","seq":2445,"state_hash_hex":"c33dd342d94eecf2"}
743
+ {"outcome":"rt03 assistant requests weather","seq":2126,"state_hash_hex":"c35d7fb2ed6148ab"}
744
+ {"outcome":"rt15 support tickets russian","seq":2850,"state_hash_hex":"c3a1cf7071d28c31"}
745
+ {"outcome":"rt02 boolean question passage","seq":2096,"state_hash_hex":"c42ac0e8dcc43ad3"}
746
+ {"outcome":"rt02 boolean question passage","seq":2081,"state_hash_hex":"c44148d5cb57b978"}
747
+ {"outcome":"rt09 social offensive posts","seq":2461,"state_hash_hex":"c47027c4ade5a261"}
748
+ {"outcome":"rt13 support billing sales technical","seq":2703,"state_hash_hex":"c4b82cb0fc9906d9"}
749
+ {"outcome":"rt01 banking cards payments","seq":1992,"state_hash_hex":"c545aa3ab5e20b1e"}
750
+ {"outcome":"rt12 support tickets bengali","seq":2642,"state_hash_hex":"c636c49c0440423b"}
751
+ {"outcome":"rt03 assistant requests weather","seq":2121,"state_hash_hex":"c7046d0479ff6a2e"}
752
+ {"outcome":"rt04 encyclopedia entities topics","seq":2193,"state_hash_hex":"c73473c35101e32e"}
753
+ {"outcome":"rt03 assistant requests weather","seq":2107,"state_hash_hex":"c7a10c1b10598c4c"}
754
+ {"outcome":"rt10 product reviews opinions","seq":2554,"state_hash_hex":"c7c2d88cf862cfcc"}
755
+ {"outcome":"rt01 banking cards payments","seq":2007,"state_hash_hex":"c7e2dfe4dc9a85dd"}
756
+ {"outcome":"rt07 game commands actions","seq":2397,"state_hash_hex":"c8e42ad507a14e5a"}
757
+ {"outcome":"rt10 product reviews opinions","seq":2550,"state_hash_hex":"c96eae4ae8c746a9"}
758
+ {"outcome":"rt03 assistant requests weather","seq":2145,"state_hash_hex":"c973b16650f945ef"}
759
+ {"outcome":"rt11 text messages spam","seq":2593,"state_hash_hex":"c9a9d001162ba090"}
760
+ {"outcome":"rt01 banking cards payments","seq":2010,"state_hash_hex":"c9b9363cd8641877"}
761
+ {"outcome":"rt03 assistant requests weather","seq":2152,"state_hash_hex":"c9e5561b0910da20"}
762
+ {"outcome":"rt12 support tickets bengali","seq":2699,"state_hash_hex":"c9e688a0ba706a57"}
763
+ {"outcome":"rt14 support tickets hindi","seq":2789,"state_hash_hex":"ca1b5ffbe843289b"}
764
+ {"outcome":"rt07 game commands actions","seq":2391,"state_hash_hex":"ca1d7e7d2d26f9a7"}
765
+ {"outcome":"rt13 support billing sales technical","seq":2714,"state_hash_hex":"ca8af918b392169f"}
766
+ {"outcome":"rt08 safety destructive irreversible","seq":2429,"state_hash_hex":"cb398e5db6cb385a"}
767
+ {"outcome":"rt09 social offensive posts","seq":2516,"state_hash_hex":"cb43dae3b8f7e76b"}
768
+ {"outcome":"rt07 game commands actions","seq":2380,"state_hash_hex":"cb93efdd5b9d8595"}
769
+ {"outcome":"rt10 product reviews opinions","seq":2571,"state_hash_hex":"cbf0a71fc26d5421"}
770
+ {"outcome":"rt05 feelings emotions reactions","seq":2272,"state_hash_hex":"cc121c30acc33239"}
771
+ {"outcome":"rt01 banking cards payments","seq":2002,"state_hash_hex":"cc15a9f4d4316f9d"}
772
+ {"outcome":"rt03 assistant requests weather","seq":2108,"state_hash_hex":"cc8a1c13397a598a"}
773
+ {"outcome":"rt05 feelings emotions reactions","seq":2280,"state_hash_hex":"cd2a94b56dd00f18"}
774
+ {"outcome":"rt02 boolean question passage","seq":2051,"state_hash_hex":"cd7ef8ce3c0b0c8d"}
775
+ {"outcome":"rt14 support tickets hindi","seq":2805,"state_hash_hex":"cdb31b8f5600687f"}
776
+ {"outcome":"rt06 email inbox messages","seq":2284,"state_hash_hex":"cdf9d924cfc30f25"}
777
+ {"outcome":"rt15 support tickets russian","seq":2834,"state_hash_hex":"cdfdd55ecf27814a"}
778
+ {"outcome":"rt12 support tickets bengali","seq":2661,"state_hash_hex":"ce094be32bf11a64"}
779
+ {"outcome":"rt04 encyclopedia entities topics","seq":2181,"state_hash_hex":"ce3896d683cd49de"}
780
+ {"outcome":"rt01 banking cards payments","seq":2026,"state_hash_hex":"cea59d4528a8de94"}
781
+ {"outcome":"rt07 game commands actions","seq":2389,"state_hash_hex":"cead7d57c483ef40"}
782
+ {"outcome":"rt06 email inbox messages","seq":2334,"state_hash_hex":"cee7c260a8a81fbf"}
783
+ {"outcome":"rt05 feelings emotions reactions","seq":2248,"state_hash_hex":"cf114d741be94e03"}
784
+ {"outcome":"rt08 safety destructive irreversible","seq":2418,"state_hash_hex":"cf3d5501f1257bdb"}
785
+ {"outcome":"rt05 feelings emotions reactions","seq":2273,"state_hash_hex":"cf57cc98424e4b75"}
786
+ {"outcome":"rt12 support tickets bengali","seq":2656,"state_hash_hex":"cf647e81dbfc7507"}
787
+ {"outcome":"rt05 feelings emotions reactions","seq":2234,"state_hash_hex":"d03df25ca9b98457"}
788
+ {"outcome":"rt14 support tickets hindi","seq":2812,"state_hash_hex":"d04a596499d7011f"}
789
+ {"outcome":"rt05 feelings emotions reactions","seq":2251,"state_hash_hex":"d08ed29e833064aa"}
790
+ {"outcome":"rt12 support tickets bengali","seq":2657,"state_hash_hex":"d0a772d728e2f4d7"}
791
+ {"outcome":"rt08 safety destructive irreversible","seq":2405,"state_hash_hex":"d0e15e71e2774a67"}
792
+ {"outcome":"rt02 boolean question passage","seq":2063,"state_hash_hex":"d173768e62f50989"}
793
+ {"outcome":"rt10 product reviews opinions","seq":2568,"state_hash_hex":"d1887ba933a6dbeb"}
794
+ {"outcome":"rt10 product reviews opinions","seq":2536,"state_hash_hex":"d192b9135fa3e5ec"}
795
+ {"outcome":"rt04 encyclopedia entities topics","seq":2189,"state_hash_hex":"d1b887e44b414173"}
796
+ {"outcome":"rt12 support tickets bengali","seq":2681,"state_hash_hex":"d1d174c9f896761b"}
797
+ {"outcome":"rt00 news headlines sports","seq":1925,"state_hash_hex":"d1e89d5784fe2249"}
798
+ {"outcome":"rt06 email inbox messages","seq":2294,"state_hash_hex":"d1f4c93e62c234bc"}
799
+ {"outcome":"rt11 text messages spam","seq":2605,"state_hash_hex":"d22238c54d1cc2b2"}
800
+ {"outcome":"rt05 feelings emotions reactions","seq":2262,"state_hash_hex":"d2334badeaa61bd1"}
801
+ {"outcome":"rt11 text messages spam","seq":2607,"state_hash_hex":"d290a9542c7d8d0f"}
802
+ {"outcome":"rt03 assistant requests weather","seq":2143,"state_hash_hex":"d2a787388721172a"}
803
+ {"outcome":"rt02 boolean question passage","seq":2093,"state_hash_hex":"d308997791e66106"}
804
+ {"outcome":"rt04 encyclopedia entities topics","seq":2207,"state_hash_hex":"d359858e8af5b647"}
805
+ {"outcome":"rt03 assistant requests weather","seq":2122,"state_hash_hex":"d427d943914cba13"}
806
+ {"outcome":"rt05 feelings emotions reactions","seq":2266,"state_hash_hex":"d42dc2783bc0bfaa"}
807
+ {"outcome":"rt02 boolean question passage","seq":2052,"state_hash_hex":"d4d0dc9b6f09629b"}
808
+ {"outcome":"rt01 banking cards payments","seq":2014,"state_hash_hex":"d4f5c4634719015c"}
809
+ {"outcome":"rt09 social offensive posts","seq":2500,"state_hash_hex":"d55334892256adb7"}
810
+ {"outcome":"rt03 assistant requests weather","seq":2123,"state_hash_hex":"d59475ca6ed4ec88"}
811
+ {"outcome":"rt00 news headlines sports","seq":1971,"state_hash_hex":"d5de3163e2bb71e4"}
812
+ {"outcome":"rt09 social offensive posts","seq":2486,"state_hash_hex":"d6059ac253cae363"}
813
+ {"outcome":"rt09 social offensive posts","seq":2494,"state_hash_hex":"d6708acdb5634bd6"}
814
+ {"outcome":"rt11 text messages spam","seq":2632,"state_hash_hex":"d6d44f666fa4f27e"}
815
+ {"outcome":"rt12 support tickets bengali","seq":2700,"state_hash_hex":"d6e2d1589fe123cf"}
816
+ {"outcome":"rt06 email inbox messages","seq":2303,"state_hash_hex":"d835cb81b353b4ee"}
817
+ {"outcome":"rt12 support tickets bengali","seq":2690,"state_hash_hex":"d8807357d7d7e424"}
818
+ {"outcome":"rt03 assistant requests weather","seq":2159,"state_hash_hex":"d89a695abe093e41"}
819
+ {"outcome":"rt11 text messages spam","seq":2637,"state_hash_hex":"d8ab2a65a2f7fbbd"}
820
+ {"outcome":"rt02 boolean question passage","seq":2087,"state_hash_hex":"d92dd579fde79ec2"}
821
+ {"outcome":"rt08 safety destructive irreversible","seq":2431,"state_hash_hex":"d94b2a7323aa68a0"}
822
+ {"outcome":"rt04 encyclopedia entities topics","seq":2163,"state_hash_hex":"d97d86f6df0ac594"}
823
+ {"outcome":"rt05 feelings emotions reactions","seq":2264,"state_hash_hex":"d994a42c0c5e811e"}
824
+ {"outcome":"rt03 assistant requests weather","seq":2112,"state_hash_hex":"d9b49272ee799835"}
825
+ {"outcome":"rt08 safety destructive irreversible","seq":2430,"state_hash_hex":"d9d2851f951018c5"}
826
+ {"outcome":"rt11 text messages spam","seq":2639,"state_hash_hex":"d9e9c049d751c608"}
827
+ {"outcome":"rt00 news headlines sports","seq":1977,"state_hash_hex":"d9f42b31ae136b5c"}
828
+ {"outcome":"rt03 assistant requests weather","seq":2129,"state_hash_hex":"d9fa6709a4db4737"}
829
+ {"outcome":"rt09 social offensive posts","seq":2503,"state_hash_hex":"da4c3e64b9c84237"}
830
+ {"outcome":"rt07 game commands actions","seq":2345,"state_hash_hex":"dad74bebdd5279e8"}
831
+ {"outcome":"rt01 banking cards payments","seq":2015,"state_hash_hex":"db3a1afeb0590e10"}
832
+ {"outcome":"rt08 safety destructive irreversible","seq":2449,"state_hash_hex":"db663e4c83f0581b"}
833
+ {"outcome":"rt13 support billing sales technical","seq":2726,"state_hash_hex":"db708026063cf99f"}
834
+ {"outcome":"rt06 email inbox messages","seq":2299,"state_hash_hex":"dc9a48b230d01f80"}
835
+ {"outcome":"rt02 boolean question passage","seq":2049,"state_hash_hex":"dca08539df8ed1ec"}
836
+ {"outcome":"rt08 safety destructive irreversible","seq":2427,"state_hash_hex":"dcc870f57c346346"}
837
+ {"outcome":"rt06 email inbox messages","seq":2315,"state_hash_hex":"dd284f0d89644bb0"}
838
+ {"outcome":"rt05 feelings emotions reactions","seq":2275,"state_hash_hex":"ddecb7911b07b823"}
839
+ {"outcome":"rt01 banking cards payments","seq":2029,"state_hash_hex":"de7c9a72a2697702"}
840
+ {"outcome":"rt05 feelings emotions reactions","seq":2229,"state_hash_hex":"de9ded86aeb1b6bb"}
841
+ {"outcome":"rt02 boolean question passage","seq":2080,"state_hash_hex":"deb5835d3dcc6f70"}
842
+ {"outcome":"rt00 news headlines sports","seq":1969,"state_hash_hex":"deead683c0efd6b3"}
843
+ {"outcome":"rt07 game commands actions","seq":2347,"state_hash_hex":"df4cddcaea2c63a1"}
844
+ {"outcome":"rt15 support tickets russian","seq":2836,"state_hash_hex":"df647451c5339add"}
845
+ {"outcome":"rt09 social offensive posts","seq":2498,"state_hash_hex":"dfaa06301c0b41f3"}
846
+ {"outcome":"rt02 boolean question passage","seq":2046,"state_hash_hex":"dff5d96b37b42cfe"}
847
+ {"outcome":"rt13 support billing sales technical","seq":2705,"state_hash_hex":"e02eab90568ad5ed"}
848
+ {"outcome":"rt12 support tickets bengali","seq":2666,"state_hash_hex":"e090891ea6f28a47"}
849
+ {"outcome":"rt07 game commands actions","seq":2350,"state_hash_hex":"e128a6dcc77bb0bc"}
850
+ {"outcome":"rt15 support tickets russian","seq":2829,"state_hash_hex":"e15c18789783a5e7"}
851
+ {"outcome":"rt04 encyclopedia entities topics","seq":2178,"state_hash_hex":"e16c215cb681c833"}
852
+ {"outcome":"rt08 safety destructive irreversible","seq":2436,"state_hash_hex":"e1b1ec30e874f282"}
853
+ {"outcome":"rt14 support tickets hindi","seq":2814,"state_hash_hex":"e1e56aa3c8dc5661"}
854
+ {"outcome":"rt03 assistant requests weather","seq":2146,"state_hash_hex":"e2002c865df0714d"}
855
+ {"outcome":"rt02 boolean question passage","seq":2099,"state_hash_hex":"e21189191d51a5b3"}
856
+ {"outcome":"rt08 safety destructive irreversible","seq":2457,"state_hash_hex":"e2297f9daad52357"}
857
+ {"outcome":"rt05 feelings emotions reactions","seq":2247,"state_hash_hex":"e239bf9b029cae01"}
858
+ {"outcome":"rt13 support billing sales technical","seq":2749,"state_hash_hex":"e26e36e1a40b59a7"}
859
+ {"outcome":"rt08 safety destructive irreversible","seq":2444,"state_hash_hex":"e2772e5cc84c9bd9"}
860
+ {"outcome":"rt11 text messages spam","seq":2631,"state_hash_hex":"e27fccfc21acc48d"}
861
+ {"outcome":"rt11 text messages spam","seq":2624,"state_hash_hex":"e2d58189eba165ba"}
862
+ {"outcome":"rt03 assistant requests weather","seq":2141,"state_hash_hex":"e30838f84aed7a18"}
863
+ {"outcome":"rt07 game commands actions","seq":2348,"state_hash_hex":"e32227299c56c6cf"}
864
+ {"outcome":"rt14 support tickets hindi","seq":2779,"state_hash_hex":"e35d9a6bf6c7306b"}
865
+ {"outcome":"rt03 assistant requests weather","seq":2132,"state_hash_hex":"e3aa5b2eef8d207d"}
866
+ {"outcome":"rt04 encyclopedia entities topics","seq":2204,"state_hash_hex":"e4772f1c5cf83981"}
867
+ {"outcome":"rt12 support tickets bengali","seq":2689,"state_hash_hex":"e4e089f994f9489b"}
868
+ {"outcome":"rt02 boolean question passage","seq":2100,"state_hash_hex":"e5200ba7109958ba"}
869
+ {"outcome":"rt01 banking cards payments","seq":2013,"state_hash_hex":"e56f5a3cb63c4c37"}
870
+ {"outcome":"rt05 feelings emotions reactions","seq":2233,"state_hash_hex":"e6908f99c4c2e176"}
871
+ {"outcome":"rt10 product reviews opinions","seq":2535,"state_hash_hex":"e6e34f88d8aaf51f"}
872
+ {"outcome":"rt02 boolean question passage","seq":2048,"state_hash_hex":"e6fbb678d494923a"}
873
+ {"outcome":"rt13 support billing sales technical","seq":2752,"state_hash_hex":"e72289cb06328140"}
874
+ {"outcome":"rt09 social offensive posts","seq":2481,"state_hash_hex":"e7372b5bf9cecc93"}
875
+ {"outcome":"rt08 safety destructive irreversible","seq":2428,"state_hash_hex":"e7b02b16da031cf2"}
876
+ {"outcome":"rt13 support billing sales technical","seq":2701,"state_hash_hex":"e7d7f4516ffe7bde"}
877
+ {"outcome":"rt12 support tickets bengali","seq":2696,"state_hash_hex":"e808337ba4ee0028"}
878
+ {"outcome":"rt06 email inbox messages","seq":2314,"state_hash_hex":"e81e24411c56e725"}
879
+ {"outcome":"rt07 game commands actions","seq":2398,"state_hash_hex":"e8410b01e63f052a"}
880
+ {"outcome":"rt04 encyclopedia entities topics","seq":2202,"state_hash_hex":"e9329de36c6398b2"}
881
+ {"outcome":"rt01 banking cards payments","seq":1993,"state_hash_hex":"ea2c33ec22b8f132"}
882
+ {"outcome":"rt00 news headlines sports","seq":1972,"state_hash_hex":"eb092f4f9323d62f"}
883
+ {"outcome":"rt04 encyclopedia entities topics","seq":2166,"state_hash_hex":"eb918f8b64f2f514"}
884
+ {"outcome":"rt14 support tickets hindi","seq":2810,"state_hash_hex":"ec2284aac0080a31"}
885
+ {"outcome":"rt05 feelings emotions reactions","seq":2252,"state_hash_hex":"ecf3844824003826"}
886
+ {"outcome":"rt14 support tickets hindi","seq":2816,"state_hash_hex":"ed2093e66e64c5b7"}
887
+ {"outcome":"rt00 news headlines sports","seq":1967,"state_hash_hex":"ed3f434adf70637c"}
888
+ {"outcome":"rt04 encyclopedia entities topics","seq":2214,"state_hash_hex":"ee0cbd49f44f6020"}
889
+ {"outcome":"rt09 social offensive posts","seq":2491,"state_hash_hex":"ee1704801ce58376"}
890
+ {"outcome":"rt10 product reviews opinions","seq":2567,"state_hash_hex":"ee292b7dd3276e4b"}
891
+ {"outcome":"rt06 email inbox messages","seq":2325,"state_hash_hex":"ee3c8ca0a539ebb1"}
892
+ {"outcome":"rt07 game commands actions","seq":2382,"state_hash_hex":"ee41b8815d9fcfca"}
893
+ {"outcome":"rt12 support tickets bengali","seq":2671,"state_hash_hex":"eeb12efd15e29f05"}
894
+ {"outcome":"rt12 support tickets bengali","seq":2654,"state_hash_hex":"eebe98368e95a805"}
895
+ {"outcome":"rt03 assistant requests weather","seq":2120,"state_hash_hex":"eecc51a561a35cf2"}
896
+ {"outcome":"rt08 safety destructive irreversible","seq":2412,"state_hash_hex":"ef492b2106c8edbc"}
897
+ {"outcome":"rt15 support tickets russian","seq":2842,"state_hash_hex":"ef4ea903ce4f882e"}
898
+ {"outcome":"rt08 safety destructive irreversible","seq":2432,"state_hash_hex":"ef9dd115a8bf3e2f"}
899
+ {"outcome":"rt10 product reviews opinions","seq":2538,"state_hash_hex":"efaff142b601bebc"}
900
+ {"outcome":"rt04 encyclopedia entities topics","seq":2176,"state_hash_hex":"efc4947f36642d64"}
901
+ {"outcome":"rt13 support billing sales technical","seq":2711,"state_hash_hex":"f0504b128de474bb"}
902
+ {"outcome":"rt01 banking cards payments","seq":2012,"state_hash_hex":"f0ba6c9a97910ab0"}
903
+ {"outcome":"rt04 encyclopedia entities topics","seq":2161,"state_hash_hex":"f0ba762cb54607ef"}
904
+ {"outcome":"rt13 support billing sales technical","seq":2706,"state_hash_hex":"f12399c5c91c7a4d"}
905
+ {"outcome":"rt01 banking cards payments","seq":2024,"state_hash_hex":"f126a583c73f6441"}
906
+ {"outcome":"rt13 support billing sales technical","seq":2709,"state_hash_hex":"f1cbb8af8f479854"}
907
+ {"outcome":"rt08 safety destructive irreversible","seq":2446,"state_hash_hex":"f1cefaad5b1ea79d"}
908
+ {"outcome":"rt04 encyclopedia entities topics","seq":2210,"state_hash_hex":"f2067e2d7f53cc32"}
909
+ {"outcome":"rt12 support tickets bengali","seq":2697,"state_hash_hex":"f2432083985df06c"}
910
+ {"outcome":"rt02 boolean question passage","seq":2084,"state_hash_hex":"f285b7ff830ee1d7"}
911
+ {"outcome":"rt09 social offensive posts","seq":2514,"state_hash_hex":"f28e747f8710c249"}
912
+ {"outcome":"rt10 product reviews opinions","seq":2556,"state_hash_hex":"f28ec851607a598d"}
913
+ {"outcome":"rt15 support tickets russian","seq":2870,"state_hash_hex":"f2a956d2a280aabc"}
914
+ {"outcome":"rt06 email inbox messages","seq":2337,"state_hash_hex":"f39094158f1427d3"}
915
+ {"outcome":"rt09 social offensive posts","seq":2462,"state_hash_hex":"f3b1fe23223bcf4e"}
916
+ {"outcome":"rt01 banking cards payments","seq":1986,"state_hash_hex":"f3f9a5d87c58e7f3"}
917
+ {"outcome":"rt13 support billing sales technical","seq":2738,"state_hash_hex":"f41b20e202c536c0"}
918
+ {"outcome":"rt09 social offensive posts","seq":2484,"state_hash_hex":"f51acd3445feca89"}
919
+ {"outcome":"rt03 assistant requests weather","seq":2127,"state_hash_hex":"f55ba28a23c932ad"}
920
+ {"outcome":"rt06 email inbox messages","seq":2326,"state_hash_hex":"f571f0e52306288a"}
921
+ {"outcome":"rt09 social offensive posts","seq":2502,"state_hash_hex":"f5775947682ded61"}
922
+ {"outcome":"rt11 text messages spam","seq":2603,"state_hash_hex":"f59d5f1954629972"}
923
+ {"outcome":"rt09 social offensive posts","seq":2467,"state_hash_hex":"f5a85276b625a212"}
924
+ {"outcome":"rt13 support billing sales technical","seq":2740,"state_hash_hex":"f5d405473e5f16ff"}
925
+ {"outcome":"rt15 support tickets russian","seq":2877,"state_hash_hex":"f60110725a0f88ba"}
926
+ {"outcome":"rt12 support tickets bengali","seq":2655,"state_hash_hex":"f6206e29d3bb528c"}
927
+ {"outcome":"rt13 support billing sales technical","seq":2758,"state_hash_hex":"f668f665e58e499a"}
928
+ {"outcome":"rt04 encyclopedia entities topics","seq":2200,"state_hash_hex":"f66aa6a2926cb96b"}
929
+ {"outcome":"rt09 social offensive posts","seq":2501,"state_hash_hex":"f6a7b2c7777e5fee"}
930
+ {"outcome":"rt13 support billing sales technical","seq":2753,"state_hash_hex":"f6e51ecd81e2c5b9"}
931
+ {"outcome":"rt15 support tickets russian","seq":2844,"state_hash_hex":"f7b914da57cdd4db"}
932
+ {"outcome":"rt10 product reviews opinions","seq":2545,"state_hash_hex":"f7cde23e526c0d64"}
933
+ {"outcome":"rt09 social offensive posts","seq":2469,"state_hash_hex":"f7eaa75640c0f14e"}
934
+ {"outcome":"rt01 banking cards payments","seq":2018,"state_hash_hex":"f8ef557698815101"}
935
+ {"outcome":"rt15 support tickets russian","seq":2827,"state_hash_hex":"f97614185c641a34"}
936
+ {"outcome":"rt09 social offensive posts","seq":2504,"state_hash_hex":"f98ac511e721eb96"}
937
+ {"outcome":"rt01 banking cards payments","seq":1997,"state_hash_hex":"f9c221a47897af23"}
938
+ {"outcome":"rt15 support tickets russian","seq":2826,"state_hash_hex":"f9e136438dee1357"}
939
+ {"outcome":"rt08 safety destructive irreversible","seq":2424,"state_hash_hex":"fa05126a622ec377"}
940
+ {"outcome":"rt15 support tickets russian","seq":2853,"state_hash_hex":"fa17e770c8ed488a"}
941
+ {"outcome":"rt15 support tickets russian","seq":2843,"state_hash_hex":"faa08fc9a694cef0"}
942
+ {"outcome":"rt02 boolean question passage","seq":2055,"state_hash_hex":"faae028f460a5caa"}
943
+ {"outcome":"rt08 safety destructive irreversible","seq":2453,"state_hash_hex":"fae2f1f00abaa301"}
944
+ {"outcome":"rt15 support tickets russian","seq":2847,"state_hash_hex":"fb0028ad0d9fa76c"}
945
+ {"outcome":"rt06 email inbox messages","seq":2331,"state_hash_hex":"fb8179f3f4c1c5bf"}
946
+ {"outcome":"rt00 news headlines sports","seq":1938,"state_hash_hex":"fbaa5232b3398e44"}
947
+ {"outcome":"rt03 assistant requests weather","seq":2139,"state_hash_hex":"fbb21fc5bc530d1b"}
948
+ {"outcome":"rt08 safety destructive irreversible","seq":2439,"state_hash_hex":"fc5474bc75541f24"}
949
+ {"outcome":"rt00 news headlines sports","seq":1963,"state_hash_hex":"fc80d50e2b98d133"}
950
+ {"outcome":"rt02 boolean question passage","seq":2083,"state_hash_hex":"fce07cf1f17fa5f8"}
951
+ {"outcome":"rt05 feelings emotions reactions","seq":2260,"state_hash_hex":"fce1619389453e40"}
952
+ {"outcome":"rt03 assistant requests weather","seq":2103,"state_hash_hex":"fd0f65ad1c1d72cf"}
953
+ {"outcome":"rt10 product reviews opinions","seq":2523,"state_hash_hex":"fdc3a6e16c25c4fe"}
954
+ {"outcome":"rt03 assistant requests weather","seq":2154,"state_hash_hex":"fe099a7e0309fff9"}
955
+ {"outcome":"rt08 safety destructive irreversible","seq":2423,"state_hash_hex":"fe749ebefc46213f"}
956
+ {"outcome":"rt04 encyclopedia entities topics","seq":2205,"state_hash_hex":"ff8a6b5672408d6a"}
957
+ {"outcome":"rt09 social offensive posts","seq":2480,"state_hash_hex":"ff9a252748d3a8da"}
958
+ {"outcome":"rt06 email inbox messages","seq":2316,"state_hash_hex":"ffb5f6ddb4b21307"}
959
+ {"outcome":"rt08 safety destructive irreversible","seq":2435,"state_hash_hex":"ffd3fae62a628f66"}
960
+ {"outcome":"rt12 support tickets bengali","seq":2652,"state_hash_hex":"ffeda8c50195a6e5"}
model/router16/meta.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"contradictions":0,"core":"si-substrate","engine":"syfox","evidence_records":29860,"lane_contexts":29661,"lanes":67089,"nodes":4742,"retrieval_memories":0,"sem_edges":25873,"semantics":true,"teach_events":2880,"version":"3.2.0"}
model/router16/router.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "anchors": {
3
+ "rt00": "news headlines sports",
4
+ "rt01": "banking cards payments",
5
+ "rt02": "boolean question passage",
6
+ "rt03": "assistant requests weather",
7
+ "rt04": "encyclopedia entities topics",
8
+ "rt05": "feelings emotions reactions",
9
+ "rt06": "email inbox messages",
10
+ "rt07": "game commands actions",
11
+ "rt08": "safety destructive irreversible",
12
+ "rt09": "social offensive posts",
13
+ "rt10": "product reviews opinions",
14
+ "rt11": "text messages spam",
15
+ "rt12": "support tickets bengali",
16
+ "rt13": "support billing sales technical",
17
+ "rt14": "support tickets hindi",
18
+ "rt15": "support tickets russian"
19
+ },
20
+ "models": {
21
+ "rt00": "model-giant-latin",
22
+ "rt01": "model-b77-sem",
23
+ "rt02": "model-giant-latin",
24
+ "rt03": "model-giant-latin",
25
+ "rt04": "model-giant-latin",
26
+ "rt05": "model-giant-latin",
27
+ "rt06": "model-giant-latin",
28
+ "rt07": "model-giant-latin",
29
+ "rt08": "model-giant-latin",
30
+ "rt09": "model-giant-latin",
31
+ "rt10": "model-giant-latin",
32
+ "rt11": "model-giant-latin",
33
+ "rt12": "model-giant-latin",
34
+ "rt13": "model-giant-latin",
35
+ "rt14": "model-giant-latin",
36
+ "rt15": "model-giant-latin"
37
+ },
38
+ "domains": {
39
+ "rt00": "agnews",
40
+ "rt01": "bank77",
41
+ "rt02": "boolq",
42
+ "rt03": "clinc",
43
+ "rt04": "dbpedia",
44
+ "rt05": "emotion",
45
+ "rt06": "enron",
46
+ "rt07": "game",
47
+ "rt08": "guard",
48
+ "rt09": "hate",
49
+ "rt10": "polarity",
50
+ "rt11": "sms",
51
+ "rt12": "tickets_bn",
52
+ "rt13": "tickets_en",
53
+ "rt14": "tickets_hi",
54
+ "rt15": "tickets_ru"
55
+ }
56
+ }
model/router16/substrate.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4f2340690b15feec0ec0fb6a4f30ac748833721b2b0c270f85b58cdbe105d59
3
+ size 4988369
server/requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastapi>=0.110
2
+ uvicorn>=0.29
server/syfox_bridge.py CHANGED
@@ -31,6 +31,11 @@ _LIB.syfox_engine_set_energy_norm.argtypes = [ctypes.c_void_p, ctypes.c_int]
31
  _LIB.syfox_engine_set_source_modes.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_int]
32
  _LIB.syfox_engine_set_parallel_settle.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_int]
33
  _LIB.syfox_engine_set_ngrams.argtypes = [ctypes.c_void_p, ctypes.c_int]
 
 
 
 
 
34
  _LIB.syfox_core_version.restype = ctypes.c_char_p
35
  _LIB.syfox_string_free.argtypes = [ctypes.POINTER(ctypes.c_char)]
36
 
@@ -67,7 +72,13 @@ class SyFoxEngine:
67
  salience_gating bool -> SI salience source mode
68
  miller_window bool -> SI Miller [cap-4,cap] window
69
  ngrams "on"|"off" -> v2.2 trigram lane policy
 
 
 
 
 
70
  Returns (answers, usage) plus "evidence" key when requested.
 
71
  """
72
  payload = json.dumps(questions, ensure_ascii=False).encode()
73
  with self._lock:
@@ -99,6 +110,25 @@ class SyFoxEngine:
99
  def set_ngrams(self, on: bool):
100
  _LIB.syfox_engine_set_ngrams(self._h, int(on))
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  def info(self) -> dict:
103
  raw = _LIB.syfox_engine_info(self._h)
104
  if not raw:
 
31
  _LIB.syfox_engine_set_source_modes.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_int]
32
  _LIB.syfox_engine_set_parallel_settle.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_int]
33
  _LIB.syfox_engine_set_ngrams.argtypes = [ctypes.c_void_p, ctypes.c_int]
34
+ _LIB.syfox_engine_set_semantics.argtypes = [ctypes.c_void_p, ctypes.c_int]
35
+ _LIB.syfox_engine_set_retrieval.argtypes = [ctypes.c_void_p, ctypes.c_int]
36
+ _LIB.syfox_engine_set_retrieval_topk.argtypes = [ctypes.c_void_p, ctypes.c_int]
37
+ _LIB.syfox_engine_set_retrieval_dose.argtypes = [ctypes.c_void_p, ctypes.c_double]
38
+ _LIB.syfox_engine_set_hierarchy.argtypes = [ctypes.c_void_p, ctypes.c_int]
39
  _LIB.syfox_core_version.restype = ctypes.c_char_p
40
  _LIB.syfox_string_free.argtypes = [ctypes.POINTER(ctypes.c_char)]
41
 
 
72
  salience_gating bool -> SI salience source mode
73
  miller_window bool -> SI Miller [cap-4,cap] window
74
  ngrams "on"|"off" -> v2.2 trigram lane policy
75
+ semantics bool -> v3.2 semantic field (resonance + ctx lanes)
76
+ retrieval bool -> v3.2 retrieval-by-default priming
77
+ retrieval_topk int -> v3.2 memories to prime with (default 5)
78
+ retrieval_dose float -> v3.2 prime dose x inject (default 0.30)
79
+ hierarchy bool -> v3.2 Stage-3 category gating
80
  Returns (answers, usage) plus "evidence" key when requested.
81
+ usage carries "retrieval": [{label, resonance}] when priming fired.
82
  """
83
  payload = json.dumps(questions, ensure_ascii=False).encode()
84
  with self._lock:
 
110
  def set_ngrams(self, on: bool):
111
  _LIB.syfox_engine_set_ngrams(self._h, int(on))
112
 
113
+ # -- v3.2 semantic layer / retrieval / hierarchy ------------------------
114
+
115
+ def set_semantics(self, on: bool):
116
+ """Runtime kill switch for the semantic field (v3.2)."""
117
+ _LIB.syfox_engine_set_semantics(self._h, int(on))
118
+
119
+ def set_retrieval(self, on: bool):
120
+ """Toggle retrieval-by-default priming (v3.2; inert without memories)."""
121
+ _LIB.syfox_engine_set_retrieval(self._h, int(on))
122
+
123
+ def set_retrieval_topk(self, topk: int):
124
+ _LIB.syfox_engine_set_retrieval_topk(self._h, int(topk))
125
+
126
+ def set_retrieval_dose(self, dose: float):
127
+ _LIB.syfox_engine_set_retrieval_dose(self._h, float(dose))
128
+
129
+ def set_hierarchy(self, on: bool):
130
+ _LIB.syfox_engine_set_hierarchy(self._h, int(on))
131
+
132
  def info(self) -> dict:
133
  raw = _LIB.syfox_engine_info(self._h)
134
  if not raw:
tools/b77_train_chunked.sh ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # ============================================================================
3
+ # b77_train_chunked.sh — dedicated bank77 fabric, chunked incremental learn.
4
+ # The full 18k-row file (19KB JSON rows, 77-candidate criteria) OOMs the
5
+ # 4GB sandbox in one process; chunking keeps each process's peak bounded and
6
+ # is exactly how the v3.1.3 giant fabric was trained.
7
+ # Usage: bash scripts/b77_train_chunked.sh <start-chunk> <end-chunk-inclusive>
8
+ # ============================================================================
9
+ set -e
10
+ cd /home/z/my-project/syfox
11
+
12
+ CHUNKS_DIR=data/b77_hier_chunks
13
+ MODEL=model-b77-sem
14
+ ROWS_PER_CHUNK=1500
15
+
16
+ if [ ! -f "$CHUNKS_DIR/.split_done" ]; then
17
+ mkdir -p "$CHUNKS_DIR"
18
+ rm -f "$CHUNKS_DIR"/chunk_*.jsonl
19
+ python3 - "$CHUNKS_DIR" "$ROWS_PER_CHUNK" << 'EOF'
20
+ import json, sys, os
21
+ out_dir, per = sys.argv[1], int(sys.argv[2])
22
+ rows = []
23
+ with open('data/bank77_hier_train.jsonl') as f:
24
+ for line in f:
25
+ if line.strip():
26
+ rows.append(line)
27
+ n_chunks = 0
28
+ for i in range(0, len(rows), per):
29
+ with open(f"{out_dir}/chunk_{n_chunks:02d}.jsonl", "w") as f:
30
+ f.writelines(rows[i:i+per])
31
+ n_chunks += 1
32
+ open(f"{out_dir}/.split_done", "w").write(str(n_chunks))
33
+ print(f"split {len(rows)} rows into {n_chunks} chunks")
34
+ EOF
35
+ fi
36
+
37
+ START=${1:-0}
38
+ END=${2:-17}
39
+ for i in $(seq -f "%02g" "$START" "$END"); do
40
+ f="$CHUNKS_DIR/chunk_$i.jsonl"
41
+ if [ ! -f "$f" ]; then echo "chunk $i missing, done"; break; fi
42
+ echo "=== CHUNK $i $(date +%H:%M:%S) ==="
43
+ ./build/syfox learn --model "$MODEL" --examples "$f" --epochs 3 2>&1 | tail -1
44
+ done
45
+ echo "=== chunks $START..$END complete ==="
tools/bank77_hier.py ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # ============================================================================
3
+ # bank77_hier.py — v3.2 Stage 3 (semantic hierarchy) + Stage 4 prep for the
4
+ # DEDICATED bank77 fabric.
5
+ #
6
+ # What it emits (deterministic, seed-free):
7
+ # data/bank77_hier_train.jsonl — the v3.1.0 opaque/empty-instructions rows
8
+ # PLUS one category lesson per row (interleaved intent/category), so
9
+ # BOTH levels of the hierarchy are trained anchors in one fabric.
10
+ # data/bank77_hierarchy.json — ships into the model dir as hierarchy.json:
11
+ # {"intents": {cNN: h_<cat>}, "categories": {h_<cat>: {"criteria": ...}},
12
+ # "floor": 0.35}
13
+ # data/bank77_memories.jsonl — stride-sampled lived experiences for
14
+ # retrieval-by-default ({"label": cNN, "state": text}).
15
+ #
16
+ # Category assignment is prefix/keyword rules over the NATURAL intent names
17
+ # (Banking77's own naming), applied in priority order — top_up wins over
18
+ # transfer because "top_up_by_bank_transfer_charge" contains both words.
19
+ # No ML anywhere: this is a deterministic labeling function + the criteria
20
+ # miner already shipped in v3.1.0.
21
+ # ============================================================================
22
+ import argparse
23
+ import json
24
+ from pathlib import Path
25
+
26
+ RULES = [
27
+ ("top_up", lambda n: "top_up" in n or "topping_up" in n),
28
+ ("withdrawal", lambda n: "withdrawal" in n or "cash_received" in n
29
+ or n == "atm_support"),
30
+ ("transfer", lambda n: "transfer" in n
31
+ or n in ("beneficiary_not_allowed", "receiving_money")),
32
+ ("card_payment", lambda n: "card_payment" in n
33
+ or n in ("transaction_charged_twice", "extra_charge_on_statement",
34
+ "exchange_charge", "reverted_card_payment?",
35
+ "declined_card_payment", "pending_card_payment")),
36
+ ("exchange_rate", lambda n: "exchange" in n
37
+ or n in ("fiat_currency_support", "supported_cards_and_currencies",
38
+ "visa_or_mastercard")),
39
+ ("card_management", lambda n: "card" in n
40
+ or n in ("contactless_not_working", "passcode_forgotten", "pin_blocked",
41
+ "change_pin", "apple_pay_or_google_pay", "lost_or_stolen_card",
42
+ "activate_my_card")),
43
+ ("refund", lambda n: "refund" in n),
44
+ ("verify_identity", lambda n: "identity" in n or "verify" in n
45
+ or n in ("age_limit", "country_support", "edit_personal_details",
46
+ "terminate_account", "lost_or_stolen_phone")),
47
+ ]
48
+
49
+
50
+ def category_of(natural: str) -> str:
51
+ n = natural.lower()
52
+ for name, rule in RULES:
53
+ if rule(n):
54
+ return name
55
+ return "account_other"
56
+
57
+
58
+ def main() -> None:
59
+ ap = argparse.ArgumentParser()
60
+ ap.add_argument("--train", default="data/bank77_train.jsonl")
61
+ ap.add_argument("--criteria", default="data/bank77_criteria.json")
62
+ ap.add_argument("--categories", default="data/bank77_categories.json")
63
+ ap.add_argument("--out-train", default="data/bank77_hier_train.jsonl")
64
+ ap.add_argument("--out-hierarchy", default="data/bank77_hierarchy.json")
65
+ ap.add_argument("--out-memories", default="data/bank77_memories.jsonl")
66
+ ap.add_argument("--memories", type=int, default=256,
67
+ help="stride-sampled memories for retrieval-by-default")
68
+ ap.add_argument("--cat-words-per-intent", type=int, default=8)
69
+ ap.add_argument("--floor", type=float, default=0.35)
70
+ args = ap.parse_args()
71
+
72
+ cats = json.loads(Path(args.categories).read_text())
73
+ label_of = cats["label_of"] # natural -> cNN
74
+ anchor_of = {natural: label_of[natural] for natural in cats["classes"]}
75
+
76
+ # intent -> category (assert full coverage)
77
+ cat_of_intent, members = {}, {}
78
+ for natural in cats["classes"]:
79
+ cat = category_of(natural)
80
+ cat_of_intent[anchor_of[natural]] = cat
81
+ members.setdefault(cat, []).append(natural)
82
+ covered = sum(len(v) for v in members.values())
83
+ assert covered == len(cats["classes"]), f"category rules lost {covered} != 77"
84
+ print(f"categories ({len(members)}):")
85
+ for cat in sorted(members):
86
+ print(f" {cat:16s} {len(members[cat]):2d} intents")
87
+
88
+ # category criteria: union of member intents' mined criteria words
89
+ crit = json.loads(Path(args.criteria).read_text())
90
+ crit = crit["criteria"] if isinstance(crit.get("criteria"), dict) else crit
91
+ # keyed by NATURAL intent name ("w, w, ..." comma text)
92
+ def words_of(natural: str) -> list:
93
+ v = crit.get(natural, [])
94
+ if isinstance(v, str):
95
+ return [w.strip() for w in v.split(",") if w.strip()]
96
+ return list(v)
97
+
98
+ cat_criteria = {}
99
+ for cat, naturals in members.items():
100
+ seen, words = set(), []
101
+ for natural in naturals:
102
+ for w in words_of(natural)[: args.cat_words_per_intent]:
103
+ if w.lower() not in seen:
104
+ seen.add(w.lower())
105
+ words.append(w)
106
+ cat_criteria["h_" + cat] = " ".join(words[: 3 * args.cat_words_per_intent])
107
+
108
+ hierarchy = {
109
+ "intents": {a: "h_" + c for a, c in cat_of_intent.items()},
110
+ "categories": {"h_" + c: {"criteria": cat_criteria["h_" + c]}
111
+ for c in members},
112
+ "floor": args.floor,
113
+ }
114
+ Path(args.out_hierarchy).write_text(json.dumps(hierarchy, indent=1))
115
+ print(f"wrote {args.out_hierarchy}")
116
+
117
+ # training rows: original (intent) rows + category rows, interleaved
118
+ n_intent = n_cat = 0
119
+ with open(args.train) as src, open(args.out_train, "w") as dst:
120
+ for line in src:
121
+ if not line.strip():
122
+ continue
123
+ row = json.loads(line)
124
+ dst.write(json.dumps(row, ensure_ascii=False) + "\n")
125
+ n_intent += 1
126
+ # category twin of the same state: labels.hier = h_<cat>
127
+ try:
128
+ anchor = row["labels"]["intent"]
129
+ except KeyError:
130
+ continue
131
+ cat = cat_of_intent.get(anchor)
132
+ if cat is None:
133
+ continue
134
+ crow = {
135
+ # "hier " prefix: the category twin must NOT collide with the
136
+ # intent lesson in the contradiction detector (same state text
137
+ # + a different outcome = false dispute; the audit ledger would
138
+ # fill with counter-evidence against the intent binding).
139
+ "state": "hier " + row["state"],
140
+ "questions": {"hier": {
141
+ "type": "choice",
142
+ "instructions": "",
143
+ "criteria": {"h_" + cat: cat_criteria["h_" + cat]},
144
+ }},
145
+ "labels": {"hier": "h_" + cat},
146
+ }
147
+ dst.write(json.dumps(crow, ensure_ascii=False) + "\n")
148
+ n_cat += 1
149
+ print(f"wrote {args.out_train}: {n_intent} intent + {n_cat} category lessons")
150
+
151
+ # retrieval memories: stride sample (deterministic)
152
+ rows = []
153
+ with open(args.train) as src:
154
+ for line in src:
155
+ if line.strip():
156
+ rows.append(json.loads(line))
157
+ stride = max(1, len(rows) // max(1, args.memories))
158
+ picked = rows[::stride][: args.memories]
159
+ with open(args.out_memories, "w") as dst:
160
+ for row in picked:
161
+ dst.write(json.dumps({
162
+ "label": row["labels"]["intent"],
163
+ "state": row["state"],
164
+ }, ensure_ascii=False) + "\n")
165
+ print(f"wrote {args.out_memories}: {len(picked)} memories (stride {stride})")
166
+
167
+
168
+ if __name__ == "__main__":
169
+ main()
tools/router_prepare.py ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # ============================================================================
3
+ # router_prepare.py — v3.2 two-stage architecture, stage 1.
4
+ # Builds the DEDICATED ROUTER FABRIC: a small (500-node class) substrate
5
+ # whose only job is domain routing — 16 anchors, one per domain, physics
6
+ # only (no classifier, no ML; the same SI substrate decides).
7
+ #
8
+ # Source: data/giant/train.jsonl rows already carry the router question
9
+ # (qkey "domain": criteria for rt00..rt15). We carve a balanced sample:
10
+ # data/router16_train.jsonl — train rows for the router fabric
11
+ # data/router16_cal.jsonl — small cal carve (router accuracy check)
12
+ # data/router16_router.json — ships as router.json in the model dir:
13
+ # {"anchors": {rtNN: criteria}, "models": {rtNN: model-dir},
14
+ # "domains": {rtNN: domain-name}}
15
+ #
16
+ # The two-stage contract (CLI: decide --router model-router16 ...):
17
+ # stage 1: model-router16 settles the state -> picks the domain anchor
18
+ # stage 2: the mapped domain fabric decides the actual questions
19
+ # Domain fabrics stay isolated; the router fabric never sees domain labels.
20
+ # ============================================================================
21
+ import argparse
22
+ import json
23
+ from collections import Counter, defaultdict
24
+ from pathlib import Path
25
+
26
+
27
+ def main() -> None:
28
+ ap = argparse.ArgumentParser()
29
+ ap.add_argument("--train", default="data/giant/train.jsonl")
30
+ ap.add_argument("--schemas", default="data/giant/schemas.json")
31
+ ap.add_argument("--out-train", default="data/router16_train.jsonl")
32
+ ap.add_argument("--out-cal", default="data/router16_cal.jsonl")
33
+ ap.add_argument("--out-router", default="data/router16_router.json")
34
+ ap.add_argument("--per-domain", type=int, default=60)
35
+ ap.add_argument("--cal-per-domain", type=int, default=10)
36
+ ap.add_argument("--bank77-model", default="model-b77-sem")
37
+ ap.add_argument("--default-model", default="model-giant-latin")
38
+ args = ap.parse_args()
39
+
40
+ schemas = json.loads(Path(args.schemas).read_text())
41
+ # labels.domain carries the ANCHOR (rt00..rt15); schemas.router maps domain -> anchor
42
+ domain_of = {a: d for d, a in schemas["router"].items() if not d.startswith("_")}
43
+ anchors = sorted(domain_of) # deterministic order
44
+ print(f"domains ({len(anchors)}):",
45
+ ", ".join(f"{domain_of[a]}->{a}" for a in anchors))
46
+
47
+ # one pass: bucket rows by router anchor, stride-sample inside each bucket.
48
+ # Rows are REWRITTEN to carry ONLY the domain question: learn teaches every
49
+ # question in a row, and the router fabric must never see domain labels.
50
+ buckets = defaultdict(list)
51
+ with open(args.train) as src:
52
+ for line in src:
53
+ if not line.strip():
54
+ continue
55
+ row = json.loads(line)
56
+ a = row.get("labels", {}).get("domain")
57
+ if a is None:
58
+ continue
59
+ slim = {
60
+ "state": row["state"],
61
+ "questions": {"domain": row["questions"]["domain"]},
62
+ "labels": {"domain": a},
63
+ }
64
+ buckets[a].append(json.dumps(slim, ensure_ascii=False))
65
+
66
+ train_rows, cal_rows = [], []
67
+ for a in anchors:
68
+ rows = buckets.get(a, [])
69
+ if not rows:
70
+ print(f" WARNING: no rows for anchor {a} ({domain_of[a]})")
71
+ continue
72
+ stride = max(1, len(rows) // max(1, args.per_domain))
73
+ picked = rows[::stride][: args.per_domain]
74
+ train_rows.extend(picked)
75
+ # deterministic cal carve: the row after each picked stride boundary
76
+ cal_idx = [min(i * stride + 1, len(rows) - 1) for i in range(args.cal_per_domain)]
77
+ seen = set()
78
+ for ci in cal_idx:
79
+ if rows[ci] not in seen and rows[ci] not in picked:
80
+ cal_rows.append(rows[ci])
81
+ seen.add(rows[ci])
82
+ print(f"train rows: {len(train_rows)} cal rows: {len(cal_rows)}")
83
+
84
+ Path(args.out_train).write_text("\n".join(train_rows) + "\n")
85
+ Path(args.out_cal).write_text("\n".join(cal_rows) + "\n")
86
+
87
+ # router.json: anchors = the modal criteria text per anchor across rows
88
+ crit_votes = defaultdict(Counter)
89
+ for line in train_rows:
90
+ row = json.loads(line)
91
+ crit = row["questions"]["domain"]["criteria"]
92
+ items = crit.obj.items() if hasattr(crit, "obj") else crit.items()
93
+ for tgt, text in items:
94
+ crit_votes[tgt][text] += 1
95
+ keep = set(anchors)
96
+ anchors_out = {a: votes.most_common(1)[0][0]
97
+ for a, votes in sorted(crit_votes.items()) if a in keep}
98
+ models = {}
99
+ for a in anchors:
100
+ d = domain_of[a]
101
+ models[a] = args.bank77_model if d == "bank77" else args.default_model
102
+ router = {
103
+ "anchors": anchors_out,
104
+ "models": models,
105
+ "domains": {a: domain_of[a] for a in anchors},
106
+ }
107
+ Path(args.out_router).write_text(json.dumps(router, indent=1))
108
+ print(f"wrote {args.out_router} ({len(anchors_out)} anchors)")
109
+
110
+
111
+ if __name__ == "__main__":
112
+ main()
tools/zeroshot_suite.py ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # ============================================================================
3
+ # zeroshot_suite.py — v3.2 final zero-shot probe suite (manual-CLI parity).
4
+ #
5
+ # Four families, none of them trained in the target fabrics:
6
+ # EMAIL_SPAM — spam/ham over model-tickets-big-latin (support tickets only;
7
+ # no spam lessons ever) — plain fabric vs its semantic rebuild
8
+ # SMS_SPAM — same fabrics, SMS-length texts
9
+ # SNAKE — 8 archived scenarios (docs/ZEROSHOT.md Part 1) over
10
+ # model-giant-latin (game domain trained, zero Snake lessons)
11
+ # TICTACTOE — archived symbolic-composition probe over the same fabric
12
+ #
13
+ # Every run is a real CLI decide call (manual-parity), deterministic.
14
+ # Output: data/zeroshot_v32_results.json + a printed table.
15
+ # Interpretation rules of docs/ZEROSHOT.md apply: confidence = concentration,
16
+ # never correctness; probes bound, they never establish.
17
+ # ============================================================================
18
+ import json
19
+ import subprocess
20
+ import sys
21
+ from pathlib import Path
22
+
23
+ BUILD = "./build/syfox"
24
+
25
+ EMAIL_SPAM = [
26
+ # (state, expected) — tickets-fabric vocabulary overlap is the zero-shot channel
27
+ ("Congratulations you are our lucky winner click this link to claim your free prize now", "spam"),
28
+ ("Urgent your account will be suspended verify your payment details immediately", "spam"),
29
+ ("Win a free holiday click here offer expires today claim now", "spam"),
30
+ ("Hi team the invoice for this month is attached please confirm the payment date", "ham"),
31
+ ("Can we move the meeting to tomorrow morning and add the new project plan", "ham"),
32
+ ("Thanks for your help with the refund the money arrived in my account today regards", "ham"),
33
+ ]
34
+ SMS_SPAM = [
35
+ ("FREE entry to win 1000 cash prize text WIN to the number now", "spam"),
36
+ ("Your mobile prize is waiting claim your reward click the link urgent", "spam"),
37
+ ("Hey are we still meeting at the pub tonight let me know", "ham"),
38
+ ("Running late sorry be there in ten minutes see you soon", "ham"),
39
+ ("Can you send me the photos from the weekend thanks", "ham"),
40
+ ("Your account balance is low top up now to avoid charges", "spam"),
41
+ ]
42
+ # snake: (state, safe set, expected single answer or the user's archived winner)
43
+ SNAKE = [
44
+ ("snake game the food is directly ahead of the head move right", "right"),
45
+ ("snake game a wall is directly ahead moving right hits the wall", "up/down"),
46
+ ("snake game the body blocks the right side so right is lethal", "up/down/left"),
47
+ ("snake game the food is behind while the head moves right", "up/down"),
48
+ ("snake game the food is at the wall and right is lethal", "up/down"),
49
+ ("snake game long term survival avoid the walls keep space", "up"),
50
+ ("snake game only one safe move remains all others hit walls", "down"),
51
+ ("snake game shortest safe route to the food", "up"),
52
+ ]
53
+ TICTACTOE = [
54
+ ("tic tac toe board positions 1 to 9 X holds 1 and 2 O holds 4 and 5 X to move "
55
+ "three in a row wins the game the top row 1 2 3 completes with 3", "3"),
56
+ ]
57
+ MOVES = ["up", "down", "left", "right"]
58
+
59
+ DIR_Q = json.dumps({"move": {"type": "choice", "instructions": "which move is safe",
60
+ "criteria": {
61
+ "up": "move up away safe escape",
62
+ "down": "move down away safe escape",
63
+ "left": "move left away safe escape",
64
+ "right": "move right toward food ahead"}}}, sort_keys=True)
65
+ TTT_Q = json.dumps({"cell": {"type": "choice", "instructions": "which cell wins now",
66
+ "criteria": {str(i): f"place at position {i}" for i in range(1, 10)}}},
67
+ sort_keys=True)
68
+
69
+
70
+ def spam_q() -> str:
71
+ return json.dumps({"spam": {"type": "choice", "instructions": "is this message spam",
72
+ "criteria": {
73
+ "spam": "free prize win click offer claim urgent account suspended verify now limited",
74
+ "ham": "meeting schedule invoice project team regards thanks attached plan tomorrow"}},
75
+ }, sort_keys=True)
76
+
77
+
78
+ def run(model: str, state: str, q: str, extra=None):
79
+ cmd = [BUILD, "decide", "--model", model, "--state", state, "--questions", q,
80
+ "--energy-norm", "--retrieval-topk", "0"]
81
+ if extra:
82
+ cmd += extra
83
+ out = subprocess.run(cmd, capture_output=True, text=True, timeout=300)
84
+ if out.returncode != 0:
85
+ return {"error": out.stderr.strip()[:200]}
86
+ return json.loads(out.stdout)
87
+
88
+
89
+ def tally(model: str, rows, q, expect_key):
90
+ res = []
91
+ for state, expected in rows:
92
+ r = run(model, state, q)
93
+ if "error" in r:
94
+ res.append({"state": state[:40], "error": r["error"]})
95
+ continue
96
+ a = r["answers"]["spam"] if "spam" in r["answers"] else next(iter(r["answers"].values()))
97
+ if "choice" in a:
98
+ pick, conf = a["choice"], a["confidence"]
99
+ else:
100
+ pick, conf = (None, 0.0)
101
+ res.append({"state": state[:50], "expected": expected, "picked": pick,
102
+ "conf": conf, "deferred": a.get("deferred", False)})
103
+ ok = sum(1 for r in res if r.get("picked") and r["picked"] in str(r["expected"]).split("/"))
104
+ return {"accuracy": round(ok / len(res), 3) if res else 0.0, "rows": res}
105
+
106
+
107
+ def main() -> None:
108
+ models = {
109
+ "email_tickets_plain": "model-tickets-big-latin",
110
+ "email_tickets_sem": "model-tickets-big-latin-sem",
111
+ "sms_tickets_plain": "model-tickets-big-latin",
112
+ "sms_tickets_sem": "model-tickets-big-latin-sem",
113
+ "snake_giant_plain": "model-giant-latin",
114
+ "snake_giant_sem": "model-giant-latin-sem",
115
+ }
116
+ report = {}
117
+ report["email_spam"] = tally(models["email_tickets_plain"], EMAIL_SPAM, spam_q(), "spam")
118
+ report["email_spam_sem"] = tally(models["email_tickets_sem"], EMAIL_SPAM, spam_q(), "spam")
119
+ report["sms_spam"] = tally(models["sms_tickets_plain"], SMS_SPAM, spam_q(), "spam")
120
+ report["sms_spam_sem"] = tally(models["sms_tickets_sem"], SMS_SPAM, spam_q(), "spam")
121
+ report["snake"] = tally(models["snake_giant_plain"], SNAKE, DIR_Q, "move")
122
+ report["snake_sem"] = tally(models["snake_giant_sem"], SNAKE, DIR_Q, "move")
123
+ report["tictactoe"] = tally(models["snake_giant_plain"], TICTACTOE, TTT_Q, "cell")
124
+ report["tictactoe_sem"] = tally(models["snake_giant_sem"], TICTACTOE, TTT_Q, "cell")
125
+
126
+ Path("data/zeroshot_v32_results.json").write_text(json.dumps(report, indent=1))
127
+ for fam in ["email_spam", "email_spam_sem", "sms_spam", "sms_spam_sem",
128
+ "snake", "snake_sem", "tictactoe", "tictactoe_sem"]:
129
+ r = report[fam]
130
+ print(f"{fam:22s} acc {r['accuracy']:5.2f} " +
131
+ " ".join(f"{x['picked']}({x['conf']:.3f})" for x in r["rows"][:4]))
132
+ for x in r["rows"]:
133
+ if "error" in x:
134
+ print(" ERROR:", x)
135
+
136
+
137
+ if __name__ == "__main__":
138
+ main()