Fix residual .claude/PAI literals in executable code (#108)#117
Merged
virtualian merged 1 commit intomainfrom Apr 14, 2026
Merged
Fix residual .claude/PAI literals in executable code (#108)#117virtualian merged 1 commit intomainfrom
virtualian merged 1 commit intomainfrom
Conversation
Two files under Releases/v4.0.3+/.claude/PAI/ still referenced the pre-separation `.claude/PAI` path in executable code. Both now resolve via `process.env.PAI_DIR || ~/.pai` matching the repo convention used in Tools/algorithm.ts, Tools/FailureCapture.ts, and hooks/lib/paths.ts. - RebuildPAI.ts:16 — introduce PAI_ROOT const; PAI_DIR now = PAI_ROOT/PAI - runner.v2.ts:33 — resolve PAI_ROOT inside createLocalLLM() Out of scope and intentionally untouched: - `~/.claude/settings.json` reference in RebuildPAI.ts:21 (correct per two-root architecture — settings live in CLAUDE_CONFIG_DIR) - The 102-line Algorithm-spec gap in v3.7.0.md (separate problem) - 4 residual hits in `.claude/skills/` tree (filed as separate issue) Per Plans/2026-04-14-two-root-separation-followups.md the plan listed 10 files but 8 were already clean on this branch between #101 and #106. Refs #108 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
virtualian
added a commit
that referenced
this pull request
Apr 14, 2026
Captures three design documents that have been sitting untracked in the working tree, making them visible in git for future sessions and making pre-existing PR citations resolvable. 1. Plans/2026-04-14-two-root-separation-followups.md (238 lines) Authoritative planning doc for issues #108, #109, #110, and #115. Already cited by merged PRs #117, #118, #119 — committing here makes those citations resolve against a real file in git for the first time. Scopes "tonight's decision" (#108+#109 implement, #110 and #115 defer for design) and documents the Path A/B alternatives for the feedback-memory-home decision that drove #118/#119. 2. Plans/2026-04-14-110-mirror-source-investigation.md (new) Post-#115-merge investigation answering the "where does the 178 MB ~/.claude/skills ↔ ~/.pai/skills mirror come from?" question left open by the followups doc. Path A confirmed: mirror is static; no installer writes to either tree; content was populated by an out-of-installer mechanism and has not been maintained since Apr 7 2026. Scopes three Option B implementation variants (copy-then-symlink, clone-to-PAI-root, Option-D-and-wait) with tradeoffs and recommends B-Plan-1 for minimum disruption. 3. Plans/eager-enchanting-snail.md (95 lines) Historical planning artifact from an earlier direction proposing ~/.claude/PAI/ → ~/data/PAI/ relocation with a new PAI_INSTALL_DIR env var. Superseded by #98/#101 which chose the two-root separation (CLAUDE_CONFIG_DIR + PAI_DIR = ~/.pai) instead. Preserved as historical context; not an active plan. No code changes. No runtime impact. Pure documentation archive to resolve working-tree drift between design docs and git state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
virtualian
added a commit
that referenced
this pull request
Apr 14, 2026
Captures three design documents that have been sitting untracked in the working tree, making them visible in git for future sessions and making pre-existing PR citations resolvable. 1. Plans/2026-04-14-two-root-separation-followups.md (238 lines) Authoritative planning doc for issues #108, #109, #110, and #115. Already cited by merged PRs #117, #118, #119 — committing here makes those citations resolve against a real file in git for the first time. Scopes "tonight's decision" (#108+#109 implement, #110 and #115 defer for design) and documents the Path A/B alternatives for the feedback-memory-home decision that drove #118/#119. 2. Plans/2026-04-14-110-mirror-source-investigation.md (new) Post-#115-merge investigation answering the "where does the 178 MB ~/.claude/skills ↔ ~/.pai/skills mirror come from?" question left open by the followups doc. Path A confirmed: mirror is static; no installer writes to either tree; content was populated by an out-of-installer mechanism and has not been maintained since Apr 7 2026. Scopes three Option B implementation variants (copy-then-symlink, clone-to-PAI-root, Option-D-and-wait) with tradeoffs and recommends B-Plan-1 for minimum disruption. 3. Plans/eager-enchanting-snail.md (95 lines) Historical planning artifact from an earlier direction proposing ~/.claude/PAI/ → ~/data/PAI/ relocation with a new PAI_INSTALL_DIR env var. Superseded by #98/#101 which chose the two-root separation (CLAUDE_CONFIG_DIR + PAI_DIR = ~/.pai) instead. Preserved as historical context; not an active plan. No code changes. No runtime impact. Pure documentation archive to resolve working-tree drift between design docs and git state. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.claude/PAIpath literals in executable code underReleases/v4.0.3+/.claude/PAI/, so both files now resolve viaprocess.env.PAI_DIR || ~/.paimatching the repo convention (Tools/algorithm.ts,Tools/FailureCapture.ts,hooks/lib/paths.ts)..claude/PAI/subtree residuals in executable code..claude/skills/subtree (same bug class, outside Two-root separation incomplete: stale ~/.claude/PAI/ tree and residual ~/.claude/PAI/ references in canonical ~/.pai/PAI/ #108's plan scope).What changed
Releases/v4.0.3+/.claude/PAI/Tools/RebuildPAI.tsPAI_ROOT = process.env.PAI_DIR || ~/.pai;PAI_DIRnow =PAI_ROOT/PAIReleases/v4.0.3+/.claude/PAI/ACTIONS/lib/runner.v2.tsPAI_ROOTinsidecreateLocalLLM(); dynamic import ofInference.tsuses itNet diff: 4 insertions, 2 deletions.
Plan-vs-reality finding
Plans/2026-04-14-two-root-separation-followups.mdlisted 10 files for #108. 8 of those 10 were already clean on this branch — likely handled between commits #101 and #106. The remaining 2 are the ones fixed here. The OBSERVE-phase verification used:grep -rn '~/.claude/PAI' Releases/v4.0.3+/.claude/PAI/which returned zero hits before AND after these edits (the stale cases in the remaining 2 files used
${HOME}/.claude/PAIform without a literal~, so they required a broader.claude/PAIgrep to catch).Out of scope — intentionally untouched
~/.claude/settings.jsonreference atRebuildPAI.ts:21— correct per two-root architecture; settings live inCLAUDE_CONFIG_DIR, notPAI_DIR.Releases/v4.0.3+/.claude/PAI/Algorithm/v3.7.0.md— separate reconciliation problem per plan doc; explicitly not bundled.Releases/v4.0.3+/.claude/skills/— filed as issue Residual .claude/PAI literals in Releases/v4.0.3+/.claude/skills/ tree #116. Same bug class, outside plan's canonical-tree scope. Needs its own PR since fixing these likely requires parallel edits inPacks/source-of-truth tree (sync direction to be determined).~/.claude/and~/.pai/) — no runtime touches per plan constraint.Verification
grep -rn '\.claude/PAI' Releases/v4.0.3+/.claude/PAI/→ zero hits after the fixbun build --target=bun Releases/v4.0.3+/.claude/PAI/Tools/RebuildPAI.ts→ bundles cleanly in 6msbun build --target=bun Releases/v4.0.3+/.claude/PAI/ACTIONS/lib/runner.v2.ts→ same pre-existingajvmodule-resolution error as before (attypes.v2.ts:164, unrelated to this PR's edit at line 32-34)RebuildPAI.ts:21unchangedv3.7.0.mdTest plan
grep -rn '\\.claude/PAI' Releases/v4.0.3+/.claude/PAI/returns zero hits.claude/PAIcheck) passes; if no such guard exists, consider adding one in a followupbun Releases/v4.0.3+/.claude/PAI/Tools/RebuildPAI.tsin an env wherePAI_DIR=~/.paiis set and confirm it resolvesComponents/under~/.pai/PAI/Components/(not~/.claude/PAI/Components/)runner.v2.tssmoke test: invoke an action that usescreateLocalLLM()and confirm theInference.tsimport resolvesReferences
Plans/2026-04-14-two-root-separation-followups.md🤖 Generated with Claude Code