One user-space repair task per eligible HWE debug-diag / compile-deploy base ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content filter. Each ships a public spec with a check-to-basis table, at least two defects with single-fix fixtures, a symptom-masking fixture and an alternative correct implementation. Claude re-checked all 320: structure, the HWE quality items and trace6 Docker calibration receipts against current digests (320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120 ad-hoc family names; the next batch maps them to the canonical list. The batch's 1,256-line progress log stays in its factory report and the 36-local branch batch15-hwe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9.1 KiB
resource-line-buffer v1
Route C original; source and split group hwe/gi-leak-getline-loop. The source material supplied only the reusable getline ownership direction. Root reviewed the six source files and cold/local SHA before assignment (root-next-medium-source-proof-05.json); no source script was executed. This newly authored service, protocol, oracle and fixtures do not claim a real incident. Author: sole gi-leak-getline-loop worker. Independent review: root pending.
The deterministic C11 byte-source callback replaces a real stream; an observable allocator replaces external leak instrumentation. Dynamic line storage is still retained and reused across reads, so the same terminal ownership defect survives substitution. No board, ARM ABI, real file, GNU extension, network, clocks or asynchronous signal safety is assessed. Intended medium difficulty is UNMEASURED: no Agent sampling has been done. Status after gates is CALIBRATED/UNMEASURED, never ADMITTED.
The complete public workspace has four submitted modules, a public header, a raw observation program, Makefile and docs/contract.md. Files are not imported from another task. The fixed image provides gcc 14.2.0 and GNU Make 4.4.1, verified by an explicit project-named read-only tool probe; exact command and original output are in the author's tool-probe directory. Local public make clean / make / make demo have original stdout/stderr in public-commands.json and public-*.stdout/stderr. The demo exposes a live allocation after a text job.
The first defect is in the job's terminal ownership branch: normal EOF or stop returns without destroying a nonempty line allocation. only_fix_release repairs that branch but retains bounded-byte handling failure. The second defect computes record statistics using strlen instead of the public length: embedded NUL truncates ordinary content. It occurs outside the text-only default demo. only_fix_binary repairs length handling but retains the ownership defect. The defects are independent: each partial repair remains a compiled behavioral failure.
Gold uses a 37-byte prefetched source and geometric buffer growth. valid_exact reads one byte per callback and requests exact-fit allocation for each append; this changes both source data handling/control and allocation strategy, and deliberately has different read/resize counts. The checker does not demand those counts equal gold. noop preserves a compilable API while omitting normal processing; cheat masks digest to 16 bits; mask_symptom converts real terminal failures into success. cheat_read_grader executes real gold behavior only when opening a private check succeeds. Its trusted-host PASS is an allowed exception and does not establish host isolation; Docker must reject it.
Every behavior below is checked from raw public API/allocator observations against a Python model which never runs or calls gold. C harness code contains no hidden expectation or assertion; the P row reports direct API facts. All support, source copies and input are prepared before the first child. Thereafter parent check only uses memory and pipes, including finally cleanup via candidate-identity argv and an independently supervised strict os.lstat probe.
| Criterion | Exact public basis | Coverage / observation |
|---|---|---|
| Offline clean compilation, normal program exit | template/docs/contract.md:3 and :23; template/Makefile:2 | compiler real rc and candidate real rc |
| API and result status agree; seed and zero initialization | template/docs/contract.md:5 and :19 | every J row; invalid maximum/stop/divisor/remainder |
| Ordered bytes, cache-independent delivery | template/docs/contract.md:7 | chunks 1/3/7/11/37/81, lengths crossing 37, delivered byte count |
| Empty, LF, consecutive LF, final suffix | template/docs/contract.md:9 | empty, one byte, newline pairs and suffix jobs |
| NUL, high bytes, CR are bounded content | template/docs/contract.md:9 and :17 | embedded NUL; bytes(range(256)); generated binary jobs |
| Exact maximum accepted and next byte rejects partial line | template/docs/contract.md:11 | 1/2/15/16/17/37/38/127/256/1024 boundaries; prior line preserved |
| Error before/within/after complete lines; error wins over EOF | template/docs/contract.md:13 | offsets 0/1/3/4/5/7/8/9 with prefetch |
| Explicit allocator rejection yields LP_MEMORY; no partial publish | template/docs/contract.md:15 and :21 | reject_all on empty/text/binary jobs |
| No live allocations, live bytes or invalid release on any return | template/docs/contract.md:15 and :25 | EOF, stop, I/O, limit, invalid options, explicit allocation failure |
| Resize/release observations are nonnegative and conserve operations | template/docs/contract.md:15 and :25; template/observe.c resize_block/release_block | successes <= attempts; releases <= successes; successful nonzero allocation implies positive peak |
| Full line count/bytes/longest, selection by byte sum | template/docs/contract.md:17 | deterministic independent Python aggregate model |
| Rolling uint64 digest with per-line boundary | template/docs/contract.md:17 | seeds 31 and generated uint64, all byte values, complete lines only |
| stop_after prevents next-line delivery | template/docs/contract.md:19 | stop 1/2/3 with prefetch and generated jobs |
| Invalid options reject without callbacks/resources | template/docs/contract.md:19 | invalid max 0/65537, stop 1000001, divisor 0/257, remainder==divisor |
| Raw input and observation format | template/docs/contract.md:21 and :23 | one tag and exactly 18 ASCII decimal tokens per J row |
| Arbitrary signs/leading zeroes; arbitrary stderr permitted | template/docs/contract.md:23 | whole ASCII token validation then zero normalization; no stderr cap; production 17MiB/256-byte regression |
| Direct line append/content/sentinel, clear/reuse, destroy twice and invalid initialization | template/docs/contract.md:15 and :27 | P row exact defined 14 fields, no unused padding/cache checks |
Necessary engineering counts are recorded per file in code-line-count.json: 683 ordinary nonblank noncomment lines, or 530 after additionally excluding standalone braces. No duplicate fixture, data, Markdown, Python oracle, or supervisor line contributes to that count. C sources alone have 599 ordinary lines; the public header and Makefile are necessary support. The observer includes byte source, ownership tracker, protocol decoding and API fact reporting.
Grader isolation uses byte-identical rollout/bos_verify.py and only check.py/context.json as grader_files. Candidate, compiler, cleanup and independent absence are child processes, with fixed production 20/10/5/5-second deadlines. The embedded supervisor inherits candidate UID/GID/groups, is a Linux subreaper, discovers descendants from current parentage or live same-start old tokens, polls the owned Popen before adopted waits, and freshly checks each signal PID/start/state. Z/X and reused old identities cannot become roots. ENOENT/ESRCH disappearance is normal; other observation/signal exceptions reject.
The parent validates native required fields, identity, exact integer types, finite bounded elapsed (deadline+5 seconds for reap), booleans, real leader rc/reaped, timeout/control rc consistency, absence, exceptions, IO lengths/SHA and command/nonce bindings. A wrapper nonzero, missing wire/field, preparation fault, blank OSError after any success flag, cleanup nonzero/timeout even after removal, present path or lstat exception cannot PASS. Raw wrapper length/SHA and actual wrapper rc are recorded before JSON parsing. Native records retain actual IO lengths/SHA; original inner wire and raw candidate IO bytes are not archived and are not claimed as preserved. Outer grade stdout/stderr are actual saved bytes with SHA. Native metadata is compressed to fit the bos 4000-character stderr tail and is decoded and checked from actual logs; a truncated record is explicitly incomplete.
Final diagnostics use actual complete core.load_task packages and fixed-image core._grade, not reduced deadlines. They include normal gold, 17MiB stderr cycling all byte values, leader 0 plus setsid/closed-stdio descendant reclamation, leader 0 holding pipes until production timeout, nonterminating leader, actual compiler FIFO, delete-then-nonzero/timeout cleanup, noop cleanup followed by present absence, absence timeout, strict lstat PermissionError, preparation/after-success/after-cleanup/after-absence empty OSError, missing all wire metadata, missing leader_start, supervisor nonzero, boolean elapsed, negative IO length, and long plus/leading-zero stdout. Earlier-generation diagnostics are retained separately and are not described as final-generation coverage. Pure synthetic /proc tests do not involve real PID exhaustion or unrelated processes.
The local and Docker gates each execute all nine fixture classes five times with unique attempt directories. Actual paths, task digest, image identity, per-class verdicts, native decoding and cleanup checks are in report.json. No Qwen/Pi/real Agent or hardware run is authorized in this task scope. Root runs the repository-wide suite; the author's nine focused behavior tests have original logs. Final independent review and any later difficulty sampling remain outside this delivery.