gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0553b51f0553b51ftracker#19 (mission 066): franchises and timelines — tables, /franchises, /franchises/<slug>, /timelines/<slug> (Timeline | Release sort, series by last episode), the Prequel | Timeline | Sequel widget with the franchise above, the creator's editor, TMDB collection seed in the app (resumes, paced); gate tests/franchises.mjs 48/0 + browser.mjs 266/0, tests/realdata-066.mjs, docs/franchises.md, README + STATUSmre0553b51f/README.md

84.1 KB

  1. # tracker.worldapi.org
  2. The new tracker: a Hybriel app that will track the TV shows (and later movies) the creator
  3. follows and watches. **`CONCEPT.md` (the creator's) is the source of truth** — read it first;
  4. nothing is built that it does not describe. Built step by step, one ticket per step
  5. (tracker.worldapi.org#1, #2, …).
  6. **Built so far — step 1 (ticket #1)**: the shell. The header carries the ident login (an
  7. identity selector, like calendar/gitoria) and sign-out; the homepage itself stays empty. No
  8. design carried over from the old app.
  9. **Step 2 (ticket #2)**: the old tracker's MongoDB export is now in `storage/mpackdb/` (new
  10. mpackdb ids, every reference re-pointed) — see "Data" and `STATUS.md`. Nothing is shown in the
  11. UI yet; the homepage still renders empty. That is a later step, from the creator.
  12. **Step 4 (ticket #4)**: the show page, `/shows/:slug` (`components/show.hl`) — poster, title,
  13. genre pills, plot, cast (as described in "What it does (step 4)" below), every season with its
  14. episodes, and the watch check (episode and season, season bulk-toggles its episodes).
  15. **Step 5 (ticket #5)**: `/unwatched` (`components/unwatched.hl`) — every already-released,
  16. unwatched episode of a show the signed-in user follows, newest release first (see "What it does
  17. (step 5)" below).
  18. **Step 6 (ticket #6)**: `/schedule` (`components/schedule.hl`) — every not-yet-released episode
  19. of a show the signed-in user follows, soonest first, no check icons (see "What it does (step 6)"
  20. below).
  21. **Step 7 (ticket #7)**: `/my/shows` (`components/myshows.hl`) — every show the signed-in user
  22. follows, newest follow first: small poster, title, last watched episode (`S08E35`) (see "What it
  23. does (step 7)" below). The homepage itself is still empty.
  24. **Step 8 (ticket #8)**: the personal lists all live under `/my/`: `/my/shows`, `/my/unwatched`,
  25. `/my/schedule` (old `/unwatched`, `/schedule` answer 301). Episodes everywhere as `S01E01`, show
  26. titles in lists with the year (`Doctor Who (2005)`), "1 episode" singular, and every `/my/` page
  27. under 1 s full load on the real data (see "What it does (step 8)" below).
  28. **Step 9 (ticket #9)**: the TMDB sync — every show someone follows gets its new seasons/episodes
  29. (existing ones updated: title, summary, release) and its poster from TMDB, once a day inside the app
  30. (04:00 UTC) and on demand with `tools/sync-tmdb.hl` (see "What it does (step 9)" below).
  31. **Step 10 (ticket #10)**: an installable app (PWA) with its own icon — a TV with a check mark, tracker green
  32. on dark; also the favicon. The shell (`/`) opens without network and says it is offline (see "What it does
  33. (step 10)" below).
  34. **Step 12 (ticket #12)**: the show page's header has small link icons to the show on TMDB, IMDb, TheTVDB and
  35. TVmaze (a movie: TMDB + IMDb), only for the ids the show has, each in a new tab; the TMDB sync fills missing
  36. ids (TMDB `external_ids`, TVmaze lookup) and never overwrites one (see "What it does (step 12)" below).
  37. **Step 13 (ticket #13)**: the homepage has content — signed in, four big icons (Unwatched, Schedule, Shows,
  38. Movies → the `/my/` pages); for everyone a short text about the site, the 10 latest released movies and the 10
  39. series with the newest released episode (headings link to `/movies` and `/shows`: everything, 24 per page). Plus
  40. `/my/movies` (the movies you follow); `/my/shows` is series only now (see "What it does (step 13)" below).
  41. **Step 15 (ticket #15)**: the daily sync also asks TVmaze for every series and adds what TVmaze has but TMDB not
  42. yet — new episodes/seasons, missing titles and air dates; TMDB values are never overwritten (see "What it does
  43. (step 15)" below).
  44. **Step 14 (ticket #14)**: the search — a magnifier in the header opens `/search`; typing searches OUR shows, movies and
  45. people at once (in-memory index), "Fetch from web" lists TMDB titles we don't have yet, "Add" imports one like the daily
  46. sync and opens its page (signed out: the sign-in modal) (see "What it does (ticket #14)" below).
  47. **Mission 054**: adult titles never appear in the public lists (homepage rows, `/movies`, `/shows`) or the search (ours and
  48. "Fetch from web") — only titles TMDB says are NOT adult are listed, unknown counts as hidden. A followed title stays on the
  49. user's `/my/` pages and its page. A background job in the app (the "adult backfill") asks TMDB once per title for the
  50. adult flag, the poster and the external ids (see "What it does (mission 054)" below).
  51. **Step 16 (ticket #16)**: person pages — `/person/<slug>` (the show page's cast and the search's people link there): name,
  52. photo, born/died, a short bio, the filmography (poster, title, year, role, newest first). A person we don't have complete yet is
  53. fetched from TMDB on the first visit (person + all credits, every missing title added), the page fills in without a reload
  54. (see "What it does (ticket #16)" below).
  55. **Mission 060 (ticket #27)**: every movie, series and person has a 5-character short id (`shortId`, like `a9s9a`) shown
  56. under its poster / photo; the 702 titles the old tracker numbered keep theirs (`100jh`…); `/<shortId>` answers 301 to the page
  57. (see "What it does (mission 060)" below).
  58. Written in **Hybriel** on **hl:web**, same stack and conventions as `ident.worldapi.org`
  59. (vendored plugins/binary copied from there, see "Vendored Hybriel").
  60. ## Run (dev, Loreana)
  61. ```bash
  62. cd /media/STORAGE/projects/tracker.worldapi.org
  63. TRACKER_PORT=8700 TRACKER_SYNC=0 setsid nohup ./bin/hybriel project.hl > server.log 2>&1 < /dev/null & echo $! > server.pid
  64. # TRACKER_SYNC=0: the runtime loads .env (real TMDB token) by itself — without it a dev server syncs from TMDB at 04:00 UTC
  65. # stop: kill $(cat server.pid)
  66. ```
  67. * Config (env; the real environment outranks nothing here — there is no `.env` reader in
  68. project.hl, unlike ident's SMTP settings — set these in the shell or `docker-compose.yml`):
  69. | Variable | Default | |
  70. |---|---|---|
  71. | `TRACKER_PORT` | 45008 | |
  72. | `TRACKER_URL` | `http://127.0.0.1:<port>` | this app's own origin — the ident login button's `return=` is built from it |
  73. | `IDENT_URL` | `https://ident.worldapi.org` | |
  74. | `TRACKER_KEY` / `TRACKER_SECRET` | `''` | this app's API key + secret, from ident's `/apps` (register once, origin = `TRACKER_URL`) — **not set yet on Byrodin**: the first deploy (architect) registers the app in the live ident and puts these in `.env` next to `docker-compose.yml`, exactly like ident's own `.env` holds its SMTP settings |
  75. | `TRACKER_WATCH` | on | `0` = no dev watcher (the container) |
  76. | `TRACKER_STORAGE` | `./storage/mpackdb` | the `usersTable` directory |
  77. | `TRACKER_SESSIONS` | `./.sessions` (hl:web's own default) | this app's own session store |
  78. | `HL_HOST` (or `HOST`) | 0.0.0.0 | interface to bind; `127.0.0.1` on Byrodin |
  79. | `TMDB_READ_TOKEN` | — | TMDB v4 read token (in `.env`, never print it). Unset → the daily sync is off. **The runtime loads the `.env` beside `project.hl` by itself** (the real environment wins): every dev server on Loreana has the real token — start dev servers with `TRACKER_SYNC=0` |
  80. | `TRACKER_SYNC` | on | `0` = no daily TMDB run inside the app |
  81. | `TRACKER_SYNC_HOUR` | 4 | UTC hour of the daily run (hl:time has no time zones; the container is UTC) |
  82. | `TMDB_BASE_URL` / `TMDB_IMAGE_URL` | `https://api.themoviedb.org/3` / `https://image.tmdb.org/t/p` | the gate points both at its fake TMDB |
  83. | `TVMAZE_BASE_URL` | `https://api.tvmaze.com` | #12: the TVmaze id lookup; the gate points it at its fake (`<fake>/tvmaze`) |
  84. | `TRACKER_BACKFILL` | on | mission 054: `0` = no adult-flag backfill (off too without `TMDB_READ_TOKEN`). **A dev server with the real token runs it** — it only writes the storage it was given, but asks real TMDB |
  85. | `TRACKER_BACKFILL_LOG_EVERY` | 500 | a progress line every N titles |
  86. | `TRACKER_OLD_SHORT_IDS` | `./data/old-short-ids.json` | mission 060: the old tracker's short ids (`oldId` → id), part of the code (deployed with it) |
  87. | `TRACKER_SHORTIDS` | on | mission 060: `0` = no short-id backfill (the gate's resume check; ids for NEW records are still given) |
  88. | `TRACKER_SHORTID_BUDGET_MS` | 40 | mission 060: ms of work per backfill batch (one batch per 0.1 s tick) |
  89. | `TRACKER_SHORTID_LOG_EVERY` | 5000 | mission 060: a progress line every N records |
  90. | `TRACKER_COLLECTIONS` | on | #19: `0` = no TMDB collection seed (off too without `TMDB_READ_TOKEN`; the main gate sets `0`). **A dev server with the real token runs it** against the storage it was given |
  91. | `TRACKER_COLLECTIONS_LOG_EVERY` / `TRACKER_COLLECTIONS_PERSIST_EVERY` | 500 / 25 | #19: a progress line / a persist every N movies |
  92. | `TRACKER_EDITORS` | `az5b2` | #19: ident ids (comma list) allowed to edit franchises and timelines (the gate sets its own) |
  93. Without `TRACKER_KEY`/`TRACKER_SECRET`, `/` still renders (signed out, the selector and "Log
  94. in with ident" show in the header); a login attempt answers `'login is not set up on this
  95. server (TRACKER_KEY / TRACKER_SECRET missing)'` instead of exchanging a code — so the app is
  96. never a dead 500 while waiting for that one-time setup.
  97. ## What it does (step 1)
  98. * **Login, copied unchanged from calendar.worldapi.org** (rejected once for a centered
  99. sign-in and no header selector — architect, 2026-09-27): ident only, no own passwords
  100. (ident's login button flow, ident.worldapi.org README "How apps use ident"), the identity
  101. selector (`<ident-selector>`, ident's `/selector.js`) sits in the header
  102. (`components/main.hl`, `userBox`), a plain "Log in with ident" link beside it when signed
  103. out. Choosing an identity in the selector fires `ident-login` (one-time code); `login.js`
  104. (an external-component bridge, allowed per the creator: "login.js is correct, as thats for
  105. externals in general") hands the code to a hidden input, whose `change` calls the server
  106. face `trackerLogin` (`users.hl` `exchangeCode`, `POST <ident>/api/exchange` — nothing else:
  107. ident does not hand over a display name yet, ident#23 done / ident#11 on hold), which makes
  108. or finds this app's own user record (`usersTable`, `storage/mpackdb/users.db`) and sets
  109. `session.user = { id }`. `/login/callback` is the same exchange as a plain redirect (the
  110. login button's return URL) for a client that has no socket yet. "Log out" in the header
  111. calls `trackerLogOut`; ident's own login is untouched. This app's own session cookie is
  112. `trackersid` (cookies ignore ports, an own name keeps it apart from ident's `identsid` on
  113. the same dev host, hybriel#10/#17).
  114. * **The empty homepage** (until #13 — see "What it does (step 13)") (`/`, `components/home.hl`): no content at all, signed in or out —
  115. the header alone carries the login state. Nothing else.
  116. * **One mpackdb table**: `storage/mpackdb/users.db` (`identity` → this app's user id — no
  117. display name, no other per-user data yet). Step 2 (tracker.worldapi.org#2, open) brings the
  118. old tracker's data across.
  119. ## What it does (step 4)
  120. `/shows/:slug` (`components/show.hl`, slug = the migrated `urlSegment`), read-only data from
  121. `shows.hl`, per-user watch state from `watches.hl` (both reused as-is by `/unwatched` and
  122. `/schedule`, tickets #5/#6 — "reuse, don't copy"):
  123. * **Header**: poster on the left (`/posters/<name>`, `project.hl` `posterRoute` — served from
  124. `storage/mpackdb/posters/`; the real poster files were never in the Mongo backup, see
  125. `DECISIONS.md` "tracker concept" — a placeholder SVG shows until a later TMDB step brings
  126. real ones back), title, genre pills (blue, link to `/genre/<slug>`) and the plot summary to
  127. its right, the cast below as comma-separated red links to `/person/<slug>`.
  128. * **Seasons**, latest first, the latest expanded and every other one collapsed to start; each
  129. row: a round check icon (a disc with a check, drawn in SVG/CSS, no icon font), the season
  130. title/number, its episode count. Its episodes (number + title, and their own check icon)
  131. show once expanded (click the row to toggle).
  132. * **The watch check** (signed-in only — signed out, no check icons show at all): clicking an
  133. episode's check toggles that one watch; clicking a season's check toggles the season's own
  134. watch AND every one of its episodes at once (`watches.hl` `setSeasonWatched`). Every click is
  135. a server round trip (`emit server showToggleEpisode` / `showToggleSeason`; collapse/expand: see
  136. ticket #17 below) that rebuilds the row list server-side and reassigns it whole — a season has
  137. at most a few dozen episodes, cheap. A **Hybriel gap found here** (filed as hybriel#115,
  138. reported after this ticket's first attempt): a plain per-instance member function that calls
  139. an hl:mpackdb-backed import comes back `null` when called from inside an `on server` face,
  140. even though the very same call works as a member's own top-level initializer — the fix is to
  141. declare such helpers `static` (the same shape calendar.worldapi.org's `soonOf` already uses).
  142. `components/show.hl`'s own helpers (`buildRows`, `genreRowsOf`, …) are `static` for exactly
  143. this reason.
  144. * **Data fix**: `tools/relink-episode-seasons.hl`, a one-off idempotent tool that links every
  145. episode whose `season` was still null in the migrated data (36,194 of them, ticket #2) to its
  146. season by matching `(show, seasonNumber)` — never touches an episode whose season is already
  147. set, never runs `update()` on the live table (hybriel#113; it rebuilds a fresh episodes table
  148. and swaps the files over, the same rule `tools/migrate.hl` follows). Not run against the live
  149. data yet — the architect runs it (stop the container first, `storage/mpackdb` is not shared
  150. across processes, hybriel#21).
  151. ## What it does (step 5)
  152. `/unwatched` (`components/unwatched.hl`): every episode of a show the signed-in user follows
  153. (`follows.hl`, new) that is already released (`release` ≤ today) and not yet watched
  154. (`watches.hl` `isWatched`), newest release first. Creator: "/unwatched lists all unwatched
  155. episodes of shows followed in release date desc order"; "check icon is a disc with a check in
  156. it" — the SAME icon/class (`watches.hl` `watchClassOf`, moved there from `components/show.hl` so
  157. both pages share one definition instead of each declaring its own) and the same
  158. `setWatched`/`isWatched` watch logic as the show page (step 4), not copied.
  159. * Each row: check icon, the show's title (linking to `/shows/:slug`), "Ep `<number>` ·
  160. `<title>`", the release date.
  161. * A row only ever shows an unwatched episode, so a click always marks it watched (never toggles
  162. back, unlike the show page's checks) — the row leaves the list. Signed out: no rows, a
  163. "Sign in to see the shows you follow." message instead.
  164. * `follows.hl` (new): read-only per-user follow data (`followedShowIds`), kept apart from
  165. `shows.hl`/`watches.hl` the same way, for `/schedule` (ticket #6) to reuse.
  166. ## What it does (step 6)
  167. `/schedule` (`components/schedule.hl`): every episode of a show the signed-in user follows
  168. (`follows.hl`) that is NOT yet released (`release` > today), soonest first. Creator: "/schedule
  169. has a similar list without check icons for the upcoming episodes of shows followed" — same row
  170. layout as `/unwatched` (show title linking to `/shows/:slug`, "Ep `<number>` · `<title>`", the
  171. release date), minus the check icon and minus any click handling: the page is read-only, so it
  172. needs no `on server` face at all. Signed out: no rows, the same "Sign in to see the shows you
  173. follow." message as `/unwatched`.
  174. ## What it does (step 7)
  175. `/my/shows` (`components/myshows.hl`): every show the signed-in user follows, ordered by the
  176. follow's `at` (epoch ms), newest first. Creator: "trackers /my/shows that just ists the shows in
  177. desc order i followed them, small poster, title, last episode like s08e35". Read-only, no `on
  178. server` face (like `/schedule`).
  179. * Each row: a small poster (2.5rem wide, the same `/posters/<name>` route + placeholder as the show
  180. page; a show with no poster name at all gets `/posters/none`, i.e. the route's placeholder), the
  181. title linking to `/shows/<slug>`, and the **last watched episode** as `SxxEyy` (zero-padded to
  182. two digits) = the HIGHEST season/episode number the user has an episode watch for (architect's
  183. reading, in the ticket) — not the most recently watched one; season watches alone don't count.
  184. Nothing watched → no episode element at all.
  185. * Signed out: no rows, the same "Sign in to see the shows you follow." as `/unwatched`.
  186. * Cost: touches only the user's follows + episode watches (one `episodeById` fetch per watch),
  187. never all episodes of a followed show — 128 rows in ~0.2 s on a copy of the real data (STATUS.md).
  188. * Reuse: `follows.hl` `followsOfUser` (new — the whole follow record, `followedShowIds` now
  189. builds on it), `shows.hl` `episodeById` (new, one line), `showById`, `posterName`, `watches.hl`
  190. `watchesOfUser`.
  191. ## What it does (step 8)
  192. * Routes (`project.hl`): `/my/unwatched`, `/my/schedule`; the old `/unwatched`, `/schedule` are
  193. function routes answering **301** to them (`movedTo`, no query carried — the pages take none).
  194. * `shows.hl` (shared by all lists): `episodeCode(s, e)` → `S01E01` (`/my/shows`, `/my/unwatched`,
  195. `/my/schedule` rows: `S01E02 · <title>`), `titleWithYear(show)` → `Doctor Who (2005)` (`year`,
  196. else the first 4 chars of `release`, else the bare title — 197 shows have no `year`), `pad2`,
  197. `posterUrlOf(show)`. The show page's own `h1` stays without the year (it is not a list).
  198. * Show page: season count `1 episode` / `N episodes`.
  199. * **Speed** (the creator's real data: 128 follows, 11,692 watches, 831 unwatched rows):
  200. * `/unwatched` was ~15 s: `isWatched` scanned all 11,692 watches per episode. Now
  201. `watches.hl` `watchedSet(rows)` builds `'<type>:<id>' → true` ONCE; `/my/unwatched` and the
  202. show page's `buildRows` look up that map. Now ~0.6 s server render (the rest is fetching
  203. every episode of 128 shows; the insertion sort is ~50 ms).
  204. * `/my/shows` "25 s full load while data takes 0.2 s": (1) **hl:web serves one request at a
  205. time** — measured: a `/my/shows` request made during a 15 s `/unwatched` render waited 13.7 s;
  206. every poster request of every visitor queues the same way. Fixing `/unwatched` removes that.
  207. (2) 128 rows = 128 different `/posters/<oldId>.jpg` URLs, all answering the same placeholder
  208. (no poster files exist yet) — 128 requests per load. `posterUrlOf` now gives rows without a
  209. poster FILE the one URL `/posters/none` → 1 request, cached.
  210. * How it was measured: see STATUS.md ticket #8 ("Real-data check").
  211. ## What it does (step 9)
  212. `tmdbsync.hl` (`syncShow`), run by the app every day and by `tools/sync-tmdb.hl`:
  213. * **Which shows**: every show ANY user follows (`follows.hl` `allFollowedShowIds`, 126 on the real data).
  214. * **Per show** (1 + ⌈seasons/20⌉ requests + the poster if new): `GET /tv/<tmdbId>?append_to_response=external_ids`
  215. (status, counts, overview, `poster_path`, the season list, since #12 the external ids), then `GET /tv/<tmdbId>?append_to_response=season/1,…` (≤ 20
  216. seasons with their episodes per request). Bearer `TMDB_READ_TOKEN`.
  217. * **Matching, never duplicating, never deleting**: episode by `tmdbId`, else (161 migrated episodes have
  218. none) by S/E number if that one has no tmdbId yet — then it gets the tmdbId; season by (show,
  219. seasonNumber) (migrated seasons have no tmdbId). Existing episodes/seasons: title, summary, release
  220. updated; an empty TMDB value never overwrites. New ones: self-assigned 16-hex ids (NOT mpackdb's own —
  221. hybriel#113), `oldId = 'tmdb-episode:<id>'` / `'tmdb-season:<showTmdb>:<n>'` (the tables' `!oldId`
  222. index), linked into `season.episodes` / `show.seasons`. Show: `status`, `seasonsCount`,
  223. `episodesCount`, `tmdbSummary`, `tmdbPoster`, `tmdbSync` (ms). Season 0 (specials) only for a show that
  224. already has one; a TMDB season with no episodes is not created.
  225. * **Posters**: TMDB `poster_path`, size w342 → `storage/mpackdb/posters/<oldId>.<ext>` (the folder the
  226. existing `/posters/:name` route already served; inside `storage/` → in the nightly backup), `show.image`
  227. set to the ext. Downloaded again only when the file is missing or TMDB's `poster_path` changed.
  228. * **Daily run inside the app** (`project.hl` `syncTick`): an hl:time `every(1)` clock; at
  229. `TRACKER_SYNC_HOUR` (UTC), once per day, it queues all followed shows and then syncs ONE show per tick.
  230. hl:web serves one request at a time and `fetch()` blocks the whole process, so a step blocks requests
  231. for its duration (real data: ~0.7 s average, Saturday Night Live 53 seasons ~1.7 s; logged as
  232. `tmdb sync: slow step …` above 1.5 s) — requests queued meanwhile are served between two ticks; a tick
  233. never runs inside a page render. After a show with n requests the next waits n × 260 ms (TMDB ≤ 40
  234. requests / 10 s). Log: `tmdb sync: daily at 4:00 UTC`, `tmdb sync: start, N followed shows`,
  235. `tmdb sync done: shows=… newSeasons=… newEpisodes=… updatedEpisodes=… updatedSeasons=… posters=…
  236. requests=… errors=… seconds=…` (`docker logs tracker.worldapi.org | grep tmdb`). Tables are persisted
  237. every 10 shows and at the end (~36 ms).
  238. * **The tool** (same sync, sequential, paced; prints one line per show + the totals). **App stopped or a
  239. COPY only** — hl:mpackdb is one process per storage (hybriel#21):
  240. ```bash
  241. set -a; . ./.env; set +a # TMDB_READ_TOKEN, never print it
  242. TRACKER_STORAGE=$PWD/.scratch/realdata/storage/mpackdb ./bin/hybriel tools/sync-tmdb.hl [--limit N]
  243. ```
  244. * Real data (copy, 2026-09-30): first run 126 shows → +20 seasons, +800 episodes, 2651 episodes
  245. updated, 125 posters (6.4 MB), 380 requests, 0 errors, 186 s; a second run: all 0, 255 requests, 90 s.
  246. Details: STATUS.md ticket #9.
  247. ## What it does (step 10)
  248. The installable app, the same way calendar.worldapi.org does it (its ticket #3) — hl:web's own manifest
  249. and service worker from settings in `project.hl`, no JavaScript of ours:
  250. * `appIcons` (192 + 512 PNG, each `any` and `maskable`), `appTouchIcon` (180 PNG), `appFavicon`
  251. (`/icons/favicon.svg`), `appThemeColor` = token `darker` (the header, rgb(15, 20, 25)),
  252. `appBackgroundColor` = token `dark` (rgb(25, 30, 35)); name = `appTitle` "tracker". hl:web serves
  253. `/__hl/manifest.webmanifest` (start_url/scope `/`, display standalone) and links it, the
  254. apple-touch-icon and theme-color from every head. `/favicon.ico` is a real icon (16/32/48) for
  255. browsers that ask for it themselves. Each icon has its own `file` route in `project.hl`.
  256. * **Icons** (`icons/`): `icon.svg` is the source (512, hand-written: a TV with antennas and a check on
  257. the screen, `#4ec9b0` on rgb(25,30,35); everything inside the maskable safe zone, a circle of radius
  258. 204, so one image serves `any` and `maskable`); `favicon.svg` is the same drawing cropped tight on a
  259. rounded tile. Rendered on Loreana:
  260. ```bash
  261. rsvg-convert -w 192 -h 192 icons/icon.svg -o icons/icon-192.png
  262. rsvg-convert -w 512 -h 512 icons/icon.svg -o icons/icon-512.png
  263. rsvg-convert -w 180 -h 180 icons/icon.svg -o icons/apple-touch-icon.png
  264. for s in 16 32 48; do rsvg-convert -w $s -h $s icons/favicon.svg -o /tmp/fav-$s.png; done
  265. magick /tmp/fav-16.png /tmp/fav-32.png /tmp/fav-48.png icons/favicon.ico
  266. ```
  267. * **Offline**: `offline = [ Home ]` — the worker precaches the shell (runtime, modules, CSS, manifest,
  268. icons, favicon) and the document of `/`. Navigations are network-first; without a network `/` comes
  269. from the cache and every other page gets hl:web's own "Unavailable offline" page (503) — data pages
  270. need the network, no offline data. The shell (`components/main.hl`) shows "You are offline. Your shows
  271. and lists need the network." while `navigator.onLine` is false: hl:web gives a page no connection
  272. state and no mount hook, so an invisible `netProbe` runs an endless 1 s CSS animation (`styles.hl`
  273. `@keyframes tracker-net-tick`) and its `animationiteration` handler reads `navigator.onLine` (a write
  274. only when it changes). A server that is down while the device is online shows no note.
  275. ## What it does (step 12)
  276. * **Link icons** (`components/show.hl`, `shows.hl` `externalLinksOf`, `styles.hl` `showLinks`/`a.extlink`): under the
  277. title (phone: between the title row and the full-width poster; desktop: under the title, right of the poster) one
  278. small monochrome badge per id the show HAS — `TMDB` https://www.themoviedb.org/tv/<tmdbId> (a movie: `/movie/<id>`),
  279. `IMDb` https://www.imdb.com/title/<imdbId>/, `TVDB` https://thetvdb.com/dereferrer/series/<tvdbId>, `TVmaze`
  280. https://www.tvmaze.com/shows/<tvmzId>. A movie (`type = 'movie'`) shows only TMDB + IMDb. Each `target="_blank"
  281. rel="noopener"`. CSS only (muted grey badge, dark text, accent on hover), no copied logos. URL forms checked
  282. 2026-10-01: all four 301 to the site's slug page (TheTVDB's old `?tab=series&id=` too; `dereferrer` is its id form).
  283. * **Sync** (`tmdbsync.hl` `externalIdsFor`): the details request carries `append_to_response=external_ids` (no extra
  284. request); a MISSING `imdbId` (`tt` + digits) / `tvdbId` (number > 0) is filled from it. A show still without
  285. `tvmzId` → `GET <TVMAZE_BASE_URL>/lookup/shows?imdb=tt…`, on 404 `?thetvdb=<id>` (hl:fetch follows TVmaze's 301 to
  286. `/shows/<id>`); 550 ms pause per lookup (TVmaze 20 / 10 s) — both runners wait `pauseMsAfter(r)`. **An id the show
  287. has is never overwritten.** Totals gain `ids=` (ids filled) and `tvmazeRequests=`.
  288. * **Movies** (7814 of 9453 migrated rows are `type = 'movie'`, 1 followed: Star Trek: First Contact): before #12 the
  289. sync asked `/tv/<tmdbId>` for them — a DIFFERENT title on TMDB. Now a movie gets one `GET
  290. /movie/<tmdbId>?append_to_response=external_ids`: missing imdbId + its poster; no seasons/status/overview.
  291. * **Counting ids** (a COPY only): `TRACKER_STORAGE=$PWD/.scratch/realdata/storage/mpackdb ./bin/hybriel
  292. tools/count-external-ids.hl` → per type, all / followed: shows, tmdbId, imdbId, tvdbId, tvmzId.
  293. ## What it does (step 15)
  294. * **TVmaze merge** (`tmdbsync.hl` `mergeTvmaze`, after the TMDB step of `syncShow`, both runners): a series with a
  295. `tvmzId` → `GET <TVMAZE_BASE_URL>/shows/<tvmzId>/episodes` (1 request, 550 ms pause like the lookups). Matched by
  296. season/episode number: a missing episode is ADDED (`tmdbId = null`, `tvmzId`, `oldId 'tvmaze-episode:<id>'`; its
  297. season too if missing: `oldId 'tvmaze-season:<tvmzId>:<n>'`), an existing one gets an EMPTY title / air date
  298. filled. **A TMDB value is never overwritten.** Placeholder titles (`Episode 4`, `Épisode 4`, `Folge 4`, `TBA`,
  299. `isPlaceholderTitle`) count as empty — and TMDB's placeholder no longer overwrites a real title (else they flip
  300. daily). When TMDB lists the episode later, the TMDB step adopts the row by number (it has no tmdbId), TMDB wins.
  301. Skipped: TVmaze specials (no number), season 0 unless the show has one, summaries (TVmaze's are HTML).
  302. * **Numbering check** (`numberingAgrees`): ≥ 80 % of the episodes both know must air within a day OR share the title,
  303. and a show with episodes must share at least one S/E with TVmaze — else TVmaze is ignored for that show
  304. (`tvmazeSkipped`). Real data: The Daily Show (TVmaze seasons by year: would have added 1093 episodes), Star Trek:
  305. Prodigy / Blood & Treasure (TMDB merges double episodes → shifted), Alex Rider / Intergalactic / The Rising (other
  306. premiere dates, placeholder titles) are skipped.
  307. * Totals/tool line gain `tvmazeEpisodes= tvmazeSeasons= tvmazeFilled= tvmazeSkipped=`; `tvmazeRequests` now also
  308. counts the episode lists (≈ 125/day on real data, ~70 s more per daily run).
  309. ## What it does (ticket #14: search)
  310. Creator: "in the actionbar a search symbol that first checks our database and then has a fetch from web button that
  311. actually searches tmdb then for things we dont have yet". `components/search.hl` (page), `search.hl` (index, TMDB, import).
  312. * **Header**: a magnifier (`#searchlink`, SVG) before the ident selector → `/search` (client-side navigation).
  313. * **Address `/search/<text>`, not `/search?q=`**: hl:web gives a page its route params but no query string. A full load gets
  314. the segment already decoded by the server (an encoded `/` would split it → 404), a client-side navigation the raw one —
  315. `queryOfParam` decodes what is left, safely (malformed `%` → literal). While typing the address follows the text
  316. (`history.replaceState`; `/ ? #` become spaces). `/search?q=x` just opens the empty search page.
  317. * **Our database, as you type** (face `searchDb`, no session): `search.hl` builds an **in-memory index once at boot**
  318. (`project.hl` → `ensureIndex`, ~0.6 s on the real data, log line `search index: 9453 titles, 15157 people, 4180 keys,
  319. … ms`): every title/name → words (lower case, apostrophes dropped, punctuation = word break, Latin accents folded; a
  320. title's year is one more word); each word's first 2 and 3 letters are bucket keys. A query reads ONE bucket (its longest
  321. word's first 3 letters, 2 for a 2-letter word) and keeps entries where every query word starts one of the entry's words.
  322. Order: whole name, name starts with the text, first word does, rest; then shorter name; then series before movie, newer
  323. first. ≤ 30 titles ("The first 30 of N titles — type more…") + ≤ 10 people. Under 2 letters: "Type at least 2 letters.".
  324. People link to `/person/<slug>` (no person page yet — same as the show page's cast).
  325. * **Fetch from web** (face `searchWeb`, signed out too): ONE `GET <TMDB>/search/multi?query=…&include_adult=false&page=1`;
  326. people dropped, titles we have (same TMDB id AND kind: `series:<id>` / `movie:<id>`) left out. Poster thumbs straight
  327. from TMDB's image host (`w92`).
  328. * **Add** (face `searchImport`, session): signed out → the sign-in modal, nothing sent. Signed in → `importTitle`: one
  329. `GET /tv/<id>` (or `/movie/<id>`) for the new record (title, overview, first air/release date → year, status, genres
  330. matched to OUR genres by name, language, homepage, tagline; own 16-hex id, `oldId = tmdb-tv-<id>` / `tmdb-movie-<id>`,
  331. `urlSegment` like the migrated ones: `Pluribus`, taken → `-2`…), then **`tmdbsync.hl` `syncShow`** — seasons, episodes,
  332. poster, external ids exactly like the daily sync — `persistSync`, index updated, the public lists too (`catalog.hl`
  333. `refreshCatalogShow`, since the #13/#14 merge); then the show page opens. A title we
  334. already have answers its slug. A failure (TMDB 404 …) is shown on the page ("Could not add it: …"), the lists stay.
  335. Log: `search import: tv 225171 "Pluribus" → /shows/Pluribus (newSeasons=1 newEpisodes=9 posters=1 ids=3 requests=4 errors=0)`.
  336. * An imported title is NOT followed automatically, so the daily sync (followed shows only) does not update it later.
  337. * Hybriel traps (hybriel#121 / #122): no list is ever appended to (replaced whole); no member reads both the route param
  338. `q` and `session`; the gate checks the lists after a failed import (a session face that stays on the page).
  339. ## What it does (ticket #16: person pages)
  340. Creator: "when one clicks on an artist that has no dataset yet the old version fetched that artist and its entire bibilogrqphy
  341. so its profile was complete". `components/person.hl` (page), `people.hl` (data + the fetch).
  342. * **`/person/<slug>`** (slug = the person's `urlSegment`; `people.hl` builds a slug → id map once, ~15k people): photo (TMDB
  343. w185 → `storage/mpackdb/profiles/<oldId>.<ext>`, route `/profiles/:name` like `/posters/:name`; no file → no photo), name,
  344. "Born 4 March 1986 in …", "Died …", the bio (four lines, a click shows all), then **Filmography**: one row per title (cast and
  345. crew of the same title merged: "Hero / Director"), poster (our file, else TMDB's w92 thumb like search's web rows, else the
  346. placeholder), title, year, Movie/Series, role; newest first by the title's release (else year), undated last; each row →
  347. `/shows/<slug>`. Only PUBLIC titles are listed (merge, mission 056: shows.hl `isPublicTitle` = `adult == false`, unknown hidden like the lists) whose credit's TMDB flag is not adult either. Unknown slug →
  348. "Not found".
  349. * **Complete** = `persons.filmographyAt` (ms) set → the page is just read, TMDB never asked again. Not complete (every migrated
  350. person; 153 carry the old tracker's credits, shown meanwhile and kept) and a `tmdbId` → **the fill**:
  351. * the page shows "Loading filmography…"; an invisible `personProbe` (endless 0.1 s CSS animation, the same trick as the
  352. shell's offline tick — hl:web has no mount hook) fires `animationiteration` → the client handler calls the face
  353. `personFill` again and again until `done` ("Loading filmography… 40 of 87 titles"), then replaces the rows and facts —
  354. no reload, works after a client-side navigation too.
  355. * step 1: `GET <TMDB>/person/<tmdbId>?append_to_response=combined_credits` (ONE request) + the photo; facts updated (empty
  356. TMDB values never overwrite: biography, birthday, deathday, place_of_birth, imdb_id, adult). Every next step: 40 titles.
  357. A title we have (search.hl `titleIdByTmdb`, TMDB id + kind) is linked; one we don't gets a MINIMAL show record (title,
  358. overview, year/release, type, tmdbId, `adult`, language, genres by TMDB id, `cast` = this person, no seasons/poster;
  359. `oldId tmdb-<tv|movie>-<id>`, a free slug — search.hl's `slugOf`), indexed for the search (`indexShow`) and put into the
  360. public lists (`catalog.hl refreshCatalogShow`). Last step: `person.shows` = the credits `{ show, character, posterPath,
  361. adult }` (+ migrated credits TMDB no longer lists), `filmographyAt`, `persist()`. Log:
  362. `person fill: Jared Harris (tmdb 15440) credits=97 added=80 requests=2 steps=4 tmdbMs=287 ms=624`.
  363. * hl:web serves one request at a time and `fetch()` blocks: the TMDB step blocks other requests for its duration
  364. (~0.25–0.65 s real), each 40-title step ~0.15 s; other requests are served between steps (real data: a 758-credit
  365. person, 20 steps, 3.8 s, other requests waited ≤ 0.61 s).
  366. * the job lives in memory (`people.hl jobs`); a restart mid-fill loses it — the next visit starts again, titles stored
  367. already are found by TMDB id (no duplicates). A TMDB failure shows "Could not load the filmography: …"; the next visit
  368. retries. No sign-in needed (no session face on this page — hybriel#121/#122 can't bite).
  369. ## What it does (mission 047: checks after client-side navigation, mobile first, show page)
  370. * **Invisible checks fixed** by re-vendoring Hybriel master ff51cf46 (see "Vendored Hybriel"): the old
  371. build created SVG built in the BROWSER (client-side navigation, expand/collapse, a check click) in the
  372. XHTML namespace — nothing drawn. Server-rendered pages were fine.
  373. * **Mobile first** (`styles.hl`): every rule outside the one `@media (min-width: 40rem)` block is the
  374. phone's (390 px); the block only adds the wide layout. The header is one row on a phone (brand, ident
  375. selector, Log out; signed out — mission 056 — the selector + "Log in", " with ident" only from 40rem, nowrap); `/my/unwatched` + `/my/schedule` rows are two lines on a phone (show + date, the
  376. episode below), one line from 40rem.
  377. * **Show page** (`components/show.hl`): phone = title (+ Follow) first, then the poster at the full
  378. content width, then genres/plot/cast (`showMeta` is `display: contents` there, the title row
  379. `order: -1`); desktop unchanged (poster 10rem left). Season header: a caret at the right edge (since
  380. ticket #17: DOWN = closed, `season-row.expanded` turns it UP). Episode rows are not indented (episode check under the
  381. season check). Artists orange (`#ce9178`, token `orange`). Unwatched check = the inverted solid icon:
  382. outline circle + check mark, since ticket #29 in MUTED grey (accent only under the pointer — in accent a page of
  383. them read as "all ticked"); watched = filled accent disc, dark check.
  384. * **Follow toggle** (signed in): "Follow" = the inverted button (accent border), "Following" = filled;
  385. face `showToggleFollow` → `follows.hl` `setFollowed` (new record, `at` = now → top of `/my/shows`;
  386. unfollow deletes the user's records for that show). **Signed out** the checks and Follow are visible;
  387. a click opens the modal "You need to sign in to follow shows and mark episodes." (Close + "Sign in with
  388. ident" = the ident login link) and sends nothing. The modal is `components/modal.hl`, copied verbatim
  389. from components.hybriel.worldapi.org `components/modal/modal.hl` (becbd59, 2026-09-30) — its own
  390. `Style` lands in `/__hl/app.css`.
  391. ## What it does (step 13)
  392. * **`/`** (`components/home.hl`): signed in, four icon tiles (inline SVG, accent) → `/my/unwatched`, `/my/schedule`,
  393. `/my/shows`, `/my/movies` (2×2 on a phone, 4 in a row from 40rem). For everyone: the text about the site (signed out
  394. plus a "Log in with ident" hint), then **Movies** (→ `/movies`) = the 10 latest RELEASED movies (release ≤ today) and
  395. **Shows** (→ `/shows`) = the 10 series whose newest released episode is newest. Tiles: poster (`posterUrlOf`:
  396. the file or `/posters/none`), title, year; a link to `/shows/<slug>` (movies too — same page, same Follow button).
  397. Phone: each row scrolls sideways inside itself (`tile-row`, the page never does); from 40rem a grid of 5.
  398. * **`/movies`, `/shows`** (`components/movies.hl`, `components/allshows.hl`, both compose `components/tilelist.hl`):
  399. every movie by `release` desc (future-dated ones first, undated last — "all … sorted by release date desc"); every
  400. series by its newest released episode (series with none released after them, by their own `release`). 24 per page,
  401. grid of 3 (phone) / 6. **The page is a path segment: `/movies/page/2`**, page 1 = `/movies`; out of range → the last
  402. page, not a number → page 1. NOT `?page=2` (the mission asked for it): a page component cannot read the query
  403. (hybriel#11, query half open) and hl:web's Back (`popstate`) drops the query — every page change would be a full
  404. reload and Back would land on page 1. With the path, paging is a client-side navigation and Back works.
  405. * **Pagination** = components.hybriel's `components/pagination/pagination.hl`, **copied verbatim** to
  406. `components/pagination.hl` (4b4dabe) — re-copy, don't edit. It has no data out (its README, hybriel#87), so
  407. `tilelist.hl` wraps it in `pager-box { on click }`: a click on one of its buttons bubbles there, the button's text
  408. ("Previous", "Next", a number; "…" nothing) gives the page → `navigate()`. Hidden when there is only one page.
  409. `styles.hl` makes its buttons a bit tighter on a phone so "Previous 1 … 99 100 101 … 326 Next" stays one row.
  410. * **`/my/movies`** (`components/mymovies.hl`): the movies the user follows, newest follow first (same rows as
  411. `/my/shows`: small poster, title with year). `/my/shows` now leaves movies out. Shared sort: `follows.hl`
  412. `insertByFollowDesc`.
  413. * **Speed — `catalog.hl`**: built ONCE at start (one scan of shows + episodes: real data ~1 s, server answers
  414. ~1.5 s after launch) into two sorted id lists in memory (`static index`; hand-written merge sort). A page only
  415. slices 24 ids and fetches those shows: real data, server time ≈ 5 ms per page. Kept fresh without a rebuild:
  416. `project.hl` `syncTick` calls `refreshCatalogShow(id)` after each synced show (its seasons/episodes only, ~2.5 ms;
  417. 126 shows 0.3 s); a NEW DAY moves episodes that came out today (each series keeps its upcoming release dates) into
  418. place on the first read. `tools/sync-tmdb.hl` runs with the app stopped → the next start rebuilds.
  419. * **Content warning** (open, not decided here): the migrated movie table holds many adult titles (the old tracker
  420. imported TMDB lists); they show on the public `/` and `/movies`. No `adult` flag is stored.
  421. ## What it does (ticket #17: season caret, skeleton rows, faster opening)
  422. * Caret DOWN while a season is closed, UP while open (`styles.hl` `'season-row.expanded season-caret'` rotate 180°).
  423. * **Opening** a season (`components/show.hl` `on toggleCollapse`): at once, client-side, the caret turns up and
  424. min(episodes, 8) **skeleton rows** (`skeleton-row`: disc, number, title bar in the episode row's shape and height; CSS
  425. shimmer `@keyframes tracker-shimmer`) appear under it; then the face `showSeasonEpisodes(seasonId)` answers the
  426. season's episodes `{ id, episodeNumber, title }` and `filledRows` replaces the skeletons. **Closing** is client-only.
  427. Opened and closed again before the answer → the answer is dropped. An error closes the season again.
  428. * Why it was slow: the old face `showRows` took `session`, and hl:web answers every session face by RE-MOUNTING the whole
  429. page on the server and shipping every session-derived member as `sync` (`plugins/web/WebFramework.hl` `inbound`) —
  430. slug scan, watches scan, all rows twice. `showSeasonEpisodes` takes NO session (public data): no mount, no sync.
  431. * The watch state of the new rows comes from the member `watchedEpisodes` (`watchedEpisodesOf`: per season with a
  432. watched episode `{ all, except }` — `all` = mostly watched, `except` = the other ids), rendered with the page and
  433. re-synced after every watch face. Only this show's, never the user's watch list.
  434. * An ADULT title's page (followers only) still opens seasons through the session face `showRows(slug, collapsed)`:
  435. `showSeasonEpisodes` refuses seasons of adult titles (no user known). Real data has no adult title with seasons.
  436. * Real data (Daily Show S30 142 ep / LWT S12 30 ep, 390 + 1280): episodes visible 380–450 / 235–390 ms (outliers 1.1 s)
  437. before → 230–290 / 55–100 ms after; skeleton after 80–100 / 25–45 ms; close 420–500 / 260–390 → 135–175 / 26–45 ms. STATUS.md ticket #17.
  438. ## What it does (mission 054: adult titles, the backfill)
  439. * `shows.adult`: `true` / `false` from TMDB, `null` = not known yet (all 9,453 migrated rows). `shows.hl isPublicTitle` =
  440. `adult == false`. Used by `catalog.hl` (the homepage rows, `/movies`, `/shows`: built from public titles only;
  441. `refreshCatalogShow` adds or removes one) and `search.hl` (`titleOk[id]`; `dbSearch` skips the others — they are not
  442. counted either). "Fetch from web" asks TMDB with `include_adult=false` and keeps only results with `adult: false`.
  443. * Not filtered: `/my/shows`, `/my/movies`, `/my/unwatched`, `/my/schedule` (the user's own follows).
  444. * The show page (mission 056, `components/show.hl adultHiddenFor`/`visibleShow`): a title with `adult == true` is "Not
  445. found" for everyone who does not follow it (signed out too; no member carries its row); a follower sees it, and an
  446. Unfollow on the page hides it at once. Unknown (`null`) pages open (they are in no list). The faces `showRows` /
  447. `showToggle*` refuse a hidden title. Needs hybriel ≥ 73267707 for the instant hide (#122); `collapsed` derives from the
  448. slug, never from the session-derived `showRow` (else it snaps back after every session face).
  449. * Every TMDB answer sets the flag: the daily sync (`syncShow`/`syncMovie`), the search import (`importTitle`), the backfill.
  450. * **The backfill** (`project.hl backfillTick` → `tmdbsync.hl backfillTitle`): at start the app collects every title with
  451. `adult` unknown, a `tmdbId` and no `adultCheck`; then ONE title per step on the app's clock (0.1 s tick, shared with the
  452. daily sync, which takes precedence — the backfill waits while a daily run is going on):
  453. `GET /movie|tv/<tmdbId>?append_to_response=external_ids` → `adult`, a missing `imdbId`/`tvdbId`, the poster (w342 into
  454. `posters/<oldId>.<ext>` when the file is missing — NOT for an adult title, mission 056; no TVmaze, no seasons). Then 260 ms pause per API request (≤ 40 /
  455. 10 s; poster downloads go to TMDB's image host and are not counted). The lists and the search take the title at once.
  456. TMDB 404 → `adultCheck = 'TMDB 404'` (stays hidden, never asked again); no answer / 429 / 5xx → back of the queue, at
  457. most 2 more tries per start. Persisted every 25 titles (mpackdb's `update` is durable anyway — the gate's resume check
  458. stops it after 6 titles, before any persist). A restart builds the queue from what is still unknown = it resumes.
  459. * Log: `adult backfill: start, N titles without an adult flag`, every 500: `adult backfill: 500/9453 titles, adult=…
  460. notAdult=… unknown=… posters=… ids=… requests=… errors=… retries=… seconds=…`, each failure, then `adult backfill done: …`;
  461. with nothing to do: `adult backfill: nothing to do`.
  462. * Real data (copy of 2026-10-01, real TMDB): 9,453 titles in 99 min — 3,450 adult, 5,866 not, 137 unknown (TMDB 404),
  463. 8,740 posters (459 MB in total); pages during the run avg 0.05–0.16 s, max 4.9 s (a slow TMDB answer blocks). STATUS.md mission 054.
  464. ## What it does (mission 058: tickets #22–#25)
  465. * **#22 air dates** (`components/show.hl`): every episode row ends with its air date (`episodes.release`, `YYYY-MM-DD`
  466. like /my/unwatched; none → empty) — in `buildRows` (server) and in `showSeasonEpisodes` → `filledRows` (an opened season).
  467. * **#23 season check = all episodes watched** (`seasonAllWatched`): derived from the episode watches on every render, not
  468. from the season's own watch record (a season without episodes still uses that record). Unchecking one episode turns the
  469. season off with the face's answer (`showToggleEpisode` rebuilds the rows), checking it again turns it on. A season click
  470. watches every episode when not all are watched (a partly watched season → all), else unwatches all (`setSeasonWatched`
  471. still writes the season record too — nothing reads it for the check any more).
  472. * **#24 movie watched check** (show page, `isMovie`): the episodes' check icon `#moviewatch` + "Watched"/"Not watched"
  473. under the title (phone: above the poster). Face `showToggleMovie(slug, session)` → watch `{ targetType: 'movie', target:
  474. <the title's shows.db id> }` (new target type; `tools/verify.hl` knows it). Signed out → the sign-in modal ("You need to
  475. sign in to follow movies and mark them watched."). `/my/movies`: "N movies · M watched" and a solid check per watched row.
  476. * **#25 `/genres/<genre>`** (+ `/genres/<genre>/page/<n>`, `components/genre.hl`, composes `tilelist.hl`): the genre by
  477. `urlSegment` (`shows.hl genreBySlug`; case-insensitive fallback), its public movies AND series together, newest first,
  478. 24 per page. Lists in `catalog.hl` (`index.genres`, built in the same start scan; key = a movie's release / a series'
  479. newest released episode, else its release — so the date is comparable across both kinds; `refreshGenres` on every
  480. `refreshCatalogShow`, `rollDay` re-keys the series). Adult/unknown hidden like /movies. Unknown genre → "Not found".
  481. The show page's genre pills link `/genres/<x>`; the old `/genre/<x>` answers 301.
  482. * Real data: TMDB's TV genres differ from its movie genres ("Action & Adventure", "Sci-Fi & Fantasy" vs "Action",
  483. "Science Fiction") — `/genres/Action` is movies only (643), `/genres/Action-Adventure` series only (266),
  484. `/genres/Drama` both (2,665). Not merged (open question for the creator).
  485. ## What it does (mission 060: short ids, ticket #27)
  486. Creator: "i wanted to give all our movies, shows, series and persons own short ids like a9s9a … those ids show below the
  487. poster." `shortids.hl` (all of it), `project.hl` (route, backfill clock), the two pages.
  488. * **Field** `shortId` on `shows.db` (movies + series) and `persons.db`: 5 characters `[a-z0-9]`. **Unique across both tables**
  489. through ONE in-memory map (`shortids.hl owners`, short id → `{ kind, id }`), built at start (one scan of each table,
  490. ~0.2 s real data); every id handed out goes through it. Not an mpackdb index: those are per table and cannot span two.
  491. * **Old ids**: the old export had `id` on 702 of 9,453 shows (`Show.jsonl`, base62 counter `100jh`…`1012y`, all lower case).
  492. `data/old-short-ids.json` (old Mongo `_id` = our `oldId` → id; made ONCE by `tools/old-short-ids.hl` from the export on
  493. Loreana; committed, deployed with the code) gives those shows their old id back. All 702 are RESERVED: a new id is never
  494. one of them, even where the show is gone. Persons never had one. Real data: 702 of 702 kept (Foundation `100sp`, Raised by
  495. Wolves `100jh`).
  496. * **New ids**: 5 random characters (hl:crypto, bytes ≥ 252 skipped so all 36 are equally likely), retried while taken or old.
  497. New records get one AT CREATION (`claimShortId`): search import (`search.hl importTitle`) and the person fill's minimal
  498. titles (`people.hl addMinimalTitle`) — the only places the app creates shows; persons are created only by `tools/migrate.hl`.
  499. The daily sync creates seasons/episodes only.
  500. * **Backfill** (records without one — at first all 25,167): in the background, its own `every(0.1)` clock in `project.hl`
  501. (`shortIdTick` → `shortIdStep`): per tick ONE batch of as many records as fit into 40 ms (fetch, set `shortId`, `update`);
  502. persisted every 20 batches and at the end. The queue is built at start from what is still missing → resumes after a
  503. restart. A record whose id another one already holds (never seen; logged "… gets a new one") is re-queued. Log:
  504. `short ids: N records, X with a short id, Y without, 702 old ids, … ms`, `short ids: backfill start …`, every 5000 `short
  505. ids: N assigned, M left, s`, `short ids done: assigned=… oldKept=… batches=… slowestBatchMs=… slowestPersistMs=… seconds=…`,
  506. or `short ids: nothing to do`. Chosen over "all at start": 25k records in one go would block the server ≥ 16 s (a tool on the copy: 1,564 records/s; inside
  507. the app a record costs more, ~3 ms — not found out why).
  508. Real data (copy 2026-10-01): **~300 s**, 1,859 batches, slowest batch 62 ms, slowest persist 31 ms (STATUS.md mission 060).
  509. * **Shown** (`components/show.hl`, `components/person.hl`, `styles.hl shortIdLabel`): `#shortid` under the poster (phone: under
  510. the full-width poster) and under the person's photo — no photo: under the name and facts; small (.8rem), muted, monospace,
  511. centred under the image, one click selects it. None while the backfill has not reached the record yet.
  512. * **`/<shortId>`** (`project.hl shortIdRoute`, the LAST route — every named one-segment route wins): 301 → `/shows/<slug>` or
  513. `/person/<slug>`; upper case is read as lower; unknown / not 5 chars → 404 (plain text). An adult title's page itself then
  514. says "Not found" to non-followers as before.
  515. * Count on a COPY (or app stopped): `TRACKER_STORAGE=… TRACKER_OLD_SHORT_IDS=$PWD/data/old-short-ids.json ./bin/hybriel
  516. tools/count-short-ids.hl` → per kind with/without/malformed, old kept/lost, duplicates across both.
  517. ## What it does (ticket #19: franchises and timelines)
  518. Details: [docs/franchises.md](docs/franchises.md). New tables `franchises.db`, `timelines.db`, `collectionchecks.db`
  519. (`franchises.hl`). `/franchises` (list), `/franchises/<slug>` (index: each timeline sortable Timeline | Release — a series by
  520. its LAST episode), `/timelines/<slug>`; on every show/movie page one widget per timeline: franchise above, `‹ Prequel | name |
  521. Sequel ›`. The creator (`TRACKER_EDITORS`, az5b2) edits at `/franchises/edit` and `/timelines/<slug>/edit`. A background seed
  522. turns TMDB movie collections (≥ 2 of our movies) into timelines (one movie per step, ≤ 40 TMDB req / 10 s, resumes).
  523. ## Test
  524. ```bash
  525. # ticket #19: the franchise gate (own storage, own ident, fake TMDB collections) — run BOTH gates
  526. TRACKER_GATE_SHOTS=/tmp/w066/shots TRACKER_GATE_PORT=8732 TRACKER_GATE_IDENT_PORT=8733 TRACKER_GATE_CHROME=8734-8736 TRACKER_GATE_TMDB_PORT=8737 node tests/franchises.mjs
  527. ```
  528. ```bash
  529. node tests/browser.mjs # THE GATE: this app's own server + its OWN ident (a copy of
  530. # ident's code without .env, codes to a mail sink — no live
  531. # ident, no real mail; tests/identkit.mjs, same as calendar's
  532. # gate) + a real headless Chrome: signed out (header shows the
  533. # selector + "Log in with ident"; since #13 the homepage has
  534. # content, see below) -> sign in -> header shows "Log out" -> sign
  535. # out -> signed out again -> a reload stays signed out. Also
  536. # checks the header has no bottom border and filled buttons
  537. # (incl. the ident selector's) have none, while inverted ones
  538. # ("Log out") keep theirs.
  539. # tracker.worldapi.org#4: a fixture show (tests/seed-show.hl,
  540. # written into the gate's own storage before the server starts)
  541. # proves /shows/:slug — header renders, no checks signed out;
  542. # signed in, click an episode check (turns solid), click a
  543. # season check (itself AND its episodes turn solid, proven
  544. # after a reload — server-side, not just client state).
  545. # tracker.worldapi.org#5: the same fixture (now followed by the
  546. # test user) proves /unwatched — signed out, no rows; signed in,
  547. # only the two already-released episodes show, newest first, the
  548. # far-future one excluded; click a check, the row disappears
  549. # (proven server-side after a reload).
  550. # tracker.worldapi.org#6: the same fixture proves /schedule —
  551. # signed out, no rows; signed in, only the far-future episode
  552. # shows (the two already-released ones excluded), no check icons
  553. # at all, unaffected by any watch toggle on the other pages.
  554. # tracker.worldapi.org#7: the fixture now has a 2nd followed
  555. # show (followed later, no poster name, never watched) and
  556. # proves /my/shows — signed out, the sign-in message; signed
  557. # in, newest follow first, title links, loaded posters (the
  558. # placeholder), S01E02 after /unwatched's click, then S02E01
  559. # (highest, not most recent) after the show-page checks; the
  560. # unwatched show shows no episode.
  561. # tracker.worldapi.org#8: the lists moved to /my/unwatched and
  562. # /my/schedule (old addresses: 301, and the browser lands on
  563. # the new one), rows say S01E02 / S02E01, titles carry the
  564. # year ("Gate Test Show (2024)", "Unwatched Gate Show (2025)"
  565. # — from `release`, that show has no `year`), the show page
  566. # says "1 episode" / "2 episodes", /my/shows gives the show
  567. # with a poster FILE (the gate writes posters/sh1.png) its
  568. # own URL and the other one /posters/none.
  569. # tracker.worldapi.org#9: a FAKE TMDB (tests/faketmdb.mjs, a
  570. # node http server inside the gate, fixed JSON + a png; the
  571. # app/tool get TMDB_BASE_URL/TMDB_IMAGE_URL + a gate token —
  572. # never the real TMDB). App stopped → tools/sync-tmdb.hl: +2
  573. # seasons, +4 episodes, 3 fixture episodes matched by S/E and
  574. # updated, 2 posters, no season 0, Bearer token on every call;
  575. # a 2nd run changes nothing. Restarted: /my/schedule and
  576. # /my/unwatched show the new episodes, /my/shows + the show
  577. # page the downloaded posters (/posters/sh2.png byte-equal),
  578. # S1 keeps its watched episodes, no duplicates. Then the
  579. # app's OWN daily run (TRACKER_SYNC_HOUR = the current UTC
  580. # hour, fake TMDB slowed to 700 ms/request, one new episode):
  581. # it runs, finds the episode, and pages asked meanwhile are
  582. # answered < 2.5 s (between shows) though the run takes ≥ 3 s.
  583. # tracker.worldapi.org#10: the PWA — head links (manifest,
  584. # apple-touch-icon, favicon, theme-color = token darker), the
  585. # manifest (type, name, start_url, scope, standalone, colours),
  586. # every icon a real PNG of its size, touch icon 180, favicon
  587. # svg + ico; Chrome: no installability error, manifest parsed
  588. # without errors; the worker /__hl/sw.js registered, scope /,
  589. # controls the page (a separate 390 px phone tab). OFFLINE:
  590. # CDP offline → the note appears; the server STOPPED too (CDP's
  591. # offline does not reach the worker's own fetches) → reload of
  592. # / shows header + note from the cache; /my/shows gives
  593. # "Unavailable offline"; server back → no note.
  594. # mission 047: a CLIENT-SIDE navigation /my/shows → the show
  595. # (window marker proves no reload): every check/caret svg in the
  596. # SVG namespace and drawn — again after expand, an episode click,
  597. # collapse (FAILED on the old vendored build: XHTML namespace,
  598. # circle width 0 — /tmp/w047/old-build-gate.log); caret down/
  599. # right and flips; episode check under the season check; artists
  600. # rgb(206,145,120); unwatched icon = accent outline + accent
  601. # check; Follow: "Following" filled → unfollow ("Follow",
  602. # outlined) → gone from /my/shows, survives reload → follow →
  603. # top of /my/shows; signed out: checks + Follow visible, a click
  604. # (episode, season, Follow) opens the sign-in modal, Close
  605. # closes it, a reload shows nothing was written. 390 px + 1280
  606. # px: header one row, no sideways scroll, show-page order
  607. # (phone: title, full-width poster, genres, plot, cast).
  608. # tracker.worldapi.org#12: link icons only for existing ids
  609. # (show 1: TMDB+IMDb, show 2: TMDB+TVDB, a fixture MOVIE: TMDB
  610. # /movie/), exact hrefs, target _blank + rel noopener, a click
  611. # opens a NEW tab (CDP target, canAccessOpener false) and the
  612. # page stays; also after client-side navigation; phone/desktop
  613. # position. Sync: external_ids come with the details request,
  614. # the movie only via /movie/, a FAKE TVmaze (same fake server,
  615. # /tvmaze/…, 301 like the real one): imdb hit, imdb 404 → thetvdb
  616. # hit; afterwards the stored ids are unchanged (tt0000001, 4002
  617. # — TMDB says otherwise) and the missing ones filled; 2nd run:
  618. # ids=0, no TVmaze request.
  619. # tracker.worldapi.org#13: fixture + 32 never-followed movies
  620. # (Pager Movie 01…30 = 2001-01-01…30, one 2099, one undated) and
  621. # a series with an episode 2021-01-01. Home signed out: no
  622. # icons, the text, headings → /movies /shows, the 10 latest
  623. # RELEASED movies (30…21, not the 2099 one), the series by
  624. # newest released episode; signed in: 4 icons → /my/…, the
  625. # Movies icon → /my/movies (client-side). /movies via the
  626. # heading: page 1 = 2099 + 30…08, "1 2 Next"; Next →
  627. # /movies/page/2 (client-side, 9 left, undated last), "1" →
  628. # /movies, Back → page 2, direct load, page 99 → 2, abc → 1.
  629. # /shows: series only, order, no pagination for one page; a
  630. # tile → show page. Follow a MOVIE on its page → /my/movies
  631. # has it, /my/shows does not. After the sync tool + restart
  632. # /shows reorders (S03E01); after the IN-APP run (TMDB adds a
  633. # released episode to show 2) /shows and the home row put
  634. # show 2 first without a restart. Offline / from the cache
  635. # still has the text and both rows.
  636. # Session-sync (hybriel 64527baa): after each face-driven change
  637. # (/my/unwatched click, expand, episode click, Follow) every row
  638. # appears exactly once.
  639. # tracker.worldapi.org#15: the fake TVmaze also serves
  640. # /tvmaze/shows/<id>/episodes. First runs: lists agree with
  641. # TMDB → nothing taken. Then TVmaze knows more: S3E4's title +
  642. # date filled (TMDB "Episode 4"), S3E5 + a new S4 added, TMDB's
  643. # S3E1 title kept, show 2 numbered differently → skipped;
  644. # idempotent; /my/schedule + show page show them; TMDB catches
  645. # up → adopts the rows by number (no duplicates, TMDB wins).
  646. # tracker.worldapi.org#14: the header magnifier → /search
  647. # (client-side); typing: 1 letter → "at least 2", "gate" →
  648. # 3 titles in order with year/type/link, address /search/gate;
  649. # people ("test act"); case/accents ("GATE tést"); nothing →
  650. # note + Fetch; reload of the address = same results; bad %
  651. # escapes → 200; "/" → space in the address. Fetch from web
  652. # (fake TMDB search/multi): ours (tv 1001, movie 1003) and the
  653. # person left out, w92 thumbs; signed out Add → modal, nothing
  654. # sent. Signed in: Add tv 1006 (details 404) → error, every
  655. # list unchanged (hybriel#121/#122); Add tv 1004 → its page
  656. # with season/episodes/poster/genre/4 id links, exact TMDB
  657. # calls; then in our results and gone from the web list; Add
  658. # movie 1005 → /movie/ only. Screenshots search-{390,1280},
  659. # search-web-{390,1280}, search-signed-out-modal-1280.
  660. # Merge #13 + #14: an imported title is on /movies and /shows
  661. # at once (search.hl → catalog.hl refreshCatalogShow); #13's
  662. # 32 extra fixture titles are 'Pager …' so 'gate' finds only #14's.
  663. # Mission 054 (adult titles): tests/seed-adult.hl adds, app
  664. # stopped, 1 adult movie alice follows + 14 titles with an
  665. # unknown flag (fake TMDB: 1 adult, 1 404). Backfill off:
  666. # none on /, /movies (both pages), /shows, the search; the
  667. # adult one on alice's /my/movies + its page; Fetch from web
  668. # drops TMDB's adult result. Backfill on (fake TMDB 300 ms per
  669. # answer): stopped after 6 titles, restarted → only the rest is
  670. # asked (resume), pages < 1.2 s meanwhile, then the lists and
  671. # the search have the non-adult ones at once, the poster is
  672. # served, a 3rd start has nothing to do. Screenshot
  673. # adult-home-1280.png. startServer() runs TRACKER_BACKFILL=0
  674. # unless a block switches it on.
  675. # tracker.worldapi.org#16: person pages (fake TMDB /3/person/<id>
  676. # + combined_credits, w185 photo → fake.personRequests): a
  677. # COMPLETE person at once (facts, rows, TMDB not asked); the
  678. # cast link on the show page → /person/Test-Actor CLIENT-SIDE:
  679. # "Loading filmography…" (TMDB slowed to 900 ms), fills without
  680. # reload: facts + photo, 86 rows (87 titles − adult), order,
  681. # roles merged, posters (file / TMDB w92 / placeholder), ONE
  682. # person request + photo, log steps=4 added=85; bio four lines
  683. # → click → all; row → show page → Back; an added title's page;
  684. # second visit: complete, nothing asked/added; Second Actor:
  685. # linked, added=0, our adult record hidden though TMDB's credit
  686. # is not; search finds the added title once; 390/1280 no
  687. # sideways scroll; screenshots person{,-complete}-{390,1280}.
  688. # Mission 056: signed-out header ONE row at 320/390/1280
  689. # ("Log in" on a phone, "Log in with ident" wide; shots
  690. # header-signed-out-{320,390,1280}.png); the backfill does not
  691. # download the adult title's poster; /shows/adult-gate-movie is
  692. # "Not found" signed out (no title in the HTML), alice sees it,
  693. # her Unfollow on the page hides it at once (+ reload,
  694. # /my/movies); an episode check on a normal show page toggles
  695. # and back. Every stopServer() leaves the tab on about:blank first
  696. # (else websocket reconnect errors fail the console check).
  697. # #17: caret up (open) / down (closed) and flips; opening with the
  698. # face held back 1.5 s (`window.__delayFace`, an init script that
  699. # delays that websocket frame): 2 skeleton rows under season 1,
  700. # episode-row shape/height, shimmer animation, caret already up,
  701. # no episode yet (390 + 1280, shots show-skeleton-*); after the
  702. # answer: skeleton gone, every row once (hybriel#121), watch state
  703. # right (show-open-*, show-closed-*); closed while loading stays
  704. # closed; only showSeasonEpisodes is sent (wsSent), closing sends
  705. # nothing.
  706. # mission 058: #22 air dates (server + opened season), #23 season
  707. # check off/on live + after reload + partly watched → all, #24 the
  708. # movie check signed out (modal) / in (click, reload, uncheck) +
  709. # /my/movies count, #25 /genres/Action (2 pages, series + movies,
  710. # adult hidden, pill → /genres/Drama, /genre/ 301, imports at once).
  711. # Fixture: genre Action on the Pager titles + adult "Hidden Action Film".
  712. # mission 060 (short ids): the gate's own old-id file (sh1 → 100jh,
  713. # 'gone-old' → 100ji reserved); the first start's background
  714. # backfill (oldKept=1); a search import has its id at once;
  715. # #shortid under the poster/photo (person without photo: under
  716. # the facts), monospace, muted, smaller, 390 + 1280 (shots
  717. # shortid-{show,movie,person,person-nophoto}-{390,1280}); the
  718. # fill's new titles have one (the run's backfill was done
  719. # before); /<id> → 301 (show, movie, person, upper case),
  720. # unknown / reserved / 3 chars → 404, the browser lands on the
  721. # page; tools/count-short-ids.hl (app stopped): all have one,
  722. # 0 duplicates; RESUME: tests/seed-shortids.hl adds 60 persons
  723. # without + 2 sharing aaaa1, a start with a 1 ms budget is
  724. # stopped part way, the next does only the rest, one of the two
  725. # keeps aaaa1, the other gets a new one, a 3rd start: nothing.
  726. # 259 checks (#13 + #14 + #15 + 1 merge check + 17 mission 054 + #16: 19 + 5 mission 056 + 6 #17 + 24 mission 058 + 21 mission 060). Own servers :8700 (this app) / :8701 (ident copy)
  727. # / :8710 (fake TMDB); own storage .scratch/gate-store; Chrome
  728. # on 8702-8709. Other ports (workers get 8720-8739):
  729. # TRACKER_GATE_PORT=8720 TRACKER_GATE_IDENT_PORT=8721 TRACKER_GATE_CHROME=8722-8726 TRACKER_GATE_TMDB_PORT=8727 node tests/browser.mjs
  730. # TRACKER_GATE_SHOTS=/tmp/x also writes {home,show,my-shows,
  731. # my-unwatched,my-schedule,movies,movies-page-2,shows-list,
  732. # my-movies,genre-action,genre-action-page-2,movie}-{390,1280}.png,
  733. # movie-watched-{390,1280}.png, movie-signed-out-modal-1280.png, signed-out-modal-
  734. # 1280.png, synced-*.png (after the sync, 1280×900; synced-show-390
  735. # + synced-movie-390 at 390) + pwa-phone-
  736. # online/offline.png (390 px, dpr 2), show-{skeleton,open,closed}-
  737. # {390,1280}.png (#17) — LOOK at them
  738. ps -eo pid,args | grep [h]l-browser-tier # must print nothing afterwards
  739. ```
  740. ## Deploy (Byrodin)
  741. Target: `/CONTAINERS/projects/tracker.worldapi.org` on Byrodin, container
  742. `tracker.worldapi.org` (`docker-compose.yml`: debian:12-slim, host network,
  743. `HL_HOST=127.0.0.1`, `TRACKER_PORT=45008`, `TRACKER_WATCH=0`, the folder mounted at
  744. `/home/tracker`, `./bin/hybriel project.hl`), public https://tracker.worldapi.org/ via
  745. nginx (TLS ends there; no baseUrl/tls in the app, like ident/notes).
  746. * **First deploy: done by the architect** (folder, nginx vhost with WebSocket Upgrade
  747. headers, cert, DNS, **and registering this app in the live ident** — `/apps` → name +
  748. origin `https://tracker.worldapi.org` → the API key + secret go into `.env` next to
  749. `docker-compose.yml`, `TRACKER_KEY=… TRACKER_SECRET=…`).
  750. * **Later: `./deploy.sh`** on Loreana, in this folder: runs the gate (refuses on a failure;
  751. `--skip-tests` skips it LOUDLY), backs up `storage/`/`.sessions/`/`.env` (what exists) to
  752. Loreana's `/media/SLOW1TB2/deploy-backups/<app>/` (newest 5 kept; an empty/failed backup stops
  753. the deploy), then rsyncs the code to
  754. `[email protected]:/CONTAINERS/projects/tracker.worldapi.org` (never `storage/`,
  755. `.sessions/`, `.env`, `.scratch/`, `server.*`, logs — the preview is checked for them; no
  756. `--delete`), `docker compose up -d && docker compose restart` over `ssh -F /dev/null`,
  757. then waits for https://tracker.worldapi.org/ to answer 200.
  758. * `./deploy.sh --dry-run` = the gate + `rsync -n` + the commands it would run (no restart, no
  759. URL check). `--target DIR|HOST:DIR` and `--url URL` point it elsewhere (tested against a
  760. local directory, see STATUS.md).
  761. ## Data
  762. `storage/mpackdb/`: `users.db` (`identity` → this app's own user id, `users.hl`) plus, since
  763. step 2, the old tracker's data — `genres.db` (27), `persons.db` (15157; #16 adds `biography`, `tmdbProfile`, `adult`, `filmographyAt` and TMDB credits in `shows`), `shows.db` (9453),
  764. `seasons.db` (6430), `episodes.db` (231584), `follows.db` (128), `watches.db` (11692), all with
  765. fresh mpackdb ids and every reference re-pointed (`tools/migrate.hl`); the one old user is this
  766. app's user for ident short id `az5b2`. Since step 9 the TMDB sync adds seasons/episodes and
  767. `storage/mpackdb/posters/<oldId>.<ext>` (w342, ~50 KB each), and sets `tmdbSync`/`tmdbPoster` on
  768. shows. Mission 054: `shows.adult` (true/false/null = unknown → hidden from lists + search) and `shows.adultCheck` (why the
  769. backfill gave up on a title, e.g. `TMDB 404`). Mission 060: `shows.shortId` and `persons.shortId` (5 × `[a-z0-9]`, unique across
  770. both; `data/old-short-ids.json` holds the old tracker's 702). Known in the migrated data (not caused by the sync): 12 duplicate episode tmdbIds and 1
  771. episode whose `show`/`season` disagrees among the followed shows. Counts and the referential-integrity proof:
  772. `STATUS.md` "ticket #2". Real data 2026-10-01: 7,814 movies + 1,639 series (`shows.type`), 232,384 episodes (935
  773. series have a released one).
  774. ## Files
  775. | File | |
  776. |---|---|
  777. | `CONCEPT.md` | the creator's concept — do not edit |
  778. | `project.hl` | manifest: the installable app (`appIcons`, `appTouchIcon`, `appFavicon`, theme colours from the tokens, `offline = [ Home ]`, #10), the daily TMDB run (`syncTick`, #9), routes (`/login/callback`, `/login/failed`, `/login.js`, `/posters/:name`, `/movies` + `/movies/page/:page`, `/shows` + `/shows/page/:page` (#13), `/shows/:slug`, `/my/shows`, `/my/movies` (#13), `/genres/:genre` + `/genres/:genre/page/:page` + `/genre/:genre` → 301 (#25), `/my/unwatched`, `/my/schedule`, `/unwatched` + `/schedule` → 301, `/search/:q?` (#14), `/person/:slug` + `/profiles/:name` (#16), `/` component Home, `/:sid` → 301 (mission 060, last)), the app's own session cookie; #14: builds the search index at boot (`ensureIndex`); mission 054: the adult backfill (`backfillTick`) on the clock it shares with the daily run; mission 060: the short-id map at boot (`ensureShortIds`) and its backfill (`shortIdTick`, own clock) |
  779. | `users.hl` | the ident exchange + the `usersTable`, copied from calendar.worldapi.org's `users.hl` |
  780. | `login.js` | bridge between `<ident-selector>`'s `ident-login` event and the shell, copied verbatim from calendar.worldapi.org |
  781. | `components/home.hl` | `/` (#13): signed in the 4 icon tiles; the text; the latest 10 movies and series (catalog.hl) |
  782. | `components/movies.hl`, `components/allshows.hl` | `/movies` (+ `/movies/page/:page`), `/shows` (+ `/shows/page/:page`): every movie / series, 24 per page (#13) |
  783. | `components/tilelist.hl` | the poster grid + pagination both lists compose; turns a pagination click into `navigate()` (#13) |
  784. | `components/pagination.hl` | the pagination, copied verbatim from components.hybriel.worldapi.org (`components/pagination/pagination.hl`, 4b4dabe) — re-copy, don't edit |
  785. | `components/mymovies.hl` | `/my/movies`: followed movies, newest follow first (#13); watched count + check per watched movie (#24) |
  786. | `components/genre.hl` | `/genres/<genre>` (+ `/page/<n>`): a genre's movies and series, newest first, 24 per page (#25, mission 058) |
  787. | `catalog.hl` | the public lists: built once at start, refreshed per synced show and per new day (#13); only `adult == false` titles (mission 054); per-genre lists (#25) |
  788. | `components/main.hl` | the shell (header: brand, `<ident-selector>`, log in / log out; the offline note + its `netProbe` tick, #10) |
  789. | `components/loginfailed.hl` | `/login/failed`: why a login didn't work |
  790. | `components/show.hl` | `/shows/:slug`: the show page (header, Follow toggle, seasons with caret, episodes, watch check; signed out the sign-in modal) |
  791. | `components/modal.hl` | the modal dialog, copied verbatim from components.hybriel.worldapi.org (`components/modal/modal.hl`, becbd59) — re-copy, don't edit |
  792. | `components/unwatched.hl` | `/my/unwatched`: unwatched, already-released episodes of followed shows, newest first |
  793. | `components/schedule.hl` | `/my/schedule`: not-yet-released episodes of followed shows, soonest first, no checks |
  794. | `components/myshows.hl` | `/my/shows`: followed SERIES (#13: movies → `/my/movies`), newest follow first — small poster, title, last watched `SxxEyy` |
  795. | `shows.hl` | read-only data access (shows/seasons/episodes/genres/persons), plus the list labels `episodeCode`/`titleWithYear`/`posterUrlOf` (#8), reused by the `/my/` pages; `externalLinksOf` (#12: the link icons); `isPublicTitle` (mission 054: `adult == false`) |
  796. | `follows.hl` | per-user follow data (`followsOfUser`, `followedShowIds`), reused by `/unwatched`/`/schedule`/`/my/shows`; `allFollowedShowIds` (#9: every show anyone follows, for the sync); `isFollowing`/`setFollowed` (mission 047: the show page's Follow toggle) |
  797. | `tmdbsync.hl` | the TMDB sync of one show (`syncShow`: seasons, episodes, poster; #12: external ids + TVmaze lookup, movies via `/movie/`; #15: TVmaze episode merge `mergeTvmaze`) + run totals — used by `project.hl`'s daily run and `tools/sync-tmdb.hl` (#9); mission 054: `adultOf`, the adult backfill (`adultBackfillQueue`, `backfillTitle`) |
  798. | `watches.hl` | per-user watch state (episode/season/movie (#24) checks, the shared check-icon class `watchClassOf`, `watchedSet` = the user's watches as a map, built once per page), reused by `/unwatched`/`/schedule`/`/my/shows` |
  799. | `icons/` | #10: `icon.svg` (source) → `icon-192.png`, `icon-512.png`, `apple-touch-icon.png`; `favicon.svg`, `favicon.ico` (commands in "What it does (step 10)") |
  800. | `styles.hl` | all CSS (imports the tokens from `shared/tokens.hl`; accent green `#4ec9b0`) |
  801. | `shared/tokens.hl` | the WorldAPI tokens, vendored verbatim from `ident.worldapi.org/shared/tokens.hl` |
  802. | `tests/browser.mjs` | the gate (above) |
  803. | `tests/seed-adult.hl` | mission 054: the gate's adult/unknown-flag titles + alice's follow of the adult one, written with the app stopped |
  804. | `tests/seed-show.hl` | writes the gate's fixture show (two seasons, three episodes) and, since ticket #5, a follow of it for the test user (#7: plus a 2nd, later-followed, never-watched show; #12: partial external ids + a MOVIE followed by another user), before the server starts |
  805. | `tests/identkit.mjs` | starts a throwaway ident copy for the gate, copied from calendar.worldapi.org's `tests/` |
  806. | `tests/faketmdb.mjs` | the gate's fake TMDB (#9): details, `append_to_response=season/N`, w342 png; records every request; #12: `external_ids`, `/3/movie/<id>`, a fake TVmaze under `/tvmaze` (`tvmazeRequests`); #15: `/tvmaze/shows/<id>/episodes` from `tvmaze.episodes` |
  807. | `tests/realdata-check.mjs` | NOT the gate: the real-data browser check on a COPY of live `storage/` (STATUS.md, mission 047 / #13): times of every page incl. `/`, `/movies`, `/shows`, `/my/movies`, pagination clicks + Back, client-side navigation, screenshots to `$REAL_SHOTS`; env REAL_PORT / REAL_CHROME / REAL_OUT / REAL_SHOW (#15) |
  808. | `search.hl` | #14: the search — in-memory index (`ensureIndex`, `dbSearch`), `queryOfParam`, TMDB `webSearch`, `importTitle` (new record + `syncShow`) |
  809. | `components/search.hl` | #14: `/search` + `/search/<text>` — the field, our titles/people as you type, "Fetch from web", "Add" (signed out: the sign-in modal) |
  810. | `people.hl` | #16: person by slug, facts, filmography rows, the step-by-step TMDB fill (`personFillStep`) |
  811. | `components/person.hl` | #16: `/person/<slug>` — photo, facts, bio, filmography; "Loading filmography…" + the fill without reload |
  812. | `tests/realdata-search.mjs` | #14, NOT the gate: the search on a COPY of live `storage/` with the real TMDB (STATUS.md "ticket #14"): keystroke times, web search, ONE import, screenshots |
  813. | `tests/realdata-person.mjs` | #16, NOT the gate: person pages on a COPY of live `storage/` with the real TMDB (STATUS.md "ticket #16"): cast click → filled times, other requests' wait, second visit, screenshots |
  814. | `tests/realdata-056.mjs` | mission 056, NOT the gate: the merged app on a COPY of live `storage/` after the adult backfill (STATUS.md mission 056): every public page type signed out + /my/* signed in at 390/1280 (times, header one row, screenshots), all list/search/person links → `slugs.txt`, an adult page signed out/in |
  815. | `tools/count-external-ids.hl` | #12: how many shows have each external id, per type, all / followed — ONLY on a copy |
  816. | `tools/count-duplicate-ids.hl` | duplicate `@id`s per table — ONLY on a copy (hybriel#113 check, mission 047) |
  817. | `tests/realdata-058.mjs` | mission 058, NOT the gate: on a COPY of live `storage/` (STATUS.md mission 058), signed in, 390/1280: full loads of a show, a movie, `/genres/<g>` + page 2, `/my/movies`; air dates, season check == its episodes, genre kinds, one movie-check click + reload (and back) |
  818. | `shortids.hl` | mission 060 (#27): the short ids — old ones from `data/old-short-ids.json`, the map over shows + persons (`ensureShortIds`), `claimShortId` for new records, the backfill batch `shortIdStep`, `shortIdPath` for `/<shortId>` |
  819. | `data/old-short-ids.json` | mission 060: the old tracker's 702 short ids (`oldId` → id), made by `tools/old-short-ids.hl`; deployed with the code |
  820. | `tools/old-short-ids.hl` | mission 060, one-off: the old export's `Show.jsonl` → `data/old-short-ids.json` (reads only the export) |
  821. | `tools/count-short-ids.hl` | mission 060: short ids counted (with/without, old kept/lost, duplicates across shows + persons) — ONLY on a copy or app stopped |
  822. | `tests/seed-shortids.hl` | mission 060: the gate's resume/duplicate fixture (60 persons without a short id, 2 sharing `aaaa1`), written with the app stopped |
  823. | `tests/realdata-063.mjs` | ticket #29, NOT the gate: on a COPY of live `storage/` (STATUS.md ticket #29), signed in, 390/1280: every check's class + computed look on `/my/unwatched`, a show page, `/my/movies`; screenshots; one `/my/unwatched` click + reload |
  824. | `tests/realdata-060.mjs`, `tests/realdata-060-backfill.sh` | mission 060, NOT the gate: on a COPY of live `storage/` (STATUS.md mission 060): page times + short id under the image + `/<id>` redirects at 390/1280; the backfill run timed with curl |
  825. | `tests/realdata-057.mjs` | ticket #17, NOT the gate: on a COPY of live `storage/` (STATUS.md #17), signed in, 390/1280: opening/closing seasons of big shows timed in the page (skeleton shown, rows there, skeleton gone), skeleton count, faces sent; then client-filled watch state == server-built |
  826. | `tools/check-public-slugs.hl` | mission 056: the slugs `tests/realdata-056.mjs` collected → adult true/false/unknown counts, a user's followed adult titles, poster files of adult vs other titles — ONLY on a copy |
  827. | `franchises.hl` | #19: franchises, timelines (tables, `byShow`), the pages' data, the widget (`widgetsOf`), the editor operations (`isEditorSession`), the TMDB collection seed (`seedStep`) — docs/franchises.md |
  828. | `components/franchises.hl`, `components/franchise.hl` | #19: `/franchises`; `/franchises/<slug>` + `/timelines/<slug>` (one component, sort toggle client-side) |
  829. | `components/franchisewidget.hl` | #19: the `‹ Prequel | Timeline | Sequel ›` widget, composed by `components/show.hl` |
  830. | `components/franchiseedit.hl`, `components/timelineedit.hl` | #19: the creator's editor (`/franchises/edit`, `/timelines/<slug>/edit`) |
  831. | `tests/franchises.mjs`, `tests/seed-franchises.hl` | #19: the franchise gate + its 7 collection movies |
  832. | `tests/realdata-066.mjs` | #19, NOT the gate: on a COPY after the seed: `/franchises`, matching timelines (REAL_MATCH), a movie's widget, the creator's editor; times + screenshots |
  833. | `tests/cdp.mjs`, `tests/ports.mjs` | the CDP browser driver, copied from `ident.worldapi.org/tests/` |
  834. | `docker-compose.yml`, `Dockerfile`, `deploy.sh` | Byrodin container; the deploy from Loreana (section "Deploy") |
  835. | `tools/migrate.hl` | one-off: old MongoDB export → `storage/mpackdb/` (step 2, idempotent, see `STATUS.md`) |
  836. | `tools/verify.hl` | one-off: proves the migrated data against a COPY of `storage/mpackdb/` (counts, zero dangling references, one show end to end) |
  837. | `tools/sync-tmdb.hl` | the TMDB sync from the command line (#9) — app stopped or a copy; `--limit N`; prints counts |
  838. | `tools/relink-episode-seasons.hl` | one-off: links episodes with no `season` (step 2 leftovers) by `(show, seasonNumber)` — not run against the live data yet, see "What it does (step 4)" |
  839. ## Vendored Hybriel
  840. `bin/hybriel` + `plugins/` = **hybriel master 8590df63** (mission 056; includes #122 18cf2fb9 — the post-face
  841. session sync re-derives with the page's route params — and #121 426944c7, on top of ff51cf46's #113/#115/#116/#118,
  842. the client-built SVG fix, hl:markdown), `bin/hybriel` sha256
  843. `ca830ef8400578ee081347953258acbfc8b516942d411e45aa98cffc77efdd6d`. No local patch. Built read-only from an archive
  844. (never in the hybriel checkout; the same with `hybriel-047` → `hybriel-056` for the older build):
  845. ```bash
  846. git -C /media/STORAGE/projects/hybriel archive master | tar x -C .scratch/hybriel-047
  847. cd .scratch/hybriel-047/native && /media/STORAGE/projects/hybriel/native/zig-toolchain/zig build -Dtarget=x86_64-linux-gnu.2.39 -Doptimize=ReleaseFast # → zig-out/bin/hybriel (hybriel README + ReleaseFast)
  848. cp zig-out/bin/hybriel ../../../bin/hybriel
  849. # plugins: copy every plugin dir the app already has (core crypto data fetch fs http http1 mpackdb proc smtp
  850. # time web) from .scratch/hybriel-047/plugins/ over plugins/ — `diff -rq plugins .scratch/hybriel-047/plugins`
  851. # must then list only plugins the app does not use
  852. ```
  853. The previous builds are kept in `.scratch/pre-056/` (ff51cf46, sha256 `55a724a0…`) and `.scratch/pre-047/`
  854. (837fe120 via ident, sha256 `9e5e95b3…`), bin/ + plugins/ each. After a re-vendor run the gate.

Branches

Latest commits

  • 0553b51ftracker#19 (mission 066): franchises and timelines — tables, /franchises, /franchises/<slug>, /timelines/<slug> (Timeline | Release sort, series by last episode), the Prequel | Timeline | Sequel widget with the franchise above, the creator's editor, TMDB collection seed in the app (resumes, paced); gate tests/franchises.mjs 48/0 + browser.mjs 266/0, tests/realdata-066.mjs, docs/franchises.md, README + STATUSmre
  • fa1f9dfatracker#29 (mission 063): unwatched check muted grey outline + check (accent only on hover), watched stays solid — no code regression, the accent outline read as ticked; gate checks real checks visibly (computed style + screenshot pixel) on /my/unwatched, show, movie, /my/movies; gate 266, tests/realdata-063.mjs, README + STATUSmre
  • d8b12d67tracker#27 (mission 060): short ids for movies, series and persons — old 702 kept (data/old-short-ids.json), new random [a-z0-9]{5} unique across both, claimed at creation, background backfill (resumes), shown under poster/photo, /<shortId> → 301; gate 259, tests/realdata-060*, README + STATUSmre
  • f14db671tracker#22-#25 (mission 058): episode air dates, season check = all episodes watched, movie watched check (+ /my/movies count), /genres/<genre> pages (movies + series, newest first, paginated); gate 238, tests/realdata-058.mjs, README + STATUSmre
  • 1704ec45tracker#17 (mission 057): season caret down/up, skeleton rows while a season loads, sessionless showSeasonEpisodes face (no page re-mount), client-only close; gate 214, tests/realdata-057.mjs, README + STATUSmre
  • f2fe3e36mission 056: README + STATUS (merge, fixes, Hybriel 8590df63, real-data check), tests/realdata-056.mjs, tools/check-public-slugs.hlmre
  • f40c250emission 056: re-vendor hybriel master 8590df63 (#121, #122); an adult title's page is Not found for non-followers; gate: leave the page before stopping the servermre
  • 2b7fdd6cmission 056: signed-out header one row on phones ("Log in", nowrap), backfill skips adult titles' posters, gate checksmre
  • 2c53d5efMerge branch 't16-person' (tracker#16 person pages) into main; filmography shows only public titles (054 adult flag), gate race fix (backfill start line)mre
  • c171227emission 054: hide adult/unknown titles from the public lists and the search; in-app adult-flag backfill (TMDB details + poster per title, resumes), gate + real-data proofmre
  • 139fafd8tracker#16: short bio (4 lines, click = all), real-data check script, README + STATUSmre
  • 93be9476tracker#16: person pages /person/<slug> with the filmography fetched from TMDB on the first visit (step by step), gatemre
  • 47a3cae6STATUS: mission 053 merge commit idsmre
  • dcc5eecaMerge branch 't14-search'mre
  • 03edc783Merge branch 't15-tvmaze'mre
  • 71b46345tracker#15: numbering check by date or title, placeholder titles in other languages, docs + real-data proofmre
  • 6bb2daf1tracker#13: homepage (tiles, intro, latest movies/shows), /shows, /movies/page/N, /my/movies; lists cached in memorymre
  • b8bd1157tracker#14: README + STATUS (search, real-data numbers, gate, merge notes)mre
  • 65c694a8tracker#14: search — header magnifier, /search/<text> (in-memory word-prefix index over titles + people), Fetch from web (TMDB search/multi, ours left out), Add = import via syncShow; gate +25 checks, real-data scriptmre
  • 34f2c15btracker#15: TVmaze merge in the sync (gaps only: new episodes/seasons, empty titles/air dates; numbering check), fake TVmaze episodes + gatemre