← Back to Pull requests

feat(admin): board ops and session notices with map preview #1060

Open
unknown opened this pull request with 247 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 07, 2026 18:38 UTC
Author

What and why

Admins needed a way to soft-delete or restore board annotations and recompute thermometer shade from the confirmed hide without guessing, and a short in-map notice for players during live sessions. Both paths preview on the map before any write.

What changed

  • Added adminSessionBoardOps and adminPublishSessionNotice callables (admin auth + App Check) with unit tests

  • Soft-delete / restore / recompute thermometer from hide; client map preview before Execute

  • Session notices collection + dismiss-only member rules; dismissable timed MapFloatSurface on seeker, hider, observer, and admin maps

  • Admin Mod tab Board + Notice composers; publish supersede uses a transaction

  • Changeset for player-visible notice chrome
  • Non-goal: Coarse reset-board / end-session moderation stays as-is; no player activityLog spam for ops stamps.

    Evidence

  • node --test functions/test/sessionBoardOps.test.mjs functions/test/publishSessionNotice.test.mjs (9 pass)

  • npx vitest run focused suites for board preview, notice composer, banners, AdminMapScreen, rail (41+ pass across runs)

  • CodeRabbit CLI vs origin/main: 0 findings on tracked files

  • Thermo follow-ups applied (thermometer truth alignment, notice mounts, preview exclusivity, publish transaction)
  • Risk

  • Requires Functions + rules deploy before desk/ops works in prod

  • Thermometer recompute always answers (no near-edge unavailable), matching ops intent but differing from hider-truth unavailable edge cases

  • Rollback: revert PR and redeploy prior Functions/rules
  • Where to look

  • functions/admin/sessionBoardOps.mjs - recompute + soft-delete

  • functions/admin/publishSessionNotice.mjs - TTL + supersede transaction

  • src/domain/admin/applyBoardOpPreview.ts - client preview

  • src/routes/admin-map-screen/panels/ModPanel.tsx - Board + Notice UI

  • src/hooks/session/useSessionNotices.ts + SessionOpsNoticeBanner.tsx - player float

  • firestore.rules notices match
  • Diff: 247 lines (+185 / -62) across 3 files Reviewer: github-actions[bot] Review duration: 1m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.39) × (1 − Review Confidence (0.18)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 247 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 19% · Reviewer familiarity: 35%
    17%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.330
    Real PR Conversation Timeline
    1 comments
    "Review active on #1060"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 17.8% 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: 38.9% (MEDIUM) · Higher = larger blast radius
    38.9%
    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: 17.8% · Lower = rushed or shallow review
    17.8%
    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: 32.0% · Safe to merge
    32.0%
    Repository