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:
+15
-14
@@ -4,9 +4,9 @@ import { ClarifyPhase } from "../core/clarify.js";
|
||||
import { EscalationProtocol, EscalationInput } from "../core/escalation.js";
|
||||
import { GitContext, ProjectState } from "../core/git-context.js";
|
||||
import { GitBranch } from "../core/git-branch.js";
|
||||
import { CiFiles } from "../core/ci-files.js";
|
||||
import { CIAgentFiles } from "../core/ciagent-files.js";
|
||||
import { CommitBuilder } from "../core/commit-builder.js";
|
||||
import { CIConfig, AgentName } from "../types/config.js";
|
||||
import { CIAgentConfig, AgentName } from "../types/config.js";
|
||||
import {
|
||||
PipelineState,
|
||||
PipelineStage,
|
||||
@@ -16,29 +16,29 @@ import {
|
||||
STAGE_ORDER,
|
||||
} from "../types/pipeline.js";
|
||||
import { Specification, parseSpecification } from "../types/specification.js";
|
||||
import { loadConfig, saveConfig, isCIInitialized, initCI } from "../core/config.js";
|
||||
import { loadConfig, saveConfig, isCIAgentInitialized, initCIAgent } from "../core/config.js";
|
||||
import { getAgent } from "./index.js";
|
||||
import { IntelligenceBackend, BackendUnavailableError } from "../backends/types.js";
|
||||
|
||||
export interface GitAgentContext extends AgentContext {
|
||||
gitContext: GitContext;
|
||||
gitBranch: GitBranch;
|
||||
ciFiles: CiFiles;
|
||||
ciFiles: CIAgentFiles;
|
||||
milestone: string;
|
||||
}
|
||||
|
||||
export class OrchestratorAgent extends BaseAgent {
|
||||
readonly name: AgentName = "orchestrator";
|
||||
readonly description = "Top-level autonomous controller that coordinates the full CI pipeline";
|
||||
readonly description = "Top-level autonomous controller that coordinates the full CIAgent pipeline";
|
||||
readonly workflow = "run";
|
||||
|
||||
private config: CIConfig;
|
||||
private config: CIAgentConfig;
|
||||
private pipelineState: PipelineState | null = null;
|
||||
private decisionEngine: DecisionEngine | null = null;
|
||||
private escalationProtocol: EscalationProtocol | null = null;
|
||||
private gitContext: GitContext | null = null;
|
||||
private gitBranch: GitBranch | null = null;
|
||||
private ciFiles: CiFiles | null = null;
|
||||
private ciFiles: CIAgentFiles | null = null;
|
||||
private currentMilestone: string;
|
||||
private phaseResults: PhaseResult[] = [];
|
||||
|
||||
@@ -46,10 +46,11 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
research: "researcher",
|
||||
plan: "planner",
|
||||
execute: "executor",
|
||||
test: "tester",
|
||||
verify: "verifier",
|
||||
};
|
||||
|
||||
constructor(config?: CIConfig) {
|
||||
constructor(config?: CIAgentConfig) {
|
||||
super();
|
||||
this.config = config || loadConfig(process.cwd());
|
||||
this.currentMilestone = "v1.0";
|
||||
@@ -57,14 +58,14 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
|
||||
async execute(context: AgentContext): Promise<AgentResult> {
|
||||
const startTime = Date.now();
|
||||
this.log("Starting CI Orchestrator pipeline (git-native)");
|
||||
this.log("Starting CIAgent Orchestrator pipeline (git-native)");
|
||||
|
||||
try {
|
||||
this.config = loadConfig(context.project_path);
|
||||
|
||||
this.gitContext = new GitContext(context.project_path);
|
||||
this.gitBranch = new GitBranch(context.project_path);
|
||||
this.ciFiles = new CiFiles(context.project_path);
|
||||
this.ciFiles = new CIAgentFiles(context.project_path);
|
||||
this.ciFiles.ensureCIDir();
|
||||
|
||||
const projectState = this.gitContext.reconstructState();
|
||||
@@ -207,7 +208,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
});
|
||||
|
||||
this.log("Init commit prepared with specification in ---ci--- block");
|
||||
artifactsCreated.push(".ci/config.json");
|
||||
artifactsCreated.push(".ciagent/config.json");
|
||||
|
||||
if (this.config.git.auto_commit && this.gitContext!.isGitRepo()) {
|
||||
try {
|
||||
@@ -296,7 +297,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
1,
|
||||
this.currentMilestone,
|
||||
"initial domain research",
|
||||
["Research completed. Key findings in .ci/ARCHITECTURE.md and .ci/PROJECT.md updates."]
|
||||
["Research completed. Key findings in .ciagent/ARCHITECTURE.md and .ciagent/PROJECT.md updates."]
|
||||
);
|
||||
try {
|
||||
const { execSync } = await import("node:child_process");
|
||||
@@ -310,7 +311,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
}
|
||||
|
||||
this.pipelineState!.research_completed = true;
|
||||
artifactsCreated.push(".ci/ARCHITECTURE.md");
|
||||
artifactsCreated.push(".ciagent/ARCHITECTURE.md");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -425,7 +426,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
|
||||
private generateCompletionReport(): string {
|
||||
const lines: string[] = [
|
||||
"# CI Completion Report",
|
||||
"# CIAgent Completion Report",
|
||||
"",
|
||||
`✓ Pipeline completed successfully (git-native)`,
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user