gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8d34ca338d34ca33records: repo rename (gitoria#53)mre8d34ca33/missions/K10-review-user.md

5.4 KB

  1. # Mission K10: the review model runs as its own user (kunibert#10)
  2. Task (his words, kunibert#1): "basically we want [the consultant] now to build a similar tool with gitoria and hybriel."
  3. Decision (Apollo 2026-11-02, the design consultant's design): the review model (codex) runs as its own unix user that cannot read /root/.config/kunibert or Kunibert's app data. It gets its OWN codex login later (device code, approved by the owner). This mission builds the user, the permissions and the runner change, and proves the separation. It does NOT log in.
  4. ## Where
  5. - Live service on byrodin: ssh with `/media/STORAGE/projects/WorldAPI/worldapi-conductor/byrodin-ssh.sh [email protected] '<cmd>'` (one shared connection; never run parallel ssh). Read the "Live service" section of /media/STORAGE/projects/kunibert/CONDUCTOR.md first: paths, unit, deploy.
  6. - Code: /media/STORAGE/projects/kunibert on loreana (lib/runner.hl `codexTurn`/argv at ~line 40, lib/run-job.hl, service/project.hl, deploy/). Deploy only with `deploy/deploy.sh` after commit + push (CONDUCTOR.md "Deploy" says how to push; the token goes through GIT_CONFIG_* env, never argv). Commit messages short, no self-attribution, author `-c user.name=Kunibert -c [email protected]`.
  7. - Hybriel: docs/HL-PRIMER.md, docs/CODE-ORDER.md, plugins/proc/server.hl (spawn/run options). .hl only.
  8. ## Build
  9. 1. **User**: system user `kunibert-review` with its own home (e.g. /home/kunibert-review, 700), no login shell needed beyond what codex needs, no sudo rights, not in any group that can read root's or Kunibert's files.
  10. 2. **codex for that user**: root's codex is a symlink into /root (unreadable for others). Install the SAME version (0.166.0, standalone musl binary from /root/.codex/packages/standalone/releases/0.166.0-x86_64-unknown-linux-musl/bin/codex) as a copy at /usr/local/bin/codex-review (root-owned, 755). Do NOT touch /root/.codex, root's PATH, or root's codex, and never read or copy /root/.codex/auth.json. The review user's ~/.codex must be its own and writable by it (token refresh).
  11. 3. **Permissions**: /root/.config/kunibert stays 700/600 root. Kunibert's data (/CONTAINERS/projects/kunibert-data: state, sessions, token temp files, git cache) stays unreadable to kunibert-review. The model only needs to READ the job worktree (the checkout + .kunibert/pr.diff, delta.diff, spec.md, prompt files) and the schema file: put worktrees where kunibert-review can read but not write (e.g. a separate dir /CONTAINERS/projects/kunibert-work, root-owned, worktrees readable by a dedicated group or world-readable inside a 711 parent; your choice, explain it). The git cache and token temp files must NOT be reachable from there.
  12. 4. **Runner**: a config value `reviewUser` (service config.json → passed through run-job to the runner CLI). When set, every codex call (first and resume) runs as that user with its own HOME, e.g. `runuser -u kunibert-review -- env HOME=/home/kunibert-review /usr/local/bin/codex-review exec …` (the codex binary path is also config, `codexBin`). Keep all offline flags, stdin /dev/null, read-only sandbox, -C <worktree>. Unset (local proofs) → today's behaviour, so the K4/K6/K7/K8/K9 proofs on loreana still pass (run them: commands in CONDUCTOR.md "Local gates").
  13. 5. Update deploy/config.byrodin.json (reviewUser, codexBin, work dir) and the live /root/.config/kunibert/config.json accordingly; deploy; /health OK.
  14. ## Proof (on byrodin, no real model run: codex-review is NOT logged in yet, that is expected)
  15. - `runuser -u kunibert-review -- cat /root/.config/kunibert/gitoria-proof-key` and `…-secret`, `ls /root/.config/kunibert`, reading a state file and the git cache under /CONTAINERS/projects/kunibert-data, and `cat /root/.codex/auth.json` → all Permission denied. Show the outputs (never print a secret: if a read SUCCEEDS, stop and report without showing content).
  16. - As kunibert-review: reading a job worktree file and the schema works; writing into the worktree fails.
  17. - The runner, run on byrodin through the real CLI path (e.g. `bin/hybriel tools/runner.hl review …` on a tiny local fixture repo in a scratch dir on byrodin, or a probe codex) shows that codex is started as kunibert-review: e.g. point `codexBin` for that one run at a probe script that prints `id`, HOME, and tries to read the key file, then exits 1. Show its output. Remove the probe and the fixture afterwards.
  18. - `runuser -u kunibert-review -- /usr/local/bin/codex-review login status` → "Not logged in" (or the equivalent); root's `codex login status` is unchanged (logged in) before and after.
  19. - Loreana: the five local proofs still ALL OK.
  20. - List (do not change) any OTHER world-readable secret files you happen to notice under /CONTAINERS/projects that kunibert-review could read (e.g. .env files): just report paths, for Apollo.
  21. ## Limits
  22. About 60 tool calls. Touch only: the new user and its home, /usr/local/bin/codex-review, Kunibert's dirs, /root/.config/kunibert/config.json, kunibert.service (restart via deploy only). Do not restart or change any other service, do not touch docker, other apps, /root/.codex, sshd or sudoers. No codex login, no real model run, no tickets, no messages to others. Scratch on loreana only under /media/STORAGE/claude-scratch/kunibert/K10/; on byrodin under /tmp/kunibert-k10 (removed at the end).
  23. Report: /media/STORAGE/projects/kunibert/reports/K10-review-user.md (what was created with modes/owners, exact commands, proof outputs, other readable secrets list, the exact command for the later device-code login as kunibert-review). 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