Single-host install follow-ups from the PR #71 reviews: removal guard, snapshot volumes and test gaps #72
Labels
No labels
boundary:crosses
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/messages-mind-mcp#72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Findings from the two fresh reviews of PR #71 (#56) at
1d99353that the merge-gate rework does not fix. The rework fixes the symlink-hop blocker, the link-check test gaps, the one-linesttyblock and two wordings. Line numbers are at1d99353.Should fix
docs/install-single-host.md§9, therm -rf "$checkout"line). A synthetic repo at an exact tag with ignored.envandnotes/files passed the whole guard.git status --porcelaindoes not list ignored files, stashes or other branches, sorm -rfdeletes them. An unreplaced placeholder fails safe. Decide: addgit status --porcelain --ignoredminus.venv/, checkgit stash listis empty, or record the limit.snapshots=probes only the Mirror's volume (host.py:223). The install document (§5) sayspresentmeans snapshots hold "the store and the key". The key, the salt and the Tombstone store may sit on another volume. Probe each of those volumes, or narrow the sentence. A snapshot that Time Machine did not make (for example Carbon Copy Cloner) reportsnone; record that limit.Test gaps
report(host.py:219-220). Reporting the last value that is notexcluded, in place of the first, passes every test. Add a case where the two store directories give two different non-excluded values._contain_faultsruns beforestart()(cli.py:114-115). Moving the call afterstart()passes every test. A warning raised duringstart()would then escape uncontained.Notes
$HOMEor to/makes the check walk that whole tree. Nothing bounds the walk, and under$HOMEthe~/LibraryACL then fails closed (a false positive). Unlikely in a.venv; decide whether to cap the walk.threading.excepthookreplacement (cli.py:84) reportsSystemExitin a thread as a fault; the default hook ignores it.root.resolve()inwritable_by_othersraiseValueError, which is not caught (host.py:195,201). The callers passsys.prefixand__file__, so it is unreachable today. Older than #71.secrets.noindexhas no migration step. An install that followed the older document keepssecrets/, and the §9 removal no longer names it.rmdirthen fails visibly, so the leftover is noticed. Decide whether §9 names the old directory.checkis a one-time probe. A tree that is safe at check time can change before launch. Inherent; record it in §5 "Whatcheckdoes not see" if the operator wants it stated.Acceptance criteria
Triage decisions (2026-11-16)
The operator accepted these decisions ("Yes, my way").
git -C "$checkout" rev-parse --show-toplevelequals$checkout;git status --porcelain --ignoredexits 0 and lists nothing except.venv/;git stash listis empty.Test the exit code of each command, never only its output.
snapshots=reports only names that start withcom.apple.TimeMachine.on the store directory's volume. They also say that the key, the salt and the Tombstone store may sit on another volume, and that other snapshots (macOS update, other tools) are not seen. Add a test with an unrecognised snapshot name. §9 names the same mount point thatcheckprobes. Any ADR 0007 wording change is a draft for the operator and mind-spec only.sys.prefix,sys.base_prefixand__file__paths with the same hop rule, so that a link through a directory that others can write failscheck..venv/.lockmode 0666. Keep the check fail-closed. §2 says why thechmod -R go-wstep is required and that a lateruvrun in the checkout undoes it.SystemExitin a thread). Match the default hook: ignoreSystemExit.ValueError). CatchValueErrorwithOSErrorand fail closed with no traceback.secrets/tosecrets.noindex). §9 also names the oldsecrets/directory.checkdoes not see".Sequencing
Run SVD after #65, #78 and #75 merge, one at a time, because all of them write
README.md.Blocked by
host.py,cli.pyanddocs/install-single-host.md)Filed under: operator grant "I grant authority to file tickets, merge T4, label/de-label svd:go, continue svd and batch-svd (with auto-gate)" (2026-11-15)
Additions from the fresh reviews of PR #71 at
21eaf29(merge-gate rounds 2 and 3). Round 4 of #71 fixes the ownership-ignoring hop; the items below stay here.snapshots=presentas presence of local Time Machine snapshots on the probed store volume, with no expiry bound (mind-spec ratification direction). Still open: the Tombstone store, the key and the salt on another volume are not probed, and install §9 hard-codestmutil listlocalsnapshots /anddeletelocalsnapshots /, whilecheckprobes the store directory's real mount (for example/System/Volumes/Data). Decide whether §9 names the mount point thatcheckuses.git -C "$checkout" describeandstatuswalk up to a parent repository, so the guard does not prove that$checkoutis a repository top-level. Consider[ "$(git -C "$checkout" rev-parse --show-toplevel)" = "$checkout" ].ValueErrorfromos.lstatin the middle of a link chain also escapeswritable_by_others(host.py, the outer handler catchesOSErrorandRuntimeErroronly). The check does not pass, butcheckwould print a traceback. A real filesystem cannot produce it./var -> private/var), so an owner-only chain of 40 links through/var/tmpfails while 39 passes. No practical effect: the macOS kernel stops at 32 links.ancestors(target)in the ancestor-link branch,ancestors(target)for a file target, and_ownership_uncertainon a directory target. Decide whether to keep them as defence in depth with a comment, or to remove them.Additions from the two fresh reviews of PR #71 at
ecd61ee(merge-gate round 4). Neither review found a blocker. Line numbers are atecd61ee.Filed under: #56 merge gate, round 4 reviews of PR #71.
Should fix
git statusfails (docs/install-single-host.md:280). In a synthetic tagged repo with a corrupted.git/index,git status --porcelainexits 128 with empty output, so[ -z "$(…)" ]is true andrm -rfwould run. Test the exit code, for examples=$(git -C "$checkout" status --porcelain --ignored) && [ -z "$s" ]. The base guard had no status check at all, so this is not a regression.cli.py:26-27,host.py:220).cli._checkresolvessys.prefix,sys.base_prefixand__file__before the check runs. A link component on the path that Python and launchd use (for example a@CHECKOUT@from$PWDthat keeps a link) is not checked. A reviewer showed it with a link to an owner-only venv placed in a 0777 directory: the check returns False. So README line 463 ("checkfails when … another user can write to the environment or code directory") claims too much. The claim predates #71. Decide: check the unresolved path's components with the hop rule, or narrow the sentence..venv/.lockwith mode 0666, even underumask 077.writable_by_others(sys.prefix)then returns True on any venv that uv has touched since the §2chmod -R go-w … "$checkout/.venv". Both the development checkout and a fresh clone return True, and both return False when only that file's mode is masked. The check fails closed, so this is a false positive, not a hole. Decide: say in §2 why thechmodstep is required and that any lateruvrun in the checkout undoes it, or tellcheckto ignore uv's lock file (only with a reason recorded). This affects the Open Risk 5 post-merge check.snapshots=nonecovers less than the ADR wording (host.py:99). Only lines that start withcom.apple.TimeMachine.count. ADR 0007 Amendment 1 item 2 says Time Machine "can make other local snapshots, for example for a macOS update". Acom.apple.os.update-*snapshot, or one from another tool, can hold the store whilecheckreportsnone. This extends item 2. The reviewer could not confirm what the realtmutil listlocalsnapshotslists, because running it is forbidden. Fixing this is an ADR wording change, so it needs ratification.Test gaps
spotlight=has no test. The mutationsp = probes[0][1]survivestest_host.pyandtest_config_cli.py.statfs(tests/test_host.py:36, 404, 775, 865, 892). A realstatfsfollows links, and the mocks do not model that. A realhdiutil attach -owners offimage passed every case in both round-4 reviews and in the architect probe, but no test pins this.volume_only_at_hop=True(:865,:892) models a layout that cannot exist. A hop link's own volume is always the volume of its parent directory, which is checked as an ancestor.ecd61ee. These mutations do not change the result: droppingancestors(target)in the ancestor-link branch, dropping it for a file target, and not sharing the hop counter (a loop still fails closed throughRuntimeError). Removing the parent canonicalisation infollow_link, thetime_machineValueErrorguard, or thecom.apple.snapshot prefix also survives. Decide whether each check stays as defence in depth, with a comment saying so, or goes.Notes
statfson a hop link (host.py:172) follows the link, so it reads the target's volume. It does not fail open, for the reason above.report(())with no stores givestimemachine=excluded spotlight=excludedand can beok(host.py:233-250).clialways passes two paths, so a user cannot reach this.install-single-host.md:45says other users must not be able to write the roots "or their ancestors".host.py:205accepts a sticky world-writable ancestor, which is sound. The document should say so.install-single-host.md:164("does not see") is accurate only because it is scoped to ownership checks. Hop links and foreign-device ancestors are also statfs'd.start()incheckre-raises atcli.py:128with a full traceback. Fault containment covers onlysyncandforget(item 12 scope). This predates #71.source.py:74checks only the socket's mode). The "0700 directory the Owner owns" wording in README, SECURITY.md and ADR 0011 Amendment 1 is a requirement on the Feeder.mind-spec ratification ruling for PR #71 at
ecd61ee03bd60420641864655c0de49230838f51: the snapshot coverage item remains a follow-up in #72 and does not require another rework round for #71.At this head,
snapshots=nonemeans the probe found no returned name starting withcom.apple.TimeMachine.on the probed store volume. It does not establish the absence ofcom.apple.os.update-*, third-party snapshots, snapshots on another volume, backups, or other recoverable copies, and it is not evidence that Forget has completed. The field remains advisory.Apple documents hourly snapshots, a last-successful-backup snapshot, and a snapshot before macOS updates. That source does not establish the names or completeness of this probe's output. Retain the follow-up to make the diagnostic's name/volume coverage explicit or widen it on evidence, with tests for unrecognised snapshot names. Any resulting ADR amendment still requires its own exact-head ratification. The current operator policy remains: Time Machine stays on, the service never deletes snapshots, and the split shape is unchanged.
The operator accepted the triage decisions on 2026-11-16. They are now in the issue body under "Triage decisions (2026-11-16)". State: ready-for-agent.
⏸ SVD architect gate: dev/messages-mind-mcp#72 single-host-install-follow-ups-from-the-pr-71-reviews-remova
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
substrate· dispatch efforthighRun:
20261116T114648Z-ff952958Held because: CLEAN but 7 open risk(s) (1 sequencing · 2 verification · 4 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
2f42311) and #78 (c67adfd) are closed by merged commits. No commit on main atc6c9e1fcloses #75, and gh is denied in Half-A, so #75's state is unverified. [sequencing — blocked by #75]git status --porcelain --ignoredmust list nothing except .venv/. The agents run python3 -I without -B, so Python writes src/messages_mind_mcp/pycache/ and kit/pycache/ into the checkout; the dev clone shows both as !! entries this session. Taken literally, the guard refuses every install that has ever run. Question: accept the lean of also allowing pycache/ directories under src/ (and nothing else)? The alternative keeps the literal rule and adds a separate guarded pycache deletion step. [decision]df -P "$store_dir" | sed -n '2s/^\([^ ]* *\)\{5\}//p'must print the same mount that check probes (expected /System/Volumes/Data on a standard install), andtmutil listlocalsnapshots "$store_volume"must exit 0. tmutil cannot run in the review sandboxes, and in this sandbox df reported / for /Users/piers. [verification]uv sync --locked --no-dev --link-mode=clonecheckout after the §2 chmod and confirm environment=owner-only code=owner-only, so that neither the unresolved-path check nor WALK_LIMIT=100000 gives a false positive. Recordfind .venv | wc -land the sys.base_prefix entry count in the PR. [verification]Change: Follow the existing writable_by_others closure in host.py:149-227 and reuse its ancestors, follow_link and unsafe helpers. Take unresolved = root.absolute() and resolve it. Bind root_dev, then run ancestors(unresolved) or unsafe(unresolved, ancestor=True) before unsafe_tree(root). Add a module WALK_LIMIT = 100_000 with one entry counter shared across the whole call in the os.walk loop (host.py:214); the walk fails closed past it. Widen the outer except to (OSError, RuntimeError, ValueError). Add a comment naming the overlap at the three defence-in-depth checks (host.py:192, 199, 212). In cli.py:42-43, pass the .absolute() roots instead of .resolve(). In cli.py:100, threading.excepthook ignores exc_type is SystemExit, matching CPython's default. Install §9: a one-line guard that tests every exit status: rev-parse --show-toplevel equals $checkout, describe --exact-match,
s=$(git status --porcelain --ignored)filtered by sed to allow only .venv/ and src/**/pycache/, and stash list empty. The same block capturesstore_volumefromdf -P "$store_dir"for tmutil, and deletes the old secrets/ directory. Narrow the snapshots= wording in §5, README:14 and SECURITY:37. Add §2's uv .venv/.lock chmod sentence, plus the cap and one-time-probe sentences. The ADR stays a draft in the PR body. Tests mirror test_host.py:474-528 and test_config_cli.py:2252-2289. They include a behavioural git test of the §9 guard line, extracted from the document.Files:
src/messages_mind_mcp/host.py·src/messages_mind_mcp/cli.py·docs/install-single-host.md·README.md·SECURITY.md·tests/test_host.py·tests/test_config_cli.py·tests/test_layout.pyDecision: accept the 7 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-single-host-install-follow-ups-from-the-pr-71-reviews-remova.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-single-host-install-follow-ups-from-the-pr-71-reviews-remova.md— messages-mind@voyager
spec-verify-dispatch Half B for dev/messages-mind-mcp#72 single-host-install-follow-ups-from-the-pr-71-reviews-remova completed integration verify.
53b5d37b15checkremain operator checks, as the spec directs.codex-svd ship --run-id 20261116T123255Z-e3feae73 --confirm-merge)spec-verify-dispatch Half B for dev/messages-mind-mcp#72 single-host-install-follow-ups-from-the-pr-71-reviews-remova completed integration verify.
53b5d37b1553b5d37: ci/woodpecker/pr/validation green. Local full suite 1568 passed, 58 skipped. Mergeable.checkagainst a real uv sync --link-mode=clone checkout.codex-svd ship --run-id 20261116T123255Z-e3feae73 --confirm-merge)spec-verify-dispatch Half B for dev/messages-mind-mcp#72 single-host-install-follow-ups-from-the-pr-71-reviews-remova completed integration verify.
464e1d3fdcuv sync --link-mode=cloneproduction-install checks remain operator checks under the spec's Agent Adjustments.make checkbaseline was measured here. Local run on the PR head had 713 passed, 0 failed, 0 skipped across the 3 touched suites. ruff check, ruff format --check and mypy were clean.codex-svd ship --run-id 20261116T130328Z-bca03f9a --confirm-merge)