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
- 2f2959c5|||PR apps API: broken JSON body gives 400 invalid_json, not 500mre
- f7c6ca07Merge branch 'ident-chooser-selector' into mainGitoria
- 691abb8e|||PR tests: find ident identity choice without the removed .choose classmre
- 16a3530fMerge branch 'heap-revert' into mainGitoria
- 220a80e0|||PR Remove temporary /__heap route and heap helper; logmre
- 13f0c342Merge branch 'hl25-records' into mainGitoria
- a002ecb7|||PR records: HL25 report, heap helper, logmre
- 2492a55cTemporary keyed /__heap route for the live memory snapshotmre
- fefaedd2log: tracker PR-only, HL25 startedmre
- 21aa57calog: parkmre
- e9f950a8reports: G25c soakmre
- a7783686log: deploy 9f41ffcmre
- 9f41ffc1log: W30b mergedmre
- bef635c1Merge branch 'w30b'mre
- 15b996a5Org list: keyed rows by @id, newest first, concat instead of hand loopmre
- c4f6d9e3reports: G25c growth huntmre
- b88e39f1log: privacy cleanup donemre
- bfd7826ddocs: neutral example organisation namemre
- 01b71c2edocs: neutral wording in missions, reports and logmre
- 3eeea733log: 2026-11-09 PR flow plan and membersmre