Skip to content

Add Python preflight prompt to install.ps1; remove premature git-alias self-test - #220

Open
J-MaFf wants to merge 2 commits into
mainfrom
feat/install-python-preflight
Open

Add Python preflight prompt to install.ps1; remove premature git-alias self-test#220
J-MaFf wants to merge 2 commits into
mainfrom
feat/install-python-preflight

Conversation

@J-MaFf

@J-MaFf J-MaFf commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Fixes #219

Changes

  • install.ps1 now checks for a working Python interpreter (via the existing Resolve-Python) right after admin elevation and before any file is touched. Python only powers the git alias browser (rich/textual) — the core install works fine without it. A missing interpreter now surfaces as one clear [WARN] plus a Continue anyway? (y/n) prompt instead of three scattered warnings deep into the run. -Force auto-continues past the prompt (consistent with everywhere else -Force is used); declining exits 0 before any STEP runs or files are touched.
  • Removed Initialize-Symlinks.ps1's STEP 2 git alias self-test. It ran before install.ps1 STEP 6 installs the rich dependency gitconfig_helper.py hard-requires at import time, so it structurally could never pass on a fresh Python install — it always printed [WARN] git alias command failed, even on runs that went on to succeed (STEP 7 re-runs the identical, correctly-ordered check later in the same run and is now the sole git alias verification).
  • Updated CHANGELOG.md [Unreleased] with both changes.

Spec: specs/install-python-preflight.md (produced via the blueprint skill from a real install-run diagnosis in conversation, then implemented via the forge generator/evaluator loop).

Testing

  • forge generator/evaluator loop: all 8 acceptance criteria (C1-C7, C-final) passed on round 1.
  • Evaluator manually traced all four {-Force present/absent} x {Python found/not found} combinations against the spec's R3 and confirmed exact-match behavior (including exit code 0 and zero files touched on decline).
  • Full tests/run-tests.ps1 Pester run: 221 passed / 3 failed / 18 not-run — the 3 failures are pre-existing (tests/gitconfig_helper.Tests.ps1), confirmed identical against a main baseline. Zero new failures.
  • Did not run install.ps1 end-to-end on this machine (it requires admin elevation and would touch this machine's real ~/.gitconfig); verified via syntax parse + manual trace instead.

🤖 Generated with Claude Code

…t-alias self-test

install.ps1 now checks for a working Python interpreter (via the existing
Resolve-Python) right after admin elevation and before any file is touched.
Python only powers the 'git alias' browser (rich/textual); the core
gitconfig install works without it, so a missing interpreter now surfaces
as one clear warning + a 'Continue anyway? (y/n)' prompt instead of three
scattered warnings deep into the run. -Force auto-continues past the
prompt, consistent with what -Force already means everywhere else in the
script; declining exits 0 before any STEP runs or files are touched.

Also removes Initialize-Symlinks.ps1's STEP 2 'git alias' self-test, which
ran before install.ps1 STEP 6 installs the rich dependency gitconfig_helper.py
hard-requires at import time - it structurally could not pass on a fresh
Python install and always false-warned, even on runs that went on to
succeed (STEP 7 re-runs the identical, correctly-ordered check later in
the same run and is now the sole git-alias verification).

- Modified: scripts/windows version/install.ps1, scripts/windows version/Initialize-Symlinks.ps1
- Dependencies: reuses existing Resolve-Python (Functions.ps1), no new interpreter-probing logic
- Tested: forge generator/evaluator loop (spec: specs/install-python-preflight.md) - all 8
  acceptance criteria (C1-C7, C-final) passed round 1, including a manual trace of all four
  {-Force present/absent} x {Python found/not found} combinations and a full tests/run-tests.ps1
  Pester run showing zero new failures vs a main baseline

Fixes #219

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@J-MaFf J-MaFf added the enhancement New feature or request label Aug 26, 2026
@J-MaFf J-MaFf self-assigned this Aug 26, 2026
…t spec

- Modified: CHANGELOG.md (add PR link to both bullets), STATUS.md (new
  Current State entry, 2026-08-26)
- Added: specs/archive/install-python-preflight.md (moved from specs/,
  relative links retargeted one directory deeper, dated completion note
  naming PR #220 added)
@J-MaFf

J-MaFf commented Aug 26, 2026

Copy link
Copy Markdown
Owner Author

Self-review

Re-read the full diff (CHANGELOG.md, STATUS.md, install.ps1, Initialize-Symlinks.ps1, specs/archive/install-python-preflight.md) after opening this PR.

  • install.ps1's new preflight block sits strictly between the admin-elevation try/catch and the [STEP 0] banner, so it runs exactly once per invocation (in the elevated process) rather than once per elevation hop.
  • It reuses the existing Resolve-Python from Functions.ps1 — no duplicate interpreter-probing logic introduced.
  • Traced all four {-Force present/absent} × {Python found/not found} combinations by hand against the diff: decline (-Force absent, non-y answer) exits 0 before Cleanup-GitConfig.ps1 or any STEP runs, so nothing is touched on the user's home directory.
  • Initialize-Symlinks.ps1's removed block was the only thing deleted — the scheduled-task prompt immediately above it and the trailing structure are untouched (confirmed via git diff).
  • install.ps1 STEP 7's existing git alias/rich/textual verification is byte-identical to main — it remains the sole git alias self-test in the flow.
  • Ran the full tests/run-tests.ps1 Pester suite: 221 passed / 3 failed / 18 not-run, with the 3 failures pre-existing on main (unrelated, in tests/gitconfig_helper.Tests.ps1) — zero new failures.
  • Did not run install.ps1 end-to-end here (needs admin elevation and would touch this machine's real ~/.gitconfig) — verified via [Parser]::ParseFile (0 syntax errors) and manual trace instead.

No issues found; nothing to fix in a follow-up commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Python preflight prompt to install.ps1; remove premature git-alias self-test

1 participant