feat(ci): v0.9.0 — Distribution & Expansion milestone complete
---ci---
project: ci
phase: 6
milestone: v0.9
status: complete
artifacts:
tags: [v0.9.0]
decisions:
- id: D-047
decision: v0.9 theme = Distribution & Expansion
rationale: npm publish + OpenAI/Anthropic backends + agent flesh + parallel execution
confidence: 0.92
- id: D-049
decision: Feature milestone — patch tags v0.8.1-v0.8.6 then v0.9.0
rationale: OpenAI backend, agent flesh, npm publish all feat
confidence: 0.95
- id: D-059
decision: Rename OllamaBaseBackend to LLMBaseBackend + thin OllamaBaseBackend subclass
rationale: 15 of 17 methods backend-agnostic
confidence: 0.92
- id: D-060
decision: OpenAI/Anthropic backends use native fetch() not SDK packages
rationale: No dependency bloat; fetch native in Node 18+
confidence: 0.85
- id: D-066
decision: Concurrency limiter internal (no p-limit dependency)
rationale: 15 lines; avoids dependency for trivial feature
confidence: 0.90
- id: D-067
decision: Promise.allSettled for review agents at orchestrator lines 373-400
rationale: Current sequential loop replaced with parallel execution
confidence: 0.88
requirements:
covered: [PUBLISH-01, PUBLISH-02, PUBLISH-03, PUBLISH-04, OPENAI-01, OPENAI-02, OPENAI-03, OPENAI-04, OPENAI-05, FLESH-01, FLESH-02, FLESH-03, FLESH-04, FLESH-05, ANTHROPIC-01, ANTHROPIC-02, FLESH-06, FLESH-07, NPM-01, NPM-02, PARALLEL-01, PARALLEL-02, PARALLEL-03, INTEG-01, INTEG-02, INTEG-03, INTEG-04, INTEG-05]
---/ci---
6 phases, 28 tasks, 4077 net lines added, 57 test suites, 527 tests, zero stub agents
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
import * as fs from "node:fs";
|
||||
import * as path from "node:path";
|
||||
import * as os from "node:os";
|
||||
import { IdeationAgent } from "../agents/ideation-agent.js";
|
||||
|
||||
describe("IdeationAgent", () => {
|
||||
let tempDir: string;
|
||||
|
||||
beforeEach(() => {
|
||||
tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "ciagent-ideation-test-"));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fs.rmSync(tempDir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
it("generates ideas from uncovered requirements", () => {
|
||||
const ciagentDir = path.join(tempDir, ".ciagent");
|
||||
fs.mkdirSync(ciagentDir, { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(ciagentDir, "REQUIREMENTS.md"),
|
||||
"REQ-1: First requirement\nREQ-2: Second requirement"
|
||||
);
|
||||
|
||||
const agent = new IdeationAgent();
|
||||
const ideas = agent.mechanicalIdeate(tempDir);
|
||||
|
||||
const reqIdeas = ideas.filter((i) => i.source === "uncovered_requirement");
|
||||
expect(reqIdeas.length).toBeGreaterThanOrEqual(2);
|
||||
expect(reqIdeas.some((i) => i.relatedReq === "REQ-1")).toBe(true);
|
||||
});
|
||||
|
||||
it("identifies coverage gaps from PROJECT.md", () => {
|
||||
const ciagentDir = path.join(tempDir, ".ciagent");
|
||||
fs.mkdirSync(ciagentDir, { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(ciagentDir, "PROJECT.md"),
|
||||
"We use agent: magic-agent and agent: super-agent for tasks."
|
||||
);
|
||||
|
||||
const srcDir = path.join(tempDir, "src", "agents");
|
||||
fs.mkdirSync(srcDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(srcDir, "base.ts"), "");
|
||||
fs.writeFileSync(path.join(srcDir, "index.ts"), "");
|
||||
|
||||
const agent = new IdeationAgent();
|
||||
const gaps = agent.identifyCoverageGaps(tempDir);
|
||||
|
||||
expect(gaps).toContain("magic-agent");
|
||||
expect(gaps).toContain("super-agent");
|
||||
});
|
||||
|
||||
it("finds repeated patterns from lessons list", () => {
|
||||
const agent = new IdeationAgent();
|
||||
const lessons = [
|
||||
{ topic: "testing", detail: "testing: tests are flaky" },
|
||||
{ topic: "testing", detail: "testing: more test failures" },
|
||||
{ topic: "build", detail: "build: CI broken" },
|
||||
];
|
||||
|
||||
const repeated = agent.findRepeatedPatterns(lessons);
|
||||
expect(repeated).toContain("testing");
|
||||
expect(repeated).not.toContain("build");
|
||||
});
|
||||
|
||||
it("returns empty ideas when no project files exist", () => {
|
||||
const agent = new IdeationAgent();
|
||||
const ideas = agent.mechanicalIdeate(tempDir);
|
||||
|
||||
expect(ideas).toEqual(expect.arrayContaining([]));
|
||||
});
|
||||
|
||||
it("agent name is ideation-agent", () => {
|
||||
const agent = new IdeationAgent();
|
||||
expect(agent.name).toBe("ideation-agent");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user