gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit5803cf4f5803cf4f|||PR vendor: Hybriel set-day59 and GC budget 32 MiBmre5803cf4f/missions/W49-member-read.md

3.1 KB

  1. # W49 — members read PRs by API with a gtr_ token (Apollo GO 2026-11-04)
  2. Task (Apollo, verbatim): "(1) yes. (2) GO too (Sol, small): conductors in the PR workflow need to read their PRs, reviews, threads and check states by API with their gtr_ token (members read-only; write stays as is)."
  3. (1) = a clear 401 for a gtr_ token on the app-only routes instead of "missing, unknown or expired token".
  4. ## Rules
  5. - Read fully first: /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. Copy working shapes from the existing code (lib/api.hl apiMergePull is the model for gtr_ auth). No hand-written JS. A framework gap → DOCS line in the report, no workaround.
  6. - Work in a git worktree: `git worktree add /media/STORAGE/claude-scratch/gitoria/W49 -b w49-member-read main` from /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org. Commit there; do NOT merge, push or deploy. Never touch live (byrodin) or his repos/data.
  7. - Ports for gate runs: 8720–8739 only (check `ss -ltn`).
  8. - Do not edit docs/apps-api.md (the external reviewer's contract); put the proposed contract text in the report.
  9. ## What to build
  10. 1. GET routes in lib/api.hl: appPulls, appPull, GET of appReviews, appThreads, GET of appComments, GET of appStatus (GET {api}/statuses/<sha>). Accept EITHER the app token (unchanged behaviour) OR a gtr_ token of a user for whom mayRead(uid, repo) and mayPush(uid, repo) hold (owner/member/org = "members"). Non-member gtr_ → 404 not_found (like a repo that does not exist). Rate limit: keep the app limit for apps; for users reuse whatever the existing gtr_ routes do (say so in the report).
  11. - listReviews/listThreads take the app (who.app): find out what the app is used for in reads (e.g. "own" flags) and pass the right neutral value for a user; no app-specific data must leak or break.
  12. - ONE helper (e.g. in lib/app-auth.hl: readerOfRequest(route, req) → { repo, app|null, user|null } or { error }), not copies per route.
  13. 2. All POST/PUT (writes) stay app-only. A gtr_ token on any app-only route (writes, deliveries, redeliver, apps token routes that take gat_) → 401 with message "this route needs an app token (gat_); user tokens (gtr_) can read pulls, reviews, threads, comments and statuses and merge with POST /pulls/N/merge". Unknown/expired gat_ keeps the old message.
  14. 3. Gate: extend tests (copy the shape of the member-merge gate added in W48, see tests/ and deploy.sh GATES): member gtr_ reads all 6 GETs 200 with the same body shape as the app; non-member gtr_ 404; no token 401; gtr_ on a POST review / PUT status → 401 with the new message; app token behaviour unchanged. Then run ALL gates (LC_ALL=C): `node theme/check-theme.mjs .`, `node tests/browser.mjs`, and every gate in deploy.sh GATES — all 0 failed.
  15. ## Report
  16. Write /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org/reports/W49-REPORT.md: commits, files changed, gate results with counts, rate-limit choice, the reviews/threads app-parameter decision, proposed docs/apps-api.md text for the external reviewer, DOCS lines. Then STOP.

Branches

Latest commits

  • 5803cf4f|||PR vendor: Hybriel set-day59 and GC budget 32 MiBmre
  • 9eff6627Merge branch 'f2-api-bugs' into mainGitoria
  • 26117255|||PR apps API: review comments on files with spaces in their namemre
  • b8796cecMerge branch 'f1-broken-json' into mainGitoria
  • 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