Skip to content

Archive MAX seat flags daily on a public data branch - #4

Merged
davd-gzl merged 1 commit into
mainfrom
archive-max-seats
Oct 5, 2026
Merged

davd-gzl merged 1 commit into
mainfrom
archive-max-seats

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Before: the SNCF feed only shows today's MAX seats, so the seat history is gone each day.

After: a daily workflow saves one snapshot per day to the public data branch (archive/max/YYYY/YYYY-MM-DD.json.gz). Once a couple of months have built up, seat odds can be computed from it by weekday, departure time and days before travel.

How: scripts/archive-max.ts stores each service (origin, destination, train, departure) once, with one character per day of the feed window (1 free, 0 full, . not running), and gzips it. The workflow runs at 14:00 UTC, after the 13:30 publish. It creates the orphan data branch on its first run, and never overwrites a day that's already archived. The format is in docs/archive.md. Nothing in the shared build code changes.

Tested with unit tests on the fixture, plus two simulated workflow runs against a local remote. The first run created the branch and the snapshot. The second left the day as it was.

Replaces #2, which was the same change on a different branch name.


Generated by Claude Code

The SNCF feed only shows today's seats, so seat odds need history. A daily
workflow saves one gzipped snapshot per day to the data branch, each service
stored once with a flag per day, and never overwrites a day.
@davd-gzl davd-gzl self-assigned this Oct 5, 2026
@davd-gzl
davd-gzl merged commit 2067283 into main Oct 5, 2026
4 checks passed
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.

1 participant