# chx — the parametric layer of SPXI-TLP

Built 2026-11-30 for SPXI-TLP v3.0 (§VII.6). It implements the Morrow layer of the protocol (§VII). Each module is implemented as specified or, where it departs, as named here.

```
chx inscribe DOC.md --payload "orcid:…,axn:…,version:…" [--kl-budget 0.03] [--protect "phrase"] [--output OUT.md] [--evidence EV.json]
chx detect   TEXT --payload "…"
chx survive  DOC.md --payload "…"
chx probe    --suspect MODEL --reference MODEL --doc DOC.md --payload "…" [--canaries C.json]
chx finetune --model EleutherAI/pythia-160m --doc DOC.md --out DIR
```

The tool needs `torch` and `transformers`. `survive` also uses `markdown` and `trafilatura` when they are installed. The scoring model, EleutherAI/pythia-160m, runs on a CPU.

- **Module 1.** The payload string is put in canonical order and hashed into a key. A text bears payload P when its carrier choices agree with P's key more often than chance. Detection tests a named payload; it does not decode bits. No hiding network H is trained.
- **Module 2.** Each carrier group in `carriers.json` is one slot. At each occurrence the key picks a preferred member, from the group and the previous word. A swap is kept only if the scoring model's sentence NLL rises by no more than `--per-change`, and the document's summed rise per token stays within `--kl-budget`. That per-token rise is reported as the KL estimate. It is a proxy measured by the scoring model, not the bound itself.
- **Module 3.** Robustness comes by construction. The key reads only the group and the previous word, lower-cased, so markup, case, spacing, deleted sentences and reordered paragraphs leave the surviving choices readable. `survive` measures this.
- **Protection.** These are never changed: quotations, code, headings, table rows, capsules (lines of ═), `ENTITY RELATIONS:` blocks, field labels, and any `--protect` phrase. The guards in `carriers.json` remove occurrences whose neighbours make the members differ: a noun after a determiner, a phrasal verb, an article that would not agree. Inscription skips those occurrences, and so does detection.
- **Detection.** Under no inscription, each slot agrees with the key with probability 1/n. `detect` reports the z-score of the excess. `probe` reports the signed per-token deviation over canaries (§VII.4) and a keyed-choice deviation with a t statistic.

The first run is on SPXI-TLP v3.0 itself; see `rebuild/spxi-tlp-3/`.
