From ffbe5c6819b3ae70d52f94ee3e2851fb030fd762 Mon Sep 17 00:00:00 2001 From: Pyuyi <136783609@qq.com> Date: Tue, 26 May 2026 10:20:41 +0800 Subject: [PATCH] Fix Windows PowerShell installer parity (#242) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rewrite the Windows PowerShell installer to use flat per-skill junctions instead of nested-junction layout, matching the Unix installer's safety model. Two rounds of cross-model review caught: CRLF noise (eliminated; .gitattributes added with LF normalization); UPDATE_TARGET silently overwriting user-customized junctions (now guarded by inside-repo check); missing legacy nested migration (added -FromOld / -MigrateCopy keep-user|prefer-upstream); missing .aris/tools junction parity; tests effectively never running (added Windows GitHub Actions matrix for both powershell.exe and pwsh). Author then self-found a narrower variant: parent-path-component reparse points. Resolve-ReparseChain now walks root → leaf rewriting at the first junction/symlink component, with cycle detection (40-depth limit + HashSet of seen paths). 12 tests passing on both PS hosts. Maintainer rebased onto post-RENDER_HTML + post-drift-fix main; resolved 3 conflicts (README_CN.md, SKILLS_CATALOG.md, wiki-enrich Codex mirror) by taking the previously codex-reviewed origin/main version. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitattributes | 2 + .github/workflows/check-skills-inventory.yml | 2 + .github/workflows/test-install-aris-ps1.yml | 31 + README.md | 5 +- docs/ARIS_INTRO.html | 12 +- docs/ARIS_INTRO.review.json | 2 +- tests/test_codex_skill_mirror.py | 2 +- tests/test_install_aris_ps1.py | 356 ++++++ tools/install_aris.ps1 | 1096 ++++++++++++++---- 9 files changed, 1286 insertions(+), 222 deletions(-) create mode 100644 .github/workflows/test-install-aris-ps1.yml create mode 100644 tests/test_install_aris_ps1.py diff --git a/.gitattributes b/.gitattributes index 8e25262..39723e5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,5 @@ +* text=auto eol=lf + skills/paper-write/templates/* linguist-vendored skills/skills-codex/paper-write/templates/* linguist-vendored skills/skills-codex-claude-review/paper-write/templates/* linguist-vendored diff --git a/.github/workflows/check-skills-inventory.yml b/.github/workflows/check-skills-inventory.yml index 50558d4..6cf4ada 100644 --- a/.github/workflows/check-skills-inventory.yml +++ b/.github/workflows/check-skills-inventory.yml @@ -24,6 +24,8 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.x' + - name: Install pytest + run: python -m pip install pytest - name: Check skill inventory drift run: python tools/check_skills_inventory.py - name: Check Codex skill mirror semantics diff --git a/.github/workflows/test-install-aris-ps1.yml b/.github/workflows/test-install-aris-ps1.yml new file mode 100644 index 0000000..0b54609 --- /dev/null +++ b/.github/workflows/test-install-aris-ps1.yml @@ -0,0 +1,31 @@ +name: Windows PowerShell installer tests + +on: + pull_request: + paths: + - 'tools/install_aris.ps1' + - 'tests/test_install_aris_ps1.py' + - '.github/workflows/test-install-aris-ps1.yml' + workflow_dispatch: + +jobs: + test: + runs-on: windows-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + powershell: + - powershell.exe + - pwsh + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install pytest + run: python -m pip install pytest + - name: Run installer tests with ${{ matrix.powershell }} + env: + ARIS_TEST_POWERSHELL: ${{ matrix.powershell }} + run: python -m pytest tests/test_install_aris_ps1.py -q diff --git a/README.md b/README.md index 584fd9c..35c1c7e 100644 --- a/README.md +++ b/README.md @@ -1507,8 +1507,9 @@ bash ~/aris_repo/tools/install_aris.sh --dry-run # show plan, no changes bash ~/aris_repo/tools/install_aris.sh --uninstall # remove only managed symlinks (per manifest) bash ~/aris_repo/tools/install_aris.sh --from-old # migrate from old nested .claude/skills/aris/ -# Windows (PowerShell, requires admin or developer mode for junctions): -.\tools\install_aris.ps1 C:\path\to\your-paper-project +# Windows (PowerShell, no WSL required; creates flat per-skill junctions): +.\tools\install_aris.ps1 C:\path\to\your-paper-project -Platform claude +.\tools\install_aris.ps1 C:\path\to\your-codex-project -Platform codex ``` **Why "git pull" alone isn't enough for new/removed skills:** the flat layout uses one symlink per skill, so upstream additions/deletions don't propagate until the installer is re-run. The trade-off bought us Claude Code's automatic slash-command discovery (which only scans one directory level deep). diff --git a/docs/ARIS_INTRO.html b/docs/ARIS_INTRO.html index f42c60e..bd1efb6 100644 --- a/docs/ARIS_INTRO.html +++ b/docs/ARIS_INTRO.html @@ -7,8 +7,8 @@ - - + +