3.8 KiB
Follow-up row brief: stack-release.sh hardening after D1 (row 162 review notes)
Draft by Darkwing for Sage (sage-0882), from Filbert's five non-blocking notes on row 162
round 1, #1659 comment 28997. Line numbers are scripts/stack-release.sh and the brief as of
row 162's candidate; the script is byte-identical in r1 and r2. This row starts only after
row 162 lands, and it rebases on that landing.
Suggested gate: Filbert approves the candidate manifest; cli suite and every
scripts/test-*.sh green on Sage's gate. Suggested owner: Darkwing, reviewer Filbert, gate
owner Sage.
None of the five is a known failure today. Items 1 to 4 each fail closed or can't be reached with the current pin. The fix is to make each one refuse earlier, or tell the truth sooner, with codes row 162 already has. No new refusal code.
Items
-
Precheck unreadable drop-ins.
drop_in_override(:503) scans the same three directories asinstall_guardinscripts/bus-service.sh(:100), but skips a directory or file it can't read ([ -d ],grep 2>/dev/null).install_guarddies on that same path, after the stop, so the run goes through item 6 and the live stack stopped for nothing. The precheck refusesdrop-in-overridewith the path when a unit path, drop-in directory or.conffile exists but can't be read, usinginstall_guard's own tests (-r,-x, a failed read). Test: a drop-in file with mode 000 (and a directory with mode 000) refuses before anysystemctl stopin the stand-in log, and the units stay active. -
Close the
is-activeto read race.plan_store(:573, check at :577) and the--restoreevent count (:716) choose the held-store read or the stopped-store read from oneis-activecall. If the bus stops between the check and the readOnly open, the open can leave-walor-shmbeside a stopped store, and the next run refusesstore-unclean. Fix: after a held-store read, checkis-activeagain. If the bus stopped meanwhile, report it (--plan: say the store state changed during the read and print no migration line; rollback: refuserestore-mismatchbefore anything stops) instead of using the count. Test: a stand-insystemctlthat answers active then inactive. -
Compare the copy check with the target. The
copy-checkgate step (:373) runsstack-copy.sh check --business, which proves the bus, Console and CLI agree on one copy, not that the copy is the one this run installed. Pass the expected copy id (or compare the check's reported id with the target) and fail the gate withcopy-checkon a mismatch. Test: a stand-in check that reports agreement on another copy fails the gate. -
Don't split a quoted
Environment=.read_units(:148) reads thesystemctl showoutput (showat :144) and splits itsEnvironment=line on spaces withread -r -a(:157). systemd quotes a value that holds a space, so aMOSAIC_CLAUDE_BINpath with a space reads as a prefix of itself. Smallest fix:read_unitsreturns 1 when that line holds a quote or backslash, so its callers refuse as they do for an unreadable unit (unit-flags-driftat :535,check-failedat :561; the status view at :743 then skips its unit flags line). Parsing systemd's quoting is the larger option. The same split readsExecStartargv (argv_of, :145, used at :153 and :159); cover it the same way. Test: a stand-in unit withEnvironment="MOSAIC_CLAUDE_BIN=/a b/claude"refuses by name and never reads/a. -
Re-pin brief item 8.
docs/plans/2026-10-18_stack-release.mditem 8 (:180-185) says the plan reads the schema "with no store read". sage-0745 and mos-0741 replaced that with the held or immutable read that row 162 implements. Sage re-pins the brief text; no code.
Out of scope
The bus-side PM marker (ruling 2's follow-up) and anything in Mos's live window.