gitoria
All repositories: gitoria
3.5 KB
# P51 — anonymous reads of public repos' PRs and statuses (gitoria#51)Task line (caramboleyo, 2026-11-12, verbatim): "yes go for public pr reads"Apollo GO 2026-11-12: anonymous read of PR state and commit status on public repos, for the hycon link chips. Private repos stay 404 for anonymous callers. Sonnet, cap $3.## RulesRead fully first: /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md and /media/STORAGE/projects/hybriel/docs/HL-STANDARD.md (L1–L19, F1–F21). For .hl, copy a working shape from the existing code. No hand-written JS. Do NOT push, do NOT deploy, do NOT touch byrodin. Never kill processes by pattern; exact pid only. Ports: only 8720–8737 on loreana (check `ss -ltn` first).## WhereWorktree /media/STORAGE/projects/WorldAPI/gitoria-P51 (branch p51-public-pr-reads, from main 21b2c14; `bin` is a symlink to the main folder's bin). Work and commit only there. Run `LC_ALL=C`.## Todaylib/app-auth.hl:68 `readerOfRequest`: a gtr_ token → member read; anything else → `appOfRequest` (app token) → no token = 401. Used by `appPull` (GET {api}/pulls/N, lib/api.hl ~340) and the GET branch of `appStatus` (GET {api}/statuses/<sha>, lib/api.hl ~398).## Change- ONLY when the request has NO Authorization header at all, and ONLY for `GET {api}/pulls/N` and `GET {api}/statuses/<sha>`: if the repo is PUBLIC, answer exactly as for a member (same JSON shape, same 404 for an unknown PR / unknown sha). If the repo is private or missing: 404 `not_found` (same body as today's notFound(); never reveal that a private repo exists).- Everything else is unchanged: a request WITH a token (gtr_, gat_, invalid) keeps today's rules (a non-member gtr_ still gets 404; invalid token 401). The PR list (GET {api}/pulls), reviews, threads, comments, writes, merge, deliveries: unchanged (still 401 without a token).- No rate limit for anonymous reads (the same data is already on the public HTML PR page without a limit); do not count them in the app limits.- Keep it small: a separate function (e.g. `publicReaderOfRequest` in lib/app-auth.hl) used by those two routes only; reuse the existing repo visibility helper (mayRead with a null user, or however the public repo pages decide visibility — find and reuse it, do not write a new rule).- Docs: docs/apps-api.md — add a short section "Anonymous reads (v1.6, gitoria#51)" with the two routes, the 404 for private/missing repos, and the fact that a token keeps the member rules; add a changelog line v1.6. README.md: one line where the API reads are listed.## Test- Extend the gate that covers member reads (tests/member-merge.mjs or tests/reviews.mjs — pick the one with public + private fixtures; tests/private.mjs if that fits better): without any token on a public repo, GET pulls/N → 200 with the pull object, GET statuses/<sha> → 200 {statuses}; unknown PR → 404; on a private repo both → 404 with the same body as a missing repo; a missing repo → 404; with an invalid token → 401 still; a non-member gtr_ on a public repo → 404 still; GET {api}/pulls (list) without token → still 401.- Run all gates: `node theme/check-theme.mjs .`, `node tests/browser.mjs`, and the GATES list in deploy.sh (each with explicit ports from 8720–8737). All 0 failed.## ReportOne commit, subject `|||PR Anonymous reads of public repos' pulls and statuses` (no '#N' in the subject). Write reports/P51-REPORT.md in the worktree: diff summary, the exact anonymous request/response examples for both endpoints (status + body, public and private), gate counts per gate, cost. 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