kunibert
All repositories: gitoria
8.7 KB
# K12: Hybriel day39 cleanup2026-11-03, local loreana only. Implementation complete; original K7 acceptance gate is blocked by its obsolete assertion (expects 500 where this mission requires 400). Its isolated updated copy passes. No deployment, remote push, byrodin access, tickets, messages to others, or real model run. All review posts went to local fake gitoria; git transfers were between scratch repositories only.## Changes- `lib/intake.hl`: both request-body parses use `JSON.tryParse`; malformed JSON, JSON null and empty bodies return `400 {"status":"invalid_json"}`. With per-repo secrets this check precedes signature verification. Missing signatures still return 401 first; default-secret verification order is preserved. HTTP empty-body null is normalized to an empty string before parsing. Signature comparison uses `hl:crypto.timingSafeEqual`; equal-length and different-length wrong signatures return 401, correct signatures return 202.- `lib/tickets.hl`: `tryFetch` makes network failure status 0 follow the existing not-readable path; review continues. Restored `entries.map((e) => { return { heading = e.heading, body = e.body.join(NL).trim(), cut = false } })`.- `lib/gitoria-api.hl`: `tryFetch`, structured `{status:0, ok:false, body:null, code:"network_error", message:"request failed", details:null, headers:{}}` before response methods; normal responses use `JSON.tryParse`. Removed the hybriel#280 comment. Existing child-failure and queue retry behavior handles the failed request.- `plugins/`: refreshed existing module set: core, crypto, fetch, fs, http, http1, proc, time, web, including native libraries. `plugins/VENDOR.txt` records Hybriel commit `3bd9880442e0a8b55917ad9ac00f2ab39db52b2f` (`LOG/STATUS: #206 day39, w246 gates`). All 85 upstream tracked files in that module set matched byte-for-byte. Initially copied at `7d42934ad4570e6fd86243d0e91d44b3915a4e76`; upstream advanced during the work, with identical plugins tree `13ecf93d24e7b1fc87e15571ffab8f9e629ccaa1` at both commits. No upstream edits.## Local proofsRuntime for every run: `/media/STORAGE/projects/hybriel/native/zig-out/bin/hybriel`. New scratch scripts/artifacts are under `/media/STORAGE/claude-scratch/kunibert/K12/`. Required existing proofs ran unchanged and used their existing scratch fixtures. All ports were checked with `ss -ltn` before work (8840–8859 free); final `ss -ltnp '( sport >= :8840 and sport <= :8859 )'` returned only its header. Every test process was stopped by PID.Exact commands, executed from `/media/STORAGE/projects/kunibert`; full stdout/stderr saved to the named K12 files:| Command | Exit | Exact output / artifact || --- | ---: | --- || `python3 -I /media/STORAGE/claude-scratch/kunibert/K4/proof.py` | 0 | `ALL OK`; 0 PASS lines; `K12/K4-output.txt` || `python3 -I /media/STORAGE/claude-scratch/kunibert/K6/scripts/proof.py` | 0 | `ALL OK`; 36 PASS lines; `K12/K6-output.txt` || `python3 -I /media/STORAGE/claude-scratch/kunibert/K7/scripts/proof.py` | 1 | `FAIL GAP hybriel#280: 500 (not 400) but HL_ENV=production: the body names no file path`; 3 PASS lines; `K12/K7-output.txt` || `python3 -I /media/STORAGE/claude-scratch/kunibert/K8/scripts/proof.py` | 0 | `ALL OK`; 25 PASS lines; `K12/K8-output.txt` || `python3 -I /media/STORAGE/claude-scratch/kunibert/K9/scripts/proof.py` | 0 | `ALL OK`; 15 PASS lines; `K12/K9-output.txt` || `python3 -I /media/STORAGE/claude-scratch/kunibert/K11/scripts/proof.py` | 0 | `ALL OK`; 17 PASS lines; `K12/K11-output.txt` || `python3 -I /media/STORAGE/claude-scratch/kunibert/K12/k7-regression/scripts/proof.py` | 0 | `ALL OK`; 36 PASS lines; `K12/K7-adapted-output.txt` || `python3 -I /media/STORAGE/claude-scratch/kunibert/K12/proof.py` | 0 | `ALL OK`; `K12/K12-output.txt` (includes map proof) |The six original commands were orchestrated sequentially with `python3 -I /media/STORAGE/claude-scratch/kunibert/K12/run-gates.py`; `K12/gate-results.json` records exits. K9 has `ALL OK` before its cleanup line. An initial cold service start exceeded K7’s 15-second readiness window and left test listeners behind, which also affected the first K8/K9 attempts. Those test PIDs were stopped; the reported rerun above was clean.K7 is unchanged outside K12 scratch. The isolated copy changes its root to `K12/k7-regression`, ports to 8854/8855, and only the obsolete expectation/message to require `400 invalid_json`. It exercises follow-up, replies, reset, notes, close, timeout, retry and secret handling. Literal original-K7 `ALL OK` cannot coexist with the requested behavior without updating that external proof.Exact K12 output:```textPASS map matches previous loop exactly; entries=2; joined/trimmed history bodies retained; rendered section unchangedALL OK-- fake gitoria pid 568000 port 8857 | service pid 568151 port 8858 | HL_ENV=development | job timeout 8 sPASS signed non-JSON/null/empty -> 400 invalid_json, no source path: '{"status":"invalid_json"}'PASS signed non-JSON/null/empty -> 400 invalid_json, no source path: '{"status":"invalid_json"}'PASS signed non-JSON/null/empty -> 400 invalid_json, no source path: '{"status":"invalid_json"}'PASS wrong signature length 71 -> 401 bad_signaturePASS wrong signature length 8 -> 401 bad_signaturePOST pull_request.opened PR1 -> 202 {"status":"queued","job":"1#1","threadReplyOnly":false}PASS correct signature -> 202PASS tickets server down: review completedPASS tickets server down: review posted to fake gitoriaPASS tickets server down: demo#1 not readable (HTTP 0)POST pull_request.opened PR2 -> 202 {"status":"queued","job":"1#2","threadReplyOnly":false}PASS gitoria down: intake accepts the jobPASS gitoria down: job fails after retry; /health still answersPASS gitoria down: tries=2 status=failedPASS gitoria down: handled request failure: /media/STORAGE/projects/kunibert/lib/review-output.hl:8:24: token request failed: HTTP 0 network_errorPASS service alive after network failurePASS default-secret service readyPASS default secret: signed malformed JSON -> 400 invalid_jsonPASS default secret: bad signature remains 401 before parsePASS default secret: correct signed ping -> 202ALL OK-- stopped by PID: [568000, 568151, 569035]```Map equality: `python3 -I /media/STORAGE/claude-scratch/kunibert/K12/map-check.py` runs the same fixture against `tickets-before.hl` (previous HEAD loop copied into scratch) and current `lib/tickets.hl`, compares the entire parsed object and rendered section, and requires exactly 2 entries. Generated `map-before.hl`/`map-after.hl`, their outputs and the checker remain in K12 scratch. The checked bodies are exactly `First body` and `Newest body`, with original headings, order and trimming retained. K8 also verifies the size-cap path and newest-comment retention.Additional check: `git diff --check` returned exit 0 with no output.## JSON.parse inventory retainedPer mission, unrelated parse calls are unchanged. No corrupt-file recovery or silent state reset was introduced:- `lib/queue.hl:40,57`: persisted `queue.json`, `deliveries.json`, read at service startup. Corrupt JSON stops startup; existing atomic writes reduce partial-file risk. Recovery policy remains an open point.- `lib/review-memory.hl:14,53`: per-PR state and optional thread input JSON. These run in the review CLI; a corrupt file fails the child and follows the service queue retry path, rather than killing the service.- `service/project.hl:12`, `lib/intake.hl:41,47`: service, secrets, per-repo config files, read at startup. They are operator configuration rather than request bodies. Invalid JSON prevents startup, as before.- `tools/runner.hl:76`: service-written notes file, read in a child CLI; malformed data fails that job.- `lib/run-job.hl:71`: last JSON line of the child’s own stdout. Unchanged; malformed output beginning with `{` could fault in the service exit callback. Broader child-output hardening is outside this cleanup.- `lib/review-output.hl:12,45`: model final result and JSON event lines, in the child CLI; not file-state parsing.- `lib/intake.hl:34`, `lib/runner.hl:119`, `lib/review-post.hl:8,9`: constant newline, NUL and tab literals, not external JSON input.## Open points / DOCS- Acceptance exception: the original K7 gate still asserts the old 500 behavior. The updated isolated copy is ALL OK; original K7 requires a separate authorized update outside the K12-only scratch limit.- DOCS: the primer specifies `JSON.tryParse` invalid-JSON-to-null, but not null-argument handling. Observed `JSON.tryParse(null)` raises `JSON.parse(text) takes one argument — the String to read`; HTTP empty bodies may be null. Input normalization now supplies a String and the empty-body proof passes. No missing feature required a workaround or handwritten JavaScript.- Persisted-state/config corruption handling is unchanged, as inventoried above. No production behavior or deployment was tested.
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