tickets
All repositories: gitoria
5.4 KB
# Mission 005 (old 011) — tickets: login via ident (ticket tickets.worldapi.org#7)One-shot worker. The architect (Claude Code on Byrodin) verifies your report and deploys; you do NOTdeploy and do NOT touch Byrodin.## Read first — in this order1. **`loreana:/media/STORAGE/projects/tickets.worldapi.org/CONCEPT.md`** — the creator's concept, section"Login via ident" is this mission. Source of truth; don't add what it doesn't describe; where it issilent, make the smallest choice and list it under "Questions for the creator".2. **`loreana:/media/STORAGE/projects/ident.worldapi.org/CONCEPT.md` and `README.md`** — how apps useident: `<ident-selector key=…>` from `/selector.js`, the `ident-login` event with a one-time code, thelogin button (`/login?key=&return=` → `?ident_code=`), `POST /api/exchange {key, secret, code}` →`{identity}` (a per-app id; no names, no email).3. tickets' own `README.md` / `STATUS.md`. Ticket: `GET https://tickets.worldapi.org/api/projects/tickets.worldapi.org/tickets/7`(send a `user-agent` header — Cloudflare blocks default script agents).4. `/CONTAINERS/projects/antcolony/README.md` — conventions (UUID `@id` keys, `storage/mpackdb/`, JSON writes+ Markdown text fields), lessons.## Hybriel (standard block)Read `/CONTAINERS/projects/antcolony/docs/hybriel-for-app-workers.md` first — which docs to trust, knownpitfalls (#31 forged face sessions, #36 global face names, #24 HL_HOST, #25 no request context in faces,#40 open only COPIES of stores), conventions, deploy notes. Report new Hybriel findings under"Hybriel issues"; do not edit that guide.## Where- Develop in `loreana:/media/STORAGE/projects/tickets.worldapi.org` (DEVELOPMENT only — live is on Byrodin;its local `storage/` is a stale copy you may use for tests). Work in `.scratch/dev` and copy back whengreen (as missions 004 (old 008)/ident 006 (old 010) did). The Loreana dev servers are stopped; start your own test servers.- For tests run your OWN ident instance from `/media/STORAGE/projects/ident.worldapi.org` code (read only:start it with its own storage dir, `IDENT_MAIL_SINK`, own port, e.g. as ident's `tests/selector.mjs`does) and register a test app in it. Never use the live ident, never send real mail.## Scope1. **ident login in tickets**: the identity selector top right (host tells it `logged-in`), plus the loginbutton flow. tickets' server exchanges the code with `IDENT_API_KEY` / `IDENT_API_SECRET` from itsenvironment (the live `.env` on Byrodin already has them — **you never read or write any `.env`**; intests pass your own values as env vars). Logout on tickets resets the selector.2. **Users**: a tickets user per ident per-app identity id. First login asks once for a **display name**(interim — see concept point 6: keep it a normal field so ident can fill it later).3. **Reading stays public. Writing needs a login**: creating tickets, commenting, state changes — in the webUI (faces: check the real session, #31) and in the API. Anonymous writes → 401.4. **Author from the login**: no free `author` field any more (API: refuse it with 400 naming the field, orignore — list your choice). Events store the user; old events keep their author string.5. **Confirm / reject only by the creator**: the creator is configured as `TICKETS_CREATOR_IDENTITY` =the creator's per-app identity id (env). Until it is set, nobody can confirm/reject. Provide a way for alogged-in user to see their own per-app id (e.g. on a small "you" page) so the architect can set it.6. **API tokens** for machine clients: a logged-in user creates / lists / revokes their tokens in the UI;a token is shown once, stored hashed; `Authorization: Bearer <token>` acts as that user on every APIwrite. Wrong / revoked token → 401.7. Existing API endpoints keep working for reads; for writes they now need a token.8. Data: new tables with `@id` keys in `storage/mpackdb/`; existing tickets/events untouched. The livestore on Byrodin must keep working after the architect's deploy (no manual migration step if avoidable;if one is needed, write an idempotent tool and say so).## Rules- No git. No `.env` access. Don't touch Byrodin. Don't POST to the live tickets server.- Only kill your own PIDs. Clean up headless Chromes (`--disable-gpu`). Scratch in `.scratch/`.- If any action is refused by the permission system, don't retry or work around it; report it.- A test is the whole process: real headless browsers, your own ident + tickets servers, same-sitehostnames (both on 127.0.0.1, different ports): signed-out read works; write refused; selector login →display name → write shows the user as author; second user can't confirm; creator (configured id) can;token create → API write as that user → revoke → 401; forged face sessions refused; old events stillshow their authors. Extend `tests/browser.mjs` (all existing checks stay green, adapt the ones that write).Screenshots at 390px and 1280px (selector top right, name prompt, tokens page), look at them.- Update tickets' `README.md` (login, tokens, env vars, how to set `TICKETS_CREATOR_IDENTITY`) and`STATUS.md`. Do NOT edit `CONCEPT.md`. Also update `docker-compose.yml` if new env vars are needed(values come from `.env`, never hard-coded secrets).## Report (final answer, this structure)```## Done## Verified (each: command run + observed output)## Not verified / open## Hybriel issues (repro, observed, expected)## Questions for the creator## Running (URL, PID, log path)```
Branches
- mainmain branch
Latest commits
- 7538b034mission 011 (ticket #25 web part): short page URLs /<slug> and /<slug>/<number>; /projects/<slug>, /projects/<slug>/<n>, /projects/<slug>/tickets/<n> and /tickets/<ref> answer 301 (current slug); slug pages moved behind hl:web's own routes after construction (they answered /__hl/* and /components/*.hl); reserved slugs refused; API paths unchanged. gate 293/0, connect 60/0, live-data copy 187/0, API old vs new: only page links differmre
- 0369106emission 010 (code order) 4/4: README file map + import order + 'Same output' test, STATUS (entry, lessons, how to verify), LOG, report; tests/realdata-baseline.mjs + realdata-compare*.py (a cleanup answers the same on live data), tests/letcount.pymre
- a75e0279mission 010 (code order) 3/4: let only where a variable is reassigned or re-bound in a loop body (456 lets → plain declarations; Hybriel refuses a plain declaration inside a loop on its 2nd pass). gate 249/0, connect 60/0, real-data reads identical, a 50-step write sequence (API + faces) identical to the old codemre
- e9d5c618mission 010 (code order) 2/4: one lib/ file per topic — store.hl split into projects / tickets (+ relations) / events / tickets-helpers, util.hl shared helpers (env, storage dir, URLs, sorts, Vienna time), the function routes out of project.hl into lib/api.hl (thin; auth/filters/Accept in api-helpers.hl), invite + member-removal logic out of the faces/routes into invites.hl / tickets.hl; project.hl is the map. /login/callback gets req + the session store by reference. gate 249/0, connect 60/0, real-data reads identicalmre
- 97e269b5mission 010 (code order) 1/4: .hl files out of the root — lib/ (store, users, connections, invites, migrate, markdown, mdview, import = ticketfile, util = localtime, jsoncheck, api-helpers = api), tools/import.hl, components/styles.hl; import paths only. gate 249/0, connect 60/0, real-data reads identicalmre
- 38f9d10ftickets: Hybriel master 06617221 (plugin allocators 3a781359 + 413f60e4, mpackdb 2cb7ae5e, http1 773de63e); gate 249/0, connect 60/0mre
- d3db6139tickets: Hybriel master 190aa11d (fc838894 GC correctness, #126 closure scopes, #127); gate 249/0, connect 60/0mre
- bce182e3tickets: Hybriel master 7eea0d32 (#126 memory, #48 lambda copies its argument); migrate.hl lambdas take &logmre
- 4137be0fantcolony#40: mission references point to the moved missionsmre
- 9bfba36aantcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
- c7bd2645tickets: Hybriel master 73267707 (#122 fixed); compactNow workaround removed (#110 covered)mre
- 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