From 9f06297c64976f77380c42e3a39dcbf8b880e53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 21 Aug 2026 03:39:01 +0000 Subject: [PATCH] reindex-music looked one level too deep and reported the sidecar down MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It read `process.env.DATA_PATH ?? cwd/data`. DATA_PATH stopped being an env var on 2026-08-13, when the install layout became something derived from the working directory rather than configured — so run from the repo this looked for platform/data/music/.server, which is one level too deep, found nothing, and said the sidecar was not running. Imports DATA_PATH from the platform instead, so there is one derivation rather than a copy that fell behind. Verified it resolves to /home/pastilhas/officer-dev/data. Also corrects the usage line: the script moved into this plugin and the header still said `bun scripts/reindex-music.ts` from the platform repo. Co-Authored-By: Claude Opus 5 --- scripts/reindex-music.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/reindex-music.ts b/scripts/reindex-music.ts index 4ed7791..c0d9ed8 100644 --- a/scripts/reindex-music.ts +++ b/scripts/reindex-music.ts @@ -1,15 +1,22 @@ #!/usr/bin/env bun /** * Trigger the music library index on the officer-music sidecar and follow its progress live, - * ending with a summary report. Run from the platform repo: bun scripts/reindex-music.ts + * ending with a summary report. Run from the platform repo: * - * It reads the sidecar's port from DATA_PATH/music/.server (written by the sidecar on startup) and + * bun plugins/music/scripts/reindex-music.ts + * + * It reads the sidecar's port from `/music/.server` (written by the sidecar on startup) and * consumes its /reindex/stream SSE endpoint — the same stream the app subscribes to. + * + * The data root comes from the PLATFORM, not from an env var. This read `process.env.DATA_PATH ?? + * cwd/data` and DATA_PATH stopped existing on 2026-08-13, when the install layout became something + * derived from the working directory rather than configured. Run from the repo it looked in + * `platform/data/music/.server`, which is one level too deep, and reported the sidecar as not running. */ import { readFileSync } from 'node:fs'; import { join } from 'node:path'; +import { DATA_PATH } from '@@/data-path'; -const DATA_PATH = process.env.DATA_PATH ?? join(process.cwd(), 'data'); const PORT_FILE = join(DATA_PATH, 'music', '.server'); type Progress = {