Serve the picks from the API, so the live picker reads them #9

Merged
mesh-tools merged 2 commits from fix/picker-reads-picks into master 2026-11-30 09:25:39 +00:00
Collaborator

The live photo picker (https://f1-circuits.zurag.be/examples/picker.html) showed two red errors, "Could not read the layouts' picks (circuits/photos.json): HTTP 404" and the same for seasons/photos.json. The page read the picks relative to itself, and the API serves only /examples/; /circuits/photos.json even falls into the /circuits/{country} route.

  • 7809840 writes the lead's lines and answers of 2026-11-30 into docs/posters.md (Picking photos).
  • 2508287 builds them: the API serves the two picks files read-only, as the poster service has them loaded (notes first, a refused entry left out), at /picks/circuits.json and /picks/seasons.json, with the CORS of every route and no Cache-Control, listed in the root index. The picker reads them from the API base and falls back to the repository's files only on file: or a loopback host. The picks loader moved into poster_sources.py (class Picks); the review confirmed the posters draw exactly what they drew.

Checked: merge-check.sh passes with 32 tests. The new test fails on an assertion when the notes are left out or a changed file is not read again. A merge with fix/madring-trace is clean both ways and passes 33 tests. The picker served by the API shows no error (screenshot on a test host; the live site follows once this is delivered).

Reviewed-by: mesh-code-reviewer for f1-reply@shanks at 250828710c

https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W

The live photo picker (https://f1-circuits.zurag.be/examples/picker.html) showed two red errors, "Could not read the layouts' picks (circuits/photos.json): HTTP 404" and the same for seasons/photos.json. The page read the picks relative to itself, and the API serves only /examples/; /circuits/photos.json even falls into the /circuits/{country} route. - 7809840 writes the lead's lines and answers of 2026-11-30 into docs/posters.md (Picking photos). - 2508287 builds them: the API serves the two picks files read-only, as the poster service has them loaded (notes first, a refused entry left out), at /picks/circuits.json and /picks/seasons.json, with the CORS of every route and no Cache-Control, listed in the root index. The picker reads them from the API base and falls back to the repository's files only on file: or a loopback host. The picks loader moved into poster_sources.py (class Picks); the review confirmed the posters draw exactly what they drew. Checked: merge-check.sh passes with 32 tests. The new test fails on an assertion when the notes are left out or a changed file is not read again. A merge with fix/madring-trace is clean both ways and passes 33 tests. The picker served by the API shows no error (screenshot on a test host; the live site follows once this is delivered). Reviewed-by: mesh-code-reviewer for f1-reply@shanks at 250828710ce5358fb2716cda1240f5fa3a4225bc https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W
mesh-tools added 2 commits 2026-11-30 09:19:51 +00:00
The operator's symptom of 2026-11-30: the live picker showed two HTTP 404
errors, one for circuits/photos.json and one for seasons/photos.json,
each with a "Load it from disk" box. The page read the picks relative to
itself, and the API serves only /examples/.

These are the lead's lines and answers of 2026-11-30, written into
Picking photos. The API serves both picks files, read-only, as the poster
service has them loaded, at /picks/circuits.json and /picks/seasons.json:
the notes first, then the entries it draws from, a refused entry left out.
Both routes have the CORS of every route and, like the other JSON routes,
no Cache-Control (answer Q1). The picker reads them from the API base and
falls back to the repository's files only on file: or a loopback host:
localhost, 127.0.0.1, [::1] (answer Q2).

Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W
The picker read circuits/photos.json and seasons/photos.json relative to
itself. The API serves only /examples/, so the live page showed two HTTP
404 errors and a "Load it from disk" box for each.

The API now serves both picks files, read-only, at /picks/circuits.json
and /picks/seasons.json. Each answer is the file as the poster service
has it loaded, from the same loader it draws from: the notes first, then
the entries, a refused entry left out. The root route lists both routes.

The picker reads them from the API its site picks. Only a page opened
from a working copy (file:, or a loopback host) falls back to the
repository's files. A failure names each address and why.

Builds: docs/posters.md, Picking photos, as written in 780984064f (the lead's lines 1-4 of 2026-11-30 and answers Q1, Q2)

Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W
mesh-tools merged commit 7cee693a2c into master 2026-11-30 09:25:39 +00:00
mesh-tools deleted branch fix/picker-reads-picks 2026-11-30 09:25:40 +00:00
Author
Collaborator

{
"records": [
{
"instance": "record/master_4_76c7f363",
"sequence": 199737,
"bytes": 903,
"of-bytes": 65536,
"record": {
"milestone": "master.4",
"branch": "master",
"source": 4,
"call": "19de7a5fc2176dbd",
"heads": {
"jschoubben/f1-circuits@10": "072bbcc023c8a2ed00f43a83dc87dea98a20dcef",
"jschoubben/f1-circuits@9": "7cee693a2cd5448473ea4e611b00ac6a3bc041c6"
},
"opened": "2026-11-30T09:25:42.359148625Z",
"form": 3,
"trace": {
"from": "1039",
"to": "1039"
},
"ended": {
"at": "2026-11-30T10:51:58.458320203Z",
"why": "every present node runs its entries"
},
"ends": 1,
"pipeline-ends": 1,
"movers": 1,
"merge-called": "2026-11-30T09:25:42.355Z",
"phases": {
"build": {
"end": "2026-11-30T10:49:44.877348964Z",
"start": "2026-11-30T10:49:42.325131077Z"
},
"composition": {
"end": "2026-11-30T10:49:50.873243084Z",
"start": "2026-11-30T10:49:50.635963608Z"
},
"ended": "2026-11-30T10:49:50.873243084Z",
"placed": "2026-11-30T10:49:42.325131077Z",
"taken": "2026-11-30T09:25:53.164700174Z",
"validate": {
"end": "2026-11-30T10:49:50.635963608Z",
"start": "2026-11-30T10:49:42.325131077Z"
}
}
},
"movers-per-outcome": {
"bypassed": 1,
"could not run": 1,
"nothing to run": 1,
"passed": 1,
"taken-in": 1,
"waiting": 1,
"wanted": 1
}
}
]
}

<!-- mesh-delivery:view --> { "records": [ { "instance": "record/master_4_76c7f363", "sequence": 199737, "bytes": 903, "of-bytes": 65536, "record": { "milestone": "master.4", "branch": "master", "source": 4, "call": "19de7a5fc2176dbd", "heads": { "jschoubben/f1-circuits@10": "072bbcc023c8a2ed00f43a83dc87dea98a20dcef", "jschoubben/f1-circuits@9": "7cee693a2cd5448473ea4e611b00ac6a3bc041c6" }, "opened": "2026-11-30T09:25:42.359148625Z", "form": 3, "trace": { "from": "1039", "to": "1039" }, "ended": { "at": "2026-11-30T10:51:58.458320203Z", "why": "every present node runs its entries" }, "ends": 1, "pipeline-ends": 1, "movers": 1, "merge-called": "2026-11-30T09:25:42.355Z", "phases": { "build": { "end": "2026-11-30T10:49:44.877348964Z", "start": "2026-11-30T10:49:42.325131077Z" }, "composition": { "end": "2026-11-30T10:49:50.873243084Z", "start": "2026-11-30T10:49:50.635963608Z" }, "ended": "2026-11-30T10:49:50.873243084Z", "placed": "2026-11-30T10:49:42.325131077Z", "taken": "2026-11-30T09:25:53.164700174Z", "validate": { "end": "2026-11-30T10:49:50.635963608Z", "start": "2026-11-30T10:49:42.325131077Z" } } }, "movers-per-outcome": { "bypassed": 1, "could not run": 1, "nothing to run": 1, "passed": 1, "taken-in": 1, "waiting": 1, "wanted": 1 } } ] } <!-- mesh-act:view.record/master_4_76c7f363.jschoubben/f1-circuits#9@1796035918466209273.324ffce4 -->
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jschoubben/f1-circuits#9