gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite448e656e448e656Tickets conductor: STATUS #51mree448e656/missions/027-push-subscriptions-build.md

7.0 KB

  1. # 027 — Build: ticket delta + push subscriptions (tickets#51)
  2. TASK (his words, unchanged): "we will also change the information you get to a delta like we have in conductor-hub as
  3. vinzenz the conductors should get their ticket updates directly as a push from tickets via a similar subscriber as gitoria
  4. builds it now. you don't need to know every detail of all projects its enough if you keep the overview." ('you' = Apollo)
  5. and "do the tickets delta and push subscription first to get it away from you" and "implement it as you see fit i will ask
  6. details tomorrow". Ticket: https://tickets.worldapi.org/tickets.worldapi.org/51 (do not write to it).
  7. ## Read first
  8. - /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all).
  9. - /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md; the plugin READMEs
  10. you use (plugins/fetch, plugins/time, plugins/crypto). Copy a working shape from the docs and from lib/stream.hl /
  11. lib/connections.hl; DOCS line in the report.
  12. - The evaluation: /media/STORAGE/claude-scratch/tickets/P51/REPORT.md (facts about /api/events, stream rows, HC /api/wake,
  13. Apollo's subscriber). Its option C with a separate public receiver is NOT what is built (see design).
  14. - README "API", "Event stream for programs (ticket #26)", "Test"; lib/stream.hl, lib/tickets.hl, lib/api.hl, project.hl.
  15. - HyperConductor API: /media/STORAGE/projects/hyper-conductor/README.md "API" (POST /api/wake {project,text},
  16. POST /api/chats/<id>/messages {text}).
  17. ## Design (NOT HIS: Apollo's direction 2026-11-01 + Tickets' simplification; Apollo decides changes)
  18. 1. Subscription (new table): id, owner (tickets user id), projects (list of project ids, or all), wake target
  19. {instance, wakeProject} or {instance, chat}, cursor (= last delivered stream row id), wakePending flag, created.
  20. Created by POST /api/subscriptions with a tickets token: for yourself (owner = token user), or for another user if
  21. you are admin of EVERY listed project. "all projects" only for yourself. GET /api/subscriptions (own + those you
  22. administer), POST /api/subscriptions/:id/remove. Instance must be a name from the server config (below). Baseline:
  23. cursor = current stream high-water at creation (no history flood).
  24. 2. The delta is COMPUTED from the existing numbered stream rows (lib/stream.hl) after the cursor; no second journal:
  25. - only the subscription's projects; never events whose actor is the owner (stable user id, not display name);
  26. - merged per ticket: first → last state, created, title/summary edited, assignee old → new, N comments (+ the last
  27. comment's first 200 chars), links; one line per ticket;
  28. - relevance marks per line: assigned (to owner, now or before), own (owner created it), mention (owner's name/handle
  29. in a comment/summary text of this delta — document the exact rule);
  30. - JSON {subscription, from, upTo, tickets:[{project, number, ref, subject, href, changes:{…}, relevance:[…], actors,
  31. lastAt}], more} and a text rendering (Accept: text/markdown) capped at 4 KB: relevant tickets first, at the cap one
  32. summary line "… and N more tickets in P1 (a), P2 (b)" (Vinzenz: summarise, never a second digest).
  33. - GET /api/subscriptions/:id/delta (owner's token only) returns it AND marks it delivered (cursor = upTo,
  34. wakePending = false), as Apollo ruled. `?peek=1` returns without marking.
  35. 3. Wake: after each stream write (never blocking the write: async fetchStart), every matching subscription whose
  36. wakePending is false and that has a non-own matching event gets wakePending = true and ONE wake to its HC instance:
  37. POST <instance url>/api/wake {project: wakeProject, text} or POST …/api/chats/<chat>/messages {text}. The text is
  38. content-free and self-explanatory: "tickets: new changes for you. Read them: curl -s -A <you> -H 'Authorization:
  39. Bearer <your tickets token>' -H 'Accept: text/markdown' https://tickets.worldapi.org/api/subscriptions/<id>/delta".
  40. No further wakes until the subscriber fetches. Failed wake (non-2xx/timeout 10 s): retry after 1, 5, 30, 120 min,
  41. then mark failed (visible in GET /api/subscriptions); on server start re-wake every subscription with pending
  42. undelivered changes. The standby swap must not double-send (document how).
  43. 4. Instances in the server config (.env on byrodin, never in git, never logged): TICKETS_WAKE_<NAME>_URL and
  44. TICKETS_WAKE_<NAME>_TOKEN for loreana (http://100.77.141.84:8100), byrodin (http://127.0.0.1:45010), lisbeth
  45. (ask nothing: leave it unset if unknown). The container runs with network_mode host. The tokens: Apollo provides
  46. them for the live .env (ask the conductor; never copy them from Apollo's files yourself).
  47. 5. Unchanged: /api/events (fields, cursor, filters), the Markdown views, cookies, the connect flow. Additive only.
  48. No gitoria-style signed POST to outside apps in this build (later, shared with gitoria).
  49. ## Tests (gates)
  50. - New tests/subscriptions.mjs against a local fake HC (records wakes): create/list/remove + rights (other user 403,
  51. non-admin for another user 403, unknown instance 400); baseline (no old events); own events never wake or show; one
  52. wake per pending episode, none until fetch, wake again after fetch + new event; merge per ticket (open → review → done
  53. = one line); relevance marks; 4 KB cap + summary line; peek does not mark; fake HC down → retries → failed, restart
  54. re-wakes; JSON + Markdown shapes. Each new check must fail on old code where meaningful (no route = fail).
  55. - Existing gates 0 failed: node tests/browser.mjs, tests/events.mjs (legacy stream unchanged), tests/security.mjs,
  56. tests/connect.mjs, node theme/check-theme.mjs . (2 day35 flakes were fixed in b7ca093).
  57. - README: new section "Subscriptions (ticket #51)" for conductors (how to subscribe, read, what a wake looks like).
  58. ## Path to live and live proof
  59. - STOP after gates and REPORT; the conductor reviews the diff. Then on his word: deploy with
  60. /media/STORAGE/projects/WorldAPI/worldapi-conductor/deploy-init.sh tickets (backup on /media/STORAGE; rc=0, 0 FAILED,
  61. curl loop 0 × 5xx, push after rc=0, main = origin/main), the conductor puts the wake tokens into the live .env.
  62. - Live proof (test data only in the test project the conductor names, never in his projects): a subscription for one
  63. parked conductor (Jukebox, loreana, wakeProject jukebox) on that test project; a ticket event there by another user →
  64. the parked chat wakes with the wake text (session_read shows it) → its delta fetch returns that ticket, marks
  65. delivered, a second fetch is empty. Then remove the subscription.
  66. ## Environment
  67. - Worktree + all files under /media/STORAGE/claude-scratch/tickets/S51/ (REPORT.md there). Branch s51-subscriptions from main.
  68. - Ports 8740–8759 (check ss first). Stop and list every process you started. No attribution lines in commits.
  69. - Model Sol (codex|gpt-6.1-sol), Sol at most 3 % of the Codex week (hard cap set by the conductor). Cap ~70 requests.
  70. ## Report
  71. Commits, design deviations (with reasons), gate numbers old vs new, test list, DOCS line, processes, open points.

Branches

Latest commits

  • e448e656Tickets conductor: STATUS #51mre
  • 1c10857bTickets conductor: P51 eval, brief 027mre
  • e725969dTickets conductor: #51 directionmre
  • 1b5c63ddTickets conductor: P51 startedmre
  • 9f13fbdaTickets conductor: brief 026 prioritymre
  • acc477d9Tickets conductor: brief 026 + Vinzenz recommendationsmre
  • 9233a734Tickets conductor: brief 026 completemre
  • 5da589fdTickets conductor: brief 026 + Gitoria's answermre
  • a3cd5329Tickets conductor: tickets#51 opened, brief 026 draftmre
  • 6f6e5797Tickets conductor: STATUS wordingmre
  • 957de51fTickets conductor: T36 live, #36 review, #50 donemre
  • bc2fde32Merge branch 'main' into t36-stylemre
  • b7ca093atests: wait for the new row and normalize editor marker spacesmre
  • 41da3525Tickets conductor: flake cause, T36 deploy stepmre
  • 64c477e6Tickets conductor: deploy waits for Arachnemre
  • 467d7286Tickets conductor: T36 done, deploy questionmre
  • fed5ca81ticket_list: remove repeated selected-state coloursmre
  • 8542fc8aTickets conductor: T36 proof reviewedmre
  • 35980936inbox: preserve desktop columns after list styles were scopedmre
  • 2a5b8b91Tickets conductor: T36 cap stop, resumed for proofmre