Skip to content

Commit 2306de6

Browse files
fix: bump all version strings to 4.0.3 + fix installer merge logic
Version was stuck at 4.0.0/4.0.1 after upgrade because: 1. Installer merge logic preserved user's existing pai.version 2. All hardcoded version strings were stale across 15+ files Fixes: - settings.json: 4.0.1 → 4.0.3, algorithmVersion: 3.6.0 → 3.7.0 - CLAUDE.md, SKILL.md, README.md: all version refs updated - Banner.ts, BuildCLAUDE.ts: fallback versions updated - Installer types.ts: added PAI_VERSION/ALGORITHM_VERSION constants as single source of truth — no more scattered hardcoded values - Installer actions.ts: force-overwrite pai.version on merge so upgrades always stamp the release version - Algorithm: added v3.7.0.md, updated LATEST pointer - install.sh + display.ts banners: corrected version display Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1f96d6d commit 2306de6

File tree

18 files changed

+429
-30
lines changed

18 files changed

+429
-30
lines changed

Releases/v4.0.3/.claude/CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PAI 4.0.0 — Personal AI Infrastructure
1+
# PAI 4.0.3 — Personal AI Infrastructure
22

33
# MODES
44

@@ -32,7 +32,7 @@ On follow-ups, include the ITERATION line. On first response to a new request, o
3232
## ALGORITHM MODE
3333
FOR: Multi-step, complex, or difficult work. Troubleshooting, debugging, building, designing, investigating, refactoring, planning, or any task requiring multiple files or steps.
3434

35-
**MANDATORY FIRST ACTION:** Use the Read tool to load `PAI/Algorithm/v3.5.0.md`, then follow that file's instructions exactly. Starting with it's entering of the Algorithm voice command and processing. Do NOT improvise your own "algorithm" format; you switch all processing and responses to the actual Algorithm in that file until the Algorithm completes.
35+
**MANDATORY FIRST ACTION:** Use the Read tool to load `PAI/Algorithm/v3.7.0.md`, then follow that file's instructions exactly. Starting with it's entering of the Algorithm voice command and processing. Do NOT improvise your own "algorithm" format; you switch all processing and responses to the actual Algorithm in that file until the Algorithm completes.
3636

3737
## MINIMAL — pure acknowledgments, ratings
3838
```

Releases/v4.0.3/.claude/PAI-Install/cli/display.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export function printBanner(): void {
7575
print("");
7676
print(` ${c.navy}████████████████${c.reset}${c.lightBlue}████${c.reset} ${sep} ${c.gray}"${c.reset}${c.lightBlue}{DAIDENTITY.NAME} here, ready to go${c.reset}${c.gray}..."${c.reset}`);
7777
print(` ${c.navy}████████████████${c.reset}${c.lightBlue}████${c.reset} ${sep} ${bar}`);
78-
print(` ${c.navy}████${c.reset} ${c.navy}████${c.reset}${c.lightBlue}████${c.reset} ${sep} ${c.navy}${c.reset} ${c.gray}PAI v4.0${c.reset}`);
79-
print(` ${c.navy}████${c.reset} ${c.navy}████${c.reset}${c.lightBlue}████${c.reset} ${sep} ${c.navy}${c.reset} ${c.gray}Algo${c.reset} ${c.silver}v3.5.0${c.reset}`);
78+
print(` ${c.navy}████${c.reset} ${c.navy}████${c.reset}${c.lightBlue}████${c.reset} ${sep} ${c.navy}${c.reset} ${c.gray}PAI v4.0.3${c.reset}`);
79+
print(` ${c.navy}████${c.reset} ${c.navy}████${c.reset}${c.lightBlue}████${c.reset} ${sep} ${c.navy}${c.reset} ${c.gray}Algo${c.reset} ${c.silver}v3.7.0${c.reset}`);
8080
print(` ${c.navy}████████████████${c.reset}${c.lightBlue}████${c.reset} ${sep} ${c.lightBlue}${c.reset} ${c.gray}Installer${c.reset} ${c.silver}v4.0${c.reset}`);
8181
print(` ${c.navy}████████████████${c.reset}${c.lightBlue}████${c.reset} ${sep} ${bar}`);
8282
print(` ${c.navy}████${c.reset} ${c.blue}████${c.reset}${c.lightBlue}████${c.reset} ${sep}`);

Releases/v4.0.3/.claude/PAI-Install/electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pai-installer",
3-
"version": "4.0.0",
3+
"version": "4.0.3",
44
"description": "PAI Installer — Electron wrapper",
55
"main": "main.js",
66
"scripts": {

Releases/v4.0.3/.claude/PAI-Install/engine/actions.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, symlin
99
import { homedir } from "os";
1010
import { join, basename } from "path";
1111
import type { InstallState, EngineEventHandler, DetectionResult } from "./types";
12+
import { PAI_VERSION, ALGORITHM_VERSION } from "./types";
1213
import { detectSystem, validateElevenLabsKey } from "./detect";
1314
import { generateSettingsJson } from "./config-gen";
1415

@@ -547,6 +548,10 @@ export async function runConfiguration(
547548
existing.principal = { ...existing.principal, ...config.principal };
548549
existing.daidentity = { ...existing.daidentity, ...config.daidentity };
549550
existing.pai = { ...existing.pai, ...config.pai };
551+
// Force-overwrite version fields — these must ALWAYS match the release,
552+
// never be preserved from the user's existing config
553+
existing.pai.version = PAI_VERSION;
554+
existing.pai.algorithmVersion = ALGORITHM_VERSION;
550555
existing.preferences = { ...existing.preferences, ...config.preferences };
551556
// Only set permissions/contextFiles/plansDirectory if not already present
552557
if (!existing.permissions) existing.permissions = config.permissions;
@@ -564,10 +569,10 @@ export async function runConfiguration(
564569
await emit({ event: "message", content: "settings.json generated." });
565570

566571
// Update Algorithm LATEST version file (public repo may be behind)
567-
const latestPath = join(paiDir, "skills", "PAI", "Components", "Algorithm", "LATEST");
568-
const latestDir = join(paiDir, "skills", "PAI", "Components", "Algorithm");
572+
const latestPath = join(paiDir, "PAI", "Algorithm", "LATEST");
573+
const latestDir = join(paiDir, "PAI", "Algorithm");
569574
if (existsSync(latestDir)) {
570-
try { writeFileSync(latestPath, "v3.5.0\n"); } catch {}
575+
try { writeFileSync(latestPath, `v${ALGORITHM_VERSION}\n`); } catch {}
571576
}
572577

573578
// Calculate and write initial counts so banner shows real numbers on first launch

Releases/v4.0.3/.claude/PAI-Install/engine/config-gen.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import type { PAIConfig } from "./types";
10-
import { DEFAULT_VOICES } from "./types";
10+
import { DEFAULT_VOICES, PAI_VERSION, ALGORITHM_VERSION } from "./types";
1111

1212
/**
1313
* Generate a minimal fallback settings.json from installer-collected data.
@@ -58,7 +58,8 @@ export function generateSettingsJson(config: PAIConfig): Record<string, any> {
5858

5959
pai: {
6060
repoUrl: "https://github.com/danielmiessler/PAI",
61-
version: "4.0.0",
61+
version: PAI_VERSION,
62+
algorithmVersion: ALGORITHM_VERSION,
6263
},
6364
};
6465
}

Releases/v4.0.3/.claude/PAI-Install/engine/state.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from "
77
import { homedir } from "os";
88
import { join, dirname } from "path";
99
import type { InstallState, StepId } from "./types";
10+
import { INSTALLER_VERSION } from "./types";
1011

1112
const STATE_FILE = join(
1213
process.env.PAI_CONFIG_DIR || join(homedir(), ".config", "PAI"),
@@ -18,7 +19,7 @@ const STATE_FILE = join(
1819
*/
1920
export function createFreshState(mode: "cli" | "web"): InstallState {
2021
return {
21-
version: "4.0.0",
22+
version: INSTALLER_VERSION,
2223
startedAt: new Date().toISOString(),
2324
updatedAt: new Date().toISOString(),
2425
currentStep: "system-detect",

Releases/v4.0.3/.claude/PAI-Install/engine/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,14 @@ export type EngineEventHandler = (event: EngineEvent) => void | Promise<void>;
182182

183183
// ─── Voice ───────────────────────────────────────────────────────
184184

185+
// ─── Release Versions (single source of truth) ─────────────────
186+
// Update these when cutting a new PAI release.
187+
// The installer reads these constants — no other file should hardcode versions.
188+
189+
export const PAI_VERSION = "4.0.3";
190+
export const ALGORITHM_VERSION = "3.7.0";
191+
export const INSTALLER_VERSION = "4.0";
192+
185193
export const DEFAULT_VOICES = {
186194
male: "pNInz6obpgDQGcFmaJgB", // Adam
187195
female: "21m00Tcm4TlvDq8ikWAM", // Rachel

Releases/v4.0.3/.claude/PAI-Install/engine/validate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { existsSync, readFileSync } from "fs";
77
import { join } from "path";
88
import type { InstallState, ValidationCheck, InstallSummary } from "./types";
9+
import { PAI_VERSION } from "./types";
910
import { homedir } from "os";
1011

1112
/**
@@ -191,7 +192,7 @@ export async function runValidation(state: InstallState): Promise<ValidationChec
191192
*/
192193
export function generateSummary(state: InstallState): InstallSummary {
193194
return {
194-
paiVersion: "4.0.0",
195+
paiVersion: PAI_VERSION,
195196
principalName: state.collected.principalName || "User",
196197
aiName: state.collected.aiName || "PAI",
197198
timezone: state.collected.timezone || "UTC",

Releases/v4.0.3/.claude/PAI-Install/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ echo ""
4242
echo ""
4343
echo -e " ${NAVY}████████████████${RESET}${LIGHT_BLUE}████${RESET} ${SEP} ${GRAY}\"${RESET}${LIGHT_BLUE}Lean and Mean${RESET}${GRAY}\"${RESET}"
4444
echo -e " ${NAVY}████████████████${RESET}${LIGHT_BLUE}████${RESET} ${SEP} ${BAR}"
45-
echo -e " ${NAVY}████${RESET} ${NAVY}████${RESET}${LIGHT_BLUE}████${RESET} ${SEP} ${NAVY}${RESET} ${GRAY}PAI${RESET} ${SILVER}v4.0${RESET}"
46-
echo -e " ${NAVY}████${RESET} ${NAVY}████${RESET}${LIGHT_BLUE}████${RESET} ${SEP} ${NAVY}${RESET} ${GRAY}Algo${RESET} ${SILVER}v3.5.0${RESET}"
45+
echo -e " ${NAVY}████${RESET} ${NAVY}████${RESET}${LIGHT_BLUE}████${RESET} ${SEP} ${NAVY}${RESET} ${GRAY}PAI${RESET} ${SILVER}v4.0.3${RESET}"
46+
echo -e " ${NAVY}████${RESET} ${NAVY}████${RESET}${LIGHT_BLUE}████${RESET} ${SEP} ${NAVY}${RESET} ${GRAY}Algo${RESET} ${SILVER}v3.7.0${RESET}"
4747
echo -e " ${NAVY}████████████████${RESET}${LIGHT_BLUE}████${RESET} ${SEP} ${LIGHT_BLUE}${RESET} ${GRAY}Installer${RESET} ${SILVER}v4.0${RESET}"
4848
echo -e " ${NAVY}████████████████${RESET}${LIGHT_BLUE}████${RESET} ${SEP} ${BAR}"
4949
echo -e " ${NAVY}████${RESET} ${BLUE}████${RESET}${LIGHT_BLUE}████${RESET} ${SEP}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.5.0
1+
v3.7.0

0 commit comments

Comments
 (0)