Sprint 1 : scaffolding complet de Glibredecision
Plateforme de decisions collectives pour Duniter/G1. Backend FastAPI async + PostgreSQL (14 tables, 8 routers, 6 services, moteur de vote avec formule d'inertie WoT/Smith/TechComm). Frontend Nuxt 4 + Nuxt UI v3 + Pinia (9 pages, 5 stores). Infrastructure Docker + Woodpecker CI + Traefik. Documentation technique et utilisateur (15 fichiers). Seed : Licence G1, Engagement Forgeron v2.0.0, 4 protocoles de vote. 30 tests unitaires (formules, mode params, vote nuance) -- tous verts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
31
backend/app/engine/techcomm_threshold.py
Normal file
31
backend/app/engine/techcomm_threshold.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Technical Committee threshold criterion.
|
||||
|
||||
The TechComm criterion requires a minimum number of votes from
|
||||
Technical Committee members for certain decisions.
|
||||
|
||||
Formula: ceil(CoTecSize ^ T)
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
|
||||
|
||||
def techcomm_threshold(cotec_size: int, exponent: float = 0.1) -> int:
|
||||
"""Compute the minimum number of TechComm member votes required.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
cotec_size:
|
||||
Number of Technical Committee members.
|
||||
exponent:
|
||||
T in the formula ``ceil(cotec_size^T)``.
|
||||
|
||||
Returns
|
||||
-------
|
||||
int
|
||||
Minimum TechComm votes required.
|
||||
"""
|
||||
if cotec_size <= 0:
|
||||
raise ValueError("cotec_size doit etre strictement positif")
|
||||
return math.ceil(cotec_size ** exponent)
|
||||
Reference in New Issue
Block a user