Skip to content

M4: complete the authoritative multiplayer vertical slice - #11

Closed
mhmdibrahimm wants to merge 7 commits into
developfrom
feature/33-37-m4-completion
Closed

mhmdibrahimm wants to merge 7 commits into
developfrom
feature/33-37-m4-completion

Conversation

@mhmdibrahimm

Copy link
Copy Markdown
Collaborator

Summary

  • persist server-authoritative terminal outcomes transactionally in PostgreSQL and remove public match-summary publication
  • complete authoritative Infection rounds, hider-only scoring, spectator mode, and the 3D Answer Check reveal
  • recover active round reservations after a browser refresh or client restart within the 60-second reconnect window
  • deliver the authoritative Unity lobby and round presentation with humanoid players, camouflage palette, weapon view, and the local city testing arena
  • add one-command multi-client development tooling plus Hetzner-oriented WebGL build and delivery scripts
  • align the architecture, API, schema, deployment, scoring, and local setup documentation

Scope notes

  • Match history remains server-authoritative application data. Hive integration remains reserved for ownership and value-bearing operations.
  • The MiniWorld Studio source assets are not included in the repository. Contributors import that temporary testing dependency independently; the project-authored arena prefab remains versioned. A project-owned production map is a follow-up.
  • The local WebGL launcher injects short-lived per-client sessions into one credential-neutral build and does not create offline or preview gameplay.

Validation

  • npm run verify
  • Unity PlayMode: 49 passed, 0 failed
  • PostgreSQL migration and schema contract suite
  • Go tests, vet, formatting, and race detector
  • TypeScript formatting, lint, typecheck, tests, and workspace builds
  • OpenAPI and DBML validation
  • dependency audit: 0 vulnerabilities
  • manual Unity Editor and multi-client WebGL acceptance for Infection, spectator/Answer Check, hider-only scoring, cold reconnect, and camouflage selection

Trello

@mcfarhat

mcfarhat commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@mhmdibrahimm strong M4 work — the authoritative server logic is genuinely solid (the client never submits outcome or score, the terminal result is deeply validated server-side, and reconnect can't reopen a committed result), and CI is green. But one decision has to change before this can merge:

This PR removes the on-chain Hive match publication and makes Postgres the sole authority for match history. We're not going that direction — Chameleon needs to stay Hive-native, with the match/round score posted on-chain. Please restore the on-chain result publication:

  • The authoritative outcome/score your server computes should be published on-chain (custom_json) as the canonical record; Postgres stays as the fast, queryable duplicate/index — that's our standard (on-chain canonical, Postgres fast duplicate), not Postgres-only.
  • Keep (or restore) the disclosure/consent flow that goes with putting match data on a permanent public ledger. If you think it genuinely needs rethinking, raise it for discussion rather than removing it.

Everything else in the PR — the authoritative round logic, 60s reconnect, scoring, spectator/Answer-Check, official map + Unity UI — is good and stays. While you're re-adding the on-chain path, please also: (a) tighten/comment the reconnect fallback window (the updated_at + 60s SQL path can slide past 60s), (b) confirm the destructive forward-only migration is intended (it hard-fails if any result rows exist), and (c) confirm the binary art (.blend/.fbx) versioning strategy (Git LFS?).

Ping me once the on-chain publication is back in and I'll re-review.

@mhmdibrahimm

Copy link
Copy Markdown
Collaborator Author

Closing in favor of a new PR that restores on-chain match result publication per manager feedback on #33. All M4 work will be included in the replacement PR.

mhmdibrahimm added a commit that referenced this pull request Aug 14, 2026
Re-create the outbox and HAF-projection tables the DB-only refactor (PR #11)
dropped, so a finished round's canonical summary can be published on-chain and
re-read via HAF (card #33):

- game.match_publication_request / _outbox / _item
- hive_projection.match_event / match_result / match_result_change
- enums, indexes, domain-integrity triggers, and invariant partial indexes
- the hc_match_publisher NOLOGIN role, its scoped grants, and RLS policy
- re-grant hc_projector (INSERT/UPDATE) and hc_api (SELECT) on the match
  tables, which the drop-with-CASCADE also removed

The embedded canonical_complete_result bytea added by the removal migration is
kept as-is. Schema-test fixtures updated for the restored objects.

Forward-only migration; verified via dbmate + the schema-test suite.
mhmdibrahimm added a commit that referenced this pull request Aug 14, 2026
…ontracts

Reinstate the match event family removed alongside PR #11: the
match_results_batch / _corrected / _invalidated Zod schemas, their inclusion in
the hive.chameleon discriminated union and eventFamily(), and the official
match_publisher signer policy/contract surface. Test fixtures and specs updated.
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