gitoria
All repositories: gitoria
3.0 KB
# W49 — members read PRs by API with a gtr_ token (Apollo GO 2026-11-04)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)."(1) = a clear 401 for a gtr_ token on the app-only routes instead of "missing, unknown or expired token".## Rules- 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.- 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.- Ports for gate runs: 8720–8739 only (check `ss -ltn`).- Do not edit docs/apps-api.md (Vinzenz's contract); put the proposed contract text in the report.## What to build1. 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).- 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.- ONE helper (e.g. in lib/app-auth.hl: readerOfRequest(route, req) → { repo, app|null, user|null } or { error }), not copies per route.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.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.## ReportWrite /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 Vinzenz, DOCS lines. Then STOP.
Branches
- f1-broken-json
- f2-api-bugs
- gp-gate-ports
- heap-revert
- hl25-records
- ident-chooser-selector
- mainmain branch
- p51-public-pr-reads
- records-1112
- s25-no-session-on-login-error
- v59
- w52-person-approval
- w52b-approval-followup
- w52c-header-phone
- w53-pulls-speed-pr
- w54-repo-rename-pr
- w55-rename-org
- w56-owner-members
- w62-pr-close
- w63-force-push
- w64-org-slash
Latest commits
- 24b479e7W60: record final gates, Chrome failures and AE evidencemre
- 5e11184cW60: record partial validation, framework gaps and cleanupmre
- 20fe13fagitoria#33: centralize login and tickets connection statemre
- 859754c0gitoria#29: retain the offline note and record the framework gapmre
- d140bc04gitoria#30: reproduce the upsert ordering constraintmre
- 6960e8f8gitoria#28: keep form values in bound component membersmre
- 0db27200gitoria#32: share character checks and environment lookupmre
- 452f6a1amission W60: logic clean-upsmre
- 1448c899log: cleanup, #49 GPTBot, tracker mentions on #36mre
- fcf95936log: v1.5.1 provenmre
- 22105420log: W51b livemre
- 7e8aabeareport: W51b pull source verificationmre
- 6c18de76fix: preserve pull sources across containing branchesmre
- fc36fa2elog: W51b pull source bugmre
- 56bc1220log: v1.5.1 livemre
- 845fc0aareport: W51mre
- 83127391fix: return v1.5.1 app and merge error detailsmre
- b07d0e97log: W51 v1.5.1 startedmre
- 0b417d06docs: apps-api v1.5 user tokens (#48, W49)mre
- d046940alog: vinzenz contract note sentmre