tracker
All repositories: gitoria
4.1 KB
# Report 028 (w078) — tracker: code order (no behaviour change) — DONE on main**Commits** on main in loreana:/media/STORAGE/projects/tracker.worldapi.org (parent 4f47f18, fast-forward): `186079b` 1/5 move ·`94716fd` 2/5 util + topics · `06b078e` 3/5 project.hl = the map · `54796ff` 4/5 thin faces + last copies · `2e89b96` 5/5 let ·`d924f39` comments + audit tools · `27c916f` README/STATUS/LOG. Not pushed, not deployed. No `.env` read (the real-jobs run linked it for the runtime, as in mission 027; link removed). Every process killed byPID; 8720–8731 free; real-copy data deleted.## Before → after| | before (4f47f18) | after ||---|---|---|| `.hl` files in the root | 15 | 1 (`project.hl`) || `project.hl` lines | 914 | 261 || `let` (code, all .hl) | 1,211; 706 never reassigned (676 convertible + 30 name clashes) | 525 = 264 in loop bodies + 234 reassigned + 27 kept for a name clash; 667 converted |## File map (README "Files" has every file)- `project.hl` — config, every route, thin function routes, push audiences, boot wiring, `jobs = new Jobs()`, a feature → file index on top.- `lib/`: `util` (envOr, storageDir, postersDir, profilesDir, newId, hexDigits, todayStr, dateOr, textOr, hasId, listOr, firstOf,sortDesc — each once), `users` (+ /login/callback logic, `userOfCode` for both logins), `shows` (+ `isIncomplete`,`showsMovedPath`), `follows` (+ `toggleFollowed`), `watches` (+ `toggleWatched`, `toggleSeasonWatched`), `catalog`,`search` + `search-helpers`, `people`, `credits` + `credits-helpers` (out of details), `details`, `tmdb` (requests, out oftmdbsync), `sync` + `sync-helpers` (one title), `dailysync` (was deltasync), `backfill` (adult + kind), `shortids`,`franchises`, `collections` (the seed, out of franchises), `merge`, `jobs` (all background runners + clocks), `images`(posters/photos), `export` (the tools' mongo-export readers).- `components/styles.hl` (was `styles.hl`); `tools/let-audit.py`; `tests/realdata-m028.{sh,mjs}`.## Decisions- `lib/jobs.hl` is a CLASS with one instance (`jobs = new Jobs()` after the server): the runners' state is reassigned every step,a static cannot be (measured: "Cannot reassign immutable variable"); the code moved unchanged, log order unchanged.- `let` kept inside loop bodies (a plain declaration there fails on the 2nd pass — measured), and where the name is also amember/import/outer/free name (a plain `x = …` inside a function REBINDS a file member — measured) or used outside its block(the browser target emits a plain declaration as block-scoped JS `let`). Plain declarations copy like `let` (measured).- Faces/routes made thin where the logic was the topic's: show page check/follow toggles, both logins, posters/photos, /shows/<slug>.## Tests- Gates after every step and on the final tree: `TRACKER_GATE_PORT=8720 … TRACKER_GATE_CHROME=8722-8726 TRACKER_GATE_TMDB_PORT=8727`→ browser **342 passed, 0 failed**, kinds **32/0**, franchises **52/0** (outputs `.scratch/w078/gate-*.txt`, shots `/tmp/m028/`, looked at).- Real copy (live storage, signed in as az5b2, all jobs off, no `.env`): 24 pages (/, lists, franchises, 2 series, a show, 2movies, 2 persons, genre, search, all /my/*, not-found pages) + 10 redirects/404s, 2 runs per tree: **normalized HTML and thehydrated page text identical to 4f47f18 (49/49 files)**. Browser full load 2×10 per page: sum 7,358 → 7,258 ms (0.99×), boot48–51 s and 2,216 MB both; client modules +0.9 %.- Real jobs on the copy (final tree, forced delta run): sync 345 titles errors=0, repair 24/24, collections 17/17, others nothingto do; RSS max 2.49 GB.- Tools old vs new: old-short-ids byte-identical, migrate + verify identical, 7 count tools identical.## Open- Deploy: rsync has no `--delete` → the 14 old root `.hl` stay on Byrodin (unused); delete them by hand after deploying.- The search import face still stores the credits itself (search.hl → credits.hl would be an import cycle).- Long topic files left as they are: merge.hl 599, sync.hl 446, franchises.hl 445, people.hl 404 lines.- tools/lambda-audit.py now also lists 2 harmless reassignments (`fid = franchiseId`, `inShow = showId`) besides the 13 before.
Branches
Latest commits
- 9b3828aemission 046a: report, LOGmre
- 4b37356emission 046: franchise seed supersedeCollections reads the curated timelines once (10 s one-tick block at the end of boot)mre
- ac6268e3mission 046a: re-vendor Hybriel 528bc89f (integration 6): plugins mpackdb/time/web (bin/ git-ignored)mre
- 322b3293mission 046: photoQueue guard for non-row fetch results (damaged persons index)mre
- e5b99aecmission 046: photoQueue in slices (people.hl photoQueueStart/Step, jobs.hl photoTick), tests/photoqueue.hlmre
- 31dcf2admission 045: report, LOGmre
- 9c3971d0tests/persons-skip-count.hlmre
- 4d72e365mission 045mre
- b9cae4c9slices: skip and count non-row values from range(); merge persons pass falls back to iterate; guard testmre
- 3db7dc31merge w44-jobs-slices into w43-trkmemmre
- 593dab6fmission 043: report, LOGmre
- 1a5a4818boot scans back to iterate (slices measured slower: titles 114 s, episodes 141 s, persons failed); lambda per rowmre
- 03d29893boot scans read primary-key slices (lib/slices.hl from mission 044): iterate is eager too; people view log line back; allShows/allEpisodes stay for toolsmre
- 23375c58mission 044: report, LOG, STATUSmre
- c6fd928emission 044: 4096 slices for tables over 200 K rows, 15 ms budget, TRACKER_SLICE_DEPTH for testsmre
- fb057680mission 044: jobs.hl imports mergeLeft (gate found it), mission file, slices benchmre
- 0d6293ebmission 043: mission filemre
- d25bd14amission 044: sliced merge prepare + sliced collections prepare; jobs-dump old/new check + bulk fixturemre
- 633ee210mission 044: sliced table scans (slices.hl, pk-range slices) for the adult/kind/status/art/credits/details-repair queuesmre
- 55bbd619boot: one streamed pass per table (lib/bootscan.hl) instead of find(null,null) per module; follows/watches/franchises scans streammre