Problem
On Windows, Node/Pi can run without HOME (or with HOME empty). Global config writers already use process.env.HOME || os.homedir(), but resolveConfig and migrateUserMemoryConfigFiles only inspect env.HOME. A saved ~/.pi/agent/hindsight.json or hindsight.jsonc configuration is therefore ignored, and its legacy User Bank keys are not migrated.
Expected behavior
Resolve and migrate global hindsight.json/hindsight.jsonc using an explicit nonempty HOME, otherwise node:os homedir(). Preserve project and environment override precedence and migration backups.
Scope and acceptance
- Align the two config-loading/migration paths with the existing writer fallback.
- Add isolated regression coverage for missing/empty HOME, explicit HOME, project/env overrides and migration backups.
- Run targeted tests, npm run check, npm run check:coverage and npm run typecheck:tsc. Document live-smoke availability and request cross-platform CI for this Windows-sensitive fix.
Existing local fix is being prepared as a focused PR; no package or lockfile changes.
Problem
On Windows, Node/Pi can run without HOME (or with HOME empty). Global config writers already use process.env.HOME || os.homedir(), but resolveConfig and migrateUserMemoryConfigFiles only inspect env.HOME. A saved ~/.pi/agent/hindsight.json or hindsight.jsonc configuration is therefore ignored, and its legacy User Bank keys are not migrated.
Expected behavior
Resolve and migrate global hindsight.json/hindsight.jsonc using an explicit nonempty HOME, otherwise node:os homedir(). Preserve project and environment override precedence and migration backups.
Scope and acceptance
Existing local fix is being prepared as a focused PR; no package or lockfile changes.