kunibert
All repositories: gitoria
4.7 KB
# Mission K7: one service, event → posted review (kunibert#7)Task (his words, kunibert#1): "basically we want vinzenz now to build a similar tool with gitoria and hybriel."This step only: connect what exists into one running service. A signed gitoria event comes in, a job is queued, the job runs the review against the PR, and the result is posted back. Gitoria is not live; prove it end to end against FAKES (K6's fake gitoria, a fake codex). No real gitoria, no real codex, no tickets.## Read first- reports/K4-gitcache.md, reports/K5-intake.md (esp. "GAP lines" 3 and "Open points"), reports/K6-posting.md (esp. open points), and the code they describe: service/project.hl, lib/{intake,gitoria-events,queue,run-job,runner,gitcache,gitoria-api,review-post,review-memory}.hl, tools/runner.hl.- Contract v1.2: /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org/docs/apps-api.md. Vinzenz's rules: docs/konrad-handover/4-apps-api-review.md section C and E (points 9–24).- Hybriel: docs/HL-PRIMER.md, docs/CODE-ORDER.md, /media/STORAGE/projects/hybriel/plugins/proc/server.hl (spawn, spawnArgs, its events, kill/timeout), plugins/time.Copy working shapes from the docs. Not covered → DOCS line; framework gap → GAP line with a minimal repro, no workaround. Hybriel .hl only in lib/, tools/, service/ (Python only for fakes and test scripts in scratch).## Build1. **runJob without blocking** (K5 GAP 3): the job runs the existing CLI as a child with `spawnArgs` (hybriel tools/runner.hl review-pr … with --api, --key-file, --clone from the per-repo config/event, `--force` for review_requested and @kunibert notes, the PR number). The queue gets a completion call (`done(key, result)`): success removes the job or promotes its follow-up (`next`), failure → retry/backoff as now. Hard timeout 15 min: kill the child (by its handle/PID), job counts as failed. The web route must stay answerable while a job runs: prove it.2. **Per-repo config**: a config file (path argument) mapping repo.id → { api, clone, keyFile, secretFile }; the event's repo.api/repo.clone are used when they match the config, a mismatch is refused and logged. Secrets/keys stay in files (mode 600), never in logs.3. **Flags reach the runner**: reset → the runner's reset for that PR, then the review; notes (`@kunibert <text>`) → into the next prompt (add a `--note-file` or similar to review-pr; K3 state already has pending notes); thread flips (review_thread) → already read from gitoria's threads at run time, so the queue only needs to trigger nothing extra: confirm. threadReplyOnly → the runner's existing "unchanged head → thread replies only" path: confirm it is taken.4. **removeSession**: a closed/merged PR's session is removed (runner reset/drop state for that PR) by the worker tick, and the mark is cleared.5. **Prompt**: add one line to the review prompt files: no `suggestion` blocks, write a fix as a normal code block (Vinzenz point 24).6. Draft and skipped runs post nothing (already); keep it that way.## Proof (end to end, all local; ports from 8840–8859, check `ss -ltn`)Run the service, K6's fake gitoria (copy it into K7 scratch and extend as needed: it serves the API and the git refs, file:// fetch is fine, say so) and a fake codex on PATH. A test script signs events with the repo's secret and POSTs them to the service. Show, from the fake gitoria's request log:- opened PR 1 → status pending → review with inline comment → status failure; state stored.- During that run, /health answers fast (show the time) and a synchronize for PR 1 is queued as follow-up and runs after (K5 phase 4 path, now live).- review_comment from a user (seq above watermark) on the same head → only a thread reply (+ resolve), no review, no status.- `@kunibert reset` → fresh session, review posted. `@kunibert check the db code` → note visible in the prompt the fake codex received.- closed → no run; session removed; mark cleared.- fake codex hangs → killed at the timeout (use a short test timeout from config), status `error`, retries as configured.- Signature from another repo's secret → 401.- K4 proof.py, K6 scripts/proof.py and K5 tests phases 1–3 still pass (run them).Stop every process you started by its PID at the end.## LimitsAbout 70 tool calls. No real codex, no sudo, no network outside localhost, no commits, no tickets, no messages to others. Scratch only under /media/STORAGE/claude-scratch/kunibert/K7/.Runtime: /media/STORAGE/projects/hybriel/native/zig-out/bin/hybriel, launched from /media/STORAGE/projects/kunibert.Report: /media/STORAGE/projects/kunibert/reports/K7-wiring.md (files, exact commands, proof output, DOCS/GAP lines, open points, and the exact steps to run the real proof on kunibert-test once gitoria is live). Stop when done or blocked.
Branches
Latest commits
- 070e01a4Records: parkmre
- bf8af0dcRecords: v1.4 checkedmre
- 44af321bRecords: contract v1.4mre
- 310f3fd0Records: outdated semanticsmre
- 268ebfe6Records: #11 proven live and closedmre
- 88e8aad3Records: K11 verified and deployedmre
- cd4cb09cNo review and status error when the model's tools did not run (kunibert#11)Kunibert
- a6b54efaStatus updatemre
- 5a72268eRecords: #4-#10 done, #11 started, review package on #1mre
- 194c7da6Records: real proof greenmre
- cdfa94a9Records: AppArmor profile for the review sandboxmre
- c1bf02d8Status: sandbox blockermre
- 88aaacc5Records: real proof part 2 (posting works, sandbox blocked by AppArmor userns)mre
- 401df4e8Records: review user logged inmre
- 6ca681b3Records: login command, status cleanupmre
- 6b8d763cRecords: review user, device login startedKunibert
- 07025b99Open the job worktree read-only for the review user before each model runKunibert
- 2a44bd54Runner CLI: --review-user/--codex-bin/--work-dir work in every modeKunibert
- 2177f66fReview model runs as its own unix user (reviewUser, codexBin, workDir)Kunibert
- 35df8306Records: live service on byrodin, real proof part 1Kunibert