refactor(rebrand): rename & rebrand CI → CIAgent across all source and test files
- 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---
This commit is contained in:
@@ -7,28 +7,28 @@ describe("StructuralVerification", () => {
|
||||
let tempDir: string;
|
||||
|
||||
beforeEach(() => {
|
||||
tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "ci-structural-test-"));
|
||||
tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "ciagent-structural-test-"));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fs.rmSync(tempDir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
function setupProjectStructure(hasCIDir = true, hasRoadmap = true, hasCIConfig = true, hasSpec = true) {
|
||||
function setupProjectStructure(hasCIDir = true, hasRoadmap = true, hasCIAgentConfig = true, hasSpec = true) {
|
||||
if (hasCIDir) {
|
||||
const ciDir = path.join(tempDir, ".ci");
|
||||
const ciDir = path.join(tempDir, ".ciagent");
|
||||
fs.mkdirSync(ciDir, { recursive: true });
|
||||
if (hasRoadmap) {
|
||||
fs.writeFileSync(path.join(ciDir, "ROADMAP.md"), "# Roadmap\n\n## Phases\n\n### Phase 1: Init\n**Goal**: Set up project\n**Status**: not_started\n");
|
||||
}
|
||||
}
|
||||
if (hasCIConfig) {
|
||||
const ciDir = path.join(tempDir, ".ci");
|
||||
if (hasCIAgentConfig) {
|
||||
const ciDir = path.join(tempDir, ".ciagent");
|
||||
fs.mkdirSync(ciDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(ciDir, "config.json"), JSON.stringify({ autonomy: { level: "full" } }, null, 2));
|
||||
}
|
||||
if (hasSpec) {
|
||||
const specDir = path.join(tempDir, ".ci");
|
||||
const specDir = path.join(tempDir, ".ciagent");
|
||||
if (!fs.existsSync(specDir)) fs.mkdirSync(specDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(specDir, "specification.md"), "# Project\n## Objective\nBuild a REST API for task management\n\n## Requirements\n- User auth\n- CRUD\n");
|
||||
}
|
||||
@@ -43,13 +43,13 @@ describe("StructuralVerification", () => {
|
||||
expect(result.name).toBe("Structural");
|
||||
expect(result.checks.length).toBeGreaterThan(0);
|
||||
|
||||
const phaseDirCheck = result.checks.find((c) => c.name === ".ci directory exists");
|
||||
const phaseDirCheck = result.checks.find((c) => c.name === ".ciagent directory exists");
|
||||
expect(phaseDirCheck?.status).toBe("pass");
|
||||
|
||||
const planCheck = result.checks.find((c) => c.name === "ROADMAP.md exists");
|
||||
expect(planCheck?.status).toBe("pass");
|
||||
|
||||
const configCheck = result.checks.find((c) => c.name === "CI config valid");
|
||||
const configCheck = result.checks.find((c) => c.name === "CIAgent config valid");
|
||||
expect(configCheck?.status).toBe("pass");
|
||||
|
||||
const specCheck = result.checks.find((c) => c.name === "Specification exists");
|
||||
@@ -61,7 +61,7 @@ describe("StructuralVerification", () => {
|
||||
const verifier = new StructuralVerification();
|
||||
const result = await verifier.verify(tempDir, 1);
|
||||
|
||||
const phaseDirCheck = result.checks.find((c) => c.name === ".ci directory exists");
|
||||
const phaseDirCheck = result.checks.find((c) => c.name === ".ciagent directory exists");
|
||||
expect(phaseDirCheck?.status).toBe("fail");
|
||||
});
|
||||
|
||||
@@ -75,15 +75,15 @@ describe("StructuralVerification", () => {
|
||||
});
|
||||
|
||||
it("fails when CI config has invalid JSON", async () => {
|
||||
const ciDir = path.join(tempDir, ".ci");
|
||||
const ciDir = path.join(tempDir, ".ciagent");
|
||||
fs.mkdirSync(ciDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(ciDir, "config.json"), "not valid json{{{");
|
||||
fs.mkdirSync(path.join(tempDir, ".ci"), { recursive: true });
|
||||
fs.mkdirSync(path.join(tempDir, ".ciagent"), { recursive: true });
|
||||
|
||||
const verifier = new StructuralVerification();
|
||||
const result = await verifier.verify(tempDir, 1);
|
||||
|
||||
const configCheck = result.checks.find((c) => c.name === "CI config valid");
|
||||
const configCheck = result.checks.find((c) => c.name === "CIAgent config valid");
|
||||
expect(configCheck?.status).toBe("fail");
|
||||
});
|
||||
|
||||
@@ -91,7 +91,7 @@ describe("StructuralVerification", () => {
|
||||
const srcDir = path.join(tempDir, "src");
|
||||
fs.mkdirSync(srcDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(srcDir, "app.ts"), "export function main() { /* TODO: implement */ }");
|
||||
const ciDir = path.join(tempDir, ".ci");
|
||||
const ciDir = path.join(tempDir, ".ciagent");
|
||||
fs.mkdirSync(ciDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(ciDir, "config.json"), "{}");
|
||||
fs.writeFileSync(path.join(ciDir, "specification.md"), "# Test\n## Objective\nBuild it");
|
||||
|
||||
Reference in New Issue
Block a user