Read stored Games over the wire: the caller's list and one Game by id #374

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

Imported from GitHub amaurycoudr/chess-project#374, opened by @amaurycoudr on 2026-10-11 16:26 UTC.


Parent

#355

What to build

A new game router in the contracts (ADR 0027), implemented by the API's games/ module.

game.list (GET /games) returns the caller's decided Games, newest first, capped at the 50 most recent. Each item carries:

  • the id;
  • started and ended;
  • the caller's Color;
  • how it ended;
  • the other side's occupant;
  • the line, from which the front counts Moves.

A call with no Guest, or with a Guest that owns nothing, gets an empty list rather than an error. The list waits for writes still in flight to settle before it reads. That way a Game is listed as soon as the Room shows it decided, without the Room ever waiting on the database.

game.get (GET /games/{id}) returns:

  • the line;
  • how it ended;
  • both timestamps;
  • each side's occupant;
  • the viewer, either the owner of a Color or a reader.

An unknown id, malformed ones included, is GAME_NOT_FOUND (404). An id the API could not have minted is treated as unknown before the database is read.

A side's occupant crosses the wire as its kind only, guest or none. No hash and no secret ever crosses the wire. Both procedures are reads, so the origin guard passes them without an Origin (ADR 0028), and they change no state (ADR 0030).

Seam: the RPC wire with the in-process app on the in-process database.

Acceptance criteria

  • The list read by the opponent the moment the decision lands already holds the Game (story 12).
  • The list returns this caller's Games newest first, with their Color, ending and the other side's occupant kind (story 13).
  • The list with no header, or with an unknown Guest, is empty and is not an error.
  • With more than 50 Games, the list returns the 50 most recent.
  • game.get without a Guest returns the Game with the viewer as a reader. With an owning Guest, the viewer is the owner of that Color.
  • game.get with an unknown id, or with a malformed one, is GAME_NOT_FOUND.
  • No response carries a hash or a secret.
  • Both procedures pass the origin guard without an Origin.
> _Imported from GitHub [amaurycoudr/chess-project#374](https://github.com/amaurycoudr/chess-project/issues/374), opened by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-10-11 16:26 UTC._ <!-- github-issue:374 --> --- ## Parent #355 ## What to build A new `game` router in the contracts (ADR 0027), implemented by the API's `games/` module. `game.list` (`GET /games`) returns the caller's decided **Games**, newest first, capped at the 50 most recent. Each item carries: - the id; - started and ended; - the caller's **Color**; - how it ended; - the other side's occupant; - the line, from which the front counts **Moves**. A call with no **Guest**, or with a **Guest** that owns nothing, gets an empty list rather than an error. The list waits for writes still in flight to settle before it reads. That way a **Game** is listed as soon as the **Room** shows it decided, without the **Room** ever waiting on the database. `game.get` (`GET /games/{id}`) returns: - the line; - how it ended; - both timestamps; - each side's occupant; - the viewer, either the owner of a **Color** or a reader. An unknown id, malformed ones included, is `GAME_NOT_FOUND` (404). An id the API could not have minted is treated as unknown before the database is read. A side's occupant crosses the wire as its kind only, `guest` or `none`. No hash and no secret ever crosses the wire. Both procedures are reads, so the origin guard passes them without an Origin (ADR 0028), and they change no state (ADR 0030). Seam: the RPC wire with the in-process app on the in-process database. ## Acceptance criteria - [ ] The list read by the opponent the moment the decision lands already holds the **Game** (story 12). - [ ] The list returns this caller's **Games** newest first, with their **Color**, ending and the other side's occupant kind (story 13). - [ ] The list with no header, or with an unknown **Guest**, is empty and is not an error. - [ ] With more than 50 **Games**, the list returns the 50 most recent. - [ ] `game.get` without a **Guest** returns the **Game** with the viewer as a reader. With an owning **Guest**, the viewer is the owner of that **Color**. - [ ] `game.get` with an unknown id, or with a malformed one, is `GAME_NOT_FOUND`. - [ ] No response carries a hash or a secret. - [ ] Both procedures pass the origin guard without an Origin.
root commented 2026-10-11 16:26: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): #355
  • Blocked by: #373
  • Blocking: #375
> _GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links)._ <!-- github-relations --> - Parent (sub-issue of): #355 - Blocked by: #373 - Blocking: #375
root commented 2026-10-13 08:39:45 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #375

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

mentioned in issue #355

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

mentioned in issue #373

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

marked this issue as related to #355

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

marked this issue as related to #373

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

marked this issue as related to #375

marked this issue as related to #375
root commented 2026-10-13 14:34:16 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !515

mentioned in merge request !515
root commented 2026-10-13 15:31:19 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #393

mentioned in issue #393
root commented 2026-10-13 15:31:32 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #393

marked this issue as related to #393
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-14 09:31:58 +00:00
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#374
No description provided.