Skip to content

feat(stats): host match-report review flow, pinned to db-v1.20.0 - #265

Merged
diese-tech merged 4 commits into
mainfrom
claude/report-match-commands-ready-p317uz
Aug 31, 2026
Merged

feat(stats): host match-report review flow, pinned to db-v1.20.0#265
diese-tech merged 4 commits into
mainfrom
claude/report-match-commands-ready-p317uz

Conversation

@diese-tech

Copy link
Copy Markdown
Owner

What

Carries the full contents of #262 and adds the database contract pin that its rollout notes said was still outstanding.

#262 deliberately stayed locked to released db-v1.17.0 while db-v1.18.0 was pending, and asked for "a small generated-types/contract-lock pin commit before integration or deployment." That release has since shipped and been superseded — production is now on db-v1.20.0 — so this branch advances the lock to the current release and re-vendors the generated types.

This supersedes #262. Close it in favor of this branch, or cherry-pick 39a4810 onto it — whichever you prefer. No other change: the review page, session exchange, upload/extract/revise/submit routes, and admin queue integration are exactly as reviewed on #262.

The pin

db-contract.lock.json moves to released db-v1.20.0 at 508f267470030e8daf9108fc5162c2a407ef848e (migration head 20260823130000), and src/types/database.types.ts is re-vendored with npm run sync:db-contract — which fetches the generated types from the release tag rather than editing them by hand.

The types change is purely additive: 702 insertions, zero deletions. It brings in the host-review surface this branch depends on:

  • match_report_host_tokens
  • issue_match_report_host_token, consume_match_report_host_token
  • submit_match_report_host_review, revise_match_report_extraction
  • create_match_result_action_with_report, ensure_match_report_for_pending_action
  • match_report_extraction_diagnostics

plus the roster trade, roster drop, and scoped role contracts that landed in the same window and are unused here.

Worth noting for review: the route handlers now typecheck against the real RPC signatures instead of the v1.17.0 types that predated them, and tsc --noEmit comes back clean. That is the substantive value of the pin, not just a version bump.

Dependencies and rollout

No production deployment or database write was performed from this branch.

Verification

  • npx tsc --noEmit — clean
  • npx vitest run — 772 passed, 26 skipped (121 files, 1 skipped); identical to feat(stats): add host match-report review flow #262's pre-pin numbers, so the pin is behaviorally inert
  • npx eslint . --quiet
  • npm run check:bem
  • npm run check:db-contract — verified diese-tech/sal-database db-v1.20.0 (20260823130000)
  • npm run build — succeeds under the CI build environment (E2E_TEST_MODE=1, empty Supabase vars)

Full Discord → deployed site → database verification still requires the secrets above and lab-salbot#96 deployed.


Generated by Claude Code

diese-tech and others added 3 commits August 18, 2026 23:41
The host match-report review flow calls RPCs that were added to the
canonical database after this branch was cut, but the vendored types were
still pinned to db-v1.17.0 (migration head 20260809220000). This is the
pin commit the branch anticipated in its rollout notes.

Advances db-contract.lock.json to released db-v1.20.0 at
508f267470030e8daf9108fc5162c2a407ef848e (migration head 20260823130000)
and re-vendors src/types/database.types.ts via `npm run sync:db-contract`,
which fetches the generated types from the release tag rather than editing
them by hand.

The types change is purely additive — 702 insertions, no deletions. It
brings in the host-review surface this branch depends on
(match_report_host_tokens, issue_match_report_host_token,
consume_match_report_host_token, submit_match_report_host_review,
revise_match_report_extraction, create_match_result_action_with_report,
ensure_match_report_for_pending_action,
match_report_extraction_diagnostics) along with the roster trade, roster
drop, and scoped role contracts that landed in the same window and are
unused here.

Verification:
- npx tsc --noEmit — clean; the route handlers typecheck against the real
  RPC signatures rather than the v1.17.0 types that lacked them
- npx vitest run — 772 passed, 26 skipped (121 files), unchanged from the
  pre-pin run on this branch
- npx eslint . --quiet, npm run check:bem
- npm run check:db-contract — verified db-v1.20.0 (20260823130000)
- npm run build — succeeds under the CI build environment
  (E2E_TEST_MODE=1, empty Supabase vars)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MxSTraGzCWDmpCS4h6tCYC
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sal-draft-league Ready Ready Preview Aug 31, 2026 12:37am

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39a4810504

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/admin/MatchReportClient.tsx
Comment thread src/components/admin/MatchReportCard.tsx
…ports

Addresses two Codex review findings on this branch.

P1 — admin review dropped host-validated player identities
(MatchReportClient.tsx). toReviewGames re-resolved every player by IGN and
overwrote the persisted playerId. That was harmless while reports only
reached "review" from admin OCR, where no identity had been validated yet,
but this branch routes host_review reports through the same function. A
host has already bound each row to a roster identity by then, so an IGN
change since submission silently dropped the id, and a duplicate or
recycled IGN could bind the row to a different player before official
stats were written. The persisted playerId now wins; IGN lookup remains
the fallback for extractions that were never host-validated.

P2 — cancelled reports could be resurrected (MatchReportCard/upload route).
This branch gave cancelled reports a status badge, making them ordinary
selectable cards, but openExistingReport only special-cased done, review,
and host_review; cancelled fell through to the editable upload step, and
the admin upload route unconditionally wrote status "pending". An admin
opening a cancelled report and attaching a screenshot would revive it.
The client now treats cancelled as read-only, and the upload route rejects
terminal reports with 409 — covering "done" as well, since the same
unguarded write would have reopened a report whose stats are published.

Also drops the hostReviewRow cast in the match-reports list route. It
existed only to keep the branch type-safe against the v1.17.0 contract
that predated these columns; the db-v1.20.0 pin makes revision and
host_submitted_at properly typed.

Verification:
- new upload route test covers both terminal statuses and the still-
  accepted pending case; confirmed it fails (200 instead of 409) with the
  guard removed and passes with it restored
- npx vitest run — 775 passed, 26 skipped (122 files), up from 772
- npx tsc --noEmit, npx eslint . --quiet, npm run check:bem
- npm run check:db-contract — db-v1.20.0 (20260823130000)
- npm run build — succeeds under the CI build environment

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MxSTraGzCWDmpCS4h6tCYC
@diese-tech
diese-tech merged commit 956b499 into main Aug 31, 2026
17 checks passed
@diese-tech
diese-tech deleted the claude/report-match-commands-ready-p317uz branch August 31, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants