feat: connect report-result stats review flow - #90
Conversation
|
Closing as superseded by #96. This branch was stuck at Also worth recording here: the dependency this PR described as blocking is gone. It said it was waiting on diese-tech/sal-database#103 and the protected publication of No work is lost. Continue on #96. Generated by Claude Code |
Changes /report-result to atomically create/recover the pending result and match report, authorizes the host review link through a dedicated enter-match-stats capability, mirrors host-submitted screenshots from durable storage, and posts the admin stats-review link idempotently. Carries the contents of #90 merged onto current main, resolving the six conflicts left by the trade workflow (#94) and scoped roster roles and drops (#95). Also audits proof-thread writes to matches: setProofThread now records an audit_logs entry with the submitting operator as actor plus old/new values, on both first attachment and crash-recovery re-attachment. Requires SAL_SITE_URL and SAL_SITE_INTERNAL_TOKEN (matching sal-site's INTERNAL_SERVICE_TOKEN). SAL_MATCH_STATS_ROLE_IDS optionally narrows the stats-entry role; unset falls back to the operator allowlist.
What
/report-resultto atomically create/recover the pending result and match reportenter-match-statscapability and rechecks access on clickWhy
The season flow must carry
/report-resultthrough host-corrected OCR stats and one admin final decision without duplicate actions, duplicate uploads, or preliminary scores winning a race against official player stats.Part of diese-tech/sal-site#252.
Dependencies and rollout
db-v1.18.0is published and the site/bot receive their small generated-types/contract-lock pin commits.SAL_MATCH_STATS_ROLE_IDSfor the narrow stats-entry role. If absent, the existing operator role list remains the compatibility fallback; admins retain access.No bot deployment or production write was performed.
Verification
db-v1.11.0git diff --check origin/main...HEADFull Discord → deployed site → protected database staging verification remains gated on the database release and deployment secrets.