fix(core): job failure semantics, stale-lock reaper, run-scoped context, reload

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Sonnet 5.5 committed 2026-10-30 20:52:51 +01:00
1 parent 166b8ecb5e
commit 6f628c4693
11 files changed
+356 -83

No files matched your search

+20
View File
@@ -1,4 +1,6 @@
import { expect, spyOn, test } from "bun:test";
import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { loadPlugins } from "../src/registry.ts";
@@ -22,3 +24,21 @@ test("duplicate ids across dirs keep the first", async () => {
expect(reg.list()).toHaveLength(1);
warn.mockRestore();
});
test("reload picks up an edited entry file", async () => {
const root = await mkdtemp(join(tmpdir(), "sttracker-plugins-"));
try {
await mkdir(join(root, "hot"));
const write = (v: string) =>
writeFile(join(root, "hot", "index.ts"), `export default { manifest: { id: "hot", name: "Hot", version: "${v}", sdkVersion: 1, mediaTypes: [], capabilities: [], config: [] } };\n`);
await write("1.0.0");
const reg = await loadPlugins([root]);
expect(reg.get("hot")?.manifest.version).toBe("1.0.0");
await new Promise((r) => setTimeout(r, 5));
await write("2.0.0");
await reg.reload();
expect(reg.get("hot")?.manifest.version).toBe("2.0.0");
} finally {
await rm(root, { recursive: true, force: true });
}
});