gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainfe209ffeMerge branch 'w56-owner-members' into mainGitoriamain/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

  • fe209ffeMerge branch 'w56-owner-members' into mainGitoria
  • fa0754c8|||PR repository owner transfer and members API (#55)mre
  • 8862e537Merge branch 'w55-rename-org' into mainGitoria
  • 014d2b7fOne immutable readers snapshot per move for the left-organization event (#53)mre
  • 1859d506Decide who hears a repo left its organization by its readers before the move (#53)mre
  • 499f25f2Review fixes for the Settings organization move (#53)mre
  • ed3b922b|||PR move a repository into an organization in Settings (#53)mre
  • 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
  • 9f7ce8d8Preserve rename compatibility and live page titlesmre
  • c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
  • ce08920dMerge branch 'w52c-header-phone' into mainGitoria
  • 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
  • e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
  • c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
  • 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
  • 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre
  • 69141f65|||PR pulls page: cache the git part per repo by branch tipsmre
  • 155861f6Merge branch 'w52-person-approval' into mainGitoria
  • b5435de8|||PR person approvals: second Kunibert round (#52)mre
  • 3a8b2fb8|||PR person approvals: Kunibert review fixes (#52)mre