# To Papa Sol — VT26 consumer integration: Chapter 09 lesson for other ROMs
**Date:** 2026-11-17 (America/New_York)
**From:** Chapter 09 engineering / Solcito, with owner-reported HD61 diagnostic
**To:** Papa Sol, `lib-set-01` maintainers, and future CS617 ROM integrators
**Case:** `cs617/chapter09-libraries-math-rom`, MREVAL VT26 R002 -> R002a
**Status:** **CANDIDATE / OWNER NATIVE REBUILD IN PROGRESS. NOT A COMPLETED QUALIFICATION.**
**Disposition requested:** Preserve as transferable *consumer integration experience*; do not change or promote immutable VT26 donor or historical Stable merely because this note exists.
## 1. What was attempted, and why
Chapter 09 completed a source-only `lib2/` modernization with accepted *byte-identical* images before this new feature. Accepted baselines for the **pre-VT26** edition:
- `mathrom.bin`: `23c442e593b582ed0da53afdd28e9f4e7d268f9c8ac2315005324a7e15d525c6`
- `mreval.bin`: `df98db6605d3e6009ee3f660797a7a79b0ad3ea109af30348886954f3a670f2f`
The next mission was to use the donor-exact `lib-set-01/src/lib2/vt/26` generation in **MREVAL first** (replacing VT24), leaving **MathROM on VT23** while testing integration and ROM fit. VT26 offers inverse LCD display (`:i`), line jump with blinking input (`:l`), built-in help (`:h`), and semantic `:t` SEND. This is **new functionality**, so MREVAL's final ROM SHA is expected to change if assembly succeeds. The numerical, history, library-explorer, and audit application tests remain the regression baseline.
Three exact donor files travel together:
| Donor file | Bytes | Source SHA-256 |
|---|---:|---|
| `lib2/vt/26/vt26.inc` | 29,574 | `27dc76cdf8f34894b25991383e999ec52d03e0ba11e6489acfe847af6c6f0cb9` |
| `lib2/vt/26/vt26_lcd.inc` | 9,809 | `c39a081cb5324359598b4c1e939fb95e7d6d7ebb2f8fd17d7f455260c09f642c` |
| `lib2/vt/26/export.inc` | 1,947 | `d33eb972b2f295e4f451293eb48f5931acc2de3e8c5ef4061ca5cb8b7f9565c9` |
These SHA identities were checked in the staged source, **not** a substitute for consumer-native assembly or emulator acceptance. The donor's evidence is limited to the accepted Chapter 02 PB-2000C emulator composition. It is not blanket hardware, other-ROM, AI-1000, or physical UART qualification.
## 2. The first real compiler failure: missing key-name ABI
The owner ran **HD61700 ASSEMBLER Rev 0.45** on `mreval.s` and reported:
```text
PASS 1 END
00262:448F SBC $12,KEYLT
LINE:262 ERROR CODE:015 Undefined LABEL
```
The exact VT26 donor uses `KEYLT` and `KEYRT`, while Chapter 09's existing `platform/defs.s` supplies the same physical keys using the different names:
```asm
KEYLEFT: EQU &H1D
KEYRIGHT:EQU &H1C
```
**R002a repair:** In Chapter-owned `apps/mreval_vt26_port.s`, immediately after the module header, define aliases, *not new key codes*:
```asm
KEYLT: EQU KEYLEFT
KEYRT: EQU KEYRIGHT
```
**Scope:** one Chapter-owned adapter changed. No modification to immutable VT26 donor files, Chapter 09 `platform/defs.s`, the MathROM root, the numerical tests, build scripts, or the assembly inclusion sequence. Preserve the original R002 adapter as negative evidence; the corrected R002a is the active canonical candidate. The original reported error is the *observed* compiler outcome; R002a's corrected behavior is still an unverified **prediction pending native rebuild**.
**Generalizable lesson:** a library may retain versionless public entry points and still have hidden requirements for caller-side *constant labels*. Audit all externally referenced constants and services (`KEYLT`, `KEYRT`, etc.), not only `VT_VIEW`, `VT_OPEN`, and `VT_EXPORT`. Prefer explicit consumer-owned **aliases** to modifying an accepted donor or rewriting keyboard layouts. Keep key-value identity verifiable in the platform definitions.
## 3. Why simple include substitution was not valid
VT24 performed `:t` serial output internally. VT26 deliberately **returns event `$0=8`** and the application must own the serial transport. It also expects a bound 24x80 (1,920-byte) document, owned VT state, LCD and keyboard services, and `VT_SEND_CAP`, `VT_OUTBYTE`, `VT_HOST_RAM`, `VT_TX_DETAIL` callbacks. After SEND the consumer may resume using `VT_OPEN`, preserving inverse state; `VT_VIEW` resets it.
Chapter 09 therefore introduced **one chapter-owned port** (`apps/mreval_vt26_port.s`) and updated the MREVAL tape, explorer, and audit event loops instead of patching donor `vt26.inc`. The adapter maps the older VT state into Chapter 09's existing work area: selection at `2F68h`, viewport state through `2F6Fh`, bound document base/kind at `2FA0h..2FA2h`, new inverse/blink state at `2FA7h..2FA9h`, and export pointer/counters at `2FAAh..2FADh`. These are **this consumer's allocations**; other ROMs must perform their own RAM collision and register/bank checks. Never copy the addresses blindly.
The present adapter uses existing Chapter 09 **RS232C/1** and `UA=&H14` host RAM, not the Chapter 02 donor's independently qualified RS232C/2 transport. Its `VT_SEND_CAP` returns true for the legacy behavior, and `VT_OUTBYTE` returns acceptance after calling `RS_PUTC`: **neither proves physical receiver delivery**. The current `ME_VT_SEND` runs `KBD_RESET`, `RS_INIT`, `RS_OPEN`, `VT_EXPORT`, `RS_CLOSE`, `KBD_INIT`, then the caller can resume with `VT_OPEN`. Preserve the old 24*(80+CRLF)=**1,968 bytes** framing, but measure it at the receiver before claiming a transmission PASS. Inverse rendering changes display pixels only, never exported document bytes.
The VT26 API specifically warns that older RS232C/1 fixed scratch `27F0h..27F9h` collided with executable space in the Chapter 02 donor. That does **not** prove a Chapter 09 collision, but requires an explicit per-ROM RAM/code-map audit. Avoid borrowing a donor's RAM map, firmware trampoline, or bank-restoration sequence without verifying the target consumer.
## 4. Behavioral compatibility is not just ABI compatibility
VT26's commands are not a strict superset of VT24. In particular it does **not** register the prior tape `:e` erase shortcut: in the Chapter 09 candidate, plain `c` routes to the existing tape erase confirmation instead. Test that user-visible migration deliberately. New `:h` help must not destroy tape rows, `:l` must preserve selection bounds, and `:i` must not mutate the canvas. Test Q, MENU and BRK return events separately, and any selection or COMM events supported by the consuming app.
There must be **one** VT version per ROM, with only the selected family linked. In Chapter 09 R002a: MREVAL uses VT26 and MathROM still uses VT23. Donor source, versioned include identity, consumer wrapper, and application tests are distinct acceptance objects.
## 5. Recommended low-cost integration gate for the next ROM
1. **Pin baseline first.** Save current `src/`, complete source SHA manifest, `.lst`, `.bin`, build receipt, and accepted image SHA. Do not touch published Stable.
2. **Intake source-exact donor.** Verify all three VT26 hashes; make no edits under `lib2/vt/26/`.
3. **Inventory ABI and free symbols.** From *expanded* assembly, resolve every external label, constants, processor services, keyboard codes, macros, `UA/SX/SY`, library order, and 15-character assembler symbol limits. Do not treat a static scan as a native compiler PASS.
4. **Choose a chapter-owned port.** Supply state symbols, keyboard/LCD shims, SEND/byte-sink/bank-restoration callbacks, and event handling. Pin every workspace range and audit overlap with ROM code, trampoline, graphics, UART scratch, and MathSoft scratch.
5. **Native-assemble and inspect fit.** HD61 Rev 0.45 build, warnings/errors, listing placement, end-of-ROM, size=65,536 bytes, executable regions, and assembler-reported symbols. Zero unresolved labels is necessary, not sufficient.
6. **Exercise an app-level matrix.** `:i` normal/inverse toggle and redraw; `:l` valid/invalid rows and blink; `:h` 3 pages and return; `:t` 1,968-byte unchanged page; view exit/resume; MENU/BRK/Q; canvas canary before/after; app-specific erase/selection and pre-existing numerical/audit fixtures. A passing numerical fixture does not by itself qualify the VT/UI/serial path.
7. **Record a *new* MREVAL SHA only after a passing native build and owner emulator witness.** MathROM should retain its previous SHA while its source is unchanged. Freeze the result before starting MathROM's separate VT26 migration.
### Compact acceptance matrix (not yet checked for R002a)
| Gate | R002a state |
|---|---|
| 102-file source package and donor SHA manifests | **STATIC PASS** |
| `KEYLT`/`KEYRT` compatibility aliases in Chapter-owned port | **INSTALLED / SOURCE CONFIRMED** |
| HD61700 native reassembly | **OWNER RUNNING / RESULT NOT YET INSPECTED** |
| MREVAL ROM fit and new image hash | **PENDING** |
| MathROM preserved SHA | **RECHECK AFTER OWNER BUILD** |
| Inverse + line jump + help + tape erase paths | **EMULATOR TEST PENDING** |
| `:t` UART receive and byte-exact framing | **PHYSICAL/RECEIVER EVIDENCE PENDING** |
| Public Stable/curation admission | **NOT REQUESTED; NOT PERFORMED** |
## 6. Source-of-truth links and follow-up evidence
- [Chapter 09 canonical source candidate](https://drive.google.com/drive/folders/1LgVgHFtM5oMo3MTVJZSy6sM4Wv-Hu5i9)
- [Chapter 09 corrected consumer port](https://drive.google.com/file/d/1SdllHsja0yxMBv1069_SDSj6T0Svl4_s/view)
- [Chapter 09 R002 pre-fix port, retained](https://drive.google.com/file/d/16dGRt43vO8rcEfsb0yh4o4YKiMlyMvpp/view)
- [Chapter 09 R002a staged candidate package](https://drive.google.com/file/d/1BCl9_RSxnpC0jZAW57WUMG9hUnWvaWHs/view)
- [Chapter 09 R001 accepted source backup](https://drive.google.com/drive/folders/1s3cP87oOHuwFDM-KX-4kVVOshs8X__gN)
- [Shared VT26 API contract](https://drive.google.com/file/d/1i6UbQrKTCUzgZVJtgDlBHuKwb5JXmIG5/view)
- [Shared VT26 bounded donor README](https://drive.google.com/file/d/1wIKVIECmzYWGhG1rIymTIVPl_u83167Z/view)
**Next evidence addendum:** Append the actual owner native build diagnostic/result, assembled ROM SHA, listing extent, and emulator observations as *new facts*, without retroactively changing the status of this first-failure note. Do not infer success from the user's message “building”.
---
*Praeteritum ad futurum servamus.*