@@ -32,6 +32,15 @@ vi.mock("../../src/utils/state.js", () => ({
3232 } ;
3333 return labels [ phase ] ?? "Unknown" ;
3434 } ) ,
35+ getPhaseInfo : vi . fn ( ( phase : number ) => {
36+ const info : Record < number , { name : string ; agent : string ; goal : string ; outputs : string [ ] } > = {
37+ 1 : { name : "Analysis" , agent : "Mary (Analyst)" , goal : "Gather requirements, constraints, and risks" , outputs : [ "requirements.md" , "constraints.md" , "research.md" , "risks.md" ] } ,
38+ 2 : { name : "Planning" , agent : "Larry (PM)" , goal : "Create PRD, user stories, and MVP scope" , outputs : [ "prd.md" , "stories.md" , "mvp-scope.md" ] } ,
39+ 3 : { name : "Design" , agent : "Mo (Architect)" , goal : "Define architecture, data model, and conventions" , outputs : [ "architecture.md" , "data-model.md" , "conventions.md" ] } ,
40+ 4 : { name : "Implementation" , agent : "Ralph (Developer)" , goal : "TDD build, code review, and validation" , outputs : [ "code" , "tests" , "documentation" ] } ,
41+ } ;
42+ return info [ phase ] ?? { name : "Unknown" , agent : "Unknown" , goal : "Unknown" , outputs : [ ] } ;
43+ } ) ,
3544} ) ) ;
3645
3746describe ( "resume command" , ( ) => {
@@ -126,4 +135,31 @@ describe("resume command", () => {
126135 expect . objectContaining ( { stdio : "inherit" } )
127136 ) ;
128137 } ) ;
138+
139+ it ( "shows phase info before spawning" , async ( ) => {
140+ const { isInitialized } = await import ( "../../src/installer.js" ) ;
141+ const { readPhaseState } = await import ( "../../src/utils/state.js" ) ;
142+ const { spawn } = await import ( "child_process" ) ;
143+
144+ vi . mocked ( isInitialized ) . mockResolvedValue ( true ) ;
145+ vi . mocked ( readPhaseState ) . mockResolvedValue ( {
146+ currentPhase : 3 ,
147+ iteration : 1 ,
148+ status : "running" ,
149+ startedAt : "2025-01-01T00:00:00.000Z" ,
150+ lastUpdated : "2025-01-01T01:00:00.000Z" ,
151+ } ) ;
152+
153+ const fakeChild = new EventEmitter ( ) ;
154+ vi . mocked ( spawn ) . mockReturnValue ( fakeChild as never ) ;
155+
156+ const { resumeCommand } = await import ( "../../src/commands/resume.js" ) ;
157+ await resumeCommand ( ) ;
158+
159+ const output = consoleSpy . mock . calls . map ( ( c ) => c [ 0 ] ) . join ( "\n" ) ;
160+ expect ( output ) . toContain ( "Phase 3" ) ;
161+ expect ( output ) . toContain ( "Design" ) ;
162+ expect ( output ) . toContain ( "Mo (Architect)" ) ;
163+ expect ( output ) . toContain ( "architecture" ) ;
164+ } ) ;
129165} ) ;
0 commit comments