kunibert
All repositories: gitoria
7.8 KB
# Kunibert design (draft 2026-11-01, unconfirmed; NOT HIS unless quoted)Sources: docs/reviewer-design/ (the design consultant), gitoria reports E38 and E38b, /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md.## 1. What it reviews- 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.- 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).- From day one, Kunibert also gets the improvements the earlier reviewer still lacks:- a category checklist in the prompt (caching, backfill, timeouts, deploy order, contracts);- a stricter spec axis ("move to a separate PR" is never a finding);- a per-repo memory of accepted decisions;- failures go to the operator, never as a PR comment.- Gates (lint, typecheck, tests in a prepared workspace) come in v2, as their own ticket.## 2. How it gets PRs- 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.- 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.- Code: `git fetch` over HTTPS with the app token, into a bare cache with forced refspecs (PR head and base). No diff API.- 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**.- On start, Kunibert polls the PR list once, so lost events do no harm.## 3. How it reports- 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".- 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").- Replies and resolves happen in Kunibert's own threads. The status per head sha goes pending → success, or failure on request_changes.- Kunibert never merges. Merging stays with caramboleyo.- 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.## 4. Which model- 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.- 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).## 5. How it is built- A Hybriel service (his words: "build a similar tool with gitoria and hybriel"). It uses:- hl:web for the hook route and a small status page;- hl:proc `run`/`spawn` for git and codex;- hl:fetch for the back-channel and tickets;- an hl:data table for jobs and memory;- hl:time timers for the queue.- 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.- Host, port and domain: not decided. They follow the WorldAPI scheme and need Apollo's GO.## 6. Plan (one ticket each; build only after Apollo's GO)1. Event intake: hook route, HMAC check, delivery-id dedupe, job queue.2. Git cache and local diff (forced fetch, merge-base, delta limited to the PR's files).3. Model runner and schema (prompt in a file, errors from the JSON events, operator alert).4. Posting the review, threads, replies, resolves and status to gitoria.5. Per-PR session memory (resume, delta, settled keys, generation counter, `@kunibert reset`).6. v2: a gate lane (prepared workspace, lint/typecheck/tests as facts in the prompt).- Tickets 1, 2 and 4 depend on gitoria#38 being built. Ticket 3 and parts of 5 can start against a local fake repo.- Proof for each step: a PR pushed to a test repo on gitoria → event → review visible on that PR.## 7. The design consultant's answers (2026-11-01, report from the design consultant; folded into the plan)- **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).- **Runner:**- `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.- stdin must be closed or /dev/null, because resume hangs otherwise. Prompts over ~16 KB go to a file.- Resume: `codex exec resume --json -c sandbox_mode="read-only" <session> <prompt>` (no `-s`).- Errors: take the last error event from stdout.- The runner user's ~/.codex must be writable for token refresh. Pin model and effort in its config.toml.- **Gates:** v2, but design for them now: a `gates` field in the result and a slot for gate output in the prompt.- **Checklist for the prompt:**- cache invalidation;- backfill when constraints are added;- publish/draft side effects;- timeouts split by purpose;- time limits and recovery;- stale async responses in the UI;- CLI argument validation and hard-coded developer paths;- whether README/ARCHITECTURE claims still hold;- a11y/i18n;- N+1 queries and unbounded loops;- cross-repo deploy order (backward compatibility or a "DEPLOY AFTER" note, and check the sibling's reader).- **Spec axis** (33 of the earlier reviewer's 38 false alarms were here):- "split it out" is a nit or summary-only;- read the PR description and linked/stacked PRs before calling a requirement missing;- the newest ticket comment overrides;- a cited exception is not raised again ("withdrawn");- "won't fix, by design" is kept per repo.- More detail: the design consultant's CR-vs-the earlier reviewer report.## 8. Gitoria's answers (2026-11-01, report from Gitoria) — OUTDATEDSuperseded 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).- 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.- 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.- Linked tickets: not decided.- Test repo: none. Making one is caramboleyo's call. Gitoria will ask on gitoria#38 when its build gets GO.
Branches
Latest commits
- 9710e39fType STANDARD as String (L10, Kunibert review)mre
- 4140b664|||PR Review against HL-STANDARD and cite rule ids (gitoria#50 step 3)mre
- 75c6888drecords: gitoria#50 step 1 connected and provenmre
- aa6d997frecords: gitoria#50 connect plan, Anton reportmre
- 8a190ba7Records: kunibert#18 and #15 donemre
- 2eee9dbbMerge branch 'revendor-day44' into mainKunibert
- e96721cb|||PR Re-vendor plugins from Hybriel day44 (hl:fetch redirect fix)mre
- 0c67ab8cLog: kunibert repo ping provenmre
- b6f3039cLog: kunibert repo connectedmre
- b143c3c7CONDUCTOR: push recipemre
- 7a1279eeRule: conductor merges own utility PRs after green reviewmre
- 4038b3e0Log: kunibert#18 openedmre
- 18543db1Log: day42 fetch fix, re-vendor pendingmre
- 81a12f96Statusmre
- 6ce706abRecords: neutral wording, split cleanupmre
- 81a4d31bDocs: neutral wordingKunibert
- 8205b05eRecords: #17 livemre
- c3391204Answer fresh reviews under open threadsKunibert
- a0f3d147Records: #16 livemre
- 04322148Run reviews in parallel across repositoriesKunibert