gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit477d7bdc477d7bdcMerge branch 'p50'mre477d7bdc/missions/W44-reviews.md

4.7 KB

  1. # W44 — an app can post a review with inline comments and answer in threads (gitoria#44, part of the push API #38)
  2. 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/44
  3. W44, 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.
  4. ## Scope (contract docs/apps-api.md v1.2.1 §5; every route via apiPatterns + appOfRequest; JSON errors §6)
  5. 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).
  6. 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.
  7. 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.
  8. 4. No UI in this ticket (#45 shows them). No events here except none (human-side events come with #45).
  9. 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.
  10. ## Read first
  11. - /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in the same folder.
  12. - /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md,
  13. /media/STORAGE/projects/hybriel/COMPONENTS.md "hl:web — a function route and its request", "§11 — Routing", "§9 — Data", and for any
  14. View change "§1", "§4 — Styles", "§12 — Composition" (List/Conditional rendering). Plugin READMEs you use (mpackdb, crypto, fetch, proc, time).
  15. 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.
  16. - THE CONTRACT: docs/apps-api.md v1 (fixed; anything you cannot build as written → report, do not change the contract).
  17. - Evaluation: reports/E38-push-api-eval.md (sections 1–6) and reports/E38b-konrad-needs.md. App: README.md, project.hl, lib/pulls.hl, lib/transport.hl, lib/tokens.hl, lib/tickets.hl (connect flow), lib/repos.hl.
  18. ## Rules
  19. - 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.
  20. - Hybriel stays on the vendored set (do not re-vendor).
  21. - Ports: only PORTS (check `ss -ltn` first).
  22. - 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.
  23. - Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, do not deploy, do not write to tickets.
  24. - 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.
  25. - Budget: ~60 requests / 150k context. If the work is bigger, finish a clean part, commit, and report what remains. STOP after the report.
  26. ## Report (REPORT.md, short)
  27. What was built (files, commits), how you tested (commands + results), contract points covered and not, DOCS/GAP lines, open risks.

Branches

Latest commits

  • 477d7bdcMerge branch 'p50'mre
  • 00efc06fP50 reportmre
  • e3f85afblog: commit mention slipmre
  • 4d1a4cf4log: #25 numbersmre
  • 1af0a60ddocs: H25 run() correctionmre
  • eefa2dbcRepo setting: refuse direct pushes to the main branch (pre-receive over HTTPS and ssh)mre
  • 8c8ba2f1log: PR flow announcedmre
  • fa00cd35log: Kunibert pings provenmre
  • 3a68cfaclog: components decisionmre
  • 87de8e31log: Kunibert connected to 9 app reposmre
  • c22aff69log: PR-only rollout startedmre
  • 25309981log: STOP and paused workers 2026-11-08mre
  • 5286803alog: worker briefs and reports of 2026-11-08mre
  • 85c86605log: 2026-11-08 Arachne on list shapemre
  • cb634512log: 2026-11-08 keyed lists livemre
  • 07c98d4aLists: keyed rows with @id, remove(id) and one whole-list assignment instead of hand-rebuilt loopsmre
  • 0db0d81elog: 2026-11-08 day52 live, W30 startedmre
  • b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmre
  • 1e8f4f0avendor: Hybriel set-day52 (fault-path leak fix #335, keyed rows #331)mre
  • f5f0fb7blog: 2026-11-08 day50/#29 live, H25 correction, V52 startedmre