4a58aa1657
- Type renames: CIConfig → CIAgentConfig, DEFAULT_CI_CONFIG → DEFAULT_CIAGENT_CONFIG - Type renames: CiMetadata → CIAgentMetadata, ParsedCiCommit → ParsedCIAgentCommit - Function renames: initCI → initCIAgent, isCIInitialized → isCIAgentInitialized - Function renames: extractCiBlock → extractCIAgentBlock, parseCiBlock → parseCIAgentBlock - Class renames: CiFiles → CIAgentFiles - Import paths: ci-files.js → ciagent-files.js - Directory paths: .ci/ → .ciagent/ across all source and test files - Check names: ".ci directory exists" → ".ciagent directory exists" - Check names: "CI config valid" → "CIAgent config valid" - Temp dir names: ci-*-test- → ciagent-*-test- - CLI examples: "ci init" → "ciagent init" - Fix deepMerge infinite recursion bug in config.ts - ---ci---/---/ci--- block markers preserved unchanged - All 31 test suites, 370 tests passing ---ci--- phase: 1 milestone: v0.5 plan: 07 task: 07-01-01 status: execute ---/ci---
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import { getNextStage, createInitialPipelineState, STAGE_ORDER } from "../types/pipeline.js";
|
|
import { confidenceToLevel, shouldEscalate } from "../types/decisions.js";
|
|
import { ESCALATION_TYPES } from "../types/escalation.js";
|
|
import { parseSpecification } from "../types/specification.js";
|
|
import { createClarifyQuestion } from "../types/clarify.js";
|
|
import { DEFAULT_CIAGENT_CONFIG } from "../types/config.js";
|
|
|
|
describe("Type exports", () => {
|
|
it("pipeline types are importable and functional", () => {
|
|
expect(STAGE_ORDER).toHaveLength(8);
|
|
expect(getNextStage("specify")).toBe("clarify");
|
|
const state = createInitialPipelineState("/tmp/test");
|
|
expect(state.current_stage).toBe("specify");
|
|
});
|
|
|
|
it("decision types are importable and functional", () => {
|
|
expect(confidenceToLevel(0.9)).toBe("high");
|
|
expect(shouldEscalate(0.5, 0.6)).toBe(true);
|
|
});
|
|
|
|
it("escalation types are importable and functional", () => {
|
|
expect(Object.keys(ESCALATION_TYPES)).toHaveLength(5);
|
|
});
|
|
|
|
it("specification parser is importable and functional", () => {
|
|
const spec = parseSpecification("# Test\n## Objective\nBuild it.", "inline");
|
|
expect(spec.title).toBe("Test");
|
|
});
|
|
|
|
it("clarify question factory is importable and functional", () => {
|
|
const q = createClarifyQuestion({
|
|
question: "Test?",
|
|
context: "Test",
|
|
default_answer: "Yes",
|
|
rationale: "Why not",
|
|
impact: "low",
|
|
category: "test",
|
|
});
|
|
expect(q.id).toMatch(/^Q-/);
|
|
});
|
|
|
|
it("config defaults are importable", () => {
|
|
expect(DEFAULT_CIAGENT_CONFIG.autonomy.level).toBe("full");
|
|
});
|
|
}); |