gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitdcc5eecadcc5eecaMerge branch 't14-search'mredcc5eeca/plugins/data/server.hl

2.6 KB

  1. \* hl:data — NEED EVALUATION, the one implementation every realm edge uses.
  2. A component's need is a member whose initializer calls a provider class
  3. (SPEC.md §9.2); the graph publishes each as { key, provider, method, args,
  4. project }. Evaluating one is: resolve the arguments against the caller's
  5. context — a folded constant, a route group's member, or a `session`
  6. field — call the provider method, and take the projected field. hl:web did
  7. this per request and per push; hl:ipc does it per peer push. It lived in
  8. hl:web until the second edge existed (2026-09-01), which is when "shared"
  9. stopped being a word and became this plugin. *\
  10. \* Every need of one component, against the provider instances of the calling
  11. edge. One memo per evaluation: two needs fed by the same call cost ONE call. *\
  12. runNeeds(
  13. Hybrid needs \\ the graph's need list for the component
  14. &providers \\ class name → provider instance (the edge module's)
  15. &params \\ route groups; {} for a peer that matched no route
  16. &sdata \\ the session bag; {} for a peer with no session
  17. ) {
  18. let out = {}
  19. let memo = {}
  20. for (need of needs) {
  21. out[need.key] = runNeed(&need, &providers, &params, &sdata, &memo)
  22. }
  23. return out
  24. }
  25. \* One need: the value its MEMBER holds. `need.project` is the field taken off
  26. the returned hybrid ("" = the member IS the return value). A provider read
  27. answers for null arguments (the 074 contract), so an anonymous caller
  28. evaluates the same needs and simply sees nothing of anyone. *\
  29. runNeed(&need, &providers, &params, &sdata, &memo) {
  30. let provider = providers[need.provider]
  31. if (provider == null) {
  32. return null
  33. }
  34. let args = []
  35. for (a of need.args) {
  36. if (a.group != null) {
  37. args[] = params[a.group]
  38. } else if (a.session != null) {
  39. if (a.session.length == 0) {
  40. args[] = sdata
  41. } else {
  42. args[] = sdata[a.session]
  43. }
  44. } else {
  45. args[] = a.value
  46. }
  47. }
  48. let ck = need.provider + "." + need.method + "(" + JSON.stringify(args) + ")"
  49. // a call that ANSWERED null is simply not memoized — repeating it is correct
  50. let result = memo[ck]
  51. if (result == null) {
  52. result = callProvider(&provider, need.method, &args)
  53. memo[ck] = result
  54. }
  55. if (need.project.length == 0) {
  56. return result
  57. }
  58. if (result == null) {
  59. return null
  60. }
  61. return result[need.project]
  62. }
  63. // The provider call itself — the method name is DATA, so the call is computed.
  64. callProvider(&provider, method, &args) {
  65. if (args.length == 0) {
  66. return provider[method]()
  67. }
  68. if (args.length == 1) {
  69. return provider[method](args[0])
  70. }
  71. if (args.length == 2) {
  72. return provider[method](args[0], args[1])
  73. }
  74. return provider[method](args[0], args[1], args[2])
  75. }

Branches

Latest commits

  • 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
  • cbdc4ea7tracker#12: link icons TMDB/IMDb/TVDB/TVmaze; sync fills missing ids (TVmaze lookup); movies fetched via /movie/mre
  • b105bcd8tracker#11: Hybriel master ff51cf46 (checks no longer vanish), mobile-first styles, carets, follow button, sign-in modal, inverted check, orange castmre
  • 31b758aatracker#10: installable app (manifest, service worker, offline shell), own icon + faviconmre
  • 2fa9d997tracker#9: TMDB sync (followed shows: seasons, episodes, posters), tools/sync-tmdb.hl + daily run 04:00 UTC, fake TMDB in gatemre
  • 49e1f61edeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
  • 54070a4etracker#8: /my/unwatched + /my/schedule (301 from old), S01E01, title (year), 1 episode, watched-set lookup (unwatched 15s -> 1s)mre
  • 3251488atracker#7: /my/shows (followed shows, newest follow first, poster, title, last watched SxxEyy); gate can take screenshots (TRACKER_GATE_SHOTS)mre
  • 44b7d9f9tracker#6: /schedule — upcoming episodes of followed shows, soonest firstmre
  • 91c9fc8ctracker#5: /unwatched — unwatched released episodes of followed shows, newest firstmre
  • a97c0295tracker#4: show page /shows/:slug (header, seasons, episodes, watch checks) + tools/relink-episode-seasons.hlmre
  • 05f407c5tracker: no border on any button except inverted ones (Log out, ident status and identities too); header brand weight 100mre
  • 17375427tracker#2: tools/migrate.hl + tools/verify.hl — old MongoDB data into mpackdb with new idsmre
  • 31aac936tracker#3: no border on the header and on filled buttons; inverted buttons keep theirsmre