feat: shell-install --trust-tap (Homebrew tap-trust resolution)#11
Merged
Conversation
…t warning Adds a --trust-tap flag to `shll shell-install` that resolves Homebrew's "non-official tap trust" advisory for sahil87/tap by recording genuine trust rather than silencing the hint. The flag does full setup atomically: runs the `brew trust --tap sahil87/tap` ceremony and writes `export HOMEBREW_REQUIRE_TAP_TRUST=1` alongside the shell-init eval line into a single combined rc-file block (`# >>> shll >>>`), migrating any legacy `# >>> shll shell-init >>>` block in place. Design decisions: - Single combined block holds both the export and eval lines; install is a per-line merge (union of desired lines), not a whole-block append, so an already-set-up user gets the export merged in without duplication. - --trust-tap composes with --print (dry-run) and --uninstall. - --uninstall removes the whole block but does NOT run `brew untrust` (the trust record is inert without the policy var and is user-reversible). - Graceful degradation: on old/missing brew the eval line is still written, the ceremony is skipped, and the command exits 0 with guidance toward the lighter env-var escape hatches. - The trust ceremony lives in brew.go so shell_install.go stays free of proc/exec imports (TestNoProcImports guard holds).
There was a problem hiding this comment.
Pull request overview
Adds --trust-tap to shll shell-install as an orthogonal flag that runs brew trust --tap sahil87/tap and writes export HOMEBREW_REQUIRE_TAP_TRUST=1 into a single shll-managed rc block, resolving Homebrew's tap-trust nag. The change also renames the sentinel to # >>> shll >>> (with in-place migration of legacy blocks), converts install into a per-line merge, and keeps subprocess work out of the file-I/O-only shell_install.go via a function-value ceremony seam in brew.go.
Changes:
- New
--trust-tapflag that composes with default/--print/--uninstall, plus full setup (ceremony + policy line + eval line) with graceful degradation whenbrew trustis unavailable. - Combined
# >>> shll >>>sentinel block, per-line merge, and in-place migration of legacy# >>> shll shell-init >>>blocks (including both-sentinels-present self-healing and partial-block refuse-with-exit-2). - Ceremony helpers (
brewTrustAvailable,brewTrustTap,ensureTapTrust) live inbrew.go, exposed toshell_install.govia anensureTrustFuncseam soTestNoProcImportscontinues to hold.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/cmd/shll/tools.go | Adds tapName constant (no trailing slash) distinct from formulaPrefix. |
| src/cmd/shll/shell_install.go | New sentinel + migration, per-line merge, --trust-tap wiring through a ceremony function-value seam, partial-block refusal, separate appendBlock/rewriteBlocks paths. |
| src/cmd/shll/shell_install_test.go | Updates existing tests to the new sentinel and adds extensive trust/merge/migration/degradation/uninstall coverage with a proc.Runner fake. |
| src/cmd/shll/brew.go | Adds brewTrustAvailable (capability probe), brewTrustTap (ceremony), ensureTapTrust (orchestrator + diagnostics), and trustHatchHint. |
| src/cmd/shll/brew_test.go | New unit tests for the capability probe, ceremony argument shape, and ensureTapTrust degradation ladder. |
| README.md | Documents --trust-tap, the new sentinel block, and a Troubleshooting section. |
| fab/changes/260601-l6lo-shell-install-trust-tap/* | Intake/spec/plan/status artifacts for the change. |
| docs/memory/cli/shell-install.md, docs/memory/cli/commands.md | Memory updates documenting the new behavior, seam, and constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Meta
Pipeline: intake ✓ → spec ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Impact: +1115/−86 code (excluding
fab/,docs/) · +2047/−147 totalSummary
Homebrew nags on every operation against the non-official
sahil87/tapbecause the user sits in the default "limbo" trust state, andshll updateamplifies it (the advisory prints 2–3× per command). shll previously offered no path to resolve it. This adds a first-class, user-invoked way to record genuine trust — forward-looking ahead of a future brew release that will require explicit trust — rather than silencing the hint.Changes
--trust-tapflag onshll shell-install(orthogonal selector that composes with the existing modes, not a new mutually-exclusive mode)export HOMEBREW_REQUIRE_TAP_TRUST=1and the shell-initevalline under a new# >>> shll >>>sentinel, migrating the legacy# >>> shll shell-init >>>block in place--trust-tapdoes full setup: ensures both lines and runs thebrew trust --tap sahil87/tapceremony, atomically--print(dry-run, modifies nothing) and--uninstall(removes the whole block; does NOT runbrew untrust— the trust record is inert without the policy var and is user-reversible)HOMEBREW_NO_REQUIRE_TAP_TRUST=1/HOMEBREW_NO_ENV_HINTS=1escape hatchesformulaPrefix— tap vs formula)brew.gososhell_install.gostays free of proc/exec imports — theTestNoProcImportsguard holds--trust-tapflag docs; memory updated undercli/shell-installTests
All tests pass (122 in
cmd/shll), including the new cases inshell_install_test.goandbrew_test.gocovering trust-block install, per-line idempotency,--print --trust-tap, whole-block--uninstall, degradation whenbrew trustis absent, already-set-up additive behavior, andbrewabsent. TheTestNoProcImportsguard confirmsshell_install.gocarries no proc/exec imports.