gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8d34ca338d34ca33records: repo rename (gitoria#53)mre8d34ca33/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 [the consultant] 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. The design consultant's rules: docs/reviewer-design/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 (the design consultant 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

  • 8d34ca33records: repo rename (gitoria#53)mre
  • 1e05cb3fMerge branch 'repo-rename' into mainKunibert
  • 6ee0d2e9|||PR intake: match a delivery by repo.id and signature, not URLs (gitoria#53 rename)mre
  • 900ffcd4status: routgermre
  • 59b0b793log: routger merge waitmre
  • e52f094alog: routger intake check (hycon#122)mre
  • f979027frecords: design rule livemre
  • 71efaf84Merge branch 'design-guard' into mainKunibert
  • c0656581|||PR Flag removal of a documented design as major unless his recorded yes is linked; rules version 5mre
  • 901cdd75records: L10 update 2 livemre
  • 4a68016bMerge branch 'hl-standard-l10b' into mainKunibert
  • 246d0f30|||PR HL-STANDARD L10 update (hybriel ab293e5a), rules version 4mre
  • 1aa4d64crecords: HL-STANDARD L10 update livemre
  • 2b04c240Merge branch 'hl-standard-l10' into mainKunibert
  • 88c7b09d|||PR HL-STANDARD L10 update (hybriel 5885d688), rules version 3mre
  • 00869ecbrecords: gitoria#50 step 3 livemre
  • f97a0e5fMerge branch 'hl-standard' into mainKunibert
  • 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