fix(init): record the distill rewrite-hook verdict in every flow#382
Merged
Conversation
The distill command-rewrite hook treats any repo with .repowise/ and no recorded distill.commands.enabled as enabled-with-ask. Workspace-mode init never offered the opt-in nor recorded a verdict, so users with the hook installed from another repo got prompt floods in workspace-indexed repos they were never asked about (--distill-hook/--no-distill-hook was silently ignored there too). - workspace init now runs the opt-in once and records the verdict in every selected repo (interactive prompt or explicit flag; index-only, full, and advanced modes alike; even when indexing failed, since .repowise/ was already created) - offer_distill_rewrite_hook takes a list of repos; the user-level hook installs once, per-repo writes are isolated so one failure cannot abort init - workspace add inherits the primary repo's explicit verdict for newly indexed repos - repowise update backfills the verdict for workspace members indexed for the first time outside init (single-repo and workspace paths) - hook rewrite install gains PATH / --workspace / --no-workspace so a workspace-wide decline can be reversed in one command
|
✅ Health: 7.0 (unchanged)
🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)
🔥 Hotspots touched (5)
2 more
🔗 Hidden coupling (1 file)
📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-06-05 10:57 UTC |
swati510
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The distill command-rewrite hook treats any repo with
.repowise/and no recordeddistill.commands.enabledas enabled with theaskposture. Workspace-moderepowise initnever offered the distill opt-in and never recorded a verdict in the repos it indexed — so a user who had the hook installed (opted in from some other repo) got every noisy command rewritten with a confirmation prompt in workspace-indexed repos they were never asked about. With agents/subagents running many commands, that means a flood of permission prompts.--distill-hook/--no-distill-hookwas also silently ignored in workspace mode, andworkspace add/ first-time indexing viarepowise updatereopened the same gap for repos added later.Fix
.repowise/was already created, so a decline must gate those repos off too).--distill-hook/--no-distill-hookare honored and applied workspace-wide.offer_distill_rewrite_hooktakes a list of repos: the user-level hook installs once, verdicts are written per repo, and a failed config write on one repo cannot abort init for the rest.workspace addinherits the primary repo's explicit verdict for newly indexed repos.repowise updatebackfills the verdict for workspace members indexed for the first time outside init (both the single-repo path and the workspace path) — coversworkspace add --no-indexfollowed by a later update.hook rewrite installgainsPATH/--workspace/-w/--no-workspace(same targeting ashook install), so a workspace-wide decline can be reversed in one command — keeping the "runrepowise hook rewrite installlater" promise printed on decline.Single-repo semantics are unchanged: interactive runs prompt (default No), decline writes
enabled: false, non-interactive runs without a flag record nothing (strictly opt-in).Tests
workspace addinheritance, update backfill (incl. no-op outside a workspace / for the primary / when a verdict exists), workspace-modehook rewrite install.Docs updated:
DISTILL.md,CLI_REFERENCE.md.