gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit06b078e306b078e3tracker mission 028 (code order) 3/5 project.hl is the map: config, routes, wiring and a feature → file index (914 → 258 lines); the background jobs (daily sync run, backfills, details repair, credits job, merge, short ids, collection seed) moved unchanged into lib/jobs.hl (a class: their state is reassigned every step, a static cannot be; one instance made after the server), the login callback into lib/users.hl, poster/photo serving into lib/images.hl, the /shows/<slug> rule into lib/shows.hl showsMovedPath; route handlers are thin wrappers; gates 342/0, 32/0, 52/0, real-copy pages identicalmre06b078e3/lib/people.hl

19.8 KB

  1. // lib/people.hl — THE PERSON PAGE's data (tracker.worldapi.org#16, components/person.hl `/person/<slug>`): a person by slug,
  2. // their facts and filmography, and the ONE-TIME fetch of their whole filmography from TMDB on the first visit. Creator:
  3. // "the movies come from artist scrolls. when one clicks on an artist that has no dataset yet the old version fetched that
  4. // artist and its entire bibilogrqphy so its profile was complete".
  5. //
  6. // personBySlug(slug) the person (slug = `urlSegment`) — a slug → id map built once (15k people, one scan)
  7. // personInfoOf(p) name, photo URL, born/died lines, bio
  8. // filmographyOf(p) their credits (`p.shows`): poster, title, year, role, kind — newest first, adult titles hidden
  9. // personFillStep(id) ONE step of the fetch, called again and again by the page until it answers `done`:
  10. // 1st call: GET <TMDB>/person/<tmdbId>?append_to_response=combined_credits (ONE request: details +
  11. // every cast/crew credit) + the photo (w185, like the posters); the person's facts are updated;
  12. // every next call stores the next `fillBatch` titles; the last one links the credits and marks
  13. // the person complete (`filmographyAt`, ms). hl:web serves one request at a time — between two
  14. // steps every other request is served, so a person with 300 credits never holds the server.
  15. //
  16. // COMPLETE = `filmographyAt` set: never fetched again (the daily sync may refresh followed people later — not built).
  17. // Migrated people are NOT complete (153 of them carry the old tracker's credits — kept, the fetch adds the rest).
  18. // A title we don't have → a MINIMAL show record (title, year, type, tmdbId, `adult`, overview, genres by TMDB id, language;
  19. // no seasons, no poster file; `minimal = true` — details.hl completes it when it is opened or by the repair job, tracker#26), shaped like search.hl importTitle's
  20. // (`oldId tmdb-<tv|movie>-<id>`, a free slug), indexed for the search and put into the public lists (catalog.hl).
  21. // The person's credits (`shows`, the migrated field): [{ show, character, posterPath, adult }] — `character` is the role
  22. // text (the characters, then crew jobs like "Director", " / " between them); `posterPath` = TMDB's, so the page can show
  23. // TMDB's small poster (w92, like search's web rows) until we have the file. ADULT (TMDB's flag, mission 054): a row is
  24. // shown only for a PUBLIC title (shows.hl `isPublicTitle`: `adult == false`, unknown hidden like the public lists) whose
  25. // credit is not adult either (mission 056 merge).
  26. // ONE PROCESS PER STORAGE (hybriel#21); new rows get self-assigned 16-hex ids (hybriel#113), like tmdbsync.hl.
  27. import { now } from 'hl:time'
  28. import { fetch } from 'hl:fetch'
  29. import { writeFile, mkDir, exists } from 'hl:fs'
  30. import { profilesDir, newId, textOr, listOr, sortDesc } from './util.hl'
  31. import { personsTable, showsTable, genresTable, showById, showYear, posterUrlOf, isPublicTitle, titlePath, typeWordOf, typeClassOf, liveShowOf } from './shows.hl'
  32. import { tmdbGet, tmdbImageBase } from './tmdb.hl'
  33. import { titleIdByTmdb, indexShow, slugOf, indexPerson } from './search.hl'
  34. import { slugBaseOf } from './search-helpers.hl'
  35. import { refreshCatalogShow } from './catalog.hl'
  36. import { claimShortId } from './shortids.hl'
  37. // titles stored per step (real data: see STATUS.md ticket #16 for the per-step time)
  38. static fillBatch = 40
  39. // ---- the person -------------------------------------------------------------------------------------------------
  40. static slugIndex = { built = false ids = {} }
  41. static ensureSlugIndex = () => {
  42. if (!slugIndex.built) {
  43. let m = {}
  44. for (p of personsTable.find(null, null)) { if (p.urlSegment != null) { m[p.urlSegment] = p.id } }
  45. slugIndex.ids = m
  46. slugIndex.built = true
  47. }
  48. return true
  49. }
  50. static personBySlug = (&slug) => {
  51. if (slug == null || hlTypeName(slug) != 'String' || slug == '') { return null }
  52. ensureSlugIndex()
  53. let id = slugIndex.ids[slug]
  54. return id == null ? null : personsTable.fetch(id)
  55. }
  56. static isComplete = (&p) => { return p.filmographyAt != null }
  57. // the page asks TMDB for this person: not complete yet, and TMDB knows them
  58. static needsFill = (&p) => { return !isComplete(p) && p.tmdbId != null }
  59. // the photo: /profiles/<oldId>.<ext> (project.hl profileRoute) — only when the file is there (the migrated `image` = 'jpg'
  60. // of 129 people never came with a file)
  61. static profileName = (&p) => {
  62. if (p.oldId == null || p.image == null || p.image == '') { return null }
  63. return p.oldId + '.' + p.image
  64. }
  65. static photoUrlOf = (&p) => {
  66. let name = profileName(p)
  67. return name != null && exists(profilesDir + '/' + name) ? '/profiles/' + name : ''
  68. }
  69. static monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
  70. // '1986-03-04' → '4 March 1986'; a bare year or anything else as it is
  71. static dateText = (&d) => {
  72. let t = textOr(d)
  73. if (t == null) { return null }
  74. if (t.length < 10) { return t }
  75. let m = toNumber(t.slice(5, 7))
  76. let day = toNumber(t.slice(8, 10))
  77. if (m == null || day == null || m < 1 || m > 12) { return t }
  78. return day + ' ' + monthNames[m - 1] + ' ' + t.slice(0, 4)
  79. }
  80. // { name, photoUrl, born, died, bio } — every field a plain string ('' = none)
  81. static personInfoOf = (&p) => {
  82. let born = dateText(p.birthDate)
  83. let place = textOr(p.birthPlace)
  84. let bornText = ''
  85. if (born != null && place != null) { bornText = 'Born ' + born + ' in ' + place } else if (born != null) { bornText = 'Born ' + born } else if (place != null) { bornText = 'Born in ' + place }
  86. let died = dateText(p.deathDate)
  87. return { name = p.name != null ? p.name : '' photoUrl = photoUrlOf(p) born = bornText died = died != null ? 'Died ' + died : ''
  88. bio = textOr(p.biography) != null ? p.biography : '' }
  89. }
  90. // ---- the filmography --------------------------------------------------------------------------------------------
  91. // the credits, one row per title (a title twice — the migrated credit and TMDB's — is ONE row, roles merged), newest
  92. // first by the title's release ('YYYY-MM-DD', else its year), undated last; only public titles (no adult/unknown)
  93. static filmographyOf = (&p) => {
  94. let byShow = {}
  95. let order = []
  96. for (c of listOr(p.shows)) {
  97. if (c != null && c.show != null) {
  98. let role = textOr(c.character)
  99. let prev = byShow[c.show]
  100. if (prev == null) {
  101. byShow[c.show] = { role = role != null ? role : '' posterPath = textOr(c.posterPath) adult = c.adult == true }
  102. order.push(c.show)
  103. } else {
  104. let x = prev
  105. if (role != null && !(' / ' + x.role + ' / ').includes(' / ' + role + ' / ')) { x.role = x.role == '' ? role : x.role + ' / ' + role }
  106. if (x.posterPath == null) { x.posterPath = textOr(c.posterPath) }
  107. if (c.adult == true) { x.adult = true }
  108. byShow[c.show] = x
  109. }
  110. }
  111. }
  112. let list = []
  113. let listed = {}
  114. for (sid of order) {
  115. let c = byShow[sid]
  116. // tracker#31: a credit on a merged tombstone is the keeper's (merge.hl repoints them; a keeper listed once)
  117. let s = liveShowOf(showById(sid))
  118. if (isPublicTitle(s) && !c.adult && listed[s.id] != true) {
  119. listed[s.id] = true
  120. let y = showYear(s)
  121. let release = textOr(s.release)
  122. let key = release != null && release.length >= 4 ? release : (y != null ? y : '')
  123. let poster = posterUrlOf(s)
  124. if (poster == '/posters/none' && c.posterPath != null) { poster = tmdbImageBase + '/w92' + c.posterPath }
  125. list.push({ key = key id = s.id title = s.title year = y != null ? y : '' href = titlePath(s) posterUrl = poster
  126. role = c.role typeLabel = typeWordOf(s) typeClass = typeClassOf(s) })
  127. }
  128. }
  129. let out = []
  130. let undated = []
  131. for (r of sortDesc(list)) { if (r.key == '') { undated.push(r) } else { out.push(r) } }
  132. for (r of undated) { out.push(r) }
  133. return out
  134. }
  135. // ---- the fetch ------------------------------------------------------------------------------------------------
  136. // person id → { items, pos, credits, added, requests, started, steps } while a fetch is under way (in memory: a restart
  137. // loses it — the titles stored so far are found again by TMDB id, nothing is duplicated)
  138. static jobs = {}
  139. // TMDB genre id → ours (our genres carry TMDB's id)
  140. static genreMap = { built = false ids = {} }
  141. static genreIdsOfTmdb = (&tmdbIds) => {
  142. if (!genreMap.built) {
  143. let m = {}
  144. for (g of genresTable.find(null, null)) { if (g.tmdbId != null) { m['' + g.tmdbId] = g.id } }
  145. genreMap.ids = m
  146. genreMap.built = true
  147. }
  148. let out = []
  149. for (t of listOr(tmdbIds)) {
  150. let id = genreMap.ids['' + t]
  151. if (id != null && !out.includes(id)) { out.push(id) }
  152. }
  153. return out
  154. }
  155. // TMDB's combined_credits → one item per title (cast AND crew of the same title merged), TV + movies only
  156. static creditItems = (&cc) => {
  157. let byKey = {}
  158. let order = []
  159. let all = []
  160. if (cc != null) {
  161. for (c of listOr(cc.cast)) { all.push({ credit = c role = textOr(c.character) }) }
  162. for (c of listOr(cc.crew)) { all.push({ credit = c role = textOr(c.job) }) }
  163. }
  164. for (a of all) {
  165. let c = a.credit
  166. let kind = c.media_type
  167. if ((kind == 'tv' || kind == 'movie') && c.id != null && hlTypeName(c.id) == 'Number') {
  168. let k = kind + ':' + c.id
  169. let known = byKey[k]
  170. if (known == null) {
  171. let name = kind == 'tv' ? textOr(c.name) : textOr(c.title)
  172. if (name != null) {
  173. byKey[k] = { kind = kind tmdbId = c.id title = name release = textOr(kind == 'tv' ? c.first_air_date : c.release_date)
  174. overview = textOr(c.overview) language = textOr(c.original_language) genreIds = listOr(c.genre_ids)
  175. posterPath = textOr(c.poster_path) adult = c.adult == true role = a.role != null ? a.role : '' }
  176. order.push(k)
  177. }
  178. } else if (a.role != null && !(' / ' + known.role + ' / ').includes(' / ' + a.role + ' / ')) {
  179. let x = known
  180. x.role = x.role == '' ? a.role : x.role + ' / ' + a.role
  181. byKey[k] = x
  182. }
  183. }
  184. }
  185. let out = []
  186. for (k of order) { out.push(byKey[k]) }
  187. return out
  188. }
  189. // the photo: w185 → storage/mpackdb/profiles/<oldId>.<ext> — { requests, image, tmdbProfile, failed }
  190. static syncProfile = (&p, profilePath) => {
  191. let out = { requests = 0 image = p.image tmdbProfile = p.tmdbProfile failed = null }
  192. if (textOr(profilePath) == null || p.oldId == null) { return out }
  193. let parts = profilePath.split('.')
  194. let ext = parts[parts.length - 1].toLowerCase()
  195. if (ext != 'jpg' && ext != 'jpeg' && ext != 'png' && ext != 'webp') { return out }
  196. let file = profilesDir + '/' + p.oldId + '.' + ext
  197. if (exists(file) && p.tmdbProfile == profilePath && p.image == ext) { return out }
  198. out.requests = 1
  199. let r = fetch(tmdbImageBase + '/w185' + profilePath, { headers = { 'user-agent' = 'tracker.worldapi.org (person page)' } timeoutMs = 20000 })
  200. if (r == null || r.status != 200 || r.body == null || r.body.length == 0) {
  201. out.failed = 'photo ' + profilePath + ': ' + (r == null ? 'no answer' : 'HTTP ' + r.status)
  202. return out
  203. }
  204. mkDir(profilesDir)
  205. writeFile(file, toBytes(r.body), 420)
  206. out.image = ext
  207. out.tmdbProfile = profilePath
  208. return out
  209. }
  210. // step 1: TMDB's person + credits; the facts (a TMDB value that is empty never overwrites ours) and the photo
  211. static startFill = (p) => {
  212. let t0 = now()
  213. let d = tmdbGet('/person/' + p.tmdbId + '?append_to_response=combined_credits')
  214. if (d.failed != null) { return { error = 'TMDB: ' + d.failed } }
  215. let items = creditItems(d.combined_credits)
  216. let photo = syncProfile(p, d.profile_path)
  217. let x = p
  218. if (textOr(d.biography) != null) { x.biography = d.biography }
  219. if (textOr(d.birthday) != null) { x.birthDate = d.birthday }
  220. if (textOr(d.deathday) != null) { x.deathDate = d.deathday }
  221. if (textOr(d.place_of_birth) != null) { x.birthPlace = d.place_of_birth }
  222. if (textOr(x.imdbId) == null && textOr(d.imdb_id) != null) { x.imdbId = d.imdb_id }
  223. if (d.adult != null) { x.adult = d.adult == true }
  224. x.image = photo.image
  225. x.tmdbProfile = photo.tmdbProfile
  226. if (personsTable.update(x.id, x) == null) { return { error = 'could not store the person: ' + personsTable.lastError() } }
  227. if (photo.failed != null) { console.log('person fill: ' + p.name + ': ' + photo.failed) }
  228. jobs[p.id] = { items = items pos = 0 credits = [] added = 0 requests = 1 + photo.requests started = t0 steps = 1 tmdbMs = now() - t0 }
  229. return { done = false pos = 0 total = items.length }
  230. }
  231. // a title we don't have: the minimal record (shape: search.hl importTitle) → its id, or null
  232. static addMinimalTitle = (&cr, &pid, pname) => {
  233. let kindType = cr.kind == 'tv' ? 'series' : 'movie'
  234. let rel = cr.release
  235. let yr = rel != null && rel.length >= 4 ? toNumber(rel.slice(0, 4)) : null
  236. let slug = slugOf(cr.title, cr.tmdbId)
  237. let record = {
  238. id = newId() title = cr.title summary = null tmdbSummary = cr.overview tmdbId = cr.tmdbId
  239. language = cr.language type = kindType release = rel year = yr image = null
  240. urlSegment = slug episodesCount = null homepage = null imdbId = null seasonsCount = null
  241. status = null tagline = null tvdbId = null tvmzId = null genres = genreIdsOfTmdb(cr.genreIds)
  242. cast = [{ person = pid character = cr.role actor = pname }] seasons = [] oldId = 'tmdb-' + cr.kind + '-' + cr.tmdbId
  243. adult = cr.adult imported = now() minimal = true
  244. }
  245. // mission 060: its short id (shortids.hl — unique across shows and persons)
  246. record.shortId = claimShortId('show', record.id, record.oldId)
  247. if (showsTable.put(record) == null) {
  248. console.log('person fill: "' + cr.title + '" not stored: ' + showsTable.lastError())
  249. return null
  250. }
  251. indexShow(record)
  252. refreshCatalogShow(record.id)
  253. return record.id
  254. }
  255. // every next step: the next `fillBatch` titles; the last one links the credits and marks the person complete
  256. static fillStep = (p, jobIn) => {
  257. let job = jobIn
  258. let total = job.items.length
  259. let end = job.pos + fillBatch
  260. if (end > total) { end = total }
  261. let credits = job.credits
  262. let added = job.added
  263. let pid = p.id
  264. let pname = p.name
  265. let i = job.pos
  266. while (i < end) {
  267. let item = job.items[i]
  268. let sid = titleIdByTmdb(item.kind == 'tv' ? 'series' : 'movie', item.tmdbId)
  269. if (sid == null) {
  270. sid = addMinimalTitle(item, pid, pname)
  271. if (sid != null) { added = added + 1 }
  272. }
  273. if (sid != null) { credits.push({ show = sid character = item.role posterPath = item.posterPath adult = item.adult }) }
  274. i = i + 1
  275. }
  276. job.pos = end
  277. job.credits = credits
  278. job.added = added
  279. job.steps = job.steps + 1
  280. jobs[pid] = job
  281. if (end < total) { return { done = false pos = end total = total } }
  282. // done: the credits (+ the migrated ones TMDB no longer lists), complete
  283. let have = {}
  284. let all = []
  285. for (c of credits) { have[c.show] = true all.push(c) }
  286. for (c of listOr(p.shows)) { if (c != null && c.show != null && have[c.show] != true) { all.push(c) } }
  287. let x = p
  288. x.shows = all
  289. x.filmographyAt = now()
  290. if (personsTable.update(x.id, x) == null) { return { error = 'could not store the filmography: ' + personsTable.lastError() } }
  291. personsTable.persist()
  292. showsTable.persist()
  293. jobs[pid] = null
  294. console.log('person fill: ' + pname + ' (tmdb ' + p.tmdbId + ') credits=' + total + ' added=' + added + ' requests=' + job.requests + ' steps=' + job.steps + ' tmdbMs=' + job.tmdbMs + ' ms=' + (now() - job.started))
  295. return { done = true pos = total total = total added = added }
  296. }
  297. // one step for the person with this id: { done, pos, total } or { error }
  298. static personFillStep = (&personId) => {
  299. let p = personsTable.fetch(personId)
  300. if (p == null) { return { error = 'no such person' } }
  301. if (isComplete(p)) { return { done = true } }
  302. if (p.tmdbId == null) { return { error = 'TMDB does not know this person' } }
  303. let job = jobs[personId]
  304. if (job == null) { return startFill(p) }
  305. return fillStep(p, job)
  306. }
  307. // ---- people from a title's cast (tracker#26, details.hl completeStep) ------------------------------------------
  308. // TMDB person id → our person id, built once (15k people, one scan), kept up to date by castPersonId
  309. // (flat statics, written key by key like search.hl's haveTmdb: `let m = …ids` would copy the whole map — plain data
  310. // deep-copies on assignment)
  311. static personTmdbBuilt = { yes = false }
  312. static personTmdbIds = {}
  313. static personIdByTmdb = (&tmdbId) => {
  314. if (!personTmdbBuilt.yes) {
  315. for (p of personsTable.find(null, null)) { if (p.tmdbId != null) { personTmdbIds['' + p.tmdbId] = p.id } }
  316. personTmdbBuilt.yes = true
  317. }
  318. return personTmdbIds['' + tmdbId]
  319. }
  320. // a free person slug: "Maya-Rudolph", taken → "-2", … (the migrated people's form)
  321. static personSlugOf = (&name, &tmdbId) => {
  322. ensureSlugIndex()
  323. let base = slugBaseOf(name, 'person-' + tmdbId)
  324. if (slugIndex.ids[base] == null) { return base }
  325. let n = 2
  326. while (slugIndex.ids[base + '-' + n] != null) { n = n + 1 }
  327. return base + '-' + n
  328. }
  329. // how many people castPersonId added since the start (details.hl counts a title's new people by the difference, tracker#28)
  330. static castPeopleAdded = { n = 0 }
  331. static castPeopleCount = () => { return castPeopleAdded.n }
  332. // our person for one cast entry of TMDB ({ tmdbId, name, character, gender }) — the one we have by TMDB id, else a NEW
  333. // person (name, tmdbId, a free slug, this one credit; not complete: their page fetches the rest on the first visit like any
  334. // migrated person). Answers the id, or null when it could not be stored. Also a CREW person (tracker#28: `character` = the
  335. // job, "Director").
  336. static castPersonId = (&c, &showId) => {
  337. let have = personIdByTmdb(c.tmdbId)
  338. if (have != null) { return have }
  339. let record = { id = newId() name = c.name tmdbId = c.tmdbId urlSegment = personSlugOf(c.name, c.tmdbId) oldId = 'tmdb-person-' + c.tmdbId
  340. gender = c.gender image = null tmdbProfile = null adult = false birthDate = null birthPlace = null deathDate = null imdbId = null
  341. shows = showId != null ? [{ show = showId character = c.character }] : [] added = now() }
  342. // mission 062 (tracker#27 for #26/#28): every person the app creates gets its short id at once (shortids.hl)
  343. record.shortId = claimShortId('person', record.id, record.oldId)
  344. if (personsTable.put(record) == null) {
  345. console.log('details: person "' + c.name + '" not stored: ' + personsTable.lastError())
  346. return null
  347. }
  348. personTmdbIds['' + c.tmdbId] = record.id
  349. slugIndex.ids[record.urlSegment] = record.id
  350. indexPerson(record)
  351. castPeopleAdded.n = castPeopleAdded.n + 1
  352. return record.id
  353. }
  354. // ---- GUEST STARS (mission 062): a series' guests are NOT person records — details.hl stores them on the title ({ tmdbId, actor,
  355. // character, profile, episodes, guest }, `person` only when we have them already). 160k people (most of them one-episode guests)
  356. // cost 3.3 GB of RSS at boot (w061). A guest's link is `/person/tmdb/<tmdbId>?show=<show id>` (project.hl guestRoute): the FIRST
  357. // open creates the person (name + role from that title's guest entry; without one — an old link — TMDB's /person/<id>), with its
  358. // short id, then the person page fills it like any other.
  359. static guestOf = (&showId, &tmdbId) => {
  360. let s = showId != null && hlTypeName(showId) == 'String' && showId != '' ? showsTable.fetch(showId) : null
  361. if (s == null) { return null }
  362. for (c of listOr(s.cast)) { if (c != null && c.tmdbId == tmdbId && textOr(c.actor) != null) { return c } }
  363. return null
  364. }
  365. // our person for this TMDB person (created now when we have none) → { id, created } or { error }
  366. static guestPersonId = (tmdbId, showId) => {
  367. let have = personIdByTmdb(tmdbId)
  368. if (have != null) { return { id = have created = false } }
  369. let g = guestOf(showId, tmdbId)
  370. let c = null
  371. let inShow = null
  372. if (g != null) {
  373. c = { tmdbId = tmdbId name = g.actor character = g.character gender = null }
  374. inShow = showId
  375. } else {
  376. let d = tmdbGet('/person/' + tmdbId)
  377. if (d.failed != null) { return { error = 'TMDB: ' + d.failed } }
  378. if (textOr(d.name) == null || d.adult == true) { return { error = 'no such person' } }
  379. c = { tmdbId = tmdbId name = d.name character = null gender = d.gender }
  380. }
  381. let pid = castPersonId(c, inShow)
  382. if (pid == null) { return { error = 'could not store the person' } }
  383. personsTable.persist()
  384. console.log('guest opened: ' + c.name + ' (tmdb ' + tmdbId + ') → new person ' + pid + (inShow != null ? ' from show ' + inShow : ' from TMDB'))
  385. return { id = pid created = true }
  386. }

Branches

Latest commits

  • 06b078e3tracker mission 028 (code order) 3/5 project.hl is the map: config, routes, wiring and a feature → file index (914 → 258 lines); the background jobs (daily sync run, backfills, details repair, credits job, merge, short ids, collection seed) moved unchanged into lib/jobs.hl (a class: their state is reassigned every step, a static cannot be; one instance made after the server), the login callback into lib/users.hl, poster/photo serving into lib/images.hl, the /shows/<slug> rule into lib/shows.hl showsMovedPath; route handlers are thin wrappers; gates 342/0, 32/0, 52/0, real-copy pages identicalmre
  • 94716fd2tracker mission 028 (code order) 2/5 util + topics: lib/util.hl holds envOr, storageDir, postersDir, profilesDir, newId, hexDigits, todayStr, dateOr, textOr, hasId, listOr, firstOf, sortDesc once (were copied into up to 5 files); tmdbsync.hl split into tmdb.hl (TMDB/TVmaze requests), sync.hl (one title's sync), sync-helpers.hl, backfill.hl; details.hl split into details.hl, credits.hl, credits-helpers.hl (isIncomplete to shows.hl); search-helpers.hl (words, query, ranking, slugs); collections.hl (the TMDB collection seed, out of franchises.hl); deltasync.hl renamed dailysync.hl; no behaviour change: gates 342/0, 32/0, 52/0, real-copy pages identicalmre
  • 186079b0tracker mission 028 (code order) 1/5 move: every root .hl except project.hl into lib/ (styles.hl into components/), import paths only; gates 342/0, 32/0, 52/0; real-copy pages identicalmre
  • 4f47f181tracker: report 027mre
  • dc1d4be4tracker mission 027: Hybriel master 06617221 vendored (plugin allocator fixes 3a781359 + 413f60e4); real copy RSS through first-start jobs + 400 loads flat ~2.55 GB (190aa11d 2.3 -> 5.6 GB), page times <= 1.1x; gates 342/0, 32/0, 52/0mre
  • 84e1b3e1tracker: reports 025 + 026mre
  • dc40d859tracker#31 (mission 026): duplicate titles merged — the 68 type+tmdbId pairs held by 157 records were the old tracker's (all migrated); merge.hl repair job (own clock, before the TMDB jobs) keeps one keeper per title (follows/watches > old short id > oldest), moves follows, watches, seasons, cast, credits, timelines, tombstones the rest (mergedInto, never deleted), slugs + short ids 301 to the keeper; stray seasons merged into their listed twin (Reacher S3 watches) or linked when watched; search import re-checks before its put; deploy.sh waits up to 90 s for 200; real copy 68 -> 0 dup ids, az5b2 follows/watches equal; gates 342/0, 32/0, 52/0mre
  • 2667da05tracker#30 (mission 025): /my/ pages from slim cached title cards, episode rows and watch sets (after the jobs /my/series 1.8 s -> 0.06 s, /my/unwatched 4.1 -> 0.18 s); timeline page shows its name once; franchise widget under the poster/title; movies with TV leftovers (First Contact) go through the details repair; tools/count-tmdb-ids.hl; gates 327/0, 52/0, 32/0mre
  • 3909810dantcolony#40: mission references in README/STATUS/docs point to the moved missionsmre
  • e63b1d28antcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
  • 1cda451dtracker: Hybriel master 190aa11d (#127 both shapes, GC correctness fc838894) — conductor adopts despite /my/series 2.4x after jobs (memory 8.0 → 1.7 GB boot); see reports/071mre
  • c1fa2f2etracker (mission 071): Hybriel master 190aa11d measured on the real copy vs the live binary 8590df63 — NOT adopted (after the first-start jobs /my/series 2.4x slower, /series 1.6x, RSS swings 7.4-12.2 GB; fresh it is flat at 1.7-2.2 GB and /my/unwatched faster), vendor stays 8efba065, candidate kept in .scratch/w071/vendor-190aa11d; tests/kinds.mjs: collection seed off (its TMDB request broke check 1 in 1 of 4 runs); tests/realdata-071.sh + realdata-071-bench.mjs + tools/realdata-071-table.py; README + STATUS (numbers, how to repeat); gates 325/0, 32/0, 50/0mre
  • 8081350atracker docs (mission 070): README (summary, Config HL_GC_BYTES — kept at Hybriel's default, the 256 MiB setting is taken out of docker-compose.yml again: the jobs grew to 12+ GB with it too, see STATUS), Test (three gates), Deploy (first start ~50 min: kinds then seed, restart once after collections done, memory numbers), Vendored Hybriel 8efba065 + #48 audit, Files; STATUS mission 070 entry (merges, migrated counts, lambda audit, gates, RSS old vs new, how to repeat, open points); docs/kinds.md + docs/franchises.md job order; tests/realdata-070-*.sh, tools/count-migrated.hl, tools/ref-params.py, tools/lambda-audit.pymre
  • 1ad19c8ctracker: re-vendor Hybriel master 8efba065 (#126 GC by bytes, #48 lambda parameters copy) (mission 070): bin/hybriel sha256 50361e95…, plugins core crypto data fetch fs http http1 mpackdb proc smtp time web; lambda audit: 13 lambdas change a passed record/list (11 through a local alias), no caller relies on it — unchanged; 319 read-only lambda parameters get & (no copy per call: /my/schedule 2.35 → 0.46 s, /my/unwatched 13.7 → 5.7 s on the real copy); /my/unwatched one merge sort instead of n² inserts; docker-compose HL_GC_BYTES=268435456; deploy.sh runs kinds.mjs + franchises.mjs too (default ports 8700–8710); tests/realdata-070.mjs; gates browser 325/0, kinds 32/0, franchises 50/0mre
  • 46b21389tracker (mission 070, conductor): the sync never destroys migrated data — the one-time summary step MOVES a copied summary to migratedSummary (marker summaries-moved.txt) instead of clearing it; a migrated record's first title/genres/homepage/tagline TMDB replaces → migratedTitle/migratedGenres/migratedHomepage/migratedTagline, a migrated season's/episode's title/summary → migratedTitle/migratedSummary (set once); tests/peek-shows.hl prints them; gate 325/0mre
  • 749019b0Merge t19 (tracker#19 franchises + timelines) into main (mission 070): conflicts README/STATUS/show.hl/project.hl/browser.mjs/faketmdb.mjs, both sides kept; franchise/timeline pages get #20's typed heading (Franchise | …, Timeline | …), their title links via titlePath (/movies|/series|/shows); the collection seed waits for repair, kinds and credits too; franchises.mjs URLs + 2 new checks; gates browser 323/0, kinds 32/0, franchises 50/0mre
  • daf49feaMerge t20 (tracker#20 typed headings + #21 series/shows split) into main (mission 070): conflicts README/STATUS/show.hl/project.hl/search.hl/components/search.hl/browser.mjs/faketmdb.mjs, both sides kept; clock order backfill → repair → kinds → credits; withDetailsFields stores tmdbType + kind; gates: browser.mjs URLs → /series|/movies, typed h1 selectors; kinds.mjs repair/credits off, fixture name = seed name; browser 323/0, kinds 32/0mre
  • 20e09d89Merge t18 (tracker#18 delta sync) into main (mission 070): conflicts README/STATUS/show.hl/project.hl/browser.mjs, both sides kept; pageShowOf summary = summaryOfmre
  • f83571c3tracker#18 (mission 067): daily sync by change lists — TMDB /tv|movie/changes (since the stored day, paged) + TVmaze /updates/shows → only our changed titles (followed: full step, unfollowed: light step — changed seasons, no TVmaze), full walk on first run / gap > 14 days / failed list; show record refreshed (title, tmdbSummary, tagline, status, genres …; renamed titles re-indexed); summary = the creator's own text (page: summary > tmdbSummary > tvmazeSummary), one-time clear of copied summaries (9,647 on the live copy); gate 261, tests/realdata-018*.mjs, README + STATUSmre
  • 1ed5457etracker#20 + #21 (mission 068): typed headings "<Type> | <name>" in type colours; TV titles split into Series (/series) and Shows (/shows) by TMDB type + Reality/Talk/News genres — kind stored by sync/import/adult backfill + new kind backfill (resumes), /movies/<slug>, /shows/<slug> of a series/movie → 301, /my/series + /my/shows, home 5 tiles + 3 rows, search/filmography labels; gates kinds 32 + browser 266, tests/realdata-068.mjs, tools/count-kinds.hl, docs/kinds.md, README + STATUSmre