What a finished Game keeps, and which guest identity owns it #348

Closed
opened 2026-10-11 12:59:28 +00:00 by root · 9 comments
root commented 2026-10-11 12:59:28 +00:00 (Migrated from gitlab.core-project.space)

Imported from GitHub amaurycoudr/chess-project#348, opened by @amaurycoudr on 2026-10-11 12:59 UTC.
Closed on GitHub on 2026-10-11 13:25 UTC as completed.
Assigned on GitHub to @amaurycoudr.


Parent

#346

Question

When a Game ends, what row is written (moves as a UCI line, start FEN, result, Draw reason, Resignation, timestamps, Room code?) and who are its two owners? A guest must be identifiable without an account — by Seat token, by a device identifier, or another id — so that "my games" works on this device, a guest can later claim the games into an account, and an Elo can be recomputed after the fact. Do Local games count?

> _Imported from GitHub [amaurycoudr/chess-project#348](https://github.com/amaurycoudr/chess-project/issues/348), opened by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-10-11 12:59 UTC._ > _Closed on GitHub on 2026-10-11 13:25 UTC as completed._ > _Assigned on GitHub to [@amaurycoudr](https://github.com/amaurycoudr)._ <!-- github-issue:348 --> --- ## Parent #346 ## Question When a **Game** ends, what row is written (moves as a UCI line, start FEN, result, Draw reason, Resignation, timestamps, Room code?) and who are its two owners? A guest must be identifiable without an account — by **Seat token**, by a device identifier, or another id — so that "my games" works on this device, a guest can later claim the games into an account, and an Elo can be recomputed after the fact. Do Local games count?
root commented 2026-10-11 12:59:28 +00:00 (Migrated from gitlab.core-project.space)

GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links).

  • Parent (sub-issue of): #346
  • Blocked by: #347
  • Blocking: #352
> _GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links)._ <!-- github-relations --> - Parent (sub-issue of): #346 - Blocked by: #347 - Blocking: #352
root commented 2026-10-11 13:25:45 +00:00 (Migrated from gitlab.core-project.space)

Imported from a GitHub comment by @amaurycoudr on 2026-10-11 13:25 UTC.

Resolution

  1. Scope: only Online games are stored. Local games stay in the browser (ADR 0014): they have no owner, since neither Color is "you".
  2. Which endings: only decided Games — checkmate, draw with its reason (including agreed), and Resignation. A Game cut short (restart mid-game, Room evicted, redeploy) is not stored.
  3. Guest owner: a new concept, the Guest — a secret the browser mints the first time it takes a Seat (a Spectator never gets one), kept in localStorage, sent as a header, never in a URL. It sits alongside the Seat token; ADR 0016 is unchanged, and whether the two secrets merge is left to the account ↔ Seat token ticket. If storage is cleared, the Guest's Games stay in the database but can no longer be claimed — accepted; accounts are the fix.
  4. Name: it stays a Game. No new term; a decided Game simply gains owners.
  5. Contents: an unguessable id; the owner of each Color (a Guest, later an account); the Moves as one UCI line from STARTPOS (ADR 0021; Rooms always start there); the result — winner (w, b or none) and how it ended (checkmate, resignation, or draw with its reason); started and ended timestamps. No Room code (recycled, meaningless once the Room is gone) and nothing derived (SAN, Status come from replaying, as in ADR 0014).
  6. Ownership: a Game belongs to whoever holds each Seat when it ends, even if the Seat changed hands mid-game.
  7. Visibility: anyone with its link can read a Game; it is listed only to its owners. Public listing waits for the public profile.

Left to the guest-history spec: how the server stores the Guest secret (hashed or not); what name "my games" shows for the opponent.

Glossary, to land with the spec (GLOSSARY.md):

  • Guest — a Player with no account, known by a secret their browser holds. Owns the finished Games in which they held a Seat. Avoid: anonymous user, visitor, device.
  • Relationship: a decided Online game belongs to the occupants of its two Seats at the moment it ends.
  • Flagged ambiguity: Guest vs Seat token — the Seat token proves a place in one Room; the Guest is the browser-wide identity that owns Games.
> _Imported from a [GitHub comment](https://github.com/amaurycoudr/chess-project/issues/348#issuecomment-6109501829) by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-10-11 13:25 UTC._ <!-- github-comment:6109501829 --> ## Resolution 1. **Scope:** only **Online games** are stored. **Local games** stay in the browser (ADR 0014): they have no owner, since neither **Color** is "you". 2. **Which endings:** only **decided** Games — checkmate, draw with its reason (including `agreed`), and **Resignation**. A Game cut short (restart mid-game, Room evicted, redeploy) is not stored. 3. **Guest owner:** a new concept, the **Guest** — a secret the browser mints the first time it takes a **Seat** (a **Spectator** never gets one), kept in `localStorage`, sent as a header, never in a URL. It sits alongside the **Seat token**; ADR 0016 is unchanged, and whether the two secrets merge is left to the account ↔ Seat token ticket. If storage is cleared, the Guest's Games stay in the database but can no longer be claimed — accepted; accounts are the fix. 4. **Name:** it stays a **Game**. No new term; a decided Game simply gains owners. 5. **Contents:** an unguessable id; the owner of each **Color** (a Guest, later an account); the **Moves** as one **UCI** line from **STARTPOS** (ADR 0021; Rooms always start there); the result — winner (`w`, `b` or none) and how it ended (`checkmate`, `resignation`, or `draw` with its reason); started and ended timestamps. No **Room code** (recycled, meaningless once the Room is gone) and nothing derived (SAN, Status come from replaying, as in ADR 0014). 6. **Ownership:** a Game belongs to whoever holds each **Seat** when it ends, even if the Seat changed hands mid-game. 7. **Visibility:** anyone with its link can read a Game; it is listed only to its owners. Public listing waits for the public profile. **Left to the guest-history spec:** how the server stores the Guest secret (hashed or not); what name "my games" shows for the opponent. **Glossary, to land with the spec (`GLOSSARY.md`):** - **Guest** — a **Player** with no account, known by a secret their browser holds. Owns the finished **Games** in which they held a **Seat**. Avoid: anonymous user, visitor, device. - Relationship: a decided **Online game** belongs to the occupants of its two **Seats** at the moment it ends. - Flagged ambiguity: **Guest** vs **Seat token** — the **Seat token** proves a place in one **Room**; the **Guest** is the browser-wide identity that owns **Games**.
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-11 13:25:46 +00:00
root commented 2026-10-13 08:39:38 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #352

mentioned in issue #352
root commented 2026-10-13 08:41:16 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #346

mentioned in issue #346
root commented 2026-10-13 08:41:17 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #347

mentioned in issue #347
root commented 2026-10-13 08:42:21 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #346

marked this issue as related to #346
root commented 2026-10-13 08:42:23 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #347

marked this issue as related to #347
root commented 2026-10-13 08:42:23 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #352

marked this issue as related to #352
root commented 2026-10-13 10:19:25 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 6ba8bbcfa7

mentioned in commit 6ba8bbcfa7d87b07619ab4837e686e74ce3440df
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
amaurycoudr/chess-project#348
No description provided.