Prune /setup and /submit-for-review; fix permission-audit cd false positive - #210
Conversation
…sitive via validate_only split
9d781d9 to
d636fe0
Compare
Code review —
|
…sitive via validate_only split
9d781d9 to
d636fe0
Compare
Code review —
|
Follow-on to #206, extending the prune/keep test to the two largest remaining skills and fixing a permission-audit false positive surfaced during the audit. As anticipated in the ticket, the reduction here is modest — these files are mostly gates and policy (keep-side), not output templates.
The defect (fixed)
permissions.yamllistedcdin a single flatcommands:list, butsync.pydeliberately excluded it from generated allow rules via a hardcodedif c != 'cd'./setup's Phase 2 read that same flat list and reportedBash(cd:*)as a missing allow rule on every project, every run — contradicting the skill's own hard rule to prefer false negatives, and appearing during first-run setup.Fixed by splitting the data rather than hardcoding the exception twice:
permissions.yamlnow hascommands:(emitted as allow rules and validated) andvalidate_only:(validated but never emitted —cd).sync.py's emitter readscommands:; theif c != 'cd'special case is removed — the exclusion is now a property of the data. A new_validated_commands()helper feeds the union to both validators, socdstays legal in skill code blocks.setup.mdPhase 2 readscommands:only, so it structurally cannot reportcdas missing.The exclusion lives in one place; the emitter, validators, and setup audit can no longer drift. Verified by simulating Phase 2 against this project: zero missing rules, no
Bash(cd:*). Five regression tests lock in the split.Pruning
setup.md491 → 392 (−20%): removed the fixed health-summary block, permission-report block, both signing confirmation boxes, and the label-list/change-preview boxes; deduped the doubledgh label listre-fetch and the starter-label baseline. Kept: every confirmation gate, state-detection ordering + stop-at-first-failure, the profile→values table and inference rules, theREVIEW_EFFORTpolicy note, and all hard rules.submit-for-review.md455 → 422 (−7%): four document templates (pr_body,resolution_comment,followup_body,followup_link_comment) replaced with descriptions of required content (keeping the resolution comment's non-technical-audience rule); the no-heredoc warning that appeared twice in immediate succession is now singular. Kept: the CC review contract and finding tags, all four verdict tiers and routing, the sensitive-area gate, Step 9's gating conditions, the branch guard and working-tree drift restore, themake -ncheck gate, and every closing-keyword note.Reduction recorded
Combined the pair is 946 → 814 (−14%), below the notes' ~20–25% estimate.
setup.mdhit its ~380 target;submit-for-review.mdreduced less because its listed prune surface (four small templates + one warning) totals ~33 lines — everything else is keep-side policy. Cutting further would remove the review contract or verdict tiers, which the ticket explicitly rules out. This is the modest-reduction outcome the ticket anticipated, not a shortfall to be closed by cutting deeper.Verification
./sync.py --validateclean (placeholder, permission, command-shape); all four adapters regenerated./submit-for-reviewexercised end to end by this PR./setup's configured-path Phase 2 verified above; its unreachable first-run and partial-setup states reviewed by reading the rendered output.Closes #208