# Provenance ## Licence provenance (audit 2026-11-13) Audit against the family charter: an MIT project takes nothing copied or transcribed from GPL/LGPL code, and GPL emulators are run as closed boxes, their source not opened while writing the code it would inform. This repository's own rule (validation.md "Licences, and what may be copied") was "GPL sources read for facts, cited by file, never copied"; the charter is now stricter. The audit found **no board code whose behaviour rests on GPL source**: ANTIC, GTIA and the board are written from the Altirra Hardware Reference Manual, ijor's die-derived ANTIC schematics, Atari's manuals and data sheets, and judged by Acid5200 (MIT) and Atari's diagnostic cartridges. GPL sources appear only in the documentation, explaining where a detector differs. The audit read this repository's files, commits and pin records only; MAME file licences were read from the files' first two lines (ANTIC, GTIA, `atari400.cpp`: GPL-2.0+; `bus/a800/bbsb.cpp`, `a5200_supercart.cpp`, `rom.cpp`, `sound/pokey.cpp`: BSD-3-Clause). No Atari800, Altirra, MAME-GPL or MiSTer source was opened. **Firmware:** no BIOS is shipped. `bios.py` reads the player's own copy by SHA-1 and never copies it. (House-rule note, not a licence matter: `bios.py` `DEFAULT_PLACES` names a machine path and a mirror; the family rule is an environment variable.) | Module | Behaviour source | Licence of source | Verdict | | --- | --- | --- | --- | | `antic.py` | [AHRM] ch. 4 (Avery Lee, all rights reserved, free to read: facts), [IJOR] ANTIC schematics from the die (no licence stated: facts), [DS-A] | documents | clean | | `gtia.py` | [AHRM] ch. 6 (priority equations, Table 18 delays), [DS-G]; delays tuned by Acid5200 tests | documents; MIT tests | clean | | `board.py`, `machine.py`, `system.py` | [FSM], [HM], [AHRM] ch. 13 memory map | documents | clean | | `controllers.py` | [AHRM] 13.3, [FSM] Figure 1-6, [BUCH], [FAQ]; pokey-python's RC helper (since 2026-11-14 the restarted core's `PotRC`, below) | documents; family core | clean | | `media.py` | computed YIQ palette ("a frontend choice"), PNG/WAV writers | own | clean | | `acid.py` | runs Acid5200 (MIT) and reads its results | MIT | clean | | `state.py`, `debug.py` | own | own | clean | | `bios.py` | bring-your-own by SHA-1 ([AHRM] F.2 hashes) | facts | clean (see house-rule note) | | `cartridge/walk.py` | own static walk ("no emulator's detection code is used") | own | clean | | `cartridge/__init__.py` | CART header type numbers from [A800] `DOC/cart.txt` (a documentation file in a GPL project: a list of numbers, a format fact) | facts | cite: say in the comment that only the documented numbers are used | | `cartridge/mappings.py` | Bounty Bob and Super Cart from [A800] `DOC/cart.txt` (prose, citing the board designer's post) and MAME `bus/a800/bbsb.cpp`, `a5200_supercart.cpp` | doc facts; MAME files BSD-3-Clause | clean (cite the BSD-3 licence of the two MAME files beside the citation) | | `cartridge/table.json` | MAME 0.285 `hash/a5200.xml` and `.hsi` (CC0-1.0, per file), measured rows from `scripts/observed_boot.py`; three `bios_notes` cite "[MAME] atari400.cpp comment; [AHRM] F.2" | CC0; own; one GPL-file comment beside [AHRM] | cite: let [AHRM] F.2 carry the 4-port-BIOS note alone | | `scripts/atari800_run.py`, `compare_atari800.py`, `sweep_atari800.py`, `mame_trace.py`, `lockstep_mame.py` | drive Atari800 (GPL-2.0+) and MAME as closed boxes | own tools | clean | | `scripts/count_carts.py`, `build_cart_table.py`, `dma_charts.py` | own; read MAME's CC0 hash files and the [AHRM] PDF | own | clean | | docs: undocumented-behavior.md C12 (`memory.c`), C15 (MAME `antic.cpp` line numbers) | GPL source read to explain detector differences; the board follows [AHRM] and Acid5200 | GPL (documentation only) | cite: from now on describe detectors by running them, not by their source | **Counts (rows):** clean 13, cite 4, rewrite 0, unclear 0. ## Wave 2 (specification-tier close-out, 2026-11-13) **Rewrites:** none. Wave 1 found no **rewrite** row (counts above), so no board behaviour had to be re-derived and no value changed. **The one Altirra fact.** Altirra's `cartdetect.cpp` (GPL-2.0+) is present in the ignored `reference/research-tmp/altx/` (extracted by Phase 0 on 2026-11-11, never committed). One fact was recorded from it: that Altirra decides a 16K image's class by tracing from the start vector under both readings and scoring them. That fact rests on the GPL source alone: no document in `reference/` states it ([AHRM] describes hardware, not Altirra's loader), and Altirra cannot be run here as a closed box (Windows only, no Wine: undocumented-behavior.md U12). So it is **withdrawn**, not re-established: [cartridge.md](cartridge.md) now says "not established here". Nothing depends on it: the walk (`cartridge/walk.py`) is this repository's own algorithm, judged by its results (0 contradictions against the 60 16K images MAME's CC0 list classifies; 1 wrong of the 39 observed boots). The file was not opened in this session. The Atari800 row beside it (raw 16K images carry no type) was also read from GPL source in Phase 0; it is marked HYPOTHESIS there for the same reason, and nothing depends on it either (every Atari800 run passes `-cart-type`). **The cite rows** are handled with the licence headers (scope item 3, same date): | Wave-1 cite row | What was done | | --- | --- | | `cartridge/__init__.py` CART type numbers from [A800] `DOC/cart.txt` | the comment now says only the documented type numbers (a format fact) are used, nothing of Atari800's code | | `cartridge/mappings.py` Bounty Bob and Super Cart from MAME `bus/a800/bbsb.cpp`, `a5200_supercart.cpp` | the BSD-3-Clause licence and copyright holders are named beside the citation; the notice is in NOTICE | | `cartridge/table.json` bios_notes citing a MAME GPL-file comment | the three notes now rest on [AHRM] F.2 (mechanism) and this repository's own milestone 6 runs (the titles); `build_cart_table.py` writes the new text; the CC0 seed is attributed in the file's `about` and in NOTICE | | undocumented-behavior.md C8, C12, C15 (GPL source line references) | the source references are replaced by what a closed-box run shows, or marked as Phase 0 source reading where no run replaces them | **Permissive material kept**, all listed with its notice in `NOTICE`: MAME's `hash/a5200.xml` and `hash/a5200.hsi` (CC0-1.0; the seed rows of `cartridge/table.json`, attribution kept although CC0 asks none); facts restated from MAME's BSD-3-Clause `bus/a800/bbsb.cpp`, `a5200_supercart.cpp`, `a800_slot.cpp`; the Acid800 suite (MIT, Avery Lee: `acid.py` relies on its label names and verdict codes; the ROMs are fetched, never committed). **Historical records kept as written:** docs/handoff-brief.md and docs/phase0-progress.md are Phase 0's dated record and keep their source references and machine paths; they are not instructions. docs/mame-oracle.md's description of MAME's ANTIC timing was Phase 0 source reading (2026-11-11) and is labelled so there. ### History No files were ever deleted (`git log --all --diff-filter=D`); nothing fetched was committed (`reference/` is ignored). Local repository, no remote. ## The POKEY core: the restarted pokey-python (2026-11-14) The pokey-python this board pinned until 2026-11-14 (`5a06587`, then `e276d27`) was archived that day for provenance: its build had read an unlicensed VHDL's source. It was rebuilt from documents (Atari's data sheet, [AHRM] ch. 5, Acid800, recordings) and closed-box measurements of the VHDL model's pins (pokey-python `docs/restart.md`, `docs/provenance.md`). The board now pins the restarted core at **`6ed1ffa`** (`pyproject.toml`), the commit its `docs/status.md` names for boards, and is wired as its `docs/adoption.md` says. Neither venv holds the old core any longer: it was uninstalled before the new pin was installed, and its files were not opened to compare. The board's glue was adapted from adoption.md alone (`board.py`: `POKEY(C012294)`; `controllers.py`: the core's `rc.PotRC` helper on `pot_level` and `on_dump`; `state.py`: save-state version 3 with the capacitors' charge). The archived core's code reached the board only through its interface; no board code was derived from its source, so nothing in `src/` needed re-deriving beyond the call sites. `controllers.py`'s row above now reads "the restarted pokey-python's RC helper (`PotRC`, its B5.8)". ### Sources not to use for code MAME's ANTIC/GTIA/`atari400.cpp` (GPL-2.0+), Atari800 (GPL-2.0+), Altirra's source (GPL-2.0+): closed box only. MiSTer `Atari800_MiSTer` a8core files carry Mark Watson's "non-commercial use" notice: not open source, excluded for code. MAME's `sound/pokey.cpp` and `bus/a800/*` are BSD-3-Clause: code OK with notice.