gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit03b5bb0803b5bb08W39 report to reports/, drop scratch repro, mission + logmre03b5bb08/docs/apps-api-review-vinzenz.md

6.2 KB

  1. # Vinzenz: review of gitoria apps-api contract v1.1 against Konrad (2026-11-02)
  2. Reference = what Konrad (ASI's reviewer on GitHub) needs and does today. Every point has my answer; it is final
  3. unless Markus (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.** Konrad'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.** Konrad 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`: Konrad 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 Konrad (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. (Konrad'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 Konrad: decisions (K)
  47. 18. §1 spec axis "move to a separate PR is never a finding": confirmed (stricter than Konrad's "at most nit", justified
  48. by the eval: 33/38 false alarms were spec). Also take from Konrad's live prompt (asi-konrad#17, 2026-11-01): 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. Konrad shipped gates on 2026-11-01 (asi-konrad#21); 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 (= Konrad).
  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

  • 03b5bb08W39 report to reports/, drop scratch repro, mission + logmre
  • 154d333fMerge w39-create-api: POST /api/repos with a user token (#39)mre
  • 149dd512Rewrite W39 reportmre
  • e5385075Expect 401 for POST /api/repos without a tokenmre
  • 1a76055cDocument repository creation APImre
  • 4d779b3bAdd create-api gatemre
  • 88563122Add POST /api/repos for user tokensmre
  • b00860e3Create repositories with member checks in createRepoInmre
  • 0a38f236Report repository creation API blockermre
  • b5f72187Record malformed JSON blocker for repository creationmre
  • a2ae8302logmre
  • 6947cd58logmre
  • 2175e48clogmre
  • 40eb3ca1gitoria#38: review package, logmre
  • 06a5a50egitoria#38: deploy b8252ca, logmre
  • b8252ca0gitoria#46: W46b report, logmre
  • 50093aafgitoria#46: statuses keyed by app + context (merge w46b-keyed)mre
  • dd0267edgitoria#46: fix a label in the keyed gatemre
  • b1dcb580gitoria#46: statuses keyed by app + context, required = app + context, old rows still readmre
  • 2287363egitoria#47: W47 report, logmre