fix(P01): replace hardcoded phase=1 in orchestrator and fix getDecisions double-fetch
---ci---
project: ci
phase: 1
milestone: v0.8
status: in_progress
decisions:
- id: D-021
decision: 6-phase wave-ordered vertical slices for v0.8
rationale: Each phase independently demoable; critical fixes first
confidence: 0.90
requirements:
covered: [FIX-01, FIX-06]
---/ci---
FIX-01: Replace 5 hardcoded phase=1 literals in orchestrator.ts mechanical
execution path with this.pipelineState!.current_phase. The orchestrator
correctly tracks current_phase but commits always embedded literal 1.
FIX-06: Replace getDecisions() redundant double-fetch with single
getRecentCommits(50) call, delegating to existing getDecisionsFromCommits().
Old code called getRecentCommits(50) once per grep match entry (O(N*M)
when it should be O(1)).
This commit is contained in:
@@ -500,7 +500,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
|
||||
case "research": {
|
||||
this.log("Researching project domain...");
|
||||
this.decisionEngine!.setPhase(1);
|
||||
this.decisionEngine!.setPhase(this.pipelineState!.current_phase);
|
||||
|
||||
const archMd = this.ciFiles!.readArchitectureMd();
|
||||
if (!archMd) {
|
||||
@@ -519,7 +519,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
|
||||
if (this.config.git.auto_commit && this.gitContext!.isGitRepo()) {
|
||||
const researchCommit = CommitBuilder.buildResearchCommit(
|
||||
1,
|
||||
this.pipelineState!.current_phase,
|
||||
this.currentMilestone,
|
||||
"initial domain research",
|
||||
["Research completed. Key findings in .ciagent/ARCHITECTURE.md and .ciagent/PROJECT.md updates."]
|
||||
@@ -543,7 +543,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
this.log("Planning phase execution...");
|
||||
|
||||
if (this.config.git.branching_strategy === "phase" && this.gitBranch && this.gitContext!.isGitRepo()) {
|
||||
this.gitBranch.createPhaseBranch(1, "initial-phase");
|
||||
this.gitBranch.createPhaseBranch(this.pipelineState!.current_phase, "initial-phase");
|
||||
}
|
||||
|
||||
this.pipelineState!.plan_completed = true;
|
||||
@@ -623,7 +623,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
|
||||
if (this.config.git.auto_commit && this.gitContext!.isGitRepo()) {
|
||||
const verifyCommit = CommitBuilder.buildVerifyCommit({
|
||||
phase: 1,
|
||||
phase: this.pipelineState!.current_phase,
|
||||
milestone: this.currentMilestone,
|
||||
subject: "automated verification passed",
|
||||
requirements: { covered: [], partial: [] },
|
||||
@@ -646,7 +646,7 @@ export class OrchestratorAgent extends BaseAgent {
|
||||
|
||||
if (this.config.git.auto_commit && this.gitContext!.isGitRepo()) {
|
||||
const completionCommit = CommitBuilder.buildPhaseCompletionCommit({
|
||||
phase: 1,
|
||||
phase: this.pipelineState!.current_phase,
|
||||
milestone: this.currentMilestone,
|
||||
phaseName: "initial-phase",
|
||||
tasksCompleted: 0,
|
||||
|
||||
Reference in New Issue
Block a user