gitoria
All repositories: gitoria
4.7 KB
# W44 — an app can post a review with inline comments and answer in threads (gitoria#44, part of the push API #38)TASK (his words, unchanged): "gitorias first job is to evaluate how to make a push api where external apps can register to interact with gitoria. first use case being a code reviewer." Build GO by Apollo 2026-11-02. This part: https://tickets.worldapi.org/gitoria.worldapi.org/44W44, PORTS = 8720–8729, branch w44-reviews from main 49533a5 (LIVE; has #40 lib/pullsync.hl pullObject/wasHeadOf/refs/pull/N/heads, #41 lib/apps.hl, #42 lib/app-auth.hl appOfRequest + apiPatterns, #43 lib/events.hl raiseEvent). #46 (statuses) is built in parallel by another worker: do not touch statuses or the Merge button.## Scope (contract docs/apps-api.md v1.2.1 §5; every route via apiPatterns + appOfRequest; JSON errors §6)1. Store (mpackdb, keyed by repo id + PR number, never slug): reviews {id, app, number, head, verdict approve|request_changes|comment, body, created}, threads {id, app, number, path, line, head, resolved}, comments {id, seq, thread|null (null = PR conversation), number, author {type app|user, id, name}, body, created ms}. seq = strictly increasing per repo (a counter; say in the report what happens if two processes write during a deploy swap).2. Routes: GET pulls (state, cursor, limit) and GET pulls/N (pullObject); POST pulls/N/reviews (head = current or ANY earlier head via wasHeadOf, else 409 stale_head; line check against `git diff -M -U3 <merge-base(current target tip, head)> <head>` new side, added or context lines, new-side path after rename; any bad line → whole review 422 invalid with details [{index,path,line,reason line_not_in_diff|no_such_file}]; max 100 inline comments; threads of a review on an earlier head are outdated at once); GET pulls/N/reviews (own, newest first); GET pulls/N/threads (own, paginated, with comments, outdated computed = thread.head != current head); POST threads/:id/replies; POST threads/:id/resolve; GET + POST pulls/N/comments (conversation). Bodies Markdown ≤ 65,536 chars, 413 over 1 MB request. Another app's thread or another repo → 404.3. "Current verdict" helper: latest review of the app on the PR (a comment review does not clear request_changes) — #45/#46 will show/use it.4. No UI in this ticket (#45 shows them). No events here except none (human-side events come with #45).5. Tests: tests/reviews.mjs in GATES: the full contract §5 for these routes incl. 409/422/404 cases, earlier-head review outdated, paging, seq order, foreign token 404.## Read first- /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in the same 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", and for anyView change "§1", "§4 — Styles", "§12 — Composition" (List/Conditional rendering). Plugin READMEs you use (mpackdb, crypto, fetch, proc, time).Copy a working shape from the docs or from gitoria's own code. A framework gap: write a DOCS/GAP line in the report with a tiny repro; no workaround, no hand-written JavaScript.- THE CONTRACT: docs/apps-api.md v1 (fixed; anything you cannot build as written → report, do not change the contract).- Evaluation: reports/E38-push-api-eval.md (sections 1–6) and reports/E38b-reference-needs.md. App: README.md, project.hl, lib/pulls.hl, lib/transport.hl, lib/tokens.hl, lib/tickets.hl (connect flow), lib/repos.hl.## Rules- Work in a git worktree of /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org (base main 49533a5), everything under /media/STORAGE/claude-scratch/gitoria/W44/ (REPORT.md there). Never touch live (byrodin), his repos or live data; test data only in your own temp storage.- Hybriel stays on the vendored set (do not re-vendor).- Ports: only PORTS (check `ss -ltn` first).- Secrets: keys/tokens stored as sha256 only (like lib/tokens.hl); the signing secret is server-readable but never sent to a page or a log.- Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, do not deploy, do not 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's GATES list. Add your own gate file tests/<name>.mjs for this ticket and add it to GATES. A flake: rerun once, report it.- Budget: ~60 requests / 150k context. If the work is bigger, finish a clean part, commit, and report what remains. STOP after the report.## Report (REPORT.md, short)What was built (files, commits), how you tested (commands + results), contract points covered and not, 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