gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit2f2959c52f2959c5|||PR apps API: broken JSON body gives 400 invalid_json, not 500mre2f2959c5/missions/W30-keyed-lists.md

3.0 KB

  1. # W30 — keyed list writes (gitoria#30)
  2. Task line (ticket title, Atlas audit 2026-10-26): "Lists are rebuilt by hand in handlers instead of keyed records with upsert and remove".
  3. Ticket: https://tickets.worldapi.org/gitoria.worldapi.org/30 (read it: call sites components/list.hl ~87-89 repoCreated/repos, components/tickets.hl ~100-102 addTicket/tickets keyed by number, components/sshkeys.hl ~70-72 and ~83-85 keyItems add/remove, components/tokens.hl ~69-71 and ~85-87 tokens add/remove). Was blocked because upsert appends while these lists show newest first (repro tests/fixtures/upsert-order.hl); Hybriel day52 (now vendored, hybriel#331) settles it.
  4. Read first, fully: /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md; /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md; /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md; COMPONENTS.md section "List rendering" (the rowKey paragraph, changed by #331: "Rows are keyed by the entry's `id`, then `@id` … To insert between existing keyed rows, assign the list member a whole list in the desired order; existing rows retain their nodes. `upsert(record)` replaces a matching record in place and appends a new one; it does not choose a sorted insertion position."); SPEC.md "Looking records up by the `@` property: `upsert` and `remove`" (~line 1977, day26 rule: upsert / one-argument remove need an @ property). Copy a working shape from the docs; a gap → DOCS line in the report.
  5. ## The documented shape to apply (Gitoria's reading of the docs; verify it)
  6. - Replace an existing row: `list.upsert(row)` (row carries its @ key).
  7. - Remove: one-argument `list.remove(id)`.
  8. - Add a NEW row at the top (newest first): one whole-list assignment in the desired order (new row first, then the existing rows); keyed rows keep their nodes. No hand-written filter loop that copies every row.
  9. - Each row type gets its @ key where it has none (repos @id, tickets keyed by number, ssh keys, tokens): check that server data and stored rows really carry that field; what identifies an item is its id, never a position.
  10. ## Work (git worktree `../gitoria-W30`, branch w30 from main; copy main's bin/ folder (day52, not in git) into the worktree; never edit LOG.md/STATUS.md)
  11. 1. Change the call sites above. No hand-written JS, no workaround at a framework gap (minimal repro in .scratch/ and stop). theme/ untouched.
  12. 2. Prove in tests/browser.mjs (extend it): for each list, a new row appears at the top, existing row DOM nodes are retained (same node before/after, like hybriel's #9331 check), a replace keeps one row, a remove takes exactly that row; a second visit (reload) shows the same order.
  13. 3. Gates (LC_ALL=C, ports 8720-8739 only, `ss -ltn` first; port 8700 is taken: use GITORIA_GATE_* variables as V52/R52 did): `node theme/check-theme.mjs .`, `node tests/browser.mjs`, every gate in deploy.sh's GATES list, all 0 failed.
  14. 4. Commit on branch w30 (subject without "#N"). Do NOT merge, push or deploy.
  15. ## Report
  16. reports/W30-REPORT.md (≤25 lines): per call site old → new shape, the @ keys added, test checks added, gate numbers, DOCS lines, risks. Then stop. Budget ~60 requests.

Branches

Latest commits

  • 2f2959c5|||PR apps API: broken JSON body gives 400 invalid_json, not 500mre
  • f7c6ca07Merge branch 'ident-chooser-selector' into mainGitoria
  • 691abb8e|||PR tests: find ident identity choice without the removed .choose classmre
  • 16a3530fMerge branch 'heap-revert' into mainGitoria
  • 220a80e0|||PR Remove temporary /__heap route and heap helper; logmre
  • 13f0c342Merge branch 'hl25-records' into mainGitoria
  • a002ecb7|||PR records: HL25 report, heap helper, logmre
  • 2492a55cTemporary keyed /__heap route for the live memory snapshotmre
  • fefaedd2log: tracker PR-only, HL25 startedmre
  • 21aa57calog: parkmre
  • e9f950a8reports: G25c soakmre
  • a7783686log: deploy 9f41ffcmre
  • 9f41ffc1log: W30b mergedmre
  • bef635c1Merge branch 'w30b'mre
  • 15b996a5Org list: keyed rows by @id, newest first, concat instead of hand loopmre
  • c4f6d9e3reports: G25c growth huntmre
  • b88e39f1log: privacy cleanup donemre
  • bfd7826ddocs: neutral example organisation namemre
  • 01b71c2edocs: neutral wording in missions, reports and logmre
  • 3eeea733log: 2026-11-09 PR flow plan and membersmre