99mod init;
1010mod input;
1111mod render;
12+ mod report;
1213mod scanner;
1314mod setup;
1415
@@ -1184,6 +1185,9 @@ fn run_self_update() -> Result<(), Box<dyn std::error::Error>> {
11841185 // Clone or pull
11851186 if src_dir. join ( ".git" ) . exists ( ) {
11861187 eprintln ! ( " {dim}Pulling latest...{nc}" ) ;
1188+ let _ = Command :: new ( "git" )
1189+ . args ( [ "-C" , & src_dir. to_string_lossy ( ) , "checkout" , "dev" , "--quiet" ] )
1190+ . status ( ) ;
11871191 let pull = Command :: new ( "git" )
11881192 . args ( [ "-C" , & src_dir. to_string_lossy ( ) , "pull" , "--quiet" ] )
11891193 . status ( ) ;
@@ -1209,6 +1213,7 @@ fn run_self_update() -> Result<(), Box<dyn std::error::Error>> {
12091213 . args ( [
12101214 "clone" ,
12111215 "--quiet" ,
1216+ "--branch" , "dev" ,
12121217 "https://github.com/itwizardo/hackcode.git" ,
12131218 & src_dir. to_string_lossy ( ) ,
12141219 ] )
@@ -3849,6 +3854,16 @@ impl LiveCli {
38493854 format_auto_compaction_notice( event. removed_message_count)
38503855 ) ;
38513856 }
3857+
3858+ // Auto-generate PDF report if the response is a security audit
3859+ let response_text = final_assistant_text ( & summary) ;
3860+ if report:: is_audit_report ( & response_text) {
3861+ match report:: generate_report ( & response_text) {
3862+ Ok ( path) => report:: print_report_saved ( & path) ,
3863+ Err ( e) => eprintln ! ( "\x1b [91m[HackCode]\x1b [0m Failed to save report: {e}" ) ,
3864+ }
3865+ }
3866+
38523867 self . persist_session ( ) ?;
38533868 Ok ( ( ) )
38543869 }
0 commit comments