feat(runtime): pre-copy settled harness history while serving

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-11-04 22:19:11 -06:00
1 parent a0250284e3
commit 93e2f348cf
7 files changed
+323 -59

No files matched your search

+9
View File
@@ -89,6 +89,15 @@ describe("bundleRuntime", () => {
expect(JSON.parse(stdout)).toEqual({ migrated: 42 });
});
it("packages online harness preparation as a standalone plain-Node entry", async () => {
const nativeHarnessPrestageEntry = path.join(root, "server", "dist", "prestage.js");
write(nativeHarnessPrestageEntry, 'import { values } from "@paperclipai/fixture"; console.log(JSON.stringify({ copied: values.doubled, enrollmentReady: false }));');
const outdir = path.join(root, "server", "dist-runtime");
await bundleRuntime({ entry: path.join(root, "server", "dist", "index.js"), outdir, nativeHarnessPrestageEntry });
const { stdout } = await execFileAsync(process.execPath, [path.join(outdir, "native-harness-prestage.mjs")], { timeout: 30_000 });
expect(JSON.parse(stdout)).toEqual({ copied: 42, enrollmentReady: false });
});
it("bundles workspace TypeScript and runs with plain node", async () => {
const outdir = path.join(root, "server", "dist-runtime");
const summary = await bundleRuntime({ entry: path.join(root, "server", "dist", "index.js"), outdir });