refactor(disk-hygiene): derive the Python version floor from one origin#1028
Conversation
The "3.11+" floor was hand-maintained in hygiene.py's runtime check (the real enforcement), both .test.sh wrappers, both SKILL.md files, and the README, while setup told itself to probe what the scripts require rather than recite prose; a future bump would drift the copies silently. The floor is now the module-level MIN_PYTHON constant in hygiene.py. The runtime check and its error message derive from it; a regression test locks the constant's greppable line shape and proves enforcement uses it; both test wrappers parse the constant instead of restating the number, failing loudly if the parse breaks; setup check step 1 derives the probed floor from the constant; remaining prose mentions are annotated pointers or convenience copies of the origin. Closes #1008 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 2m 37s —— View job PR Review
The approach is sound — a single Finding 1 — Test name implies a check that isn't theredef test_engine_enforces_the_constant_and_names_it_in_the_error(self) -> None:
...
self.assertNotEqual(0, code) # ← only checks exit codeThe name says "names it in the error" but the body only asserts a non-zero exit code. The error-message content check lives in Finding 2 —
|
|
Claude finished @kyle-sexton's task in 2m 35s —— View job Security Review — PR #1028
No exploitable security vulnerabilities found. The changes are a refactor (SSOT extraction) with test coverage; the security surface is small and handled defensively. Full analysis below. Shell injection in
|
Reconcile disk-hygiene conflicts from concurrent main advances (#1010, #1012, #1028, #1031) that landed while this branch was open. - plugin.json / CHANGELOG: restack this branch's fix onto main's version line, 0.4.8 -> 0.6.3 (next patch above main's landed 0.6.2); preserve every landed CHANGELOG entry (0.6.2 / 0.6.1 / 0.6.0 / 0.5.0) with this branch's entry on top. - clean/SKILL.md: compose #983's corrected kill-switch framing (a skill-scoped hook receives neither ${user_config.*} nor CLAUDE_PLUGIN_OPTION_*, so the guard cannot enforce audit-only) with #1012's deterministic kill_switch_probe read, dropping main's stale "guard enforces via --disk-hygiene-enabled" claim that #983's hook-arg change (only --plugin-root) invalidated. - clean/reference/safety-model.md: keep #983's --data-root derivation-from- plugin-root rewrite and append #1010's --confirmed-large-scan grammar note. destructive_guard.py and test_hygiene.py auto-merged (data-root derivation + --confirmed-large-scan + kill_switch_probe allowlist + MIN_PYTHON floor); full suite 98 passed, 4 platform-skipped.
Summary
Fixes finding 3 (SSOT drift) from handoff-inbox item
20260722-004536-disk-hygiene-setup-audit: the "Python 3.11+" floor was hand-maintained in ≥5 places —hygiene.py'ssys.version_info < (3, 11)runtime check (the real enforcement), both.test.shwrappers,setup/SKILL.md(twice),clean/SKILL.md, and the README — while the setup skill told itself "probe what they actually require, don't recite this file". A future floor bump would drift the copies silently.hygiene.pygains a module-levelMIN_PYTHON = (3, 11)constant; the runtime check and its error message derive from it.VersionFloorTestslock the constant's greppable line shape (^MIN_PYTHON = (\d+, \d+)$) and prove enforcement + error text use it (red-first)..test.shwrappers parse the constant viasedinstead of restating the number, and fail loudly if the parse breaks.setup checkstep 1 now derives the probed floor from the constant;applyguidance points at the parsed floor.clean/SKILL.mdgotchas, README requirements) reworded to pointers or explicitly-annotated convenience copies. API-fact mentions of Python 3.11 (e.g. "3.11 has noos.path.isjunction") are left alone — they are not floor copies.Testing
test_hygiene.py: 95 tests OK (4 platform skips), including the 3 new floor tests.check-changed-skills.shPASS,check-changelog-parity.sh --check-bumpPASS, shellcheck clean on both wrappers.Related
20260722-004536-disk-hygiene-setup-audit(F3, MED)🤖 Generated with Claude Code