gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainbd3591c7conductor: gates run on the live day44 binarymremain/reports/K2-runner.md

10.5 KB

  1. # K2 runner report
  2. Completed the local-only first-review runner. No gitoria integration or posting.
  3. ## Files made
  4. - `schema.json`: the earlier reviewer schema verbatim plus required string `gates`.
  5. - `tools/runner.hl`: three-argument CLI, single JSON output, global Error handler and nonzero failure exit.
  6. - `lib/runner.hl`: resolve refs to commit IDs, verify HEAD and tracked cleanliness, merge-base/diff, write `.kunibert/pr.diff`, spill prompts above 16,000 bytes, run Codex, save stdout JSONL, validate and return the review.
  7. - `lib/review-output.hl`: JSONL parser, last session/message/error selection, all usage counters summed, result validation, unknown finding axis mapped to correctness.
  8. - `lib/review-prompt.hl`: the earlier reviewer first-review prompt renamed to Kunibert, hasSpec=false, checklist and spec-axis rules from DESIGN section 7, gates="not run". PR metadata uses explicit local-review placeholders because this step has only repo/base/head inputs. The final wording makes splitting work summary-only, never a finding.
  9. - This report. All test programs, saved outputs, test repositories and other scratch are under `/media/STORAGE/claude-scratch/kunibert/K2/`.
  10. The process runs as the current user, uses closed stdin via hl:proc run, timeout=900 seconds, sandbox read-only, and CLI overrides `-c model="gpt-6.1-sol" -c model_reasoning_effort="max"`. No config.toml changes, sudo, user creation, project commits, pushes, tickets or messages to others.
  11. Limit interpretation: the mission requires a Git main/feature fixture while also saying "no commits". Exactly two fixture-only commit objects were constructed with git commit-tree under the specified scratch testrepo so the required merge-base review could be proved. No commit was made in Kunibert or another real repository. This is an exception to a literal blanket reading of "no commits", recorded explicitly.
  12. ## Runtime
  13. Used `/media/STORAGE/projects/hybriel/native/zig-out/bin/hybriel`, already present and executable; no build was needed. All application logic is Hybriel .hl; no JavaScript or TypeScript was added. Python and shell were used only to construct fixtures and inspect proof.
  14. Run from `/media/STORAGE/projects/kunibert`. The repository argument must resolve to an existing path, the tracked working tree must be clean, and HEAD must equal the supplied head ref. Untracked files are ignored by the cleanliness check.
  15. ## Real-run proof
  16. Exactly one real Codex run, exit 0; no retries. The clean change adds an example to README.md. The planted bug changes `<` to `<=` at total.hl:3. The base prints 5; executing feature fails with `ordered index out of range` at total.hl:4:27, where the invalid read occurs. The reported finding points to the changed loop bound on line 3.
  17. Fixture refs:
  18. ```text
  19. main 81c6e67ed677f9759c55172f3c10847e54f23463
  20. feature a6f077a424517087b557c6901b573f482ab90de8
  21. ```
  22. Exact runner command:
  23. ```sh
  24. /media/STORAGE/projects/hybriel/native/zig-out/bin/hybriel tools/runner.hl /media/STORAGE/claude-scratch/kunibert/K2/testrepo main feature
  25. ```
  26. Full stdout JSON line:
  27. ```json
  28. {"session":"01a196db-b8f2-71b3-a423-38b22360956e","usage":{"input_tokens":103142,"cached_input_tokens":70272,"output_tokens":1565,"cache_write_input_tokens":0,"reasoning_output_tokens":928},"result":{"summary":"The changed loop bound introduces a read past the end of the prices. No spec or standards findings were identified.","axes":{"correctness":"One major finding: the loop includes an index equal to the array length.","spec":"No ticket or issue is linked, so there are no spec findings.","standards":"No applicable documented standards files were found; there are no standards findings."},"verdict":"request_changes","findings":[{"axis":"correctness","path":"total.hl","line":3,"severity":"major","title":"Stop before the index reaches prices.length","body":"The `<=` condition adds an iteration at `i == prices.length`: `[2, 3]` now attempts to add `prices[2]`, and empty input attempts to read `prices[0]`. Restore `<` so the accumulator only reads supplied prices."}],"replies":[],"gates":"not run"}}
  29. ```
  30. Codex argv was the list below, with `<prompt>` replaced by the complete first-review prompt string, not shell-expanded:
  31. ```text
  32. codex exec --json -s read-only --skip-git-repo-check -C /media/STORAGE/claude-scratch/kunibert/K2/testrepo --output-schema /media/STORAGE/projects/kunibert/tools/../schema.json -c model="gpt-6.1-sol" -c model_reasoning_effort="max" <prompt>
  33. ```
  34. The real proof was taken before the final small prompt clarification changing "split it out is a nit or summary-only" to "summary-only ... never a finding". No second paid review was needed for that text change. The final parser was replayed against the complete saved real stdout and reproduced the JSON line exactly.
  35. Saved events: `/media/STORAGE/claude-scratch/kunibert/K2/testrepo/.kunibert/codex.jsonl`. All usage-bearing events were independently summed and matched the returned usage exactly.
  36. ### Usage of every real run
  37. Run 1, session `01a196db-b8f2-71b3-a423-38b22360956e`, model gpt-6.1-sol, effort max:
  38. ```json
  39. {"input_tokens":103142,"cached_input_tokens":70272,"output_tokens":1565,"cache_write_input_tokens":0,"reasoning_output_tokens":928}
  40. ```
  41. There were no other real runs. Cached/reasoning counters are subcategories, not extra tokens to add to input/output totals. The model made web searches for Hybriel information during the review; it did not post anything to a network service.
  42. ## Failure proof
  43. Exact command:
  44. ```sh
  45. /media/STORAGE/projects/hybriel/native/zig-out/bin/hybriel tools/runner.hl /media/STORAGE/claude-scratch/kunibert/K2/testrepo main missing-head
  46. ```
  47. Exit status: 1. Full stdout:
  48. ```json
  49. {"error":"lib/review-output.hl:8:24: git failed (128): fatal: Needed a single revision"}
  50. ```
  51. This fails before invoking Codex and consumes no model quota.
  52. ## Additional checks
  53. Saved synthetic JSONL was tested before the real run. It contained two agent messages and two usage events. The final message won, usage summed to input_tokens=30, cached_input_tokens=8, output_tokens=10, and finding axis "unknown" became "correctness".
  54. Exact parser command:
  55. ```sh
  56. /media/STORAGE/projects/hybriel/native/zig-out/bin/hybriel /media/STORAGE/claude-scratch/kunibert/K2/parser-check.hl /media/STORAGE/claude-scratch/kunibert/K2/saved.jsonl
  57. ```
  58. Invalid-result and last-error checks:
  59. ```text
  60. last-error exit=1 {"error":"/media/STORAGE/projects/kunibert/lib/review-output.hl:8:24: codex failed (0): last failure"}
  61. bad-verdict exit=1 {"error":"/media/STORAGE/projects/kunibert/lib/review-output.hl:8:24: invalid verdict"}
  62. bad-axes exit=1 {"error":"/media/STORAGE/projects/kunibert/lib/review-output.hl:8:24: result.axes must have three string axes"}
  63. bad-findings exit=1 {"error":"/media/STORAGE/projects/kunibert/lib/review-output.hl:8:24: result.findings must be an array"}
  64. bad-replies exit=1 {"error":"/media/STORAGE/projects/kunibert/lib/review-output.hl:8:24: result.replies must be an array"}
  65. bad-json exit=1 {"error":"/media/STORAGE/projects/kunibert/lib/review-output.hl:12:9: JSON.parse: invalid JSON at line 1, column 1"}
  66. missing-message exit=1 {"error":"/media/STORAGE/projects/kunibert/lib/review-output.hl:8:24: codex produced no final message"}
  67. ```
  68. An isolated copy of the runner with a longer Unicode prompt and a fake codex executable tested the actual spill branch. Prompt file size was 20,959 bytes, the final argv entry was exactly the instruction to read `.kunibert/prompt.md`, child cwd was the test repo, and stdin contained zero bytes. The fake returned the saved synthetic JSONL, consuming no quota. The cloned fixture uses origin/main because clone does not create a local main branch.
  69. Exact successful long-prompt test command:
  70. ```sh
  71. PATH=/media/STORAGE/claude-scratch/kunibert/K2/bin:$PATH /media/STORAGE/projects/hybriel/native/zig-out/bin/hybriel /media/STORAGE/claude-scratch/kunibert/K2/long-prompt/tools/runner.hl /media/STORAGE/claude-scratch/kunibert/K2/longrepo origin/main feature
  72. ```
  73. Artifacts: `long-prompt-output.txt`, `fake-argv.txt`, `fake-cwd.txt`, `fake-stdin.txt`, `parser-tests.txt`, `replayed-real.json`, and `bug-execution.txt` under the scratch root.
  74. ## DOCS / GAP
  75. DOCS: HL-PRIMER says static members / $mode=static can be member-imported, but function declarations remain methods and cannot be imported this way. Static function-literal properties work and are used here, combining the primer's documented function-literal and static-property shapes. A probe of `$mode = 'static'` plus `f() { return 1 }` and member import f returned "it is a method — only static property members are importable".
  76. DOCS: Absolute import paths are not covered by the assigned primer. An initial diagnostic import from `/media/STORAGE/projects/kunibert/lib/review-output.hl` was resolved under the scratch entry directory as `/media/STORAGE/claude-scratch/kunibert/K2/media/STORAGE/projects/kunibert/lib/review-output.hl` and refused. The application uses ordinary relative imports as in the docs; it needs no absolute-import feature or compatibility shim.
  77. DOCS: The primer names JSON.parse but does not specify recoverable per-line parse failures. This runner fails closed on malformed JSON-shaped events and malformed final JSON through the documented global Error handler, rather than swallowing JSON parse failures as the TypeScript handover does. Non-JSON progress lines are skipped. Result JSON must be the schema JSON object; markdown wrappers are rejected.
  78. DOCS: The assigned documents do not specify an Array.isArray equivalent. Lists are checked using documented hlTypeName plus JSON.stringify's opening `[`; saved fixtures verified that objects are rejected and arrays accepted.
  79. GAP: No blocking framework gap was required for this step. No framework patch, polyfill, or workaround was introduced. The optional import diagnostics above are documented observations, not required missing capabilities.
  80. ## Open points
  81. - The 900-second timeout is configured using documented hl:proc run behavior; an actual 15-minute forced timeout was not exercised. Start/timeout faults reach the JSON error handler. No independent SIGKILL signal audit was done.
  82. - CLI is intended for local trusted repositories checked out at the requested head. It does not fetch, switch branches, build isolated worktrees, or prepare gates.
  83. - No spec file, session resume, persistent memory, separate deploy user, gitoria calls or posting in K2; gates remains "not run".
  84. - Diff and JSONL are held in memory and the diff is not truncated; large-repository resource bounds remain future work.
  85. - Findings are checked structurally and axes normalized. Automatic verification of each reported path/line against changed hunks is outside this step; the proof's planted finding was independently checked.

Branches

Latest commits

  • bd3591c7conductor: gates run on the live day44 binarymre
  • 47f747a7records: jukebox #9 fix livemre
  • 0a3169fdMerge branch 'vendored-size' into mainKunibert
  • e447bb09Vendored size fix: keep renames with an app side whole; type the filter parameter (L10)mre
  • 99ccc742Vendored size fix: no renames in the app diff, filter the resumed delta toomre
  • 1a52e100|||PR Diff size limit counts only app files when vendored paths are setmre
  • 50a1867estatus: jukebox #9mre
  • c57484e6log: jukebox #9 diff sizemre
  • 795a20carecords: guard fix live (PR 8)mre
  • 6981d96fMerge branch 'fresh-on-nocmd' into mainKunibert
  • 37c47840runner: one shared prompt for both fresh-session fallbacks (L16)mre
  • f945d2e1|||PR runner: a resumed run with no command on a new head gets one fresh session instead of a tool errormre
  • 10b2a49estatus: PR 314, guard fix proposedmre
  • e73995a3log: hycon PR 314 approved after fresh reviewmre
  • f60427falog: hycon PR 314 false tool errormre
  • 481974f7log: Hermes accepts PR 259 findingmre
  • bb0976acrecords: hycon PR 259 design findingmre
  • 5c637c24records: hycon PR 259 false tool errormre
  • a344c406log: routger 132 reviewedmre
  • 56e70dcbrecords: review time limit 1800 s (routger 132)mre