mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 17:54:03 +01:00
Three units along the file's own concerns: atop_agg.c (204) ingest -- tokenising atop output, folding lines, main atop_agg_state.c (113) the per-PID hash tables, slot lookup, epochs, alloc atop_agg_emit.c (178) the ranked, name-aggregated report Table geometry and the four table functions that now cross a unit boundary go in a private atop_agg_internal.h. Those four lose `static` -- the one visibility change here. The Makefile edit is the load-bearing part: SRC had to grow or the build would have linked the old single unit and the suite would have passed with the new files unused. Checked by reading the compile line, not the exit status. I had written this file off as unverifiable earlier. Wrong: the Makefile has had test and coverage targets all along. Coverage is 92.9% lines / 100% functions on the same 211 source lines, before and after -- the best verifier of anything left over the cap. Production binary builds at -O2 and runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
20 lines
2.7 KiB
JSON
20 lines
2.7 KiB
JSON
{
|
|
"title": "Split linux_configuration/C/atop_agg/atop_agg.c under the 250-line cap",
|
|
"objective": "Bring atop_agg.c (478 lines) under the repo-wide 250-line file cap by splitting the single translation unit three ways along its existing concerns -- ingest, per-PID table management, and report emission -- with the TSV output the Python usage report consumes proven unchanged by the project's own C test binary at its existing 92.9% line / 100% function coverage.",
|
|
"acceptance_criteria": [
|
|
"atop_agg.c and all new .c/.h files are each at most 250 lines, and check_file_length.sh --all no longer lists any atop_agg file.",
|
|
"make clean && make test compiles every unit under -Wall -Wextra with no new warnings and prints 'atop_agg tests: OK'. The compile line must name the new .c files, proving they are built rather than silently omitted.",
|
|
"make coverage reports the same 92.9% lines (196 of 211) and 100% functions (13 of 13) as the pre-split baseline, measured after lcov strips test_atop_agg.c. Unchanged totals on unchanged source lines is what shows no code left test reach.",
|
|
"The Makefile's SRC and HDR variables list every new file, and the test target compiles $(SRC) rather than a hardcoded atop_agg.c. Without this the build would link the old self-contained unit and the suite would pass with the new files unused -- a fail-open the tests cannot detect.",
|
|
"The production binary (make, which builds at -O2 without -DATOP_AGG_NO_MAIN) links and emits a well-formed record, exercising the main path the test binary compiles out.",
|
|
"Zero suppressions: no #pragma to silence a warning, no -Wno- flag added, and no change to the coverage or test targets' strictness."
|
|
],
|
|
"out_of_scope": [
|
|
"Any change to the output format -- the W/C/R TSV record shapes are a contract with the Python driver in system-maintenance/bin and must be byte-identical.",
|
|
"Any change to the hash geometry (HASH_CAP_BITS, MAX_EPOCHS, MAX_TOKENS) or the aggregation arithmetic, both of which the tests pin only loosely.",
|
|
"Widening the public interface in atop_agg.h; declarations that must cross the new unit boundary go in a private internal header instead.",
|
|
"Wiring atop_agg into CI, which has no workflow today -- a separate piece of work."
|
|
],
|
|
"verifier": "cd linux_configuration/C/atop_agg && make clean && make test (expect 'atop_agg tests: OK' and a compile line naming every unit); make coverage (expect 92.9% lines, 100% functions after the lcov strip pass); make clean && make && printf 'PRC\\tfoo\\t1\\t100\\ny\\n' | ./atop_agg (expect a well-formed W record, exit 0); bash ~/utils/scripts/check_file_length.sh --all (expect no atop_agg entry); git diff on atop_agg.h (expect empty). Captured at HEAD as the baseline and re-run after the split."
|
|
}
|