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>
7.9 KiB
resource-exception-reader task specification
Identity and source
| Item | Value |
|---|---|
| Task and version | resource-exception-reader / 1 |
| Family and language | resource-lifecycle / C++17 |
| Source and split key | hwe/gi-py-resource-warning-unclosed |
| Route | C, original task from a public HWE topic; not a replay or a real incident |
| Status | CALIBRATED / UNMEASURED; not ADMITTED (no Agent sampling) |
| Substitution | Python open scope replaced with C++17 Store handles and injected read faults. Both exercise closure after a thrown processing error. An optional index parse error exercises a second independent exit path. |
| Boundary | No actual Python GC, ResourceWarning text, board, filesystem descriptor, timing, or network. The Store event ledger and capacity make lifetime deterministic. |
The HWE reference never throws. Its static open/close token count and board smoke checks are not used. The project contract is wholly new. template is the only initial workspace; gold and fixtures contain only the two candidate files. The compiled observer is public context, and its exact source is frozen into private check as a harness. It prints observations without expected values. verify.py is byte identical to rollout/bos_verify.py.
Defects and variants
| Defect | Trigger | Only fix fixture | Public contract |
|---|---|---|---|
| Primary lease not closed on injected read fault | fault_after before EOF; default demonstration |
only_fix_primary |
docs/reader-contract.md:5,7,12-14 |
| Index lease not closed on malformed optional index | with_index=true, complete primary, invalid index |
only_fix_index |
docs/reader-contract.md:7,11-14 |
mask_symptom rewrites returned counts but leaves Store events and later capacity wrong. valid_scope uses nested RAII leases and one status driven exit, while gold explicitly closes each branch. cheat hardcodes the demonstration, noop returns a default result, and cheat_read_grader gates correct behavior on reading /grader/check.py. Negative fixtures compile and execute; behavioral mismatch rejects them. The local grader may not isolate private file reads; only Docker gate is authoritative for that fixture.
Behavior checks ↔ public evidence
The check process uses a fixed seed (0x726561646572) for binary payloads. Its independent Python model computes all expected rows. Each row below identifies a distinct group of generated observations; no expected value is obtained by executing gold.
| Check item | Public evidence | Observation |
|---|---|---|
| Named file put/append and byte preservation | docs/reader-contract.md:3,15 |
P/A results and later Q content statistics |
| Lowest free handle, missing and capacity | docs/reader-contract.md:4 |
O/D and Q statuses with retained handles |
| Chunk read, EOF event, injected fault boundary | docs/reader-contract.md:5-6 |
R data and E amounts, Q partial count |
| Full primary scan on empty, LF, CR, NUL and binary data | docs/reader-contract.md:3,8 |
Q lines, bytes, longest |
| Primary digest and fault prefix digest | docs/reader-contract.md:9 |
Q digest for deterministic random bytes |
| Request chunk and fault validation | docs/reader-contract.md:10 |
Q BAD_REQUEST and unchanged S events |
| Optional index disabled, valid and invalid decimals | docs/reader-contract.md:11-12 |
Q status/index_value with 0, 1000000, malformed cases |
| Primary missing and index missing | docs/reader-contract.md:4,12 |
Q MISSING, preserved primary statistics |
| Primary injected read error and later recovery | docs/reader-contract.md:7,12,14 |
Q READ_ERROR, S no retained request handle, later Q |
| Malformed index and later recovery | docs/reader-contract.md:7,11-14 |
Q INDEX_ERROR, S no retained request handle, later Q |
| Per-request open, close, live fields | docs/reader-contract.md:13,16 |
Q fields against independent event ledger |
| Event ordering and exact read byte amounts | docs/reader-contract.md:5-6,16 |
S/E rows after each request |
| Independent caller handles and cloned cursors | docs/reader-contract.md:7,17-18 |
O/D/R/J/I/C around Q, cursor preserved |
| Raw invalid handles, seek range, capacity | docs/reader-contract.md:17-18 |
O/D/R/J/I/C raw result rows |
| Public stdout protocol and arbitrary stderr | docs/reader-contract.md:16,18 |
exact fields after full-token numeric parsing, accepting sign, leading zero and horizontal whitespace; stderr captured as bytes without diagnostic rejection |
Package and verification boundary
Candidate files are reader.hpp and reader.cpp. The template additionally provides reader-demo.cpp, Makefile, README.md, examples/demo.txt, and docs/reader-contract.md. The check copies only candidate bytes into a fresh scratch plus its frozen observer before starting any child. The compiler and observer run as argv subprocesses, never in the trusted Python process. The check parses full output tokens and compares their typed values against its own model. Scratch cleanup and independent strict-lstat absence checks are candidate-identity supervised phases. Every phase carries deadline, actual leader status and reaping, PID/start identity, UID/GID/groups, process descendant absence, exceptions, and actual IO length/SHA. The parent validates these facts and fails on missing or inconsistent metadata. Raw candidate IO is captured in memory for comparison; only its digest and length are emitted to the private diagnostic log.
reader.hpp, reader.cpp, reader-demo.cpp, and Makefile have 516 nonblank, noncomment, nonpreprocessor, non-brace-only effective lines at draft time (68, 227, 214, 7 respectively). This counts the one original template source tree once, not fixture copies. The fixed observer supplies real command parsing and operational diagnostics rather than data padding. Recount after freeze.
Calibration and limitations
The final package digest is b8b767d2794f3fe937096285d828fd9ae108ad07989ae64c8d0bfc9d0d62d3b4. After tightening the stdout comparison to the full public token domain, the author ran both gates again; previous attempts are retained and are not evidence for this final digest.
| Gate | Exact attempt | Outcome |
|---|---|---|
| Trusted local | runs/20261023-C-hwe-scale-15/gi-py-resource-warning-unclosed/local/calibration-ffde73dceb3f4d85a36f9f04404ba321 |
45/45 expected, cleanup confirmed |
| Fixed Docker image | runs/20261023-C-hwe-scale-15/gi-py-resource-warning-unclosed/docker/calibration-b7681afa0dc7424b9b53adb6a2845c3a |
45/45 expected, cleanup confirmed; image ID sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1 |
Fixed-image trusted diagnostic copies confirmed normal gold, every stderr byte 0..255, 17 MiB stderr, and a normally exiting leader with a detached closed-stdio child still PASS. They rejected production deadline compiler FIFO and candidate fork/held-pipe stalls, nonzero candidate exit, cleanup return 7 after successful deletion, cleanup timeout after deletion, cleanup no-op with independent absence failure, independent absence timeout or lstat error, preparation failure, errors after success and after successful cleanup/absence, missing or contradictory wire fields, and supervisor nonzero exit. Full copies, candidate SHA, raw outer grade logs and SHA, actual production deadlines, and each receipt are retained under this base ID's diagnostic paths. The small synthetic proc graph test covers retired ancestors and fresh PID/start verification; it does not exhaust real PID reuse.
The check retains actual captured candidate stdout/stderr lengths and SHA in its private metadata but does not persist raw candidate IO. Formal calibration logs retain the compressed complete phase metadata; no full Agent rollout or hardware result is claimed. No model difficulty was measured. Public observer command parsing is context, while the behavioral oracle checks valid command sequences and library outcomes, not malformed observer commands.