Restructure docs: docs-first, SSOT, one ADR per decision
- Add docs/README.md as the index of all documentation. - Split the 52 DEC entries of decisioni-e-limiti.md into docs/adr/ADR-NN files (same numbers), add ADR-53 (audit log), TEMPLATE.md and an ADR index with a feature -> ADR table. - Rename decisioni-e-limiti.md to limiti-noti.md (LIM only) and rewrite all DEC-nn references as links to the ADRs. - Document the docs-first / SSOT / ADR rules in processo-di-modifica.md and map the docs in CLAUDE.md and README.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7ba8e22bb4
commit
b424f670c5
76 files changed
+2147
-1530
No files matched your search
@@ -0,0 +1,19 @@
|
||||
# ADR-22 — Al più un round attivo, come invariante del database
|
||||
|
||||
- **Stato:** Accettata
|
||||
- **Area:** Round ed estrazione
|
||||
- **Fonte di verità per:** la scelta di progetto descritta qui sotto; i requisiti (`PREFISSO-NN`) che la attuano stanno nei documenti di dominio, indicati nelle *Conseguenze*.
|
||||
|
||||
## Decisione
|
||||
|
||||
**Al più un round attivo, come invariante del database.** Un
|
||||
indice unico su un'espressione costante, limitato agli stati attivi, fa
|
||||
fallire in modo pulito il secondo inserimento concorrente; chi perde adotta
|
||||
il round del vincitore (al massimo 3 tentativi). I round non si
|
||||
sovrappongono mai: il successivo si apre solo quando il precedente è
|
||||
`closed`.
|
||||
- *Alternative scartate:* rendere lo scheduler l'unico autore dei round (la
|
||||
prima scommessa dopo una pausa non avrebbe potuto aprirne uno, B-09).
|
||||
|
||||
*Codice:* `app/db/models.py:Round` · `app/rounds/service.py:open_new_round_if_needed` · `app/rounds/service.py:get_active_round` ·
|
||||
*Test:* `tests/unit/test_rounds_service.py::test_the_database_refuses_a_second_active_round`, `tests/unit/test_rounds_service.py::test_losing_the_open_race_reuses_the_winning_round`
|
||||
Reference in new issue
Block a user