gitoriaLog in with ident

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit2ab91ee92ab91ee9tickets: gate checks rows appear once (session sync); re-vendor to ff51cf46 stopped on hybriel#122, stays 837fe120mre2ab91ee9/STATUS.md

42.4 KB

  1. ## 2026-10-01 — mission 048: re-vendor to hybriel master ff51cf46 STOPPED (Hybriel bug) — restored to 837fe120
  2. Tried master ff51cf46 (ReleaseFast, read-only archive): gate 212 passed, 1 failed — settings "Save" turns the admin page into
  3. "Only an admin of the project can open its settings". CAUSE (hl:web, 0b17f65b + 64527baa): after ANY face that takes `session`,
  4. WebFramework.hl answers with `ack.sync` built from `mount(key, {}, s, …)` — the component re-mounted WITHOUT its route params, so
  5. every server reference site reading session (`isAdmin = … isAdminOf(project.id, me)`) is computed with `projectSlug = null` →
  6. false, and the browser takes it. Minimal repro: `.scratch/w048/repro/` (`node repro.mjs <bin>` in a tree with master's plugins:
  7. "you may edit" → "you may not edit" after a face; 837fe120 keeps it). Restored `bin/` + `plugins/` from `.scratch/pre-048/`;
  8. gate on the restored copy (ports 8732–8739, A/B one port each) → 245 passed, 0 failed. Logs: `.scratch/w048/`.
  9. Live data (copy, deleted): no duplicate @id in any table (#113). migrate.hl compactNow() workaround (hybriel #110, master has it)
  10. KEPT — not provable without the new binary. Not deployed.
  11. Follow-up (lead: since 64527baa a session face also syncs session-derived members → a handler that appends the face's row shows
  12. it twice, as in gitoria): tickets never appends a face's answer to a synced list (comments/state events arrive by push into `events`,
  13. which reads no session; list/inbox upsert by id; tokens/members/choices are replaced from the answer). Gate +4 "once:" checks
  14. (comment once in A and B, state change once, bob once in the settings members). 837fe120: 249 passed, 0 failed. Master copy
  15. (throwaway): the 3 comment/state ones green, members unreachable (stops at the settings bug) — `.scratch/w048/gate-once-*.txt`.
  16. ## 2026-10-01 — mission 046: installable app (PWA) + own icons — NOT deployed, awaiting architect / creator
  17. Done: `project.hl` (appIcons, appTouchIcon, appFavicon, theme = header darker rgb(15, 20, 25), `offline = [ TicketList ]`, icon routes,
  18. real `/favicon.ico`), `components/main.hl` + `styles.hl` (the "You are offline" note via the net-probe animation tick),
  19. `icons/` (ticket stub, svg source + PNGs + ico), gate part "PWA" in `tests/browser.mjs` (README "PWA", "Test").
  20. Gate (ports 8750–8759, command in README "Test") → **245 passed, 0 failed** (was 233); `tests/connect.mjs` 60/60 (run on a
  21. temp copy with Chrome 8757–8759). Looked at: icon 48/192/512 + maskable crop, 390 px online/offline shots — /tmp/w046-tickets/ on Loreana.
  22. Gate race fixed: "inbox follows the state change live" failed ~1/5 (API write overtook the tab's hello; the worker's extra
  23. requests widened the window) → `connected()` now waits for a pong after the hello. 12 runs green (6 on 8740–8749, 6 on 8750–8759).
  24. Open: offline `/` shows the list as last loaded (stale by design); verify install on a real phone after deploy.
  25. ## 2026-09-26 — ticket #23: connect protocol documented for app workers
  26. New `docs/connect-apps.md` (steps, exchange, key headers, create-ticket / comment / state calls); linked from the README. No code change.
  27. # STATUS
  28. ## 2026-09-26 — ticket #21: connect an app to a project (gitoria's tickets) — NOT deployed
  29. Done: `connections.hl` + `components/connect.hl` + routes (`/connect`, `/connect/:nonce`, `/api/connect/exchange`, `…/connections`, `…/connections/remove`), the
  30. connections line + Disconnect on the project page, per-project key `tktc_…` (create / comment / state only, roles of the NAMED person via
  31. `X-Tickets-Identity`). README section "Connecting an app to a project". `node tests/connect.mjs` → 60 passed, 0 failed. NOT run: the old gate
  32. `tests/browser.mjs` / `short-id-switch.mjs` (they need a copy of ident's code, `ident.worldapi.org` is not on this machine); the only shared-code
  33. change is `apiAuth` in `project.hl` (token users behave as before — checked in the new gate). Gitoria's side (button "Connect tickets", storing the key,
  34. sending the events) is gitoria's ticket. On Byrodin set `TICKETS_CONNECT_ORIGINS` only if a non-worldapi.org app must connect.
  35. ## 2026-09-26 — ticket #22: every event in the API carries `userId` — NOT deployed
  36. `store.hl eventRowOf` adds `userId` (the users @id of the author; `''` for events from before the login). `author` (display name) unchanged. Checked with a real write on a fresh store (`.scratch/m22/t.hl`: user, project, ticket, comment): both events show `userId` = the author's users @id. Not covered by the gate.
  37. ## 2026-09-26 — ticket #20: projects as own data, members, roles, new states — NOT deployed (architect: together with the scheduler update)
  38. Took over the unfinished worker session s-20260926T1044-278e20 (store/projects/members/settings/invites/inbox code was written, the gate not run).
  39. Fixed: the migration's replaced records left tombstones and the page realm's second open compacted the files under the first handle (every slug
  40. lookup 404'd after the first page render) → `migrate.hl` compacts the changed tables. Gate: `tests/browser.mjs` → 233 passed, 0 failed (roles,
  41. states + aliases, inbox, project create / settings / slug change / members / invite accepted through ident, layouts of the new pages);
  42. `tests/short-id-switch.mjs` (ports 8706/8707) → 19 passed, ported to the roles. The migration was also run on a copy of the dev store (5 projects,
  43. 47 tickets: 38 open, 9 done). Parked: the old browser checks (`tests/browser-pre20-parked.txt`). Not done: live push of a role change to an open page
  44. (a page needs a reload after an admin changes its role), the "answered" state of #19 is gone (replaced by these states).
  45. ## 2026-09-26 — mission 036: on hybriel master 837fe120 (hl:web, no local patch) — NOT deployed, awaiting architect
  46. Still carries the UNDEPLOYED #19 state (see Byrodin STATUS: never deploy tickets before #19 is decided).
  47. Switched: plugins/webex + both LOCAL PATCHes gone → master's plugins/web; `'hl:web'` / `'hl:web/css'` imports;
  48. NativeWebSocketServer/bindHost gone (hl:web reads HL_HOST); /login/callback uses `req.session` (still mints +
  49. Set-Cookie when the browser has none); `realSession()` gone (`session == null`); `encode` = `encodeURIComponent`;
  50. import.hl `after` = `a > b`; jsoncheck accepts a VALID \u surrogate pair (lone ones still 400 — JSON.parse still
  51. aborts on them, checked with the new binary); shared/tokens.hl = ident's/gitoria's hl:web copy. Gate: the 12 forged
  52. checks accept hl:web's own refusal (ack `ok:false`, "the `session` parameter is filled by the server"); surrogate cases
  53. updated (+2 checks: pair passes, high+non-low refused). `node tests/browser.mjs` → **423 passed, 0 failed** (incl.
  54. the #104 text-order check "the form says which ticket it opened"), no Chrome left. Served page:
  55. `/__hl/{hl-runtime.js,web/client.js,app.css}?v=ead0a6f2dfc83077`, 0 unhashed refs, hashed = immutable, bare = no-cache.
  56. Backup of the old state: `.scratch/pre-036/` (bin, plugins, src, tests). Kept: jsoncheck, localtime, hand sorts,
  57. login.js guard (JS untouched).
  58. ## 2026-09-25 — mission 035: re-vendor to hybriel master 13ef4f9b STOPPED (Hybriel bug) — code NOT touched (only this note)
  59. Probe in a copy (loreana `~/scratch-035/tickets-probe` deleted; recipe: rsync without .env/storage, bin+plugins from master,
  60. `'hl:webex'`→`'hl:web'`, `'hl:webex/css'`→`'hl:web/css'`, gitoria's `shared/tokens.hl`): gate 408 passed, 13 failed. (1) HYBRIEL
  61. BUG: an element built in the browser when its `if` turns true puts a child element BEFORE the bound text: `p { notice " " a {…} }`
  62. in ticket_list.hl renders `<a>open it</a>Opened hybriel #1. ` (server render is right). Repro: loreana
  63. `~/scratch-035/repro/home-textorder.hl`. (2) 12 forged-session checks expect an app `{error}`; hl:web now refuses the extra
  64. argument itself (ack `ok:false`) → the checks must accept that. Workarounds to drop at the real re-vendor: webex LOCAL PATCHes,
  65. NativeWebSocketServer listener (HL_HOST), realSession(), charCodeAt ordering, jsoncheck surrogate refusal (#15), hand URL encoders.
  66. ## 2026-09-25 — ticket #19 "answered" state — awaiting architect (deploy) / creator
  67. New state `answered`. When the creator comments on a ticket in `awaiting creator`, the store (`addComment`)
  68. also writes a state event → `answered` (goes back to whoever asked, leaves the inbox). Other users' comments
  69. change nothing; "confirmed" stays "tested, works". The asker sets `awaiting creator` again as before.
  70. API POST comments and the page face push both events; state badge colour + filter added. Gate: new #19 checks.
  71. DECISIONS.md not touched (architect/librarian).
  72. ## 2026-09-24 — ticket #12 Markdown source view (mission 025) — awaiting architect (deploy) / creator
  73. Follow-up to mission 024: the creator asked (ticket #12, after "awaiting creator") for "a switch
  74. source / markdown at the bottom" to copy/paste or hand-edit the raw Markdown.
  75. Done (worker; edited `/media/STORAGE/projects/worldapi-components/md-editor.js` directly — a plain
  76. JS asset, no `.hl` dev-server-reload risk — then `cp` into `shared/md-editor.js` here; no tickets
  77. `.hl`/faces/API/data changed, so nothing else needed a dev-copy round-trip):
  78. - `<md-editor>` gets a footer row at the bottom with a "Markdown source" button: swaps the visual
  79. editor for a plain textarea with the raw Markdown (copy/paste or hand-editing), "Visual editor"
  80. swaps back (re-parses the text). Same `input`/`change` events, Ctrl+Enter still sends the form.
  81. Hidden together with the toolbar when `toolbar="none"`. Details: worldapi-components README
  82. "Source view" / STATUS mission 025.
  83. - Component test (worldapi-components) → **81 passed, 0 failed** (72 before + 9 new checks), 83
  84. with `ORACLE_APP`. Screenshot `worldapi-components/.scratch/test/md-editor-source-view.png`.
  85. - This app's gate `node tests/browser.mjs` (ports 8700-8729, this session's range) → **418 passed,
  86. 0 failed**, unchanged from mission 024 (no new tickets-side checks added — the feature lives
  87. entirely in the vendored component; the existing `#12` checks already cover the enhanced/standalone
  88. editors and keep passing with the new footer present).
  89. How to verify (ports 8700-8749 only):
  90. ```bash
  91. cmp /media/STORAGE/projects/worldapi-components/md-editor.js shared/md-editor.js && echo same
  92. cd /media/STORAGE/projects/worldapi-components && HL_CHROME=/opt/google/chrome/chrome node test/run.mjs # 81 passed
  93. cd /media/STORAGE/projects/tickets.worldapi.org
  94. TICKETS_GATE_PORT=8700 TICKETS_GATE_IDENT_PORT=8701 TICKETS_GATE_EXCHANGE_PORT=8702 \
  95. TICKETS_GATE_CHROME_A=8710-8719 TICKETS_GATE_CHROME_B=8720-8729 node tests/browser.mjs # 418 passed
  96. ```
  97. Manual (creator): open a ticket → Comment field → click "Markdown source" at the bottom → the box
  98. becomes a plain textarea with the Markdown → edit it → click "Visual editor" → it renders again.
  99. Not deployed (Byrodin container untouched, live app on tickets.worldapi.org still the pre-mission-025
  100. version); the architect deploys with `./deploy.sh` after the creator confirms.
  101. ## 2026-09-24 — ticket #12 Markdown editor (mission 024) — awaiting architect (deploy) / creator
  102. Done (worker; developed in `.scratch/dev-m024`, copied back, NOT deployed):
  103. - New project `/media/STORAGE/projects/worldapi-components/` with `<md-editor>` (its README/STATUS/test).
  104. - Vendored as `shared/md-editor.js`, route `/md-editor.js`, script in the shell; new-ticket summary, edit
  105. summary, comment and state note (input → textarea rows 1) wrapped in `mdEditor { textarea {…} }`;
  106. `styles.hl` sets the `--md-*` tokens. Faces/API/data unchanged. README "Markdown editor".
  107. - Gate `node tests/browser.mjs` → **418 passed, 0 failed** (402 old + 16 new `#12` checks; dev copy and main folder).
  108. - Component test (in worldapi-components, with this app's markdown.hl as oracle) → 72 passed, 0 failed.
  109. - Old files before the copy-back: `.scratch/m024/pre-copy-backup/`.
  110. How to verify (ports 8800-8849 only):
  111. ```bash
  112. cd /media/STORAGE/projects/tickets.worldapi.org
  113. cmp shared/md-editor.js ../worldapi-components/md-editor.js && echo same
  114. bash .scratch/m024/gate-tickets.sh .scratch/m024/g.txt; tail -2 .scratch/m024/g.txt # 418 passed (ports 8810-8812, Chromes 8835-8844)
  115. cd ../worldapi-components && ORACLE_APP=../tickets.worldapi.org HL_CHROME=/opt/google/chrome/chrome node test/run.mjs # 72 passed
  116. ps -eo pid,args | grep [h]l-browser-tier | grep remote-debugging-port=88 # empty
  117. ```
  118. Screenshots: `.scratch/gate-{phone,desktop}-mdeditor.png`, `.scratch/gate-phone-newticket-mdeditor.png`,
  119. `../worldapi-components/.scratch/test/md-editor-{phone,desktop}.png`.
  120. Manual (creator): open a ticket → Comment: type `**bold**` → it turns bold; tap B / list on the phone;
  121. Ctrl+Enter sends; Edit → the summary shows formatted, Save.
  122. Lessons: `<md-editor>` is form-associated, so a wrapping `<label>` activates IT (not the textarea);
  123. Hybriel's JSON.stringify sorts object keys (compare key-sorted); a `<textarea>` turns CR LF into LF
  124. when its value is set by script.
  125. ## 2026-09-24 — design tokens AS DESCRIBED (ticket antcolony#3, mission 021) — awaiting architect (deploy) / creator
  126. Mission 018 (generated `':root'` copy + sync.sh) was REJECTED by the creator; mission 021 replaces it.
  127. Done (worker; developed in `.scratch/dev-m021`, copied back, NOT deployed):
  128. - `shared/tokens.hl` = hand-written webex `var()` tokens (`static dark = var('rgb(25, 30, 35)')`, semantic
  129. `colorText = var(light)` …, incl. `colorAccentText` moved here from the app), verbatim copy of
  130. `/media/STORAGE/projects/worldapi-tokens/tokens.hl`. `styles.hl` member-imports them and uses them as
  131. members; sets only `colorAccent = var(purple)`. README "Design tokens".
  132. - webex LOCAL PATCH (mission 021, hybriel#39) in `plugins/webex/WebFramework.hl`; XSS patch kept.
  133. - Old files: `.scratch/m021/pre-copy-backup/` (styles.hl, shared/tokens.hl, WebFramework.hl); mission 018's
  134. worldapi-tokens folder (sync.sh, tokens.css, generated tokens.hl): `tickets.worldapi.org/.scratch/m021/worldapi-tokens-m018-backup/`.
  135. - Rendered colours unchanged: `/__hl/app.css` after `:root` byte-identical old vs new (in `:root` only
  136. the order of `--color-accent-text` / the app's `--color-accent` changed); Chrome computed colours
  137. of every element + every token, tickets list/inbox/state/ticket/you + ident home/code/account/apps/inbox,
  138. 390 + 1280: 23 passed, 0 failed.
  139. - Gate `node tests/browser.mjs` (ports remapped: `.scratch/m021/gate-tickets.sh`) → **402 passed, 0 failed** (dev copy and main folder).
  140. - Deploy simulation (deploy.sh excludes + debian:12-slim container): same app.css, byte-identical.
  141. How to verify (ports 8850-8879 only; scripts in tickets.worldapi.org/.scratch/m021 unless noted):
  142. ```bash
  143. cd /media/STORAGE/projects/tickets.worldapi.org
  144. for a in tickets ident; do cmp /media/STORAGE/projects/worldapi-tokens/tokens.hl ../$a.worldapi.org/shared/tokens.hl && echo same $a; done
  145. bash .scratch/m021/cmpup.sh up; node .scratch/m021/cmpstyles.mjs; bash .scratch/m021/cmpup.sh down # 23 passed (old code: <app>/.scratch/m021/old-<app>)
  146. IDENT_GATE_DIR=/media/STORAGE/projects/ident.worldapi.org bash .scratch/m021/gate-tickets.sh .scratch/m021/g.txt; tail -2 .scratch/m021/g.txt # 402 passed
  147. cd /media/STORAGE/projects/ident.worldapi.org; bash .scratch/m021/gate-ident.sh . .scratch/m021/gates-main # 6 suites green
  148. bash /media/STORAGE/projects/tickets.worldapi.org/.scratch/m021/deploysim.sh <tickets dir> <ident dir> # needs cmpup's run/main-*.css
  149. ps -eo pid,args | grep [h]l-browser-tier # empty
  150. ```
  151. Screenshots: `tickets.worldapi.org/.scratch/m021/shots/<app>-<old|new>-<page>-<390|1280>.png`.
  152. Lesson: an imported `static` var() token works only with the mission 021 webex patch; tokens.hl changes need a restart.
  153. ## 2026-09-24 — shared design tokens (ticket antcolony#3, mission 018) — REJECTED by the creator, superseded by mission 021
  154. Done (worker; developed in `.scratch/dev-m018`, copied back, NOT deployed):
  155. - Tokens now come from `shared/tokens.hl` (generated from layouts `tokens.css` by
  156. `/media/STORAGE/projects/worldapi-tokens/sync.sh`, vendored like plugins/); `styles.hl` inherits it and
  157. sets only the accent (README "Design tokens"). Old copy of `styles.hl`: `.scratch/m018/pre-copy-backup/`.
  158. - Every rendered colour unchanged: `/__hl/app.css` after `:root` byte-identical old vs new; computed
  159. colours of every element (tickets list/inbox/state/ticket/you, ident home/code/account/apps/inbox, 390 +
  160. 1280) old == new in Chrome.
  161. - Gate `node tests/browser.mjs` → **402 passed, 0 failed** (dev copy and main folder).
  162. How to verify (ports 8850-8879 only):
  163. ```bash
  164. cd /media/STORAGE/projects/tickets.worldapi.org
  165. /media/STORAGE/projects/worldapi-tokens/sync.sh --check # ok ×3
  166. bash .scratch/m018/cmpup.sh up; node .scratch/m018/cmpstyles.mjs; bash .scratch/m018/cmpup.sh down # 23 passed (old code in .scratch/m018/old-*)
  167. IDENT_GATE_DIR=/media/STORAGE/projects/ident.worldapi.org bash .scratch/m018/gate-tickets.sh /tmp/g.txt; tail -2 /tmp/g.txt # 402 passed
  168. cd /media/STORAGE/projects/ident.worldapi.org; bash .scratch/m018/gate-ident.sh . .scratch/m018/gates-main # 6 suites green (ports remapped copies)
  169. bash /media/STORAGE/projects/tickets.worldapi.org/.scratch/m018/deploysim.sh <tickets dir> <ident dir> # deploy rsync + container: same app.css
  170. ps -eo pid,args | grep [h]l-browser-tier # empty
  171. ```
  172. Screenshots: `tickets.worldapi.org/.scratch/m018/shots/<app>-<old|new>-<page>-<390|1280>.png`.
  173. Lesson: a `var()` token of hl:webex/css can't cross an `inherit` (second instance) — use literal `':root'` strings.
  174. ## 2026-09-24 — ticket #4 (mission 017): parent / child + blocked-by — awaiting architect (deploy) / creator
  175. Done (worker; developed in `.scratch/dev-m017`, copied back, NOT deployed to Byrodin):
  176. - **Relations** (README "Relations"): a ticket has ≤ 1 parent and any number of blockers, across
  177. projects; parent page lists children + states, child shows "Part of …"; "Blocked by" / "Blocks" on
  178. both sides. New table `storage/mpackdb/links.*` (created empty — no migration); every change is a
  179. history event `kind:"link"` on the child / blocked ticket.
  180. - **Who may**: the author of either ticket or the creator (legacy tickets without author: only the
  181. creator or the other ticket's author). No self-links, no loops (also transitive), no duplicates.
  182. - **Parent state**: `allChildrenConfirmed` (children exist and all `confirmed`) → page "all children
  183. confirmed (n)" (green) / "k of n children confirmed"; the parent's state is never changed.
  184. - **API**: `POST …/parent {parent}` (`""` removes), `POST …/blocked-by {add}|{remove}`, both URL
  185. forms; rows (list + single) carry `parent`, `children`, `blockedBy`, `blocks` (refs with states),
  186. `allChildrenConfirmed`. Markdown view: Parent / Children / Blocked by / Blocks blocks + list-line tails.
  187. - **Web**: forms "Parent ticket" (Set / Remove) and "Blocked by" (Add, Remove per row) for logged-in
  188. users; live push `ticketsRelated` after relation writes, state changes and edits.
  189. - Gate ports configurable (`TICKETS_GATE_CHROME_A/B` new); a `connected()` wait added before the
  190. pre-existing token "Revoke" click (it flaked once on the bare SSR button).
  191. - Gate `node tests/browser.mjs` → **402 passed, 0 failed** (dev copy 3× in a row, main folder 3×).
  192. How to verify:
  193. ```bash
  194. cd /media/STORAGE/projects/tickets.worldapi.org
  195. bash .scratch/m017/gate.sh .scratch/m017/g.txt; tail -2 .scratch/m017/g.txt # gate on ports 8800-8819 (or plain node tests/browser.mjs)
  196. ps -eo pid,args | grep [h]l-browser-tier # empty
  197. bash .scratch/m017/compat.sh # old vs new code on store copies: JSON equal minus the 5 new keys, Markdown identical, .mpack unchanged
  198. node .scratch/m017/identmigrate.mjs # rehearsal on a store COPY: ident #3–#8 under ident #1 (creator token 201 ×6, non-creator 403)
  199. ```
  200. Look at `.scratch/gate-{phone,desktop}-{parent,blocked}.png`.
  201. For the architect (after the deploy): link the ident pieces —
  202. `for n in 3 4 5 6 7 8; do curl -s -XPOST -H "Authorization: Bearer $TOKEN" -d '{"parent":"ident.worldapi.org#1"}' https://tickets.worldapi.org/api/projects/ident.worldapi.org/tickets/$n/parent; done`
  203. — ident #1 and #3–#8 were opened BEFORE the login (authors "import" / "architect" as text), so only
  204. the CREATOR's token may (a non-creator gets 403, rehearsed). Check: `curl -s -H 'Accept: text/markdown' https://tickets.worldapi.org/api/projects/ident.worldapi.org/tickets/1 | head -20`.
  205. Manual (creator): open a ticket you opened → "Parent ticket" field → `ident.worldapi.org#1` → Set parent;
  206. the parent page lists it under "Children".
  207. Lessons (mission 017):
  208. - `from` is reserved in Hybriel (parse error "Expected parameter name") — known (hybriel#22), bit again.
  209. - A gate click right after `goto` + `waitForSelector` can hit the SSR button before hydration → wait for
  210. the socket (`connected()`) before any click.
  211. - Loreana ports 8821 and 8830 are taken by other software (llama-server) — inside the 8800-8849 range.
  212. ## 2026-09-24 — tickets #8 (edit) + #6 (Markdown) + #11 (gate under load), mission 014 — awaiting architect (deploy) / creator
  213. Done (worker; developed in `.scratch/dev-m014`, copied back, NOT deployed to Byrodin):
  214. - **SECURITY, found on the way (pre-existing, live too)**: hl:webex writes the page state (user
  215. text) into an inline `<script>` unescaped → a summary / comment containing
  216. `</script><img src=x onerror=…>` executes in every viewer's browser. Reproduced on the pre-m014
  217. code (`.scratch/m014/old-app`, probe ticket via `.scratch/m014/xssprobe.hl` on a store COPY →
  218. `xsscheck.mjs` `__pwned = 1`); fixed by a one-line LOCAL PATCH in `plugins/webex/WebFramework.hl`
  219. (`<` → `\u003c` in the seed) → `__pwned = undefined`, page hydrates. Deploy soon; ident and
  220. every other hl:webex app vendor the same code (hybriel issue to file).
  221. - **#8 editing** (README "Markdown, editing"): the author edits subject + summary (web "Edit",
  222. API `POST …/edit`); legacy tickets (no user on the created event): only the creator; else 403.
  223. Edit = history event `kind:"edit"` with old + new values, pushed live.
  224. - **#6 Markdown**: `markdown.hl` + `components/markdown.hl` render summary / comments / state
  225. notes safely (text nodes only, `safeHref`); `mdview.hl` = `Accept: text/markdown` on the ticket
  226. GETs. JSON unchanged (old vs new code on copies of the store: every GET byte-identical).
  227. - **#11 gate**: page waits × `TICKETS_GATE_SLOW` (default 3); console check before ident stops,
  228. browsers parked on `about:blank` during "ident down".
  229. - Gate `node tests/browser.mjs` → **335 passed, 0 failed** (dev copy and main folder).
  230. How to verify:
  231. ```bash
  232. cd /media/STORAGE/projects/tickets.worldapi.org
  233. node tests/browser.mjs # 335 passed; look at .scratch/gate-{phone,desktop}-{edit,markdown}.png
  234. ps -eo pid,args | grep [h]l-browser-tier # empty
  235. bash .scratch/m014/compat.sh # JSON DUMPS IDENTICAL, 47 tickets md+page 200, .mpack unchanged
  236. # #11 under load: a dev server on a store COPY (:8374), then
  237. node .scratch/m014/load.mjs http://127.0.0.1:8374 4 6 & # 4 Chromes x 6 tabs; kill %1 afterwards
  238. node tests/browser.mjs # 3x green (logs .scratch/m014/gate-load-*.txt, gate-heavy-*.txt)
  239. # old code under the same load: .scratch/m014/old-app → 274/1 (ERR_CONNECTION_REFUSED selector.js), 3 of 3 runs
  240. ```
  241. Manual (creator): open a ticket you opened after the login → "Edit" (top, under the dates) →
  242. change subject / summary (Markdown) → Save: the history shows "edited the ticket" with the
  243. previous version folded. `curl -H 'Accept: text/markdown' https://tickets.worldapi.org/api/projects/tickets.worldapi.org/tickets/6`.
  244. Old files before the copy-back: `.scratch/m014/pre-copy-backup/` (+ `.scratch/m014/old-app/plugins`).
  245. Lessons (mission 014):
  246. - A `#events li` selector (CSS or test) also hits the `<li>` of a Markdown list inside an event:
  247. use `#events > li`.
  248. - Hybriel string literals DO decode `\uXXXX` but not `\\`: a literal backslash is `'\u005c'`.
  249. - Never embed user text in an inline `<script>` without escaping `<` (webex did — see above).
  250. ## 2026-09-24 — tickets #9 + #10 (mission 012): login banner after logout, button returns to the page — awaiting architect (deploy) / creator
  251. Done (worker; developed in `.scratch/dev-m012`, copied back, NOT deployed to Byrodin):
  252. - **#9 cause (reproduced in headless Chrome, own ident + tickets, `.scratch/m012/repro.mjs`)**:
  253. hl:webex re-creates the shell header — `<ident-selector>` AND the `<script>` elements — every
  254. time the login state flips (login, logout); the browser runs the re-inserted `/login.js` again,
  255. and every run added one more `ident-login` listener to the (new) selector. After a logout the
  256. selector carried 2 listeners → one choice = 2 `change`s on `#identcode` = 2 `identLogin` faces =
  257. 2 exchanges of the SAME code at ident (200, then 400 "unknown or already used code" → banner).
  258. The first exchange had logged the session in as the chosen identity (B). Not identity-specific:
  259. A → Log out → A again showed the banner too; the first selector login after a page load never
  260. does (one listener) — that is why "with A alone" it never appeared. Navigation is NOT the cause
  261. (after an in-app click list → ticket, login.js had not run again); list, ticket page reached by
  262. click and ticket page loaded directly all showed it (old code: exchanges `[200, 400]`).
  263. - **Fix** `login.js`: installs once per document, `ident-login` listener on `document`, current
  264. `#selector` looked up each time (MutationObserver on the whole document), each code handed on
  265. once. After: exactly one exchange, no banner, logged in as B (all 3 scenarios).
  266. - **#10** the button returns to the page: `login.js` adds `?next=<path+query>` to the button's
  267. return URL at the click; `project.hl` `safeNext` + `/login/callback` → 302 there (same-origin
  268. path only, else `/`). ident keeps the return URL's query and appends `&ident_code=`.
  269. - Gate `node tests/browser.mjs` → **275 passed, 0 failed** (+25: #9 path with an exchange-counting
  270. proxy, #10 table + browser). With the OLD `login.js` the new #9/#10 checks FAIL (negative control).
  271. How to verify:
  272. ```bash
  273. cd /media/STORAGE/projects/tickets.worldapi.org
  274. node tests/browser.mjs # 275 passed; grep '#9\|#10' in the output
  275. ps -eo pid,args | grep [h]l-browser-tier # empty
  276. SCEN=ticket-nav node .scratch/m012/repro.mjs # "B login: exchanges=1 ..." ; banner null
  277. SCEN=list node .scratch/m012/repro.mjs .scratch/m012/old-app # the OLD login.js: "B login: exchanges=2", banner
  278. ```
  279. Old files before the copy-back: `.scratch/m012/pre-copy-backup/`. Gate logs `.scratch/m012/gate-*.txt`.
  280. Manual (creator): log in with the selector, Log out, choose another identity → no red banner,
  281. top right the other identity; log out on a ticket page, "Log in with ident" → back on that page.
  282. ## 2026-09-24 — ticket #7 (mission 011): login via ident — awaiting architect (deploy) / creator
  283. Done (worker; developed in `.scratch/dev-m011`, NOT deployed to Byrodin):
  284. - **Login** (README "Login (ident)"): ident's selector top right + "Log in with ident" button;
  285. the server exchanges the one-time code (`users.hl` exchangeCode, IDENT_API_KEY/SECRET) for the
  286. per-app identity id; `login.js` bridges the selector's `ident-login` event into the shell's
  287. face `identLogin` (no reload); `/login/callback` for the button. Logout resets the selector.
  288. - **Users** `storage/mpackdb/users.*` (identity id → display name, asked once at the first login,
  289. cannot be changed afterwards), **tokens** `storage/mpackdb/tokens.*` (sha256 only; `/you`:
  290. create / list / revoke; `Authorization: Bearer` on every API write, else 401).
  291. - **Reading public, writing needs a login** (web faces check the REAL session, #31; API 401).
  292. No author field (API `author` → 400 naming it); events store `user`, old events keep their
  293. author. **Confirm/reject only by `TICKETS_CREATOR_IDENTITY`** (unset = nobody; API 403).
  294. - `/you` shows the user's own per-app id (for TICKETS_CREATOR_IDENTITY) + tokens.
  295. - `import.hl` needs `TICKETS_TOKEN`. `docker-compose.yml`: `IDENT_EXCHANGE_URL=http://127.0.0.1:45002`
  296. (key/secret/creator come from `.env`, loaded by the runtime).
  297. - Gate `node tests/browser.mjs` → **250 passed, 0 failed** (own ident on :8353 from a copy of
  298. ident's code without `.env`, mail sink; see README "Test").
  299. - Live-store compatibility: old code (`.scratch/dev-m010`) and new code each on a COPY of
  300. `storage/mpackdb`, every GET dumped → byte-identical (`.scratch/m011/compat.sh`); old
  301. `.mpack` files unchanged; `users.*`/`tokens.*` appear empty. No migration step.
  302. For the architect (deploy): `.env` on Byrodin must have `IDENT_API_KEY` / `IDENT_API_SECRET`
  303. (creator set them). After the deploy: the creator logs in, opens `/you`, the architect sets
  304. `TICKETS_CREATOR_IDENTITY=<id>` in `.env`, restarts; the creator (identity "Architect") creates
  305. the architect's token on `/you`. Until then NOBODY can confirm/reject, and every API client
  306. (the architect's scripts, import) needs a token — writes without one are 401 from the deploy on.
  307. How to verify:
  308. ```bash
  309. cd /media/STORAGE/projects/tickets.worldapi.org
  310. node tests/browser.mjs # 250 passed; screenshots .scratch/gate-*-{signedout,name,loggedin,tokens}.png
  311. ps -eo pid,args | grep [h]l-browser-tier # empty
  312. bash .scratch/m011/compat.sh # DUMPS IDENTICAL (old vs new code on copies of storage/mpackdb)
  313. ```
  314. Manual (dev): own ident + tickets: `bash .scratch/m011/devup.sh` (ident :8358 from
  315. `.scratch/m011/ident` = copy WITHOUT .env, mail sink `.scratch/m011/run/mail.txt`; tickets :8359
  316. with `.scratch/m011/run/app.env`; `node .scratch/m011/devsetup.mjs` registers the app first).
  317. Query users/tokens: only on a COPY (#40): `cp -a storage/mpackdb /tmp/c` + a small hl script
  318. (`MPackDB(file = '/tmp/c/users.db', primaryKey = '@id', indexes = ['!identity'])`).
  319. ## 2026-09-24 — deploy readiness (mission 010) — awaiting architect (first deploy)
  320. Done (worker; NOT deployed to Byrodin):
  321. - `project.hl`: builds the listener itself so `HL_HOST=127.0.0.1` binds loopback (hl:webex
  322. ignores HL_HOST); `TICKETS_WATCH=0` = no dev watcher. Defaults unchanged (0.0.0.0, watcher on).
  323. - `docker-compose.yml` (container `tickets.worldapi.org`, 127.0.0.1:45003) + `deploy.sh`
  324. (README "Deploy").
  325. - Gate `node tests/browser.mjs` → 164 passed, 0 failed (dev copy `.scratch/dev-m010` and live folder).
  326. - Tested on Loreana only: local deploy into a directory + the container there (only
  327. 127.0.0.1:45003 listens, URL 200, fake storage marker untouched), and behind a local TLS
  328. nginx in real Chrome: page + wss socket, no http:// URLs (ident `.scratch/m010/`).
  329. How to verify:
  330. ```bash
  331. cd /media/STORAGE/projects/tickets.worldapi.org
  332. node tests/browser.mjs # 164 passed
  333. bash -n deploy.sh && ./deploy.sh --dry-run --target /tmp/ticketsdeploy-test # LOCAL dir only
  334. ```
  335. For the architect: the vhost needs WebSocket Upgrade headers and `proxy_pass http://127.0.0.1:45003`.
  336. ## 2026-09-24 — ticket #38 (mission 008): per-project numbers, UUID keys, storage/mpackdb/ — awaiting creator
  337. Done (worker, not yet confirmed by the creator):
  338. - **UUID keys** (`@id`) in all three tables, files in `storage/mpackdb/{projects,tickets,events}.*`.
  339. Ordering from stored times: lists by `updated`, history by (`created`, `seq`), projects by `created`.
  340. - **Per-project numbers** from 1; URL `/projects/<project>/<number>`; slug = project name as is
  341. (new names: letters, digits, `. _ -` only). List, inbox, ticket page, pushes, notice link use it.
  342. - **Old global numbers** kept as `oldNumber`: page shows "formerly #n", `/tickets/<n>` → 301,
  343. `/api/tickets/<n>[/comments|/state]` still work (also with the UUID). New tickets: no old number.
  344. - **API** per-project form `/api/projects/<slug>/tickets[/<number>[/comments|/state]]` (GET/POST),
  345. rows carry `project`, `number`, `href`, `apiHref`, `oldNumber`. `ticket.id` is now the UUID.
  346. - **Migration** `tools/migrate-008.hl` (idempotent) of the live data, deployed 2026-09-24:
  347. old tables stay in `storage/tickets-*` (untouched, md5-checked), full backup
  348. `.scratch/storage-backup-<ts>`, logs + before/after dumps in `.scratch/deploy-008-<ts>/`
  349. (`deploy-008.sh`, compare `cmp008.py`). Rehearsed on a copy first (`.scratch/rehearse.sh`).
  350. - Gate: `node tests/browser.mjs` → **164 passed, 0 failed** (in `.scratch/dev` before deploy).
  351. Test: gate (see README "Test"), then
  352. `python3 .scratch/cmp008.py .scratch/deploy-008-*/before.jsonl .scratch/deploy-008-*/after.jsonl`
  353. and open http://192.168.178.75:8350/tickets/38 (→ /projects/tickets.worldapi.org/5).
  354. Known gaps: new tickets have no global number, so `/api/tickets/<n>` works only for the
  355. migrated #1–#40 (use the UUID or the per-project form). Numbers are max+1 (a deleted ticket's
  356. number would be reused — there is no delete). Project names stay case-sensitive.
  357. ## 2026-09-24 — ticket #15 (mission 004): required author, 400 on invalid JSON, list lines — awaiting creator
  358. Done (worker, not yet confirmed by the creator):
  359. - **`author` required** on `POST /api/tickets`, `/comments`, `/state` → 400 `{error, field:"author"}`
  360. when missing/empty (`api.hl` required lists + `store.hl` `authorMissing`, so web faces too).
  361. Web forms: name fields removed, they write as `creator` until ident exists. Stored data unchanged.
  362. - **Invalid JSON → 400 `{error:"invalid JSON at character N"}`** (no source path) via
  363. `jsoncheck.hl` before `JSON.parse` — WORKAROUND for hybriel #12, remove when fixed. It also
  364. refuses `\uD800`–`\uDFFF` escapes (hl JSON.parse refuses even valid pairs → would be 500).
  365. - **Import list lines**: `ticketfile.hl` keeps `- ` / `* ` / `1. ` lines as own lines (`\n`),
  366. wrapped lines still joined; page shows them as separate lines (pre-wrap). #1–#5 have no lists
  367. → nothing to migrate.
  368. - Gate: `node tests/browser.mjs` → **119 passed, 0 failed** (in `.scratch/dev` before deploy).
  369. - Deploy 2026-09-24: backup + before/after API dumps in `.scratch/` (see `deploy-004.sh`).
  370. Known gaps: a body that passes jsoncheck but that hl JSON.parse still refuses would 500
  371. (none known besides surrogates). Nested list indentation is dropped. A wrapped line that
  372. happens to start with `12. ` is taken as a list item (same as Markdown).
  373. ## 2026-09-24 — ticket #10 (mission 002): strict API, Vienna time, paragraph import — awaiting creator
  374. Done (worker, not yet confirmed by the creator):
  375. - **Strict API** (`bodyError` in `api.hl`): every POST body must be a JSON object; unknown
  376. field / missing or empty required field / non-string value → 400 `{ error, field }`,
  377. nothing written. Semantic refusals (state, project name) carry `field` too. `POST /api/projects` → 405.
  378. - **Local time**: all shown times (pages + API `created`/`updated`/`when`) are Europe/Vienna
  379. (`localtime.hl`, userland EU DST rule — hl:time has no time zones). Storage stays epoch ms.
  380. - **Import**: `ticketfile.hl` joins hard-wrapped lines, blank line = new paragraph (`\n\n`).
  381. - **One-off data fix** 2026-09-24 00:11: `tools/fix-import-summaries.hl` rewrote only `summary`
  382. of #1–#5 (server stopped, backup `.scratch/storage-backup-20260924-001142`). Ids, states,
  383. `updatedMs`, events unchanged — compared API dumps `.scratch/{before,after}-full-20260924-001142.json`.
  384. - Gate: `node tests/browser.mjs` → **93 passed, 0 failed** (2026-09-24, run in a copy before deploy).
  385. Known gaps: invalid JSON → 500 (no way to catch `JSON.parse` in Hybriel; nothing written).
  386. `author` stays optional (defaults to `anonymous`). Vienna rule is correct from 1996 on only.
  387. Running: dev server on :8350, PID in `server.pid`, log `server.log`, data `storage/mpackdb/`.
  388. ## 2026-09-23 — MVP (AntColony ticket 0001, mission 001)
  389. Done (worker, not yet confirmed by the creator):
  390. - Data: projects, tickets (id, project, subject, summary, state, source, created, updated),
  391. append-only events (created / comment / state, free-text `author`). Six states.
  392. - Pages `/`, filters `/project/:p`, `/state/:s`, both; `/tickets/:id`; `/inbox`; new-ticket form.
  393. - Live push of comments / state changes / new tickets to every open browser (web AND API writes).
  394. - JSON API (list/get/create/comment/state/projects), import command (idempotent by file name).
  395. - Dark WorldAPI tokens, accent #c586c0, danger #f44747; works at 390px and 1280px.
  396. - Gate then: 57 passed.
  397. ## How to verify
  398. ```bash
  399. cd /media/STORAGE/projects/tickets.worldapi.org
  400. node tests/browser.mjs # the gate (see README "Test")
  401. ps -eo pid,args | grep [h]l-browser-tier # must print nothing afterwards
  402. curl -s http://127.0.0.1:8350/api/tickets | jq '.tickets[] | {project, ref, oldNumber, state, subject}'
  403. curl -s -XPOST -d '{"text":"x","bogus":"1"}' http://127.0.0.1:8350/api/tickets/1/comments # → 400 naming bogus (nothing written)
  404. curl -s -XPOST -d '{bad' http://127.0.0.1:8350/api/tickets/1/comments # → 400 invalid JSON at character 1
  405. curl -si http://127.0.0.1:8350/tickets/38 | grep Location # → /projects/tickets.worldapi.org/5
  406. node .scratch/checklive.mjs # read-only real-Chrome look at :8350: list/history times == Intl Vienna, #1/#2 summaries one paragraph
  407. ```
  408. Then open http://192.168.178.75:8350 in two browsers, comment in one, watch the other.
  409. ## Open / next
  410. - ~~No users~~ — done by ticket #7 (mission 011): creator-only confirm/reject via TICKETS_CREATOR_IDENTITY.
  411. - Not deployed (Byrodin container, nginx vhost, DNS) — out of MVP scope.
  412. - Project filter chips / datalist of a list page do not grow live when a NEW project appears
  413. (a reload shows it); ticket rows do.
  414. - No delete of tickets or comments; comments cannot be edited (only subject + summary, ticket #8).
  415. - Keywords in comments (`/confirm`, `/reject`, …) are the scheduler's job, not implemented here.
  416. - Hybriel limits met (worked around): no time zones in hl:time (localtime.hl), no catch for
  417. JSON.parse (jsoncheck.hl → 400), JSON.parse refuses \u surrogate escapes, no list `concat()` (NotCallable), no string escapes ("\r" is 2 chars).
  418. - Older Hybriel limits met (worked around): no string ordering / no list `sort()` (import sorts by
  419. char codes). (mpackdb `*id` from 0 no longer matters: UUID keys since #38.)
  420. ## Lessons
  421. - (mission 012) hl:webex re-creates elements of a View when an `if` block before/around them
  422. flips — including `script { src }`: the browser EXECUTES a re-inserted script again, and custom
  423. elements lose their internal state (the selector forgets the chosen name). A plain script in a
  424. View must be idempotent (guard per document) and must not hold element references.
  425. - (mission 011) A called function's PARAMETER NAMED LIKE AN ENTRY of the object literal it is
  426. called from reads that entry: `{ id = e.id author = nameOfUser(e.user) }` with
  427. `nameOfUser = (id) => …` got the EVENT's id. Compute such calls before the literal, avoid
  428. parameter names like `id` (Hybriel issue reported in mission 011).
  429. - (mission 011) hl:mpackdb `update(key, rec)` on an `@id` table with a record WITHOUT `id`
  430. stores it without the key: `fetch(key)` is null afterwards (the unique index still finds it)
  431. and the next update fails `CorruptRecord`. Always pass the whole record with `id`.
  432. - (mission 011) hl:webex cannot listen to a custom DOM event (`ident-login`): a plain script
  433. (`login.js`) writes the value into a hidden input and fires `change`.
  434. - (mission 011) A failed hl:fetch (connection refused) is an `Error` event; only a root
  435. `on Error(e)` in the ENTRY file (project.hl) absorbs it — one in the imported users.hl did not.
  436. - (mission 011) hl:webex ships every component member AND `session.user` to the browser:
  437. keep the identity id out of members and out of the session (only on /you, on purpose).
  438. - (mission 011) `rsync --exclude 'server.*'` also drops `plugins/*/server.hl` — anchor it (`/server.*`).
  439. - Hybriel resolves RELATIVE file paths (mpackdb too) against the ENTRY SCRIPT's directory,
  440. not the cwd: a tool in `tools/` must get an absolute `TICKETS_STORAGE`.
  441. - Saving a `.hl` file reloads the running dev server (watcher): develop in a copy
  442. (`.scratch/dev`, gate there), stop the server, then copy files in.
  443. - `JSON.parse` of a JSON array gives a Hybrid with `.length`; of an object `.length` is null.
  444. - A function route's request has `req.query` (parsed object); `req.path` carries NO query string.
  445. - `emit client …` inside a function route (API) works: with an `audience` entry it fans out to
  446. every admitted connection that has a listener mounted.
  447. - A selector group in `styles.hl` must be ONE quoted key (`'input,\ntextarea' { … }`); a bare
  448. `input, textarea` is a parse error.
  449. - Function PARAMETERS are immutable in Hybriel (`i = i + 1` on a param is a runtime error):
  450. copy into a `let` first (jsoncheck.hl).
  451. - `google-chrome` is not on PATH on Loreana; the gate uses `/opt/google/chrome/chrome`.
  452. - Opening an hl:mpackdb table REWRITES its index/meta files (`*.txt`, `*.meta.json`,
  453. `*.idxstate.json`) even with `compact = false`; only `.mpack` stays. Migrate from a COPY
  454. when the originals must stay byte-identical (deploy-008.sh does).
  455. - mpackdb `@id` keys are 12-char strings (`0mufbphip3w7`); a missing indexed field is fine
  456. (`*oldNumber` on new tickets); `!path` unique index refuses duplicate numbers.
  457. - A non-literal `static` in project.hl reads null in function routes (hybriel #16): API helpers
  458. in project.hl are plain members, not statics.
  459. ## 2026-09-24 — DEPLOYED (architect)
  460. - LIVE is now https://tickets.worldapi.org on Byrodin (/CONTAINERS/projects/tickets.worldapi.org). The live data was moved there.
  461. - This Loreana folder is DEVELOPMENT only; its storage/ is a stale copy. Dev servers were stopped. Update live with ./deploy.sh.
  462. ## 2026-09-24 — ticket #16: tidy relations block out of the edit handlers — awaiting creator
  463. Done (worker, not yet confirmed by the creator):
  464. - `components/ticket.hl`: the relations init block (`rel`, `hasRelations`, `hasParent`, …,
  465. `parentDraft`, `blockerDraft`, `linkMessage` — 16 lines) had been pasted verbatim into
  466. `startEdit`, `cancelEdit` and `saveEdit` too (ticket #4 code landing inside the ticket #8 edit
  467. handlers). Removed the three copies; the component's own init block (still there) is the only
  468. place that sets them. No behaviour change intended — clicking Edit/Cancel/Save no longer resets
  469. `parentDraft`/`blockerDraft`/`linkMessage` mid-edit, which was a side effect of the paste, not a
  470. feature. 489 → 441 lines.
  471. - Gate: `node tests/browser.mjs` → **418 passed, 0 failed**, run on this folder with
  472. `TICKETS_GATE_PORT=8700 TICKETS_GATE_IDENT_PORT=8701 TICKETS_GATE_EXCHANGE_PORT=8702
  473. TICKETS_GATE_CHROME_A=8703-8704 TICKETS_GATE_CHROME_B=8705-8706` (own storage in
  474. `.scratch/gate-store`, own ident, no live data touched). Includes the full #4 relations suite
  475. and #8 edit suite, both still green.
  476. - Not deployed (deploy.sh is the architect's job).
  477. Test: gate above, then open a ticket with relations on the live site and click Edit — the
  478. relations panel keeps showing normally, editing subject/summary still works.

Branches

Latest commits

  • 2ab91ee9tickets: gate checks rows appear once (session sync); re-vendor to ff51cf46 stopped on hybriel#122, stays 837fe120mre
  • e01c2b1dtickets#24: installable app (manifest, service worker, offline list), own icon; gate waits for the hello's pongmre
  • 752fbb7fdeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
  • 38bdd5e4deploy.sh: never send .git or .gitignore to Byrodinmre
  • f12fa1bcState of 2026-09-27, before the move to gitoriamre