gitoria
All repositories: gitoria
4.3 KB
# W48 — repo members merge a PR when the required checks pass (gitoria#48)TASK (his words, 2026-10-31, unchanged): "features can then be merged by me, when i accept them. smaller and utility things directly from you."Apollo's GO 2026-11-03: a repo member with write access (a conductor's gtr_ user token) must be able to merge a PR once the required checks are green, via API and button; required checks enforced; never for apps (gat_).Ticket: https://tickets.worldapi.org/gitoria.worldapi.org/48W48, PORTS = 8720–8739, branch w48-member-merge from main (HEAD at start).## Scope1. Who may merge = the owner OR a member of the repo with push rights (the SAME rule that lets them push over ssh/https; find it in lib/members.hl / lib/transport.hl and reuse it — no second copy). Org repos: the same rule the push uses.2. Button: /pulls and the PR page /pulls/N show Merge for those people (today `withMerge(list, owner)` in lib/pulls.hl and the PR page's own check). The server re-checks on click (never trust the page).3. API: `POST /api/pulls/<n>/merge` on the repo's API base (same base as the apps API: https://<repo>.gitoria.worldapi.org/api, org spelling as the other /api/pulls routes have it). `Authorization: Bearer gtr_…` (lib/tokens.hl userOfToken). Body optional `{"head":"<40 hex>"}`: when given and not the current head → 409, nothing merged.- gat_ app token → 403 `forbidden` "apps cannot merge". No/unknown token → 401. User without write → 403. Unknown PR → 404. Already merged / branch gone / conflict / required checks not success → 409 with mergePullNow's text. Success → 200 `{ merged: true, mergeCommit: "<sha>", pull: <the pull JSON as GET /api/pulls/<n> gives it> }`.- Use mergePullNow (lib/pulls.hl) — it already enforces the required checks (missingText) and the race-safe update-ref. The merge commit author = the user's display name. The `pull_request.merged` event (docs/apps-api.md §4) must be raised as for the button, `sender` = that user.- jsonOfRequest for the body (400/413 as the other write routes); limits.hl if the other user write routes use it.4. README.md: a short paragraph + curl example (placeholder token). Do NOT edit docs/apps-api.md (the external reviewer's contract): put a "contract note" in the report.5. Gate tests/member-merge.mjs in deploy.sh GATES, own temp storage: owner merges (button path or API); a member merges via API with gtr_ once a required status is success; same member BLOCKED (409) while the required status is pending/failure; non-member 403; gat_ 403; stale head 409; the merged event row exists with sender = member; the button is visible for a member and hidden for a non-member/signed-out.## Read first- /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in that folder.- /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md, /media/STORAGE/projects/hybriel/COMPONENTS.md "hl:web — a function route and its request", "§11 — Routing", "§9 — Data". Copy working shapes from gitoria's own code (lib/api.hl apiCreateRepo, lib/reviews.hl write routes, lib/prpage.hl mayWritePull, lib/pulls.hl). A framework gap: DOCS/GAP line with a tiny repro, no workaround, no hand-written JavaScript.- App: README.md, project.hl, docs/apps-api.md §4–§6, lib/pulls.hl, lib/statuses.hl, lib/members.hl, lib/tokens.hl, lib/api.hl, components/pulls.hl, the PR page component.## Rules- Git worktree of /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org under /media/STORAGE/claude-scratch/gitoria/W48/ (REPORT.md there). Never touch live (byrodin), his repos or live data.- bin/ is not in git: copy /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org/bin/ into your worktree.- Ports: only PORTS (check `ss -ltn` first). Never print token values.- Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, deploy or write to tickets.- Gates (LC_ALL=C), 0 failed at the end: node theme/check-theme.mjs ., node tests/browser.mjs, and every gate in deploy.sh GATES. Wait for them; do not end the turn while they run.- Budget: small mission (~60 requests). If bigger, finish a clean part, commit, report what remains. STOP after the report.## Report (REPORT.md, short)Files and commits; how tested (commands + results); contract note; DOCS/GAP lines; open risks.
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