Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions setup-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ if (Test-Path $claudeSource) {
$claudeMdSource = "$DotfilesDir\ai\claude\CLAUDE.md"
if (Test-Path $claudeMdSource) {
Copy-Item $claudeMdSource "$ClaudeHome\" -Force
if (Select-String -Path "$ClaudeHome\CLAUDE.md" -Pattern "CORE PRINCIPLE" -Quiet) {
Write-Success "CLAUDE.md deployed successfully (verified)"
if (Select-String -Path "$ClaudeHome\CLAUDE.md" -Pattern 'First, read `AGENTS.md`' -SimpleMatch -Quiet) {
Write-Success "CLAUDE.md deployed successfully (verified pointer to AGENTS.md)"
} else {
Write-Err "CLAUDE.md deployment failed verification"
Write-Err "CLAUDE.md deployment failed verification (expected pointer to AGENTS.md)"
}
} else {
Write-Warn "CLAUDE.md not found at $claudeMdSource"
Expand Down Expand Up @@ -463,10 +463,10 @@ if (Test-Path $geminiSource) {
$geminiMdSource = "$DotfilesDir\ai\gemini\GEMINI.md"
if (Test-Path $geminiMdSource) {
Copy-Item $geminiMdSource "$GeminiHome\" -Force
if (Select-String -Path "$GeminiHome\GEMINI.md" -Pattern "CORE PRINCIPLE" -Quiet) {
Write-Success "GEMINI.md deployed successfully (verified)"
if (Select-String -Path "$GeminiHome\GEMINI.md" -Pattern 'First, read `AGENTS.md`' -SimpleMatch -Quiet) {
Write-Success "GEMINI.md deployed successfully (verified pointer to AGENTS.md)"
} else {
Write-Err "GEMINI.md deployment failed verification"
Write-Err "GEMINI.md deployment failed verification (expected pointer to AGENTS.md)"
}
} else {
Write-Warn "GEMINI.md not found at $geminiMdSource"
Expand Down
23 changes: 23 additions & 0 deletions tests/setup-windows.bats
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,29 @@ setup() {
grep -q 'ajeetdsouza.zoxide' "$PS1_SCRIPT"
}

# --- Cross-platform parity: AI config deploy verification ---
# AI-013 refactored CLAUDE.md/GEMINI.md/copilot-instructions.md to pointer-style
# files starting with 'First, read `AGENTS.md`'. The old marker 'CORE PRINCIPLE'
# no longer exists in any deployed file. setup-linux.sh was updated; this guard
# keeps setup-windows.ps1 in lockstep (regression class: BUG-001 + BUG-002).

@test "parity: both scripts verify CLAUDE.md deploy with AGENTS.md pointer marker" {
grep -qF "grep -q 'First, read \`AGENTS.md\`' \"\$HOME/.claude/CLAUDE.md\"" "$DOTFILES_DIR/setup-linux.sh"
grep -qF "Select-String -Path \"\$ClaudeHome\\CLAUDE.md\" -Pattern 'First, read \`AGENTS.md\`'" "$PS1_SCRIPT"
}

@test "parity: both scripts verify GEMINI.md deploy with AGENTS.md pointer marker" {
grep -qF "grep -q 'First, read \`AGENTS.md\`' \"\$HOME/.gemini/GEMINI.md\"" "$DOTFILES_DIR/setup-linux.sh"
grep -qF "Select-String -Path \"\$GeminiHome\\GEMINI.md\" -Pattern 'First, read \`AGENTS.md\`'" "$PS1_SCRIPT"
}

@test "setup-windows.ps1 has no stale 'CORE PRINCIPLE' verify-pattern references" {
# AGENTS.md itself may mention 'CORE PRINCIPLE' as documentation text -- that
# is fine. The bug is using it as a Select-String -Pattern, which post-AI-013
# never matches the deployed file and emits a spurious [ERROR] every run.
! grep -qF -- '-Pattern "CORE PRINCIPLE"' "$PS1_SCRIPT"
}

# --- PSScriptAnalyzer ---

@test "setup-windows.ps1 passes PSScriptAnalyzer (if pwsh available)" {
Expand Down
Loading