Skip to content

Align Packs/ source PAI/Tools → PAI/TOOLS to match shipped v5 runtime dir (case-sensitive Linux)#1336

Open
Oliver-Liu99 wants to merge 1 commit into
danielmiessler:mainfrom
Oliver-Liu99:fix-pai-tools-casing
Open

Align Packs/ source PAI/Tools → PAI/TOOLS to match shipped v5 runtime dir (case-sensitive Linux)#1336
Oliver-Liu99 wants to merge 1 commit into
danielmiessler:mainfrom
Oliver-Liu99:fix-pai-tools-casing

Conversation

@Oliver-Liu99

Copy link
Copy Markdown

Summary

Rewrites the 10 remaining Packs/ source files that still reference the runtime tools directory with the legacy lowercase PAI/Tools/ so they match the canonical all-caps PAI/TOOLS/ used everywhere else in v5. This is the source-side half of #1324.

Root cause (corrects the issue framing)

I investigated #1324 and the shipped release is not actually broken on Linux today:

  • The installed artifact is not a /usr/local/bin/pai shim — it's a single alias pai='bun .../PAI/TOOLS/pai.ts' line, and the v5 installer already emits the correct TOOLS casing (and strips stale aliases on reinstall).
  • The entire Releases/v5.0.0/ tree is self-consistent on PAI/TOOLS/ (zero lowercase PAI/Tools/ references inside it). The shipped graders import ../../../../PAI/TOOLS/Inference.ts and the Telos chat route spawns ~/.claude/PAI/TOOLS/Inference.ts.

The real defect is a source/release divergence: the casing convention changed v4 (PAI/Tools) → v5 (PAI/TOOLS), the release builder rewrites ToolsTOOLS on packaging (so shipped output is correct), but 10 upstream Packs/ source files were never back-ported. On case-insensitive macOS/APFS every path resolves to the one physical dir, masking it; on case-sensitive Linux/ext4 (incl. WSL2) the lowercase references fail to resolve when the source is run directly.

Changes (12 references, 10 files — all PAI/Tools/PAI/TOOLS/)

  • Executable (would break at runtime on Linux): Packs/Telos/.../api/chat/route.ts (spawns Inference.ts); 3 Evals model-graders import PAI/TOOLS/Inference (LLMRubric, NaturalLanguageAssert, PairwiseComparison).
  • Copy-paste commands (break on Linux paste): PAIUpgrade/Workflows/{Upgrade,AlgorithmUpgrade}.md, Media/.../Art/Workflows/{Essay,Mermaid,Visualize}.md.
  • Doc/changelog consistency: Utilities/src/Fabric/SKILL.md.

Scope / safety

  • Only the literal PAI/Tools/ runtime-tools token is rewritten. The three legitimately capital-T Tools/ families — skill-level <Skill>/Tools/, PAI/DOCUMENTATION/Tools/, and the repo-root Tools/ — are intentionally untouched.
  • No directory rename / git mv needed: the physical dir is already TOOLS. Verified case-exact via git ls-files against Releases/v5.0.0/ (immune to the macOS case-insensitivity that hides this bug). After the change, grep -rn 'PAI/Tools/' Packs/ is empty.
  • Result resolves correctly on both case-insensitive macOS and case-sensitive Linux, since canonical TOOLS already matches the physical dir.

Suggested follow-ups (intentionally not bundled here, to keep this PR focused)

  1. CI grep-guard: fail the build if grep -rn 'PAI/Tools/' Packs/ Releases/$LATEST/ is non-empty, to stop the source/release divergence from silently reappearing.
  2. Durable upstream fix: the private release-builder (skills/_PAI/Tools/ShadowRelease.ts, not in this public tree) currently relies on a build-time ToolsTOOLS rewrite; back-porting these Packs/ edits makes the source canonical so the build no longer has to paper over it.
  3. .pai-protected.json could add a Releases/*/.claude/PAI/TOOLS/*.ts glob (the v5 runtime tools dir is currently unprotected by name).

Refs #1324

…e dir

The v5 runtime tools directory is canonically PAI/TOOLS/ (all-caps): the
installer alias, settings.json, CLAUDE.md, and the entire shipped
Releases/v5.0.0 tree use PAI/TOOLS/, and the v5 graders / Telos chat route
already import from PAI/TOOLS/. However 10 source files under Packs/ still
referenced the legacy lowercase PAI/Tools/ from v4. The release builder
silently rewrites Tools->TOOLS on packaging, so shipped v5 is fine, but the
source tree diverges: on case-sensitive filesystems (Linux, WSL2) these
Packs paths fail to resolve when run directly, while case-insensitive macOS
masks it. This is the source-side half of issue danielmiessler#1324.

Scope: only the literal 'PAI/Tools/' runtime-tools token is rewritten;
skill-level <Skill>/Tools/, DOCUMENTATION/Tools/, and the repo-root Tools/
dir are intentionally left untouched. No directory rename / git mv needed
(physical dir is already TOOLS). Verified case-exact via git ls-files
against Releases/v5.0.0.

Refs danielmiessler#1324

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant