From 3bc06bba3c3b4166a61ec29bfa9f290367d39049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 12 Aug 2026 23:23:10 +0000 Subject: [PATCH] spell the root derivation as resolve rather than dirname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolve(process.cwd(), '..') instead of dirname(process.cwd()). Identical on every input — checked including trailing slash and filesystem root — and it reads as the path arithmetic it is. resolve was already imported here for SEED_PATH. Co-Authored-By: Claude Opus 5 (1M context) --- src/servers/data-path.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/servers/data-path.ts b/src/servers/data-path.ts index 117c85cf..029f014a 100644 --- a/src/servers/data-path.ts +++ b/src/servers/data-path.ts @@ -1,4 +1,4 @@ -import { dirname, join, resolve } from 'node:path'; +import { join, resolve } from 'node:path'; import { chmodSync, mkdirSync, readFileSync } from 'node:fs'; import { homedir } from 'node:os'; @@ -20,7 +20,7 @@ import { homedir } from 'node:os'; // This depends on the working directory being the repo, which is why pm2 pins `cwd` in // ecosystem.profile.cjs — read the comment there before changing either. `assertInstallLayout` below // is the check that says so out loud instead of silently writing to the wrong place. -export const OFFICER_ROOT = dirname(process.cwd()); +export const OFFICER_ROOT = resolve(process.cwd(), '..'); export const DATA_PATH = join(OFFICER_ROOT, 'data'); @@ -32,7 +32,7 @@ export const OFFICER_ITEMS_DIR = join(OFFICER_ROOT, 'capabilities'); * Refuse to boot when the working directory is not the platform repo. * * Same posture as `assertCapabilityTotality` and `assertSecretsClosed`: a prerequisite that silently - * not holding is worse than one that fails. Every path in this file hangs off `dirname(process.cwd())`, + * not holding is worse than one that fails. Every path in this file hangs off `resolve(process.cwd(), '..')`, * so a process started from the wrong directory does not error — it computes a plausible root somewhere * else and writes managed homes, capabilities and agent runs into it. The install looks empty and the * data looks lost, with nothing naming the cause.