gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainfe209ffeMerge branch 'w56-owner-members' into mainGitoriamain/docs/apps-api-review.md

6.3 KB

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