Wire pipeline DAG execution to manager with events and project context

This commit is contained in:
2026-02-23 13:14:20 -05:00
parent 53af0d44cd
commit 889087daa1
13 changed files with 1668 additions and 380 deletions

View File

@@ -0,0 +1,58 @@
import test from "node:test";
import assert from "node:assert/strict";
import { mkdtemp } from "node:fs/promises";
import { tmpdir } from "node:os";
import { resolve } from "node:path";
import { FileSystemProjectContextStore } from "../src/agents/project-context.js";
test("project context store reads defaults and applies domain patches", async () => {
const root = await mkdtemp(resolve(tmpdir(), "ai-ops-project-context-"));
const store = new FileSystemProjectContextStore({
filePath: resolve(root, "project-context.json"),
});
const initial = await store.readState();
assert.deepEqual(initial, {
globalFlags: {},
artifactPointers: {},
taskQueue: [],
});
await store.patchState({
globalFlags: {
requirements_defined: true,
},
artifactPointers: {
prd: "docs/PRD.md",
},
enqueueTasks: [
{
id: "task-1",
title: "Build parser",
status: "pending",
},
],
});
const updated = await store.patchState({
upsertTasks: [
{
id: "task-1",
title: "Build parser",
status: "in_progress",
},
{
id: "task-2",
title: "Add tests",
status: "pending",
},
],
});
assert.equal(updated.globalFlags.requirements_defined, true);
assert.equal(updated.artifactPointers.prd, "docs/PRD.md");
assert.deepEqual(
updated.taskQueue.map((task) => `${task.id}:${task.status}`),
["task-1:in_progress", "task-2:pending"],
);
});