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

8.9 KiB
Raw Permalink Blame History

resource-topic-format specification

Status: CALIBRATED / UNMEASURED. Route C original software engineering fixture; source hwe/gi-leak-asprintf-fmt, version 1, family resource-topic-ownership, language C11. Author: batch15 source194 independent author. Independent reviewer: root (pending). Source and all same-source mutations share split key gi-leak-asprintf-fmt. The source suggests dynamic formatter caller ownership only; no source scripts were executed. This package is independently written and does not claim a real historical incident. Source bytes and pure execution reference are bound in subagent/source-binding.json.

The original material calls GNU asprintf without its declaration environment and proposes RSS or live-board checks. The new deterministic port uses standard C11 snprintf + actual malloc/free with tracked allocation tokens. Deferred delivery reads the real caller-owned bytes after enqueue. This retains caller ownership and delivery lifetime knowledge while removing GNU declarations, nondeterministic RSS, network and hardware dependencies. It does not measure MQTT, a board, physical memory performance or real asynchronous timing. No private user contents or credentials are used.

The complete public workspace contains parser/CLI, allocating formatter, delayed transport, observer, Makefile and examples. Only src/publisher.c is candidate material, and it is compiled into every official program. Makefile is fixed public support because the formal command uses fixed gcc. Necessary fixed support plus candidate comprise 659 ordinary nonblank noncomment C/header/build lines: {"Makefile": 14, "include/topic_runtime.h": 77, "src/format_port.c": 114, "src/main.c": 140, "src/plan.c": 185, "src/publisher.c": 40, "src/transport.c": 89}. Braces, declarations, port state and pointer dereference assignments count as ordinary code; no candidate-only or brace-removal threshold is applied. Copies across fixtures, examples, docs, Python verifier and pure data are excluded.

Initial defects and independence

  1. The initial worker never releases its successfully completed topic buffers. The normal default command has six P events, finishes all six deliveries, and retains six tracked blocks. only_fix_recovery retains this defect. Public ownership basis: template/docs/contract.md:28 and final audit at :33.
  2. At the injected allocation failure, it completes the current batch and returns before later input. The default example has fail-at=0, so this defect does not trigger there. The separately labelled optional command ./topic-replay --batch 2 --fail-at 3 examples/recovery.txt injects failure at P3, and later P4/P5 must still publish. only_fix_release retains this defect while releasing all completed resources. Public basis: template/docs/contract.md:11, :22.

Each can be repaired independently; neither build failure nor undefined memory access is used to count a defect.

Formal behavior to exact public basis

Checked behavior Public basis Independent mechanism
fixed C11 build and actual candidate use template/docs/contract.md:6 argv gcc with every required support source and candidate
allowed multi-device/channel/sequence, F, empty and max plans template/docs/contract.md:13 25 independently generated sessions, fixed seed 19420261025
full documented input line and suite row widths, option spelling and path width template/docs/contract.md:13, :14 and :16 valid 8190-byte input line, 1022-byte suite row, 400 leading zeroes in each option and a path longer than 767 bytes
reject raw NUL and overlong input or suite lines with exit 2 template/docs/contract.md:13, :16 and :17 four independent invalid files run through the same compiled program, with controlled exit and cleanup metadata
exact canonical topic contents and publish order template/docs/contract.md:20 and :26 Python string construction and hex independent of C implementation
allocation count/failure count, only ordinal K fails template/docs/contract.md:21 and :22 oracle counts P and removes only ordinal K
postfailure continuation and publisher_rc 0 template/docs/contract.md:22 optional failure at first/interior/last/unreached ordinal
live until actual completion and exactly one release template/docs/contract.md:25 and :28 live token check at byte read, actual allocator audit
no forced exact completion schedule or peak threshold template/docs/contract.md:27 oracle compares ordered deliveries and final audit only
JSON value, field types, whitespace consumption template/docs/contract.md:31 json.loads complete value and recursive exact types; no line splitting
final resource/queue/error values template/docs/contract.md:33 and :34 compare every published raw audit field; disposal occurs after observer

There are 25 session observations, 3111 delivery rows, 25 final audits and four invalid-input exit checks. The oracle is protected Python standard library code; it never invokes gold or uses C output to compute expected values. Fixed public support is embedded byte-for-byte in check.py. All source and input material is prepared before the first compiler child. No hidden assertions or expected values run in the C process. The raw observer only reports actual allocations, real topic bytes and transport state.

Fixtures and rejection mechanisms

{ "gold": "PASS", "template": "FAIL", "noop": "FAIL", "cheat": "FAIL", "cheat_read_grader": "FAIL", "only_fix_release": "FAIL", "only_fix_recovery": "FAIL", "mask_symptom": "FAIL", "valid_immediate": "PASS" }

Gold holds a pointer array for each batch and releases after completion. valid_immediate completes/releases each successful event immediately, with no retained batch ownership array; the documented earlier-completion allowance makes this independently valid. template retains both defects. only_fix_release and only_fix_recovery isolate them. noop performs no events. cheat builds every event using a hardcoded default device/channel; varied topic bytes reject it. mask_symptom releases each buffer immediately after enqueue to make final resource totals look clean, but real delayed reading reports dead tokens. cheat_read_grader tries /grader/check.py and exits 71 if refused (or returns with no publication if readable); it never passes through fabricated observations. Every fixture compiles; all non-reader negatives normally exit 0 and are rejected on actual observations. Reader 71 is a separately recorded controlled execution rejection.

Execution and isolation

verify.py is byte-for-byte rollout/bos_verify.py; only check.py is private grader material. In fixed-image Docker all compiler, candidate, cleanup and strict-lstat absence operations are run under UID/GID65534 with empty groups. Candidate-identity subreaper supervisors use production deadlines compiler20s, candidate12s, cleanup8s, absence8s, recovery3s, plus bounded parent wrapper margin. Every signal rechecks PID/start/non-Z/X. Current supervisor ancestry and still-live same-start tracked roots constrain discovery. Own Popen is polled/waited before adopted waitpid; adopted waits explicitly have start None and the parent accepts only None. Exceptions, timeout, nonzero or missing/inconsistent metadata reject even when success flags were already set. Source/materials are all written before children, and parent never inspects candidate-controlled trees afterward. finally executes same-identity cleanup and independent strict os.lstat absence on all preparation/compile/run/behavior failures. Only FileNotFoundError proves path absence.

Each actual wrapper rc, wire byte length/SHA and stderr length/SHA is recorded before parsing. Marker contains complete compressed metadata plus actual wire/IO lengths and SHA only. Production inner wire/IO bodies are not saved by this constrained bos channel; their nSHA facts are actual, not reconstructed contents. Helper proof saves its own actual wire/IO files independently. Each diagnostic preserves a complete core.load_task-compatible actual task copy, hashes actual check/context/candidate and raw outer logs, and records real production deadlines. stderr is arbitrary bytes without a new size cap. Fixed manifest image: ccr-29eug8s3-pub.cnc.bj.baidubce.com/algo/bench-runtime@sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1; image gcc14.2.0 and make4.4.1 were probed read-only. No new dependencies.

Acceptance and limits

Required gates: trusted local and this fixed-image Docker, 9 fixture classes x5 each; full actual metadata and cleanup confirmation, final task digest must match. No repository-wide suite, git operation or model sampling is authorized for this subagent. Calibration evidence is recorded in report.json after completion. This is CALIBRATED/UNMEASURED only once both gates pass; not ADMITTED, not a real model trace or measured difficulty. Root independent review remains required. No Salty artifact is created by this task-authoring step.

族名规范化:resource-topic-ownership → resource-lifecycle(2026-10-27)