fix(BUG-001): correct Copilot verification + gate on extension presence#40
Merged
Conversation
… presence Two issues fixed together (same code block, both surfaced 2026-05-17 during AI-011-validation): 1. Verification assertion was stale. The check grepped for the literal "Engineering Discipline" in the deployed copilot-instructions.md, but that string no longer exists -- AI-013 refactored the file to a pointer-style ≤70-line shim that delegates to AGENTS.md. The check would fail on every run, printing an "❌ Error" line immediately followed by "[SUCCESS]". Replaced with the same pattern that Claude/Gemini deploys already use: grep for `First, read \`AGENTS.md\``. 2. The block was gated on `gh` being installed, which is the wrong signal -- gh is widely used for PR/issue management without any Copilot intent. On Linux specifically the user does not use Copilot; on Windows it is per-machine. Now gated on the gh-copilot extension being actually installed (detect-and-act): if the extension is present the config deploys and aliases are wired; if absent the block is skipped with an info-level log including the install one-liner. The Linux script also no longer attempts to `gh extension install github/gh-copilot` unconditionally -- that decision is the user's. The detect-and-act pattern lets the script remain "try everything that is already available, warn on missing pieces" without surprise installs. Windows side mirrors the same logic via the gh extension list parse. Verification string updated identically. ASCII-clean (PSScriptAnalyzer non-ASCII gate respected). Empirical Windows verification still pending until WIN-002 runs.
verify-setup.bats line 289 asserted `[ -d "$HOME/.copilot" ]`, encoding the old assumption "if gh is installed, ~/.copilot is unconditionally created". The PR-40 detect-and-act gate breaks that — the directory is now created only when the gh-copilot extension is genuinely present. In the integration container gh is installed (as a dev tool) but gh-copilot is not, so the directory should NOT exist. Inverted the assertion + renamed the test + added a comment block linking the change to the BUG-001 fix and explaining the silent-skip contract.
This was referenced May 18, 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.
Summary
Surfaced 2026-05-17 during AI-011-validation runtime. The setup-linux.sh output printed a contradictory pair on every run:
```
[INFO] Installing GitHub Copilot CLI extension...
❌ Error: Copilot instructions deployment failed verification
[SUCCESS] GitHub Copilot CLI configured
```
Two underlying issues, fixed together (same code block, same scope):
1. Stale verification assertion
The check grepped for the literal `"Engineering Discipline"` in the deployed `copilot-instructions.md`, but that string no longer exists — AI-013 (May 2026) refactored `ai/copilot/copilot-instructions.md` to a pointer-style ≤70-line shim that delegates to canonical `AGENTS.md` at repo root. The deploy succeeds, but the assertion fails on every run.
Replaced with the same pattern that the already-working Claude/Gemini deploys use:
```bash
grep -q 'First, read \`AGENTS.md\`' "$HOME/.copilot/copilot-instructions.md"
```
2. Gating on `gh` is the wrong signal
`gh` (GitHub CLI) is widely used for PR/issue management on machines that have zero interest in Copilot. The old logic ran the entire Copilot block any time `gh` was installed, including the `gh extension install github/gh-copilot` line — installing the extension as a side effect of running setup.
Switched to detect-and-act: deploy the Copilot config only if the `gh-copilot` extension is actually present (`gh extension list | grep github/gh-copilot`). No more auto-installs. If absent, skip the block with an info-level log that includes the install one-liner.
This keeps the project's general philosophy of "try every supported tool opportunistically and warn on missing pieces" — without making the user own a surprise extension install.
Files changed
Test plan
Cross-links
🤖 Generated with Claude Code