Export a stored Game as PGN, with the result of a Resignation or an agreed Draw #377

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

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


Parent

#355

What to build

Game.pgn in the engine takes a result token from its caller, for endings that Status cannot express: a Resignation or an agreed Draw, which the engine never produces itself (ADR 0017). Without a result token, it derives the token from Status as it does today.

The Game page gains "Export PGN". It builds the file in the browser from the line, with these tags:

  • White and Black: "Guest";
  • Date: when the Game ended;
  • Site: the page URL;
  • Result: from how the Game ended.

The file is named after the Game's id. New strings go in English and French.

Seam: the front views (the Game view). The result override is tested at the engine barrel, in the existing PGN tests.

Acceptance criteria

  • The engine's PGN uses a result token the caller passes, and falls back to the one derived from Status when none is passed.
  • Exporting a resigned Game gives the winner's result. An agreed Draw gives 1/2-1/2, and a Checkmate or other Draw matches its ending (story 20).
  • The file's White and Black tags are "Guest", Date is the ended date, Site is the page URL, and the file is named after the id.
  • Export works for a reader with no Guest.
> _Imported from GitHub [amaurycoudr/chess-project#377](https://github.com/amaurycoudr/chess-project/issues/377), opened by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-10-11 16:26 UTC._ <!-- github-issue:377 --> --- ## Parent #355 ## What to build `Game.pgn` in the engine takes a result token from its caller, for endings that **Status** cannot express: a **Resignation** or an agreed **Draw**, which the engine never produces itself (ADR 0017). Without a result token, it derives the token from **Status** as it does today. The **Game** page gains "Export PGN". It builds the file in the browser from the line, with these tags: - White and Black: "Guest"; - Date: when the **Game** ended; - Site: the page URL; - Result: from how the **Game** ended. The file is named after the **Game**'s id. New strings go in English and French. Seam: the front views (the **Game** view). The result override is tested at the engine barrel, in the existing PGN tests. ## Acceptance criteria - [ ] The engine's PGN uses a result token the caller passes, and falls back to the one derived from **Status** when none is passed. - [ ] Exporting a resigned **Game** gives the winner's result. An agreed **Draw** gives `1/2-1/2`, and a **Checkmate** or other **Draw** matches its ending (story 20). - [ ] The file's White and Black tags are "Guest", Date is the ended date, Site is the page URL, and the file is named after the id. - [ ] Export works for a reader with no **Guest**.
root commented 2026-10-11 16:26:42 +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: #375
  • Blocking: #378
> _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: #375 - Blocking: #378
root commented 2026-10-13 08:39:46 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #378

mentioned in issue #378
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 #375

mentioned in issue #375
root commented 2026-10-13 08:42:28 +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:36 +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 08:42:37 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #378

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

mentioned in merge request !515

mentioned in merge request !515
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-14 09:36:59 +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#377
No description provided.