Narrow B-93 to the Django stack, add roadmap C6, merge TODO.md into roadmap.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
davideandClaude Sonnet 5.5 committed 2026-11-16 15:10:10 +01:00
1 parent 6509cedd7c
commit 530c740300
5 files changed
+48 -137

No files matched your search

+20 -40
View File
@@ -1,48 +1,28 @@
# BUGS.md — open findings
Only the 2026-09-28 specification review (B-73 … B-100) still has open entries
(B-93). A finding is removed from this file once it is fixed, and
`git log --all --grep 'B-nn'` is the record of how it was closed. Per CLAUDE.md's
convention each entry gets its own commit with its own regression test, and the `B-nn`
marker goes in a comment next to the fix.
# Audit of 2026-09-28 — specification review (B-73 … B-98)
Fourth audit, run against the new specification in `docs/` rather than the code
alone: four independent reviews (coin/chain mechanics, money state machine,
DevOps, spec cross-validation), with the critical claims re-verified in code.
The target behaviour of every entry below is now written into `docs/` as
requirements marked `*Stato:* da implementare (B-nn)`; the Italian overview, the
design decisions and the implementation order are in
[docs/piano-correzioni.md](docs/piano-correzioni.md). The code has **not** been
changed yet. Same convention as above: one commit per entry, with its own
regression test, spec + code + test together.
Design decisions taken with the owner on 2026-09-28 (they change existing
decisions, see `docs/limiti-noti.md`):
- **Draw by commit-reveal.** The winner must not be computable by anyone who
controls block production, since PLM's hashrate (~22 TH/s) is rentable.
- **Never release funds on doubt.** A money-moving row is rolled back only on proof
(an explicit rejection, or its inputs confirmed-spent elsewhere), never on a
timeout or on one server's silence.
- **One pool address per round**, so a round's money, history and payout are
isolated from every other round's.
- **Deposits need 6 confirmations** (configurable), everything else keeps 1: the
deposit is the only input a user can double-spend.
- **Contain reorgs instead of pretending they don't happen:** detect them, pause
on deep ones, and pay out only what is verifiably on chain.
One finding is still open (B-93), narrowed to what applies to the Django stack. A finding is
removed from this file once it is fixed, and `git log --all --grep 'B-nn'` is the record of how it
was closed. Each entry gets its own commit with its own regression test, and the `B-nn` marker
goes in a comment next to the fix. The full history of every B-nn is in
[docs/storico-bug.md](docs/storico-bug.md); the owner of this one in the plan is roadmap step C6.
## Medium
### B-93 — Deploys and rollbacks
A deploy with an open SSE stream never shuts down gracefully (uvicorn waits, Docker
kills after 10s); an older image cannot start on a newer DB; images are untagged;
`SITE_ADDRESS` passed per command reverts to `localhost` on the next plain
`docker compose up`.
On the Django stack (`docker-compose.yml`):
Fix: close SSE streams on shutdown, `stop_grace_period: 30s`, await task
cancellation; tag images per release; `SITE_ADDRESS` in `.env` with `${SITE_ADDRESS:?}`;
documented pre-deploy backup and downgrade procedure.
- every image is tagged `plm-lottery-web:local`, so there is no per-release tag and an older image
cannot be put back;
- no `stop_grace_period`: a worker stopped in the middle of a step gets Docker's default timeout;
- `SITE_ADDRESS` passed on the command line reverts to `localhost` on the next plain
`docker compose up`;
- there is no documented pre-deploy backup and no downgrade procedure, and an older image cannot
start on a database already migrated forward.
(The old stack's part — SSE streams blocking a graceful shutdown, task cancellation — goes away
with roadmap D1.)
Fix: tag images per release; `stop_grace_period: 30s` and let the worker finish its step on
SIGTERM; `SITE_ADDRESS` in `.env` read as `${SITE_ADDRESS:?}`; document the backup before a deploy
and the downgrade (restore the backup, start the previous tag).