SmartConfig

Review of chunk L: the M5 follow-ups’ apt tags

Date: 2026-10-16, after M5 follow-ups 8 and 9 were built (7fe207b..966e322):

How it was reviewed:

Gate: one high-severity finding, L1, fixed. One was medium (L2). All 6 are fixed. None asked for a decision.

What held up

Findings

Area Finding Severity Fixed
which apt (L1) apt runs its hook lines from a fork of itself (RunScripts: fork, system() each line, _exit), gone before dpkg runs. sc apt begin named that fork, so the mark was always stale and no row was ever tagged; the lab’s D.1 could not pass. The tests modelled no fork, and one took its expected pid from Runner itself. high Runner takes the parent when the process above the shells has its parent’s name, one step only; a test runs the hook line from a real fork that system()s it (51c8659).
when (L2) The tag was read when scd recorded a change, after its quiet time: dpkg’s last writes before sc apt end were auto, an edit saved just before sc apt begin was apt. medium The run is read at each event and kept on the path’s entry; the latest event wins (6022f33).
a silent hook (L3) A downgrade to 0.5.0 keeps the conffile; 0.5.0’s sc printed “unknown command” into every apt run, twice. low The hook lines send sc’s output to /dev/null (51c8659).
rescans (L4) A rescan during a run (scd restarted by the package’s own postinst) tagged edits made while scd was down, however old, as the run’s. low Only if the file changed after the run began (6022f33).
tests (L5) 11 of 24 mutations survived: the mark’s modes and begin time, begin with no apt, a created file’s rows, and D.1’s commands (the lab’s fakes keyed on the same constants). low Tests for each (51c8659).
docs (L6) The README said every dpkg run is tagged; a bare dpkg -i runs no apt hook. MILESTONES named sc-m2, which nothing tests. low Fixed (51c8659, and the write-up’s commit).

Left as it is