mirror of
https://github.com/ratspeak/C6-Reticulum-ASM
synced 2026-08-12 18:07:18 -04:00
| .. | ||
| git-hooks | ||
| check_registry.py | ||
| check_stack.py | ||
| parse_spec.py | ||
| README.md | ||
Tools
Host-side scripts that enforce the project's structural rules. Every script
in this directory is invoked by make ci (and therefore by every commit
gate); none of them ship in the production binary.
Inventory
| Script | Purpose | Invoked by |
|---|---|---|
parse_spec.py |
Parse + validate the # @field: spec block at the top of every .S file (per ADR-0007, prefix updated by ADR-0008). |
make spec FILE=…; the verify dispatcher; CI |
check_registry.py |
Cross-check FUNCTIONS.md against src/: every registered non-planned function has a source file, every source-defined global is registered, every depends-on points at a real entry. |
make registry; CI |
check_stack.py |
Worst-case stack-depth analyzer. Walks the call graph from _reset, sums @stack annotations, asserts the deepest path fits STACK_SIZE from src/include/config.S. |
make stack; CI |
git-hooks/pre-commit |
Pre-commit guard that runs make ci and blocks the commit on failure. Install via the symlink one-liner inside the script. |
git commit (after install) |
Conventions
- All scripts are Python 3.11+ and stdlib-only unless noted in
tests/requirements.txt. - All scripts accept
--jsonfor machine-readable output (so an agent can consume failures without parsing prose). - Errors go to stderr; structured output goes to stdout.
- Exit code 0 = pass, non-zero = fail. Warnings (e.g.,
@statusmismatch between source and registry) do not affect the exit code.
Adding a tool
- Write the script in this directory.
- Add a corresponding
tests/tools/test_<name>.pycovering the contract. - Wire it into
Makefile(make cishould run it). - Add a row to the inventory above.
The tool's first commit must include its tests; tools without tests do not get to gate other people's commits.