Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

STATVS/lib/backup.ts imports ../../ARCHIVE/Archive, which is not in the repo

Open bowlax opened this issue 3 weeks ago • 3 comments

LifeOS/install/LIFEOS/STATVS/lib/backup.ts line 326, inside offsiteStore():

const { r2Store } = await import("../../ARCHIVE/Archive");

There is no LIFEOS/ARCHIVE/ directory in the release. I checked the v8.761.0 tree and the current main tree through the GitHub API: no path matches LIFEOS/ARCHIVE/ (the only archive paths are under ALGORITHM/archive/). It is the only reference to ARCHIVE/ in the TypeScript.

Effect

  1. Bundling anything that reaches STATVS fails. On an install of v8.761.0, bun build --target bun LIFEOS/ROUTER/FrontDoor.ts --outfile /dev/null (same for LIFEOS/ASSAY/Engine.ts) fails with:
326 |   const { r2Store } = await import("../../ARCHIVE/Archive");
                                         ^
error: Could not resolve: "../../ARCHIVE/Archive"
    at LIFEOS/STATVS/lib/backup.ts:326:36
  1. At runtime, offsiteStore() outside bun test and without STATVS_OFFSITE_DIR would throw module-not-found. bun test does not catch it because offsiteStore() returns null under the test root before it reaches the import.

I have not run the bundler against a clean checkout of main; the line and the missing directory are confirmed there by reading the files, and the bundler failure was reproduced on a v8.761.0 install.

What I did locally

I replaced the dynamic import with a thrown error that says the R2 store is not installed and to set STATVS_OFFSITE_DIR, and added a three-case test. Nothing in the tree calls offsiteStore(), so there was no behaviour to lose. If the Archive module is meant to ship, it is missing from the release instead.

bowlax avatar Nov 09 '26 10:11 bowlax

[!NOTE] 🤖 Paulino (AI assistant) responding on behalf of Dr. Paulo

A small correction: offsiteStore() is called. statvs backup reaches it after the local copy (LIFEOS/STATVS/Statvs.ts:461). So on an install without STATVS_OFFSITE_DIR, the command throws at the offsite step, after the local backup has run.

drpaulobernardy avatar Nov 09 '26 13:11 drpaulobernardy

Thanks, confirmed: Statvs.ts:461 calls it from the backup command. My "nothing calls it" was wrong, because I only searched an install that doesn't have Statvs.ts. Worth noting that with my local change, statvs backup would throw at the offsite step after the local copy, so the fix upstream needs to decide whether that should be a hard failure or a skip with a warning.

bowlax avatar Nov 09 '26 15:11 bowlax

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

The backup step's runtime failure was already fixed: when the Archive module is not installed, the backup now does its local copy and skips the offsite step instead of throwing. The other half you reported, bun build failing to resolve that import, was still there because the import path was written out literally. It now goes through a computed path, so a bundler leaves it alone and the build succeeds on an install without that module.

This fix lands in the next LifeOS release, so I'm closing this now.

danielmiessler avatar Nov 20 '26 00:11 danielmiessler