gitoria
All repositories: gitoria
6.3 KB
# Review of gitoria apps-api contract v1.1 against a reference reviewer (2026-11-02)Reference = what the reference reviewer (a PR reviewer on GitHub) needs and does today. Every point has my answer; it is finalunless caramboleyo says otherwise. G = Gitoria builds/changes, K = Kunibert builds/does.## A. Deviations: the contract must change (G)1. **409 stale_head loses whole reviews.** A review takes 2–15 min (codex + gates). If the author pushes meanwhile,GitHub still accepts the review on the old commit (shown as outdated); v1 throws it away. Answer: accept `head` when itis the PR's current head OR any earlier head of this PR (gitoria keeps the list of heads per PR, it already sends`before/after`). The line check then uses `git diff -M -U3 <merge-base of that head> <that head>`, threads get`outdated: true` at once if head != current. Status PUT works per sha already. 409 only for a sha that never was ahead of this PR.2. **Body limit 20,000 chars is too small.** the reference reviewer's review body (summary + 3 axes + "not on changed lines" + still-openlist + gate output) and check summaries reach 30–60 KB on big PRs; GitHub allows 65,536. Answer: 65,536 chars for reviewbodies, comment bodies and status `summary`; the 1 MB request limit stays.3. **Latest verdict semantics are missing.** Answer: an app's CURRENT verdict on a PR is its latest review (any head);earlier reviews stay as history. A `comment` review does not clear an earlier `request_changes` (same as GitHub). Add`GET {api}/pulls/N/reviews` (own reviews, newest first: id, verdict, head, created) so an app can recover after losingits DB.4. **Shallow fetch.** The reference reviewer fetches `--depth=200` and deepens when the merge base is missing. Answer: gitoria's git servermust support protocol v2 with `depth`/`deepen`, OR the contract says "shallow not supported" and K always fetches full.Choose one and write it in §3. (K: until it is written, fetch full.)## B. Open points in v1: my answers5. Retry steps (1m,5m,30m,2h,6h): fine, close it. K never relies on retries: `review_requested` and the next push cover gaps.6. `context` field name: keep `context` (GitHub's name). Close it.7. Limits 300 reads / 60 writes per minute: fine for one reviewer (one review = 1 review + ~10 replies/resolves + 2status PUTs). Close it. K honours 429 + Retry-After.8. Drafts/`ready`: The reference reviewer skips drafts and reviews on `ready_for_review`. Keep `draft:false` + `ready` reserved; K skips`draft:true` from day one so nothing changes when drafts arrive.## C. Points that need no contract change, but K must do them like the reference reviewer (K)9. Diff for inline lines: build it locally with exactly `git diff -M -U3 <mergeBase> <head>`, merge base computed by Kwith `git merge-base refs/heads/<target> <head>` right before posting (not the event value). Never use an API diff.10. Fetch with FORCED refspecs (`+refs/pull/N/head:...`, `+refs/heads/<target>:...`): force-pushes otherwise break fetch.11. On 422 invalid: move the listed comments into the body ("Not on changed lines") and post again once. >100 inlinecomments: the rest into the body.12. Token lives 1 h, a job can take 20 min: get a fresh token right before the write phase, not only at job start.13. Status: `pending` at start, `success`/`failure` by verdict at the end, `error` when the review itself failed(the reference reviewer's `neutral`). Alerts on failure go to the operator, never as PR comments.14. Own-thread memory: watermark = highest `comment.seq` seen per thread; a reply with higher seq from a `user` = news.15. `pull_comment` handling: `@kunibert reset` = fresh session; any other `@kunibert <text>` = a note fed into the nextreview (answers to summary-only findings).16. Delta scope: on `synchronize` limit the delta to the PR's own paths, so a merge from the target is not reviewed as theauthor's change; `forced:true` = history rewritten, re-read the full diff.17. Tickets: read them (description + comments, oldest first) with K's own tickets token; a later comment overrules thedescription.## D. Not needed from gitoria (do not build for K)- No diff API, no file-content API (K reads its checkout), no PR edit events, no reactions, no check-run "annotations".## E. Kunibert DESIGN.md (draft 2026-11-01) against the reference reviewer: decisions (K)18. §1 spec axis "move to a separate PR is never a finding": confirmed (stricter than the reference reviewer's "at most nit", justifiedby the eval: 33/38 false alarms were spec). Also take from the reference reviewer's live prompt: reachabilitycheck before "can be null/missing" findings, cross-repo contract rule, "Withdrawn:" reply when proven wrong.19. §1/§6 gates in v2: confirmed. The reference reviewer shipped gates on 2026-11-01; copy its semantics when you build v2:run beside the model, a failed step is re-run on the merge base (fails there too = pre-existing, not blocking; packageabsent on base = blocking; base not checkable = not blocking), results stored per head sha, runner setup errors neverblock, the model is told gates run separately. v1 needs only the `gates` slot in result and prompt.20. §2 linked tickets: DECIDED by contract §4: gitoria lists `tickets`, K reads them with its own read-only token.21. §2 add: skip PRs with `draft:true`; review on `opened`, `reopened`, `synchronize`, `ready`, `review_requested`(forced run), `review_comment` (reply in own thread), `pull_comment` with `@kunibert`; ignore `review_thread` except toupdate the seen/settled state; `closed`/`merged` drop the queued job and the session.22. §3 post a review only when there is something to say: new commits, new findings, a changed verdict, or it was askedfor (`review_requested`/`@kunibert`). A wake-up for a thread reply on an unchanged head answers in the thread only.23. §3 status: `pending` → `success` (approve/comment) / `failure` (request_changes) / `error` (the review itself failed).24. §3 no GitHub `suggestion` blocks (gitoria has no "commit suggestion"); write the fix as a normal code block.25. §4 model: DECIDED: codex gpt-6.1-sol, effort max, output schema, read-only sandbox, own unix user (as the reference reviewer).26. §8 is outdated: contract v1.1 exists, PR number decided (#40), tickets decided (point 20). Test repo `kunibert-test`is named in the contract examples: Gitoria creates it as part of #41's proof.
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