gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit070e01a4070e01a4Records: parkmre070e01a4/missions/K7-wiring.md

4.7 KB

  1. # Mission K7: one service, event → posted review (kunibert#7)
  2. Task (his words, kunibert#1): "basically we want vinzenz now to build a similar tool with gitoria and hybriel."
  3. 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.
  4. ## Read first
  5. - 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.
  6. - 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).
  7. - 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.
  8. 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).
  9. ## Build
  10. 1. **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.
  11. 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.
  12. 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.
  13. 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.
  14. 5. **Prompt**: add one line to the review prompt files: no `suggestion` blocks, write a fix as a normal code block (Vinzenz point 24).
  15. 6. Draft and skipped runs post nothing (already); keep it that way.
  16. ## Proof (end to end, all local; ports from 8840–8859, check `ss -ltn`)
  17. 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:
  18. - opened PR 1 → status pending → review with inline comment → status failure; state stored.
  19. - 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).
  20. - review_comment from a user (seq above watermark) on the same head → only a thread reply (+ resolve), no review, no status.
  21. - `@kunibert reset` → fresh session, review posted. `@kunibert check the db code` → note visible in the prompt the fake codex received.
  22. - closed → no run; session removed; mark cleared.
  23. - fake codex hangs → killed at the timeout (use a short test timeout from config), status `error`, retries as configured.
  24. - Signature from another repo's secret → 401.
  25. - K4 proof.py, K6 scripts/proof.py and K5 tests phases 1–3 still pass (run them).
  26. Stop every process you started by its PID at the end.
  27. ## Limits
  28. About 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/.
  29. Runtime: /media/STORAGE/projects/hybriel/native/zig-out/bin/hybriel, launched from /media/STORAGE/projects/kunibert.
  30. 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