# Provenance and licence The target is simple: **all original code and notes in this project are MIT** (see [LICENSE](../LICENSE)). No GPL or LGPL code, text or derived implementation is to be incorporated. ROMs are never distributed. ## Documentation hierarchy **NESdev Wiki is the oracle for documentation.** Its General disclaimer states that the content is public domain and may be used any way; cite the page. Permissive source files come next, then black-box behaviour of emulators, then our own ROM observations. GPL/LGPL source is never read. ## The rule - **NESdev Wiki:** public domain; cite the page. - **MIT/BSD/public-domain:** permitted with attribution; keep the notice for anything copied. - **GPL/LGPL:** black box only. Run the binary, observe its public behaviour, record the version; never read, fetch or copy its source. Do not open a patch that contains its source. - **Facts:** register addresses, hashes, test results and observed behaviour carry a source and an evidence tag. An untagged fact is not accepted. - **Incident protocol:** stop, log what was opened, delete the local copy, quarantine any claim that might have come from it, and re-derive from a permitted source or from the ROM. A silent cleanup is not allowed. ## Licence is not evidence These are two axes, not one ladder: | Licence gate | What it allows | | --- | --- | | Public domain | NESdev Wiki: quote or cite freely | | MIT/BSD | use with attribution; prefer facts; keep the notice for copied code | | GPL/LGPL binary | black-box only: run it, observe it, never read its source | | GPL/LGPL source | forbidden | | Evidence ladder | What it is | | --- | --- | | hardware / test ROM | the strongest; a measurement or a captured verdict | | NESdev documentation | our documentation oracle, but still documentation | | permissive source facts | e.g. a BSD-3 file in MAME; a sibling, not a judge | | black-box emulator behaviour | a detector; can raise a question, not settle it | | fitted / hypothesis | our own inference; must be labeled and tested | Use the highest permitted source that actually answers. If NESdev answers, stop there. If it is silent, use permissive source facts. If those are silent, use black-box behaviour or the ROM itself, and label the result `FITTED` or `HYPOTHESIS`. Never let a lower evidence tier silently override a higher one; record the conflict. MAME is a strong reference for documented boards, but it is not an oracle for obscure pirate carts. It has no mapper 559, and its Subor Type 2 code is a sibling with open TODOs. Those facts can seed a hypothesis; they cannot decide the dump. Per-file headers matter: a BSD-3 file in a GPL repository is read as BSD for that file only. ## Where GPL lives The MIT repository contains only: - our original notes, claim ledgers, audit logs and tools; - public-domain facts (NESdev) and permissive facts (MIT/BSD) with attribution; - citations and observations. GPL/LGPL tools live **outside** it: - install the binary in the system or a local tool directory; invoke it through its public interface; record the version and command; this is where Mesen2, puNES and mame_nes live; - do not vendor, link, copy or translate its source into this repository; - an observation is ours; the tool remains external. A `GPL-box` source class in a claim ledger means exactly that; - if we ever modify or distribute a GPL tool, it gets a **separate GPL repository with its own licence**, linked from here, never code in this repository; - a script in this repository may call an external GPL binary by path or environment variable; it contains none of that program. This keeps the research project MIT while allowing GPL tools to be used as instruments. If a tool's output is a screenshot, use our own emulator or a public-domain/test-ROM source; do not publish GPL-tool screenshots. ## Source ledger | Source | Licence at access | Use | Status | | --- | --- | --- | --- | | NESdev Wiki | **public domain** per the wiki's General disclaimer | mapper 235/330/532 facts; the 559 absence | permitted; cite; no text copied | | `famicom-python` | MIT | reference implementation, mapper-330 class, runtime dependency | permitted; cite | | `z80-python`, `6502-python`, `6502-rust`, `ym2413-python`, `ym2413-rust`, `ay8910-python`, `play-nes` | MIT | family philosophy, dependency cores, palette at runtime | permitted; cite; no code copied | | MAME | **GPL-2.0 as a whole**; `src/devices/bus/nes/subor.cpp` and `subor.h` carry **BSD-3-Clause** headers | Subor Type 0/1/2 facts only | only those BSD-3 files were read; no other MAME source; no code copied; keep the BSD notice if any code is reused | | AccuracyCoin | MIT | test ROMs for PPU/bus work | permitted; ROMs not distributed | | No-Intro | metadata/hashes; ROMs not distributed | ROM identity and hashes | permitted; `NO_INTRO_DIR` only | | `capstone`, `py65` | permissive/BSD-style analysis tools | disassembly during exploration | tools only; not distributed; no code copied | | Game screenshots in `mappers/*/evidence/` | third-party game imagery; **not MIT** | local evidence of behaviour | **gitignored**; must stay out of the public repository | ## Incidents — not sources 1. **puNES (GPL-2.0).** `src/core/database.h` was fetched and a few lines viewed while searching for the Sangokushi entry. No code, text or fact from it is used in this project; the local file was deleted. Future puNES use is black-box only. 2. **Mesen2 (GPL-3.0).** `UI/Utilities/CommandLineHelper.cs`, `UI/Utilities/TestRunner.cs` and `UI/Debugger/Documentation/LuaDocumentation.json` were fetched while trying a headless screenshot; the attempt failed. No code or fact from them is used in this project; the local copies were deleted. Mesen2 is a black-box detector only from now on; do not open `mesen2-detector-fixes.patch`. MAME's `subor.cpp`/`subor.h` are not in this list: those files carry individual BSD-3-Clause headers, and only their facts are used. No other MAME source was read. ## Release checklist - [ ] Run `python tools/provenance_check.py`; it must pass. - [ ] Search code and history for GPL/LGPL code or copied licence text/prose. Policy references in this document are not source copies. - [ ] Confirm no incident-derived fact is used; if one is found, re-derive it from NESdev, a permissive source or the ROM. - [ ] Confirm every third-party fact/tool is in the ledger with its licence and attribution. - [ ] Confirm no unlicensed source is used; the project has no such dependency. - [ ] Confirm no ROMs, firmware, machine paths or private corpora are in the repository. - [ ] Confirm game screenshots are gitignored and untracked; they are not MIT. - [ ] Confirm the AI-assisted disclosure is current. - [ ] Only then create a public remote or publish. **Status: private/local. The release checklist is not complete.**