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:
Jon Chery
2026-05-29 18:01:13 +00:00
parent e31afe3b59
commit 4a58aa1657
51 changed files with 505 additions and 465 deletions
+3 -3
View File
@@ -51,7 +51,7 @@ export interface CommitCompoundMeta {
solution: string;
}
export interface CiMetadata {
export interface CIAgentMetadata {
phase: number;
milestone: string;
project?: string;
@@ -65,12 +65,12 @@ export interface CiMetadata {
compound?: CommitCompoundMeta;
}
export interface ParsedCiCommit {
export interface ParsedCIAgentCommit {
hash: string;
type: CommitType;
scope: string;
subject: string;
ci: CiMetadata | null;
ci: CIAgentMetadata | null;
body: string;
}
+32 -32
View File
@@ -1,33 +1,33 @@
import { CIConfig, DEFAULT_CI_CONFIG, AutonomyLevel, ModelProfile, ProjectEntry } from "../types/config.js";
import { CIAgentConfig, DEFAULT_CIAGENT_CONFIG, AutonomyLevel, ModelProfile, ProjectEntry } from "../types/config.js";
describe("CIConfig", () => {
it("DEFAULT_CI_CONFIG has all required fields", () => {
expect(DEFAULT_CI_CONFIG.autonomy.level).toBe("full");
expect(DEFAULT_CI_CONFIG.autonomy.clarify_budget).toBe(10);
expect(DEFAULT_CI_CONFIG.autonomy.decision_confidence_threshold).toBe(0.6);
expect(DEFAULT_CI_CONFIG.autonomy.max_revision_iterations).toBe(3);
expect(DEFAULT_CI_CONFIG.autonomy.max_verification_retries).toBe(2);
expect(DEFAULT_CI_CONFIG.autonomy.escalation_timeout_ms).toBe(300000);
expect(DEFAULT_CI_CONFIG.autonomy.escalation_hooks).toContain("deploy");
expect(DEFAULT_CI_CONFIG.model_profile).toBe("quality");
expect(DEFAULT_CI_CONFIG.parallelization.enabled).toBe(true);
expect(DEFAULT_CI_CONFIG.verification.automated_only).toBe(true);
expect(DEFAULT_CI_CONFIG.security.auto_accept_low_severity).toBe(true);
expect(DEFAULT_CI_CONFIG.git.auto_commit).toBe(true);
expect(DEFAULT_CI_CONFIG.git.auto_push).toBe(false);
describe("CIAgentConfig", () => {
it("DEFAULT_CIAGENT_CONFIG has all required fields", () => {
expect(DEFAULT_CIAGENT_CONFIG.autonomy.level).toBe("full");
expect(DEFAULT_CIAGENT_CONFIG.autonomy.clarify_budget).toBe(10);
expect(DEFAULT_CIAGENT_CONFIG.autonomy.decision_confidence_threshold).toBe(0.6);
expect(DEFAULT_CIAGENT_CONFIG.autonomy.max_revision_iterations).toBe(3);
expect(DEFAULT_CIAGENT_CONFIG.autonomy.max_verification_retries).toBe(2);
expect(DEFAULT_CIAGENT_CONFIG.autonomy.escalation_timeout_ms).toBe(300000);
expect(DEFAULT_CIAGENT_CONFIG.autonomy.escalation_hooks).toContain("deploy");
expect(DEFAULT_CIAGENT_CONFIG.model_profile).toBe("quality");
expect(DEFAULT_CIAGENT_CONFIG.parallelization.enabled).toBe(true);
expect(DEFAULT_CIAGENT_CONFIG.verification.automated_only).toBe(true);
expect(DEFAULT_CIAGENT_CONFIG.security.auto_accept_low_severity).toBe(true);
expect(DEFAULT_CIAGENT_CONFIG.git.auto_commit).toBe(true);
expect(DEFAULT_CIAGENT_CONFIG.git.auto_push).toBe(false);
});
it("DEFAULT_CI_CONFIG has multi-project fields", () => {
expect(DEFAULT_CI_CONFIG.projects).toEqual([]);
expect(DEFAULT_CI_CONFIG.active_project).toBe("");
it("DEFAULT_CIAGENT_CONFIG has multi-project fields", () => {
expect(DEFAULT_CIAGENT_CONFIG.projects).toEqual([]);
expect(DEFAULT_CIAGENT_CONFIG.active_project).toBe("");
});
it("AutonomyLevel accepts all valid levels", () => {
const levels: AutonomyLevel[] = ["full", "supervised", "guided"];
for (const level of levels) {
const config: CIConfig = {
...DEFAULT_CI_CONFIG,
autonomy: { ...DEFAULT_CI_CONFIG.autonomy, level },
const config: CIAgentConfig = {
...DEFAULT_CIAGENT_CONFIG,
autonomy: { ...DEFAULT_CIAGENT_CONFIG.autonomy, level },
};
expect(config.autonomy.level).toBe(level);
}
@@ -36,8 +36,8 @@ describe("CIConfig", () => {
it("ModelProfile accepts all valid profiles", () => {
const profiles: ModelProfile[] = ["quality", "speed", "balanced"];
for (const profile of profiles) {
const config: CIConfig = {
...DEFAULT_CI_CONFIG,
const config: CIAgentConfig = {
...DEFAULT_CIAGENT_CONFIG,
model_profile: profile,
};
expect(config.model_profile).toBe(profile);
@@ -45,7 +45,7 @@ describe("CIConfig", () => {
});
it("escalation_hooks defaults include expected items", () => {
expect(DEFAULT_CI_CONFIG.autonomy.escalation_hooks).toEqual([
expect(DEFAULT_CIAGENT_CONFIG.autonomy.escalation_hooks).toEqual([
"deploy",
"delete_data",
"merge_to_main",
@@ -66,10 +66,10 @@ describe("CIConfig", () => {
});
});
describe("CIConfig with projects", () => {
describe("CIAgentConfig with projects", () => {
it("supports multiple projects", () => {
const config: CIConfig = {
...DEFAULT_CI_CONFIG,
const config: CIAgentConfig = {
...DEFAULT_CIAGENT_CONFIG,
projects: [
{ slug: "task-api", name: "Task API", default: true },
{ slug: "auth-svc", name: "Auth Service" },
@@ -82,8 +82,8 @@ describe("CIConfig", () => {
});
it("supports single project", () => {
const config: CIConfig = {
...DEFAULT_CI_CONFIG,
const config: CIAgentConfig = {
...DEFAULT_CIAGENT_CONFIG,
projects: [{ slug: "my-app", name: "My App", default: true }],
active_project: "my-app",
};
@@ -92,8 +92,8 @@ describe("CIConfig", () => {
});
it("defaults to empty projects array and empty active_project", () => {
expect(DEFAULT_CI_CONFIG.projects).toEqual([]);
expect(DEFAULT_CI_CONFIG.active_project).toBe("");
expect(DEFAULT_CIAGENT_CONFIG.projects).toEqual([]);
expect(DEFAULT_CIAGENT_CONFIG.active_project).toBe("");
});
});
});
+4 -3
View File
@@ -28,7 +28,8 @@ export type AgentName =
| "plan-checker"
| "project-researcher"
| "research-synthesizer"
| "solution-writer";
| "solution-writer"
| "tester";
export interface AutonomyConfig {
level: AutonomyLevel;
@@ -71,7 +72,7 @@ export interface ProjectEntry {
default?: boolean;
}
export interface CIConfig {
export interface CIAgentConfig {
projects: ProjectEntry[];
active_project: string;
autonomy: AutonomyConfig;
@@ -83,7 +84,7 @@ export interface CIConfig {
backend: BackendConfigSection;
}
export const DEFAULT_CI_CONFIG: CIConfig = {
export const DEFAULT_CIAGENT_CONFIG: CIAgentConfig = {
projects: [],
active_project: "",
autonomy: {
+3 -3
View File
@@ -3,11 +3,11 @@ 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_CI_CONFIG } from "../types/config.js";
import { DEFAULT_CIAGENT_CONFIG } from "../types/config.js";
describe("Type exports", () => {
it("pipeline types are importable and functional", () => {
expect(STAGE_ORDER).toHaveLength(7);
expect(STAGE_ORDER).toHaveLength(8);
expect(getNextStage("specify")).toBe("clarify");
const state = createInitialPipelineState("/tmp/test");
expect(state.current_stage).toBe("specify");
@@ -40,6 +40,6 @@ describe("Type exports", () => {
});
it("config defaults are importable", () => {
expect(DEFAULT_CI_CONFIG.autonomy.level).toBe("full");
expect(DEFAULT_CIAGENT_CONFIG.autonomy.level).toBe("full");
});
});
+5 -2
View File
@@ -8,13 +8,14 @@ import {
} from "../types/pipeline.js";
describe("STAGE_ORDER", () => {
it("has 7 stages in correct order", () => {
it("has 8 stages in correct order", () => {
expect(STAGE_ORDER).toEqual([
"specify",
"clarify",
"research",
"plan",
"execute",
"test",
"verify",
"complete",
]);
@@ -27,7 +28,8 @@ describe("getNextStage", () => {
expect(getNextStage("clarify")).toBe("research");
expect(getNextStage("research")).toBe("plan");
expect(getNextStage("plan")).toBe("execute");
expect(getNextStage("execute")).toBe("verify");
expect(getNextStage("execute")).toBe("test");
expect(getNextStage("test")).toBe("verify");
expect(getNextStage("verify")).toBe("complete");
});
@@ -51,6 +53,7 @@ describe("createInitialPipelineState", () => {
expect(state.research_completed).toBe(false);
expect(state.plan_completed).toBe(false);
expect(state.execute_completed).toBe(false);
expect(state.test_completed).toBe(false);
expect(state.verify_completed).toBe(false);
expect(state.errors).toHaveLength(0);
expect(state.started_at).toBeTruthy();
+4
View File
@@ -6,6 +6,7 @@ export type PipelineStage =
| "research"
| "plan"
| "execute"
| "test"
| "verify"
| "complete";
@@ -19,6 +20,7 @@ export interface PipelineState {
research_completed: boolean;
plan_completed: boolean;
execute_completed: boolean;
test_completed: boolean;
verify_completed: boolean;
errors: PipelineError[];
started_at: string;
@@ -61,6 +63,7 @@ export const STAGE_ORDER: PipelineStage[] = [
"research",
"plan",
"execute",
"test",
"verify",
"complete",
];
@@ -84,6 +87,7 @@ export function createInitialPipelineState(
research_completed: false,
plan_completed: false,
execute_completed: false,
test_completed: false,
verify_completed: false,
errors: [],
started_at: new Date().toISOString(),