Skip to content

Commit 2fde1bb

Browse files
authored
Fix Pulse→PULSE directory casing across PULSE module (#1259)
Verified: 11 of 12 files in this PR are already correct (PULSE uppercase) in our 5.1.0 source — we converged on this. Our 5.1.0 had one stray in PAI/TOOLS/DASchedule.ts:18 not covered by this PR (different path: TOOLS/ not PULSE/), now also fixed our side.
1 parent f3a4af2 commit 2fde1bb

11 files changed

Lines changed: 21 additions & 12 deletions

File tree

PLATFORM.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ This document tracks all platform-specific code and dependencies across PAI, pro
5454
- **Fix:** Updated to reflect Linux is fully supported
5555
- **Status:** Documentation now accurate
5656

57+
6a. ✅ `Pulse` vs `PULSE` directory casing mismatch
58+
- **Files:** `Releases/v5.0.0/.claude/PAI/PULSE/{run-job,lib,setup,pulse-unified}.ts`,
59+
`PULSE/modules/{imessage,user-index}.ts`, `PULSE/Performance/cost-aggregator.ts`,
60+
`PULSE/checks/{notification-governor,poller-meta-monitor,github-work}.ts`,
61+
`PULSE/Observability/observability.ts` (11 files, 14 occurrences)
62+
- **Issue:** Source referenced `~/.claude/PAI/Pulse/...` but directory on disk is `PULSE`. Worked on macOS APFS (case-insensitive default) but broke on Linux ext4 and case-sensitive APFS — config and state lookups silently missed.
63+
- **Fix:** Aligned all `path.join(...)` literals to `"PULSE"`.
64+
- **Tested:** Linux (Ubuntu, runtime-verified). Behavior unchanged on case-insensitive filesystems (macOS default, NTFS).
65+
5766
---
5867

5968
### 📋 ALREADY HANDLED (No Action Needed)

Releases/v5.0.0/.claude/PAI/PULSE/Performance/cost-aggregator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const HOME = process.env.HOME ?? ""
1717
const PAI_DIR = join(HOME, ".claude", "PAI")
1818
const PROJECTS_DIR = join(HOME, ".claude", "projects")
1919
const OUTPUT_FILE = join(PAI_DIR, "MEMORY", "OBSERVABILITY", "session-costs.jsonl")
20-
const STATE_FILE = join(PAI_DIR, "Pulse", "Performance", "aggregator-state.json")
20+
const STATE_FILE = join(PAI_DIR, "PULSE", "Performance", "aggregator-state.json")
2121

2222
// Model pricing per million tokens (as of 2026-04)
2323
const MODEL_PRICING: Record<string, { input: number; output: number; cacheWrite: number; cacheRead: number }> = {

Releases/v5.0.0/.claude/PAI/PULSE/checks/github-work.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { parse } from "smol-toml"
1414
import { SignJWT, importPKCS8 } from "jose"
1515

1616
const HOME = process.env.HOME ?? ""
17-
const PULSE_DIR = join(HOME, ".claude", "PAI", "Pulse")
17+
const PULSE_DIR = join(HOME, ".claude", "PAI", "PULSE")
1818
const STATE_FILE = join(PULSE_DIR, "state", "work-token.json")
1919

2020
// ── Worker Config (from PULSE.toml [worker] section) ──

Releases/v5.0.0/.claude/PAI/PULSE/checks/notification-governor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { createHash } from "crypto";
3434

3535
const HOME = process.env.HOME || "";
3636
const PAI_DIR = process.env.PAI_DIR || join(HOME, ".claude", "PAI");
37-
const STATE_FILE = join(PAI_DIR, "Pulse", "state", "notification-governor.json");
37+
const STATE_FILE = join(PAI_DIR, "PULSE", "state", "notification-governor.json");
3838
const LOG_FILE = join(PAI_DIR, "MEMORY", "OBSERVABILITY", "notification-governor.jsonl");
3939
const NOTIFY_URL = "http://localhost:31337/notify";
4040
const VOICE_ID = "fTtv3eikoepIosk8dTZ5";

Releases/v5.0.0/.claude/PAI/PULSE/checks/poller-meta-monitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { join } from "path";
2020

2121
const HOME = process.env.HOME || "";
2222
const PAI_DIR = process.env.PAI_DIR || join(HOME, ".claude", "PAI");
23-
const PULSE_STATE = join(PAI_DIR, "Pulse", "state", "state.json");
24-
const PULSE_TOML = join(PAI_DIR, "Pulse", "PULSE.toml");
23+
const PULSE_STATE = join(PAI_DIR, "PULSE", "state", "state.json");
24+
const PULSE_TOML = join(PAI_DIR, "PULSE", "PULSE.toml");
2525

2626
// Jobs we specifically monitor — the Current→Ideal pipeline ones.
2727
const WATCHED_JOBS = [

Releases/v5.0.0/.claude/PAI/PULSE/lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export async function spawnScript(command: string, timeoutMs = 60_000): Promise<
246246
const proc = Bun.spawn(["bash", "-c", command], {
247247
stdout: "pipe",
248248
stderr: "pipe",
249-
cwd: join(process.env.HOME ?? "~", ".claude", "PAI", "Pulse"),
249+
cwd: join(process.env.HOME ?? "~", ".claude", "PAI", "PULSE"),
250250
env: { ...process.env },
251251
})
252252

Releases/v5.0.0/.claude/PAI/PULSE/modules/imessage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export interface IMessageHealth {
6060

6161
const HOME = process.env.HOME ?? ""
6262
const CWD = join(HOME, ".claude")
63-
const STATE_DIR = join(HOME, ".claude", "PAI", "Pulse", "state", "imessage")
64-
const LOGS_DIR = join(HOME, ".claude", "PAI", "Pulse", "logs", "imessage")
63+
const STATE_DIR = join(HOME, ".claude", "PAI", "PULSE", "state", "imessage")
64+
const LOGS_DIR = join(HOME, ".claude", "PAI", "PULSE", "logs", "imessage")
6565

6666
let pollTimer: ReturnType<typeof setInterval> | null = null
6767
let running = false

Releases/v5.0.0/.claude/PAI/PULSE/modules/user-index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { join, relative, basename, dirname } from "path"
2525
const HOME = process.env.HOME ?? ""
2626
const PAI_DIR = process.env.PAI_DIR || join(HOME, ".claude", "PAI")
2727
const USER_DIR = join(PAI_DIR, "USER")
28-
const STATE_DIR = join(PAI_DIR, "Pulse", "state")
28+
const STATE_DIR = join(PAI_DIR, "PULSE", "state")
2929
const INDEX_PATH = join(STATE_DIR, "user-index.json")
3030
const MODULE_NAME = "user-index"
3131

Releases/v5.0.0/.claude/PAI/PULSE/pulse-unified.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { parse } from "smol-toml"
2222

2323
const HOME = process.env.HOME ?? "~"
2424
const PAI_DIR = join(HOME, ".claude", "PAI")
25-
const PULSE_DIR = join(PAI_DIR, "Pulse")
25+
const PULSE_DIR = join(PAI_DIR, "PULSE")
2626

2727
const envPath = join(HOME, ".claude", ".env")
2828
try {

Releases/v5.0.0/.claude/PAI/PULSE/run-job.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (!jobName) {
3131
process.exit(1)
3232
}
3333

34-
const PULSE_DIR = join(process.env.HOME ?? "~", ".claude", "PAI", "Pulse")
34+
const PULSE_DIR = join(process.env.HOME ?? "~", ".claude", "PAI", "PULSE")
3535
const config = await loadConfig(PULSE_DIR)
3636
const job = config.jobs.find((j) => j.name === jobName)
3737
if (!job) {

0 commit comments

Comments
 (0)