Add the Stage 12 parallel v2 simulation path
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
La issue non nomina file di implementazione del repository, test o punti di ingresso; identifica però i file bundle .py di PolicyEngine.py e la ricevuta privata reports/comparison.json. Inizia esaminando la dipendenza di deployment da PolicyEngine/policyengine-api#3842 e la validazione di deployment esistente. Il lavoro è completato quando sono verificati tutti i controlli di accettazione, le risorse v2 elencate, il percorso isolato di dispatch e confronto e l’autorità di produzione invariata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Objective
Add the Stage 12 v2 comparison path alongside the existing simulation services without replacing the current production calculation path or making v2 output authoritative.
Scope
- Deploy a separately named Modal v2 application.
- Run one report coordinator that starts baseline and reform as independent simulation functions before waiting for either result.
- Publish and consume a v2 version manifest that is separate from the existing v1 manifest.
- Resolve country-package and dataset versions exclusively from reviewed PolicyEngine.py
.pybundle files. - Provide a temporary authenticated direct Stage 12 runner for qualification.
- When
STAGE12_ENABLED=1, automatically start one Stage 12 comparison run after a supported production annual society-wide report is accepted. - Wait no more than five seconds for Modal to acknowledge the coordinator invocation, then return the unchanged production response without waiting for Stage 12 calculation or comparison.
- After Stage 12 aggregation, retrieve the production Modal result, compare the complete aggregate result objects exactly, and write a private
reports/comparison.jsonreceipt containing result digests and every differing scalar leaf. - Isolate Stage 12 dispatch, calculation, comparison, artifact, and persistence failures from the production result.
- Remove the shared runtime-control object, process-local dispatch queue, and periodic PostgreSQL cleanup function.
Deployment dependency
PolicyEngine/policyengine-api#3842 adds the comparison-result columns consumed by this runtime. That PR must merge and its v2 Alembic revision must run before this simulation PR merges. The production restricted PostgreSQL URL secret and environment configuration must also be present and pass the existing deployment validation.
The beta and prod GitHub environments both define STAGE12_ENABLED=0. Merging this PR therefore deploys the separate Modal application, separate v2 manifest, Cloud Run configuration, and temporary authenticated direct endpoint without automatically sending normal report submissions to Stage 12. Setting one environment value to 1 and deploying Cloud Run enables automatic runs in that environment; it does not change the existing production forwarding destination or result authority.
Acceptance criteria
- Existing v1 routing and user-visible result authority are unchanged.
- Baseline and reform simulations execute independently and are aggregated by the report coordinator.
- V1 and v2 manifests use distinct storage objects.
- Stage 12 resources deploy in both staging and production after prerequisites exist.
- Automatic runs remain disabled in both environments after the initial deployment.
- The five-second Modal-acknowledgement wait is the only Stage 12 work on the production request path.
- Direct Stage 12-only execution remains available independently of
STAGE12_ENABLEDwhen resources are configured. - No periodic Stage 12 function runs.
- Private artifacts expire through the existing 30-day storage lifecycle; temporary PostgreSQL rows remain until Stage 14.
- Local tests, formatting, focused type checks, container-import validation, and deployment-contract checks pass.
- Lingua principale
- Python
- Stelle
- 1
- Fork
- 1
- Merge medio
- 9h 14m
- PR unite (30g)
- 8
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine-sim-api
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
PolicyEngine/policyengine-sim-api#674 · 3 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Tutte le issue di PolicyEngine/policyengine-sim-api
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100