← Back to Pull requests

WS-GOVUX P7 — Consequence board: le conseguenze prima della firma #165

Open
unknown opened this pull request with 617 lines diff across 7 files
View on GitHub
unknown unknown commented on Oct 02, 2026 05:32 UTC
Author

WS-GOVUX P7 — Consequence board: le conseguenze prima della firma

Fase P7 della roadmap GOV UX (/tmp/pi-tasks/pi-task-gov-ux-roadmap.md, §P7),
ultima dell'ordine P1 → P3 → P4 → P6 → P7. Base: origin/main 98f8081
(merge PR #164, WS-GOVUX P6). Sola PR verso main: nessun merge, nessun deploy.

Cosa cambia

Prima della firma, dentro la bozza d'atto, il Presidente vede quattro gruppi
distinti ed etichettati
:

  • Effetti diretti calcolati — il costo che il motore applica all'esecuzione.

  • Per gli ordini in prosa la verifica di fattibilità del motore
    (check-feasibility → estimateIntentCosts), con durata, consumi e
    mantenimenti; per le opere la distinta già risolta dal server. Ogni voce del
    motore è marcata «applicato dal motore».
  • Previsioni del motore — beneficio atteso, copertura, esito della verifica,

  • interpretazione del testo.
  • Rischi — distinta scoperta, vincoli, blocchi e prerequisiti, funzione assente.

  • Incertezze — cifre stimate o mancanti, spesa ricorrente e tempi non

  • dichiarati, effetti sociali non simulati, avviso del motore.

    Regole di fase:

  • la plancia è un read model puro: nessuna scrittura, nessun ordine accodato,

  • nessun effetto su salvataggi, risorse, turno, code eventi o RNG;
  • costi preview == costi applicati: la stima è la verifica del motore, non un

  • ricalcolo locale;
  • modificare la bozza invalida la stima: firma del preventivo = snapshot

  • canonico + capacità + opera + orderKey(testo); una stima di un'altra versione è
    dichiarata stale, scartata, e si ricalcola con un pulsante esplicito;
  • effetti non supportati dichiarati non stimabili, mai percentuali inventate:

  • l'unica percentuale che può comparire è citata come nota del motore.

    File

  • Nuovo modulo puro frontend/src/components/Game/consequenceBoard.ts —

  • consequenceBoardSignature, buildConsequenceBoard, tipi e etichette.
  • Nuovo componente frontend/src/components/Game/ConsequenceBoardPanel.tsx.

  • ActDraftPanel.tsx — rende la plancia tra lo stato e i pulsanti (prima della

  • firma); senza board resta invariato.
  • SeatTable.tsx, GovernmentOffice.tsx — snapshot canonico, refreshActBoard

  • (verifica del motore) e memo della plancia. La plancia non tocca lo stato di gioco.
  • editorial.css — blocco .consequence-, palette navy/ambra, nessun !important.

  • Test nuovi: consequenceBoard.test.ts (10), consequenceBoardRender.test.tsx (5).

  • E2E nuovo: e2e/tests/govux-p7-consequence.spec.mjs (390×844, 1 test) —

  • prepara una strada in prosa, verifica i costi del motore e i quattro gruppi,
    la stima stale + ricalcolo, e che nessuna richiesta di coda parta.
  • Report: docs/implementation/WS-GOVUX-P7-report.md; screenshot

  • docs/implementation/assets/ws-govux-p7/390x844-consequence-board.png.

    Riusati senza riscriverli: treasuryAct.ts, actDraft.ts, consequences.ts,
    actionSnapshot.ts, FeasibilityCheck.tsx, ProposalComparison.tsx. Nessuna
    libreria aggiunta; nessun backend toccato; CORE ENGINE FREEZE intatto.

    Gate

    | Comando | Esito |
    |---|---|
    | cd frontend && ../node_modules/.bin/vitest run src/components/Game/consequenceBoard.test.ts src/components/Game/consequenceBoardRender.test.tsx | 15/15 passati, exit 0 |
    | cd frontend && ../node_modules/.bin/vitest run | 132 file / 1118 passati, 1 saltato, exit 0 |
    | cd frontend && ../node_modules/.bin/tsc --noEmit | exit 0 |
    | cd frontend && npm run build | exit 0 |
    | cd backend-nest && npm run build (poi rm -rf dist) | exit 0 |
    | cd e2e && … playwright test tests/govux-p7-consequence.spec.mjs | 1/1 passato, 6,5 s |
    | cd e2e && … playwright test tests/modules.spec.mjs tests/govux-p1-council.spec.mjs tests/govux-p7-consequence.spec.mjs | 15/15 passati, 1,8 min |

    Log in /tmp/govux-p7-gate/.

    Limiti dichiarati: E2E completo Governo e matrice multi-viewport rimandati al
    gate completo di fine blocco; suite backend completa non eseguita (backend non
    toccato); audit a11y non rieseguito. Lo script letterale npm test del frontend
    non esiste (Missing script: "test"): il runner reale è vitest run ed è quello
    usato, con dist/ assente.

    Nota di gate: il profilo pi-task-govux-gates-lite.md mette P7 nel gate
    ridotto (eccezione UI minima solo per P1/P4). La regia ha chiesto per questa
    fase 1 E2E mirato a 390×844 + 1 screenshot: verifica aggiuntiva, eseguita
    davvero. Nessun test del gate ridotto è stato tolto o dichiarato verde senza esito.

    CORE ENGINE FREEZE

    Intatto. Diff limitato a frontend/src/, e2e/, docs/implementation/.
    Nessuna modifica a backend-nest/src/
    , core/simulation/
    *, GameSession,
    TurnOrchestrator, TurnPipelineService, SessionStateStore, repository,
    schema/database, checkpoint/simulation run/playback. Nessuna nuova chiamata LLM
    (solo la rotta check-feasibility esistente, di sola lettura).

    Diff: 617 lines (+462 / -155) across 7 files Reviewer: chatgpt-codex-connector[bot] Review duration: 5m
    All Vouch review confidence checks passed
    Residual risk 0.39 = Change Risk (0.50) × (1 − Review Confidence (0.23)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 617 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 36% · Reviewer familiarity: 35%
    22%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.384
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #165"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 22.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50.2% (MEDIUM) · Higher = larger blast radius
    50.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 22.5% · Lower = rushed or shallow review
    22.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 38.9% · Moderate risk
    38.9%