Refactor pipeline policies, MCP registry, and unified config/runtime
This commit is contained in:
@@ -230,6 +230,7 @@ test("runs DAG pipeline with state-dependent routing and retry behavior", async
|
||||
task: "Implement pipeline",
|
||||
},
|
||||
});
|
||||
assert.equal(result.status, "success");
|
||||
|
||||
assert.deepEqual(
|
||||
result.records.map((record) => `${record.nodeId}:${record.status}:${String(record.attempt)}`),
|
||||
@@ -471,6 +472,7 @@ test("runs parallel topology blocks concurrently and routes via domain-event edg
|
||||
const result = await runPromise;
|
||||
|
||||
assert.equal(maxConcurrentCoders, 2);
|
||||
assert.equal(result.status, "success");
|
||||
assert.deepEqual(
|
||||
result.records.map((record) => `${record.nodeId}:${record.status}`),
|
||||
["plan:success", "code-a:success", "code-b:success", "integrate:success"],
|
||||
@@ -577,6 +579,96 @@ test("fails fast after two sequential hard failures", async () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("marks aggregate status as failure when a terminal node fails", async () => {
|
||||
const workspaceRoot = await mkdtemp(resolve(tmpdir(), "ai-ops-workspace-"));
|
||||
const stateRoot = await mkdtemp(resolve(tmpdir(), "ai-ops-session-state-"));
|
||||
const projectContextPath = resolve(stateRoot, "project-context.json");
|
||||
|
||||
const manifest = {
|
||||
schemaVersion: "1",
|
||||
topologies: ["sequential"],
|
||||
personas: [
|
||||
{
|
||||
id: "coder",
|
||||
displayName: "Coder",
|
||||
systemPromptTemplate: "Coder",
|
||||
toolClearance: {
|
||||
allowlist: [],
|
||||
banlist: [],
|
||||
},
|
||||
},
|
||||
],
|
||||
relationships: [],
|
||||
topologyConstraints: {
|
||||
maxDepth: 3,
|
||||
maxRetries: 0,
|
||||
},
|
||||
pipeline: {
|
||||
entryNodeId: "build",
|
||||
nodes: [
|
||||
{
|
||||
id: "build",
|
||||
actorId: "build_actor",
|
||||
personaId: "coder",
|
||||
},
|
||||
{
|
||||
id: "verify",
|
||||
actorId: "verify_actor",
|
||||
personaId: "coder",
|
||||
},
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
from: "build",
|
||||
to: "verify",
|
||||
on: "success",
|
||||
},
|
||||
],
|
||||
},
|
||||
} as const;
|
||||
|
||||
const engine = new SchemaDrivenExecutionEngine({
|
||||
manifest,
|
||||
settings: {
|
||||
workspaceRoot,
|
||||
stateRoot,
|
||||
projectContextPath,
|
||||
maxDepth: 3,
|
||||
maxRetries: 0,
|
||||
maxChildren: 2,
|
||||
runtimeContext: {},
|
||||
},
|
||||
actorExecutors: {
|
||||
build_actor: async () => ({
|
||||
status: "success",
|
||||
payload: {
|
||||
step: "build",
|
||||
},
|
||||
}),
|
||||
verify_actor: async () => ({
|
||||
status: "failure",
|
||||
payload: {
|
||||
error: "verification failed",
|
||||
},
|
||||
failureKind: "soft",
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
const result = await engine.runSession({
|
||||
sessionId: "session-terminal-failure",
|
||||
initialPayload: {
|
||||
task: "Aggregate failure status",
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(result.status, "failure");
|
||||
assert.deepEqual(
|
||||
result.records.map((record) => `${record.nodeId}:${record.status}`),
|
||||
["build:success", "verify:failure"],
|
||||
);
|
||||
});
|
||||
|
||||
test("propagates abort signal into actor execution and stops the run", async () => {
|
||||
const workspaceRoot = await mkdtemp(resolve(tmpdir(), "ai-ops-workspace-"));
|
||||
const stateRoot = await mkdtemp(resolve(tmpdir(), "ai-ops-session-state-"));
|
||||
|
||||
Reference in New Issue
Block a user