# AGENT.md โ€” Instructions for AI agents working on this repository This file tells AI coding agents (Claude Code, Codex, Cursor, Copilot Workspace, etc.) how to maintain this repository responsibly. The goal of this repo is to be the **canonical, verifiable** byte-level reference for the Reticulum protocol. Speculation is acceptable as a starting point but must be clearly marked as such until tested against the upstream Python implementation. If you are an AI agent reading this: follow these rules. If you are a human reviewing an agent's PR: enforce these rules. **Working on a Reticulum implementation (not just this spec repo) โ€” start with [`playbook.md`](playbook.md).** This file (`agent.md`) governs what evidence is admissible when adding to the spec; `playbook.md` covers how to troubleshoot interop bugs, design tests that don't lie to you, and navigate a protocol whose primary documentation is its source code. Both files are short; read both. --- ## 1. Verification is mandatory Every claim in this repository falls into one of three states: | State | Marker | Meaning | |---|---|---| | **Verified** | (no marker, or `[verified]`) | Claim has been tested against the upstream RNS Python stack with a runnable test, OR is a direct citation of upstream source code with file + line. | | **Unverified** | `> โš ๏ธ **UNVERIFIED:**` callout | Plausible from source-reading or other-implementation behavior, but not directly tested against upstream Python. May be wrong. | | **Speculation** | `> ๐Ÿ”ฎ **SPECULATION:**` callout | Hypothesis based on reasoning about how the protocol *probably* works, with no source citation OR runtime test. Must be resolved (verified or removed) before any release. | Do not silently promote a claim from **unverified** to **verified** without doing the actual verification. The marker exists so a future reader can trust unmarked content. ### What counts as verification In rough order of strength: 1. **Round-trip with upstream Python RNS.** A small script in `tools/` that loads the relevant RNS module, performs the operation in both directions, and compares bytes. Strongest evidence. 2. **Direct upstream source citation.** File path and line number in the standard `pip install rns lxmf` install layout (`RNS/`, `LXMF/`). Acceptable for behaviors that are hard to test (e.g. multi-hop forwarding rules). 3. **Wire capture with byte-level diff.** Capturing actual upstream emission (e.g. tcpdump on `rnsd`) and showing it matches the spec. What does **NOT** count as verification: - "It worked on my Sideband install" without a script anyone can re-run - "The webclient does it this way" โ€” webclient may have the same bug - "Reading this code, I think it does X" โ€” that's source-reading, which is acceptable as a citation but only if the citation is included - "GPT/Claude/Gemini said so" โ€” no --- ## 2. Workflow for adding a new claim 1. Draft the claim in the relevant section of `SPEC.md` (or the future per-layer file). 2. Mark it `> ๐Ÿ”ฎ **SPECULATION:**` if it's pure reasoning, or `> โš ๏ธ **UNVERIFIED:**` if there's a source citation but no runtime test. 3. Write a verifier in `tools/`: - For byte-level claims: a Python script that produces the expected upstream bytes and compares to a literal `expected = bytes.fromhex(...)`. - For behavioral claims (e.g. "originator inserts transport_id at offset 2 for >1-hop paths"): a script that exercises `RNS.Transport` with a known path table and dumps `process_outgoing` calls. 4. Run the verifier. If it confirms, remove the marker and add a `(verified by tools/