@@ -343,7 +343,10 @@ function scanPhaseArtifacts(cwd: string, phaseDirectory: string): PhaseArtifacts
343343 if ( uatFile ) {
344344 result . uat_path = path . join ( phaseDirectory , uatFile ) ;
345345 }
346- } catch { /* ignore */ }
346+ } catch ( e ) {
347+ /* optional op, ignore */
348+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
349+ }
347350 return result ;
348351}
349352
@@ -464,7 +467,10 @@ export function cmdInitNewProject(cwd: string, raw: boolean): void {
464467 stdio : [ 'pipe' , 'pipe' , 'pipe' ] ,
465468 } ) ;
466469 hasCode = files . trim ( ) . length > 0 ;
467- } catch { /* ignore */ }
470+ } catch ( e ) {
471+ /* optional op, ignore */
472+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
473+ }
468474
469475 hasPackageFile = pathExistsInternal ( cwd , 'package.json' ) ||
470476 pathExistsInternal ( cwd , 'requirements.txt' ) ||
@@ -530,7 +536,10 @@ export function cmdInitQuick(cwd: string, description: string | undefined, raw:
530536 if ( existing . length > 0 ) {
531537 nextNum = Math . max ( ...existing ) + 1 ;
532538 }
533- } catch { /* ignore */ }
539+ } catch ( e ) {
540+ /* optional op, ignore */
541+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
542+ }
534543
535544 const result : QuickContext = {
536545 planner_model : resolveModelInternal ( cwd , 'maxsim-planner' ) ,
@@ -558,7 +567,10 @@ export function cmdInitResume(cwd: string, raw: boolean): void {
558567 let interruptedAgentId : string | null = null ;
559568 try {
560569 interruptedAgentId = fs . readFileSync ( path . join ( cwd , '.planning' , 'current-agent-id.txt' ) , 'utf-8' ) . trim ( ) ;
561- } catch { /* ignore */ }
570+ } catch ( e ) {
571+ /* optional op, ignore */
572+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
573+ }
562574
563575 const result : ResumeContext = {
564576 state_exists : pathExistsInternal ( cwd , '.planning/STATE.md' ) ,
@@ -682,9 +694,15 @@ export function cmdInitTodos(cwd: string, area: string | undefined, raw: boolean
682694 area : todoArea ,
683695 path : path . join ( '.planning' , 'todos' , 'pending' , file ) ,
684696 } ) ;
685- } catch { /* ignore */ }
697+ } catch ( e ) {
698+ /* optional op, ignore */
699+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
700+ }
686701 }
687- } catch { /* ignore */ }
702+ } catch ( e ) {
703+ /* optional op, ignore */
704+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
705+ }
688706
689707 const result : TodosContext = {
690708 commit_docs : config . commit_docs ,
@@ -720,17 +738,26 @@ export function cmdInitMilestoneOp(cwd: string, raw: boolean): void {
720738 const phaseFiles = fs . readdirSync ( path . join ( phasesDir , dir ) ) ;
721739 const hasSummary = phaseFiles . some ( f => f . endsWith ( '-SUMMARY.md' ) || f === 'SUMMARY.md' ) ;
722740 if ( hasSummary ) completedPhases ++ ;
723- } catch { /* ignore */ }
741+ } catch ( e ) {
742+ /* optional op, ignore */
743+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
744+ }
724745 }
725- } catch { /* ignore */ }
746+ } catch ( e ) {
747+ /* optional op, ignore */
748+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
749+ }
726750
727751 const archiveDir = path . join ( cwd , '.planning' , 'archive' ) ;
728752 let archivedMilestones : string [ ] = [ ] ;
729753 try {
730754 archivedMilestones = fs . readdirSync ( archiveDir , { withFileTypes : true } )
731755 . filter ( e => e . isDirectory ( ) )
732756 . map ( e => e . name ) ;
733- } catch { /* ignore */ }
757+ } catch ( e ) {
758+ /* optional op, ignore */
759+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
760+ }
734761
735762 const result : MilestoneOpContext = {
736763 commit_docs : config . commit_docs ,
@@ -759,7 +786,10 @@ export function cmdInitMapCodebase(cwd: string, raw: boolean): void {
759786 let existingMaps : string [ ] = [ ] ;
760787 try {
761788 existingMaps = fs . readdirSync ( codebaseDir ) . filter ( f => f . endsWith ( '.md' ) ) ;
762- } catch { /* ignore */ }
789+ } catch ( e ) {
790+ /* optional op, ignore */
791+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
792+ }
763793
764794 const result : MapCodebaseContext = {
765795 mapper_model : resolveModelInternal ( cwd , 'maxsim-codebase-mapper' ) ,
@@ -824,14 +854,20 @@ export function cmdInitProgress(cwd: string, raw: boolean): void {
824854 nextPhase = phaseInfo ;
825855 }
826856 }
827- } catch { /* ignore */ }
857+ } catch ( e ) {
858+ /* optional op, ignore */
859+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
860+ }
828861
829862 let pausedAt : string | null = null ;
830863 try {
831864 const state = fs . readFileSync ( path . join ( cwd , '.planning' , 'STATE.md' ) , 'utf-8' ) ;
832865 const pauseMatch = state . match ( / \* \* P a u s e d A t : \* \* \s * ( .+ ) / ) ;
833866 if ( pauseMatch ) pausedAt = pauseMatch [ 1 ] . trim ( ) ;
834- } catch { /* ignore */ }
867+ } catch ( e ) {
868+ /* optional op, ignore */
869+ if ( process . env . MAXSIM_DEBUG ) console . error ( e ) ;
870+ }
835871
836872 const result : ProgressContext = {
837873 executor_model : resolveModelInternal ( cwd , 'maxsim-executor' ) ,
0 commit comments