amos 4f17b2afe5 Batch 20 (20261027-C-family-20): map batch 15's ad-hoc families to canonical ones
210 batch-15 tasks used 119 ad-hoc family names. Each now carries one of the
canonical root-cause families (11 of the 19 are used), with version + 1 and a
spec.md note, and was recalibrated through both gates. Claude checked that only
family, version and spec.md changed, that every family is canonical, and the
new trace6 Docker receipts against current digests (210/210 USABLE).
Squashed from the 36-local branch batch20-family.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 05:58:17 +08:00

11 KiB
Raw Permalink Blame History

resource-open-stack v1

Identity and provenance

Route C ORIGINAL, source hwe/gi-py-with-multiple-resources-order, split/source group gi-py-with-multiple-resources-order, family resource-lifetime, language C++17. This is an authored finite configuration collector, not a reproduction of a real incident. The authorized HWE prompt/reference were read, never executed; their Python-with-.c naming and real /etc reads are deliberately not copied. HWE supplies the multiple acquisition and reverse ownership cleanup reliability issue. A deterministic stream provider preserves that issue in software, including failures after earlier opens and caller-owned streams. It requires no board, electrical timing, real file configuration, network or external service. Difficulty UNMEASURED; no LLM rollout or hardware validation.

Author scope is this task and its assigned subagent/runs directories. Platform, shared tests, docs/progress and other tasks remain untouched. Reviewer is root, pending independent review. Final status CALIBRATED; difficulty UNMEASURED. Both final five-repeat gates passed with cleanup confirmed; exact immutable receipts are in the assigned report.

Engineering and environment

The original public engineering consists of two interface headers, the finite provider, the console observer, the submitted implementation, a Makefile, complete documentation and a two-case demonstration. Only src/resource_job.cpp is frozen as candidate. Every sample directory holds only that file. Public dependencies are frozen in private context.json, and are reconstructed before the first compiler child. g++, make and Python 3 are available in the fixed image; CMake is absent, so the original source's CMake request is background only. No dependency installation.

Canonical business line counts, with a conservative count excluding empty/comment/preprocessor/brace-only lines, are stored in the subagent report. Grader/supervisor/Python generation scripts and duplicated fixture implementations are excluded. The ordinary public C++ engineering exceeds 500 lines. No other batch task business skeleton was read or copied.

Image reference and actual image ID: ccr-29eug8s3-pub.cnc.bj.baidubce.com/algo/bench-runtime@sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1 / sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1. Grade container has 512MiB and one CPU. Inner production deadlines are compiler 20s, candidate 8s, cleanup 5s and independent absence 5s, plus at most 6s recovery per supervisor. Outer task deadline is 120s, with the standard Bos wrapper's 100s ceiling. No timing influences expected business values.

Public interface and task

The prompt describes observable resource residues and inconsistent totals, gives make, ./resource-observe < examples/field.txt and make demo, lists the submitted file and requires every clause of docs/resource-job.md. It does not identify the faulty function or root-cause category. The complete API is include/resource_job.hpp. All observed behavior and decimal/JSON grammar are public. Byte-oriented configuration parsing is independent of host locale.

Initial defects are independent:

  1. Open failure after one or more owned acquisitions abandons the ownership journal. It leaks resources only on the failure path; the demonstration's first case exposes it. Public basis: template/docs/resource-job.md:4.
  2. A nonempty stream suffix without LF is ignored at EOF. This loses a final physical line, record and contribution and may hide a parse error. The demonstration's data ends with LF, so only other publicly permitted inputs expose it. Public basis: template/docs/resource-job.md:6 and :7.

The correct policy is atomic acquisition/publication with OpenError, rather than silently skipping missing resources. Borrowed streams remain the caller's property on all exits. Undefined storage beyond logical vectors is never compared.

Behavior checks mapped to exact public evidence

Check Public evidence Observation / oracle
0..8 entries, repeated keys, empty request template/docs/resource-job.md:3 independently allocated handles and empty-success row
Owned acquisition in request order; stop on first failure; no early reads template/docs/resource-job.md:4 open/failure lifecycle plus early_read=0
Every acquired owned handle closes once in LIFO order template/docs/resource-job.md:4 and :11 exact lifecycle and owned_live=0
Borrowed allocation and ownership preserved on all exits template/docs/resource-job.md:3, :4 and :11 borrowed_live, lifecycle, result counts
Short-read and read-failure behavior template/docs/resource-job.md:5 ReadError at the first affected source, atomic empty business result
LF-only physical lines, EOF suffix, empty/trailing-LF behavior template/docs/resource-job.md:6 Item.lines and records
Trim SPACE/TAB/CR; blank/comment lines template/docs/resource-job.md:6 physical lines count, no ignored-line contribution
ASCII key/value grammar, bounds, NUL/VT/FF rejection template/docs/resource-job.md:7 ParseError and no partial publication
Optional signs, arbitrary leading zeros, duplicate keys template/docs/resource-job.md:7 normalized numeric value, every record contributes
Scale, key polynomial, record checksum and aggregate totals template/docs/resource-job.md:8 independent Python integer arithmetic
Status, failed index, success opened, failure zero fields template/docs/resource-job.md:9 exact logical vector/field comparison
Normal return and repeated fresh jobs template/docs/resource-job.md:10 actual leader rc=0 and a case sequence
JSON array types, field order and caller-owned resource count template/docs/resource-job.md:11 and :12 JSON decoder plus exact integer-array type validation
Arbitrary diagnostic stderr ignored template/docs/resource-job.md:11 bytes capture; real all-256-byte and 17MiB diagnostics
Safe numeric envelope and complete public build template/docs/resource-job.md:12, :13; template/Makefile:6 public fixed-image make/demo and leading-zero probe

The independent oracle parses bytes using Python regular expressions and computes the lifecycle and result algebra from the generated requests. It does not execute gold for expected values. The public harness prints raw observations, not hidden assertions or expected values. Read call count, buffer capacities within the legal range, postfailure cursor positions and unused vector storage are not constrained. Source consumption is represented by business outcomes and the early-read flag; no claim is made that every possible redundant read is observable.

Fixtures

Fixture Verdict Mechanism
gold PASS vector ownership scope with reverse destruction, incremental parser
template FAIL both independent initial defects
noop FAIL empty success, no aggregation or ownership lifecycle
cheat FAIL hardcoded first report, rejected by multiple later inputs and live ownership
cheat_read_grader FAIL correct business behavior conditional on reading /grader/check.py; Docker denies read
only_fix_acquisition FAIL ownership fixed, unterminated EOF remains wrong
only_fix_tail FAIL EOF fixed, failed-acquisition leak remains
mask_symptom FAIL closes all resources in FIFO order, masking live count only
valid_collected PASS recursive acquisition scopes, whole-stream collection, split/regex record parser

All fixture compilers have been run and returned zero; expected failures are genuine behavior failures. Local reader FAIL is not evidence of host isolation. A local reader PASS would be an allowed and explicitly reported exception; Docker reader must FAIL. Each final gate uses all nine classes five times with the same task digest.

Isolation, cleanup and mechanism evidence

verify.py is byte-identical to rollout/bos_verify.py. grader_files contains only check.py and context.json. The parent creates every public support/input/candidate file before spawning a compiler and never traverses or touches the candidate-controlled tree afterward. It does not chmod the mkdtemp scratch root handed to UID65534. Newly created support subdirectories are writable for candidate-identity cleanup.

Compiler/candidate/cleanup/absence each run in an independently timed candidate-identity supervisor. It uses a Linux subreaper, gated exec for positive leader PID/start and credential capture, actual supervisor ancestry plus live same-start tracked roots, fresh PID/start checks immediately before every signal, own Popen poll/wait before targeted adopted wait, and bounded recovery retry even when discover/poll/signal/reap itself raises. Z/X exited old roots and reused PIDs cannot authorize unrelated process roots. PG absence is derived from the owned closure; it is not a separate global process-group scan.

The parent validates every required field, exact integer and Boolean types, finite elapsed time, deadline, UID/GID/groups, argv/cwd/nonce, actual leader/controlled rc consistency, reaping/absence, exception lists and captured IO length/SHA. PASS requires business success, both deletion and independent strict-lstat absence success, and no exception presence, even if a success flag was already set. The only nonexistent result is FileNotFoundError; other lstat errors reject. Actual EACCES on /grader/check.py is diagnosed separately from a simulated OSError.

Wire logging records the real wrapper rc and original wire byte length/SHA before parsing. For canonical wire, the log codec is lossless JSON canonicalization; repeated 256-byte IO can be represented by its actual period/repeat/tail and reconstructed byte-for-byte. Incompressible diagnostics that cannot fit the standard Bos stderr tail retain full metadata and actual IO length/SHA with an explicit omission flag, without affecting acceptance. Full raw IO is claimed only where the recorded codec actually decodes and matches hashes. Original truncated prefreeze evidence is preserved and excluded from complete-wire claims.

Every trusted diagnostic has an independently loadable actualpackage with full check/context/candidate file SHA bindings, native raw grade stdout/stderr and unique core._grade receipt. Production deadlines are used for real FIFO, fork/held-pipe, cleanup and absence timeouts. PID/start reuse and exited-root cases use pure synthetic proc graphs, not host PID exhaustion. Mechanism scope and exact diagnostics are in report.json, not inferred from a successful task result.

Completion and boundaries

Final local/Docker receipts and current digest are recorded in the assigned subagent report. Only CALIBRATED / UNMEASURED may be reported. Independent root review, real Agent/Pi/Qwen sampling, difficulty measurement, board validation, archival and centralized repository unit tests are outside this author's scope. No git operation, shared document write, platform modification or new source acquisition was performed. 族名规范化:resource-lifetime → resource-lifecycle(2026-10-27)