chore: initialize POM 2 repo (docs guards green; release gates recorded NOT RUN pending install)
This commit is contained in:
24
tests/studio.test.ts
Normal file
24
tests/studio.test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { DEFAULT_CONFIG } from "../src/domain";
|
||||
import { createState } from "../src/state";
|
||||
import { buildHiveMission, missionToTaskBatch } from "../src/studio";
|
||||
|
||||
test("Hive mission is bounded, ownership-aware, and translated to one native task batch", async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), "pom-hive-"));
|
||||
try {
|
||||
const config = { ...DEFAULT_CONFIG, maxStudioAgents: 2 };
|
||||
const state = createState("Hive Test", root, config);
|
||||
const mission = buildHiveMission(state, config, "stage");
|
||||
assert.ok(mission.tasks.length > 0 && mission.tasks.length <= 2);
|
||||
const batch = missionToTaskBatch(state, mission);
|
||||
assert.equal(batch.tasks.length, mission.tasks.length);
|
||||
assert.match(batch.context, /native IRC/);
|
||||
assert.ok(batch.tasks.every((item) => item.task.includes("pom_hive op=signal")));
|
||||
} finally {
|
||||
await rm(root, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user