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>
9.7 KiB
dev-shutdown-hooks / version 1
Status: CALIBRATED; difficulty UNMEASURED. Author: batch15 author134;
independent reviewer: root (pending). Source route C, original C++17 software
project. Source hwe/gi-ros2-lifecycle-shutdown-cleanup, source group/split key
gi-ros2-lifecycle-shutdown-cleanup, family lifecycle-resource-ownership.
User-authorized HWE material supplies only the lifecycle shutdown/cleanup topic.
Source files were read and hashed, never executed. No private user content.
This is an original reliability repair exercise, not a real incident replay.
The software substitute preserves the knowledge point: Port outlives Nodes; removing a C++ object leaves its tickets live unless the explicit lifecycle terminal transition releases them. Terminal callback events, resource ownership, subscription delivery and finalized state remain independently observable. No ROS/DDS runtime, hardware, physical device, real timing, operating-system fd leak after process exit or actual ARM result is claimed. No other batch15 task code was read or used. Source and root's source-selection proof remain batch evidence.
Public workspace: lifecycle.hpp, lifecycle.cpp, resource_port.cpp, observer.cpp, Makefile, docs/contract.md, examples/default.txt. Only the first three files are candidate files. All source, interface types, lifecycle rules, event ordering, identity/fault rules and observer protocol are public. Private check.py freezes the exact observer source; it reconstructs a fresh build using g++ -std=c++17 -O2 and computes every expectation in a Python state model, never by running gold. The observer prints raw state/events only, with no hidden assertions or expected values. verify.py is byte-for-byte rollout/bos_verify.py.
Fixed environment: C/Python runtime manifest and actual image ID
sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1.
Tools were actually probed in this image: g++, gcc and make exist; CMake does not.
Public argv: make, then ./station with examples/default.txt on stdin. Offline,
no new dependency. Docker grade: 1 CPU, 512 MiB; production stage deadlines:
compiler 20s, candidate 6s, cleanup 3s, independent absence 3s, each with 3s
recovery allowance; task outer deadline 100s (bos wrapper also 100s).
Independent defects:
- D1: Station::stop removes a node without the lifecycle transition, retaining
device/subscription ownership and omitting terminal callback history. Exposed
by examples/default.txt with owner 37 and active subscriptions.
only_fix_stopfixes this path but fails D2's inactive shutdown observation. - D2: Node::terminal_callback releases subscriptions only in state active. A
configured node that never activated reaches finalized with stale subscription
tickets. Default active demo alone does not expose this defect. Explicit
SHUTDOWN from inactive, or corrected STOP from inactive, exposes it.
only_fix_inactivefixes this callback but still fails D1 on the default demo.
The two repairs can be applied independently. CONFIG rollback, activation, deactivation, cleanup, idempotent finalization, owner/slot isolation, delivery and forensic history are initially correct and retained as regression behavior.
Every criterion maps to template/docs/contract.md (line anchors below; clause IDs are normative and each row is compared with exact integer equality):
| Criterion | Exact public basis | Actual protected scenarios |
|---|---|---|
| Eight slots, owner/subscription ranges, duplicate/absent returns, argument precedence and reuse | docs/contract.md:9–14 (C01) | invalid endpoints, occupied/duplicate owners, independent slots, 80 reuse cycles |
| State enum and CONFIG order/commit/rollback/attempt numbering | docs/contract.md:18–24 (C02) | all seven failure positions, recovery, repeated CONFIG |
| Activation/deactivation/cleanup allowed states, order and callback count | docs/contract.md:26–30 (C02) | valid and invalid transitions, cleanup/reconfigure |
| Terminal callback from all three nonterminal states, exactly once, finalized state and STOP | docs/contract.md:34–43 (C03) | subs=0/1/2/6, state=0/1/2, repeated SHUTDOWN, finalized STOP |
| Tickets, ordered events, terminal pre-state, resource flags, fault injection and delivery | docs/contract.md:47–60 (C04) | raw PORT/EVENTS/HISTORY, enabled/disabled messages, fault/reset |
| VIEW/PORT/EVENTS complete defined observations | docs/contract.md:64–70 (C05) | observations between transitions and after removal; no unused storage checked |
| Clean build, fixed observer/signatures, JSON arrays of integers, stderr unrestricted, EOF success | docs/contract.md:74–86 (C06); Makefile:1–4 | real compiler and executable, row/type checks; arbitrary stderr diagnostics |
| Persistent owner statistics and cursor-filtered history | docs/contract.md:90–97 (C07) | valid/invalid owner/cursor, removed/reused owners, empty suffix and state-preserving queries |
There are 2,451 required observation rows, deterministic seed 13420261024. These cover the complete default example, boundaries, all lifecycle states, failure rollback, independent slots, repeated shutdown and reuse. Input combinations are private; all required semantics above are public. Legal stderr bytes are captured as bytes; no combined/output stderr cap or UTF-8 restriction is added. Alternative JSON whitespace is accepted. Candidate stdout contains only the public raw rows.
Fixtures (all have exactly the candidate files, all compile):
| Fixture | Expected | Mechanism |
|---|---|---|
| gold | PASS | terminal callback releases every owned ticket and STOP invokes shutdown |
| template | FAIL | both independent defects |
| noop | FAIL | shutdown returns without callback/resource action |
| cheat | FAIL | only the public owner 37 gets callback action; private allowed owners expose it |
| cheat_read_grader | FAIL | only solves when root grader is readable via /grader or parent cmdline; host PASS may reflect no isolation |
| only_fix_stop | FAIL | repairs D1 only; inactive subscriptions remain |
| only_fix_inactive | FAIL | repairs D2 only; STOP bypass persists |
| mask_symptom | FAIL | hides live PORT entries; explicit intermediate ownership/history exposes it |
| valid_ledger | PASS | contiguous vector ledger with linear lookup/erase instead of ordered map; STOP transfers node ownership before terminal transition |
The valid solution changes data organization and lookup/removal control, rather than changing identifiers or equivalent expressions. No-op, cheats and partial repairs are rejected by runtime observations, never compile/link failure.
Execution contract: after scratch exists, every preparation/compile/run failure enters finally. All public support, candidate source and inputs are prepared before the first child. Thereafter parent check reads only memory/pipes, never candidate-controlled files. Compiler, candidate, cleanup and strict lstat absence run through a candidate-identity subreaper with real deadlines. Descendant ownership starts at the supervisor's true proc closure or live same-start tracked identities; Z/X old roots and reused PIDs do not authorize roots/signals. Every signal fresh-checks PID/start/state. Own Popen poll/wait precedes explicit adopted waitpid. Recovery iterations retain errors and continue through the fixed recovery budget. Any exception, real nonzero/timeout, missing wire metadata or inconsistent identity/type/range/IO facts prevents PASS, even after successful behavior or cleanup. Cleanup removal and independent absence are separate checked stages; only FileNotFoundError means absent. No chmod of the candidate-owned scratch root.
Each grade retains compressed, fully decodable stage metadata in private stderr: wrapper rc/wire length/SHA recorded before parsing; real argv/nonce/UID/ GID/groups/PID/start/deadline/elapsed/leader status/reaped/descendant and PG absence/ exceptions; actual captured stdout/stderr lengths and SHA. The raw inner streams are not claimed to be retained in full after each grade. Formal outer raw grade logs are retained. Diagnostic kernel EACCES stderr is also retained as actual bytes.
Before final freeze, fixed-image core._grade actually passed normal gold, 0..255 stderr, 17 MiB stderr, and leader0 plus setsid/closed-stdio child (adopted -9 and empty closure). It rejected: actual production compiler FIFO timeout; actual fork/pipe candidate timeout; candidate rc7; cleanup after deletion rc7 and production timeout even when independent absence=0; noop cleanup0/absence1; production absence timeout; preparation fault; success/cleanup/absence followed by empty OSError; simulated lstat OSError and real kernel EACCES; wire missing meta or leader_start; supervisor rc9; recovery first fresh nonleader signal empty OSError, followed by same-loop-budget retry/signaling/adoption -9 and empty closure while exceptions still reject. Complete loadable injected packages, contexts, candidate/check/raw SHA and raw logs are retained under this author's subagents directory and authorized runs root. No shortened deadline claims. Nine pure tests cover stale/reused/Z/X proc roots, fresh signal checks and required metadata missing/type/range/identity conflicts; no real PID exhaustion was done.
Final gates: final-digest local and Docker calibration each completed 45 trials, five per fixture. Docker PASS, cleanup confirmed. Local actual FAIL solely from the five allowed cheat_read_grader PASS exceptions; all other trials matched. No model rollout, Qwen/Pi, full rollout trajectory, measured difficulty or ADMITTED claim. Root owns full repository suite and independent review. Gate paths and actual receipt results are written in the author report.json; no successful gate or diagnostic is rerun to repair summary decoding. 族名规范化:lifecycle-resource-ownership → resource-lifecycle(2026-10-27)