| 1 | # đŸ¤– AGENTS.md: todo-spinel |
| 2 | |
| 3 | The one rule: **this app is Ruby compiled ahead of time, and nothing else |
| 4 | runs in production.** Everything the server does is written in the |
| 5 | Spinel-compilable subset of Ruby (`app.rb`, via tep) or in the small C |
| 6 | shims tep already ships. No Ruby interpreter, no shared library beyond |
| 7 | libc, no client framework, no JS build step. |
| 8 | |
| 9 | ## Tenancy |
| 10 | |
| 11 | - **One instance for the whole app.** A single process and a single |
| 12 | SQLite file (`--db`) serve every visitor. |
| 13 | - **Each visitor's list is kept separately by an anonymous cookie.** The |
| 14 | first visit sets `tid=<22 base64url characters>` (128 bits from the |
| 15 | kernel's `getrandom`), |
| 16 | `HttpOnly; SameSite=Lax; Path=/`, plus `Secure` over https. Every query |
| 17 | is scoped by that value; an id from someone else's list is a 404. The |
| 18 | `visitors` table holds every token the server has issued; any other |
| 19 | cookie value is replaced with a fresh one. |
| 20 | - **No sign-in.** There are no accounts, passwords or e-mail addresses. |
| 21 | - **Trust class C.** Todo text is stored as plain text in SQLite. That's |
| 22 | a deliberate choice for a demo app: nothing in it is meant to be |
| 23 | secret, and the platform's at-rest protection of the database is the |
| 24 | only protection it gets. |
| 25 | |
| 26 | ## Working here |
| 27 | |
| 28 | - Work only in `apps/spinel/`. `BRIEF.md` and `CONTRACT.md` at the repo |
| 29 | root are binding. |
| 30 | - The toolchain checkouts (spinel, tep, spinelkit) are read-only. The |
| 31 | Makefile copies tep into `.cache/` and applies `patches/*.patch` there. |
| 32 | - Servers bind `127.0.0.1` only. Scratch goes in `$TMPDIR`. No `sudo`. |
| 33 | |