gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainbd3591c7conductor: gates run on the live day44 binarymremain/docs/DESIGN.md

7.8 KB

  1. # Kunibert design (draft 2026-11-01, unconfirmed; NOT HIS unless quoted)
  2. Sources: docs/reviewer-design/ (the design consultant), gitoria reports E38 and E38b, /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md.
  3. ## 1. What it reviews
  4. - Every PR on a gitoria repo whose owner connected Kunibert. It reviews the PR's current head, with the diff taken locally as merge-base(base, head)..head.
  5. - Three separate axes, as in the earlier reviewer: **correctness** (bugs, security, data loss, edge cases, tests), **spec** (against the linked tickets: description plus comments oldest first, where a later comment overrules), **standards** (the repo's documented rules, e.g. AGENTS.md/CLAUDE.md, cited by file and words).
  6. - From day one, Kunibert also gets the improvements the earlier reviewer still lacks:
  7. - a category checklist in the prompt (caching, backfill, timeouts, deploy order, contracts);
  8. - a stricter spec axis ("move to a separate PR" is never a finding);
  9. - a per-repo memory of accepted decisions;
  10. - failures go to the operator, never as a PR comment.
  11. - Gates (lint, typecheck, tests in a prepared workspace) come in v2, as their own ticket.
  12. ## 2. How it gets PRs
  13. - Through gitoria's push API (gitoria#38, Option B plus the E38b additions), once it is built. The repo owner connects Kunibert. Gitoria then sends one HMAC-signed POST per event: PR opened, reopened or ready; new commits (incl. force-push); review re-requested; a reply in a Kunibert thread; `@kunibert reset` or `@kunibert <text>`; thread resolved; closed or merged.
  14. - Kunibert answers each POST at once and puts the job in a queue. There is one job per PR, and a newer event updates the queued job instead of adding a second one.
  15. - Code: `git fetch` over HTTPS with the app token, into a bare cache with forced refspecs (PR head and base). No diff API.
  16. - Linked tickets: gitoria names them, and Kunibert reads them directly with its own read-only tickets token. That is the design consultant's advice and my lean; **caramboleyo decides**.
  17. - On start, Kunibert polls the PR list once, so lost events do no harm.
  18. ## 3. How it reports
  19. - One review per run: a verdict (approve / comment / request_changes), a body and inline comments on new-side lines in the diff. Findings outside the diff go into the body under "Not on changed lines".
  20. - The comment format follows the earlier reviewer: badge, severity, axis and title. The header counts both new and still-open threads ("0 new, 1 still open").
  21. - Replies and resolves happen in Kunibert's own threads. The status per head sha goes pending → success, or failure on request_changes.
  22. - Kunibert never merges. Merging stays with caramboleyo.
  23. - Memory: one model session per PR, resumed on every wake-up with only the delta, following the earlier reviewer's memory rules (settled threads are never raised again). Settled keys and seen-watermarks are stored in Kunibert's own data, and a generation counter guards against a reset during a run.
  24. ## 4. Which model
  25. - DECIDED 2026-11-02 (the design consultant, 4-apps-api-review.md point 25): codex gpt-6.1-sol, effort max, output schema, read-only sandbox, own unix user.
  26. - Proposal: the same one as the earlier reviewer, codex `gpt-6.1-sol` at reasoning effort max, with the output schema and a read-only sandbox under its own unix user. It has a measured record: 74 % of findings valid, 2 min median (vs CodeRabbit 59 %, 8 min). The quota comes from Apollo's Sol budget. Claude is the alternative. **Apollo/caramboleyo decide** (cost question to the design consultant pending).
  27. ## 5. How it is built
  28. - A Hybriel service (his words: "build a similar tool with gitoria and hybriel"). It uses:
  29. - hl:web for the hook route and a small status page;
  30. - hl:proc `run`/`spawn` for git and codex;
  31. - hl:fetch for the back-channel and tickets;
  32. - an hl:data table for jobs and memory;
  33. - hl:time timers for the queue.
  34. - Known framework gaps (E38 section 6): HMAC-SHA256 is not documented, and a task cannot be detached from a request (the workaround is a timer tick that reads the queue). These are gitoria's gaps too. They go to Arachne/Anton via Apollo; Kunibert builds no workaround.
  35. - Host, port and domain: not decided. They follow the WorldAPI scheme and need Apollo's GO.
  36. ## 6. Plan (one ticket each; build only after Apollo's GO)
  37. 1. Event intake: hook route, HMAC check, delivery-id dedupe, job queue.
  38. 2. Git cache and local diff (forced fetch, merge-base, delta limited to the PR's files).
  39. 3. Model runner and schema (prompt in a file, errors from the JSON events, operator alert).
  40. 4. Posting the review, threads, replies, resolves and status to gitoria.
  41. 5. Per-PR session memory (resume, delta, settled keys, generation counter, `@kunibert reset`).
  42. 6. v2: a gate lane (prepared workspace, lint/typecheck/tests as facts in the prompt).
  43. - Tickets 1, 2 and 4 depend on gitoria#38 being built. Ticket 3 and parts of 5 can start against a local fake repo.
  44. - Proof for each step: a PR pushed to a test repo on gitoria → event → review visible on that PR.
  45. ## 7. The design consultant's answers (2026-11-01, report from the design consultant; folded into the plan)
  46. - **Model:** keep codex gpt-6.1-sol at effort max (Claude opus would work too; quality comes from prompt + memory + schema). There is no per-review $ figure: the earlier reviewer runs on a subscription, about 3 % of a weekly quota in a week of light use. → Log `usage` from codex --json per job from day one. Time: median 1.7 min, up to ~10 min on big PRs, hard timeout 15 min (SIGKILL).
  47. - **Runner:**
  48. - `codex exec --json -s read-only --skip-git-repo-check -C <dir> --output-schema <file>` via `sudo -n -H -u <runner user>`, so the model cannot read the app key.
  49. - stdin must be closed or /dev/null, because resume hangs otherwise. Prompts over ~16 KB go to a file.
  50. - Resume: `codex exec resume --json -c sandbox_mode="read-only" <session> <prompt>` (no `-s`).
  51. - Errors: take the last error event from stdout.
  52. - The runner user's ~/.codex must be writable for token refresh. Pin model and effort in its config.toml.
  53. - **Gates:** v2, but design for them now: a `gates` field in the result and a slot for gate output in the prompt.
  54. - **Checklist for the prompt:**
  55. - cache invalidation;
  56. - backfill when constraints are added;
  57. - publish/draft side effects;
  58. - timeouts split by purpose;
  59. - time limits and recovery;
  60. - stale async responses in the UI;
  61. - CLI argument validation and hard-coded developer paths;
  62. - whether README/ARCHITECTURE claims still hold;
  63. - a11y/i18n;
  64. - N+1 queries and unbounded loops;
  65. - cross-repo deploy order (backward compatibility or a "DEPLOY AFTER" note, and check the sibling's reader).
  66. - **Spec axis** (33 of the earlier reviewer's 38 false alarms were here):
  67. - "split it out" is a nit or summary-only;
  68. - read the PR description and linked/stacked PRs before calling a requirement missing;
  69. - the newest ticket comment overrides;
  70. - a cited exception is not raised again ("withdrawn");
  71. - "won't fix, by design" is kept per repo.
  72. - More detail: the design consultant's CR-vs-the earlier reviewer report.
  73. ## 8. Gitoria's answers (2026-11-01, report from Gitoria) — OUTDATED
  74. Superseded 2026-11-02: contract /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org/docs/apps-api.md (v1.1+), PR number decided (gitoria#40), linked tickets decided (Kunibert reads them with its own token), test repo kunibert-test exists. The design consultant's review of the contract and of this design: docs/reviewer-design/4-apps-api-review.md (final unless caramboleyo says otherwise).
  75. - The push API is not being built yet. It needs Apollo's GO for gitoria and caramboleyo's yes on Option B plus the E38b additions (~20 steps). No ETA.
  76. - PR id: the plan is a stable per-repo number (#1, #2…, never reused; E38 question 19, still open). Today the id is the |||PR commit sha, which changes on rewrite. → Kunibert designs against the number.
  77. - Linked tickets: not decided.
  78. - Test repo: none. Making one is caramboleyo's call. Gitoria will ask on gitoria#38 when its build gets GO.

Branches

Latest commits

  • bd3591c7conductor: gates run on the live day44 binarymre
  • 47f747a7records: jukebox #9 fix livemre
  • 0a3169fdMerge branch 'vendored-size' into mainKunibert
  • e447bb09Vendored size fix: keep renames with an app side whole; type the filter parameter (L10)mre
  • 99ccc742Vendored size fix: no renames in the app diff, filter the resumed delta toomre
  • 1a52e100|||PR Diff size limit counts only app files when vendored paths are setmre
  • 50a1867estatus: jukebox #9mre
  • c57484e6log: jukebox #9 diff sizemre
  • 795a20carecords: guard fix live (PR 8)mre
  • 6981d96fMerge branch 'fresh-on-nocmd' into mainKunibert
  • 37c47840runner: one shared prompt for both fresh-session fallbacks (L16)mre
  • f945d2e1|||PR runner: a resumed run with no command on a new head gets one fresh session instead of a tool errormre
  • 10b2a49estatus: PR 314, guard fix proposedmre
  • e73995a3log: hycon PR 314 approved after fresh reviewmre
  • f60427falog: hycon PR 314 false tool errormre
  • 481974f7log: Hermes accepts PR 259 findingmre
  • bb0976acrecords: hycon PR 259 design findingmre
  • 5c637c24records: hycon PR 259 false tool errormre
  • a344c406log: routger 132 reviewedmre
  • 56e70dcbrecords: review time limit 1800 s (routger 132)mre