Skip to content

Add doctor diagnostic command for bootstrap failure investigation#9

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/discuss-direction-with-users
Draft

Add doctor diagnostic command for bootstrap failure investigation#9
Copilot wants to merge 3 commits intomainfrom
copilot/discuss-direction-with-users

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 16, 2026

User asked whether we can locally verify that the $alias: syntax under $ErrorActionPreference="Stop" is the actual root cause of the wh not recognized bootstrap failure.

Changes

  • bin/doctor.ps1 — diagnostic script that spawns isolated pwsh subprocesses to:
    • Test $alias:tp = 'Test-Path' under $ErrorActionPreference="Stop" (reproduces the failure condition)
    • Check for pre-existing read-only aliases conflicting with tp/sc
    • Dot-source aliases.ps1 under Stop mode and verify all helpers (wh, mkd, mkl, isadmin, tp, sc) are defined
    • Check bootstrap dependency commands (pwsh, git, scoop, cargo)
  • cli/definitions.toml — register doctor as a [[script]] so dotcli generate exposes it as a shell function
  • pwsh/aliases.ps1 — fix stray double-space on line 1

Example output

=== $alias: syntax under ErrorActionPreference=Stop ===
  [FAIL] $alias: 構文が Stop モードで失敗: ERR:...
  [INFO] → これが wh not recognized の原因です

=== aliases.ps1 dot-source テスト (Stop モード) ===
  [PASS] aliases.ps1 の全ヘルパーが定義済み: wh,mkd,mkl,isadmin,tp,sc

On environments where the issue doesn't reproduce, the first check passes with a note to check for alias conflicts manually.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] Discuss implementation direction with users Discussion: Align on approach before implementation Mar 16, 2026
Copilot AI requested a review from ycookiey March 16, 2026 01:58
Copilot AI changed the title Discussion: Align on approach before implementation Fix wh not recognized during bootstrap by hardening alias definitions in aliases.ps1 Mar 16, 2026
…bootstrap failure

$alias:tp/$alias:sc can throw terminating errors when dot-sourced under
$ErrorActionPreference="Stop" (set by install/scoop.ps1), aborting before
wh function is defined. Set-Alias with -Force -ErrorAction SilentlyContinue
is resilient regardless of caller's ErrorActionPreference.

Co-authored-by: ycookiey <70356861+ycookiey@users.noreply.github.com>
Copilot AI changed the title Fix wh not recognized during bootstrap by hardening alias definitions in aliases.ps1 Fix wh not recognized during bootstrap by hardening alias definitions Mar 16, 2026
Add bin/doctor.ps1 that tests whether $alias: syntax fails under
$ErrorActionPreference="Stop", checks for alias conflicts, verifies
aliases.ps1 dot-sourcing, and checks bootstrap dependencies.
Also fix extra whitespace in aliases.ps1 line 1.

Co-authored-by: ycookiey <70356861+ycookiey@users.noreply.github.com>
Copilot AI changed the title Fix wh not recognized during bootstrap by hardening alias definitions Add doctor diagnostic command for bootstrap failure investigation Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants