Spec 021: Melee Invite Modes (Link vs. Invite) #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "021-melee-invite-modes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
melees.invite_modecolumn (DB-enforced immutable via trigger) andmelee_invitestable with Maker-only RLSjoin_melee_by_code(the minimal spec-012 join slice, since spec 012 has no implementation elsewhere in this repo),accept_melee_invite, andremove_melee_participant(discovered mid-implementation — the existing melee_participants_update policy only allowed self-updates)Test plan
tsc --noEmitclean,npm run buildsucceedsAll 29 tasks in specs/021-melee-invite-modes/tasks.md completed.
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Adds the avatar picker (src/app/profile), a shared Avatar rendering component used everywhere a user is represented (FR-003), and wires the Melee detail page with a live real-time reveal overlay plus a persisted activity history so a participant who was offline when the reveal fired still sees it on their next visit. Verified against a real authenticated session (magic-link token exchanged through /auth/confirm for the seeded Alice user): both /profile and /melees/{id} render 200 with real content — theme picker with all four DiceBear sets, participant list and activity feed with rendered avatars. The live cross-tab reveal itself is code-complete and type-checked/linted but needs a manual two-browser check per quickstart.md; no headless-browser tooling exists in this repo yet to automate that. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>Scoped down from a larger originating brief ("Competition Engine, Ontology and Series") after grounding its claims against the actual repo state. Several of the brief's premises did not hold once checked: - It references an events table throughout; no such table exists, the real entity is melees everywhere in the deployed schema. - It frames Kalshi/Polymarket auto-resolution and outcomes.entered_by accepting a system value as new decisions this spec introduces; spec 013 already fully specifies both (FR-009 through FR-015). - Its proposed market_links table substantially duplicates what spec 013 already put directly on stages. - Its Series wrapper overlaps a different, already-specified mechanism (spec 006 Tier 2 leaderboard + spec 014's migration chain), which uses a linked-chain model, not a grouping table. This spec covers the market-import-first Maker flow, the competition_type/resolution_source ontology, intensifiers, and Knockout Pool. Series/cross-event leaderboard and Draft/Roster are explicitly excluded (documented in spec.md's own Explicitly Out of Scope section) since they either duplicate already-specified work or the originating brief itself marks them as deferred. One real, unresolved tension is flagged rather than silently decided: the brief's proposal to give intensifiers a different scoring weight directly contradicts MELEE_CRITICAL_DECISIONS_v1.md's LOCKED "all Stages worth equal scoring weight, no edge cases" rule. This spec's FRs keep intensifiers equally weighted, consistent with the locked rule, and calls out that reopening it is not this spec's call to make. One clarification was needed and resolved: Knockout Pool ends with no winner declared if every remaining participant is wrong in the same round (strict last-standing), not the NFL survivor-pool convention of reinstating everyone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>Spec 019's competition_type enum includes "ordinal" ("a full ranked order"), which could read as solving the same gap spec 018 exists for. It doesn't: 019 only lets a Maker tag a Stage ordinal, it defines no storage for that Stage's prediction or result -- picks.contender_id and outcomes.winner_contender_id remain single-Contender FK columns, untouched by 019. Spec 018 is not redundant; it's the reverse -- 019's ordinal label has no working mechanism behind it until 018's storage question (FR-012: child tables vs. JSONB vs. recursive per-position Stages) is resolved. Adds an explicit cross-reference in both directions: 019's Explicitly Out of Scope section and its FR-005 now flag that ordinal is label-only, and 018's grounding note now states the dependency from its side. Also finally commits specs/018-ranking-challenge-format/, which had been sitting uncommitted since earlier in the session. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.