@@ -441,7 +441,14 @@ pub struct FileStatistics {
441441 pub lines : usize ,
442442 pub unsafe_blocks : usize ,
443443 pub panic_sites : usize ,
444+ /// `.unwrap()` and `.expect(` calls only — these can panic.
445+ /// Excluded from this count: `.unwrap_or()`, `.unwrap_or_default()`,
446+ /// `.unwrap_or_else()` — those are safe fallbacks (see `safe_unwrap_calls`).
444447 pub unwrap_calls : usize ,
448+ /// Non-panicking unwrap variants: `.unwrap_or(`, `.unwrap_or_default()`,
449+ /// `.unwrap_or_else(`. Not counted toward PA006 (PanicPath).
450+ #[ serde( default , skip_serializing_if = "is_zero" ) ]
451+ pub safe_unwrap_calls : usize ,
445452 pub allocation_sites : usize ,
446453 pub io_operations : usize ,
447454 pub threading_constructs : usize ,
@@ -462,6 +469,10 @@ pub struct FileStatistics {
462469/// Assail analysis results
463470#[ derive( Debug , Clone , Serialize , Deserialize ) ]
464471pub struct AssailReport {
472+ /// Semantic version of the report schema. Consumers must check this
473+ /// before parsing to detect incompatible drift. Current: "2.5".
474+ #[ serde( default = "assail_schema_version" ) ]
475+ pub schema_version : String ,
465476 pub program_path : PathBuf ,
466477 pub language : Language ,
467478 pub frameworks : Vec < Framework > ,
@@ -486,12 +497,25 @@ fn is_zero(n: &usize) -> bool {
486497 * n == 0
487498}
488499
500+ fn assail_schema_version ( ) -> String {
501+ "2.5" . to_string ( )
502+ }
503+
504+ fn assault_schema_version ( ) -> String {
505+ "2.5" . to_string ( )
506+ }
507+
489508#[ derive( Debug , Clone , Default , Serialize , Deserialize ) ]
490509pub struct ProgramStatistics {
491510 pub total_lines : usize ,
492511 pub unsafe_blocks : usize ,
493512 pub panic_sites : usize ,
513+ /// `.unwrap()` and `.expect(` calls only — these can panic.
494514 pub unwrap_calls : usize ,
515+ /// Non-panicking unwrap variants: `.unwrap_or(`, `.unwrap_or_default()`,
516+ /// `.unwrap_or_else(`. Not counted toward PA006 (PanicPath).
517+ #[ serde( default , skip_serializing_if = "is_zero" ) ]
518+ pub safe_unwrap_calls : usize ,
495519 pub allocation_sites : usize ,
496520 pub io_operations : usize ,
497521 pub threading_constructs : usize ,
@@ -573,6 +597,8 @@ pub struct CrashReport {
573597/// Complete assault report
574598#[ derive( Debug , Clone , Serialize , Deserialize ) ]
575599pub struct AssaultReport {
600+ #[ serde( default = "assault_schema_version" ) ]
601+ pub schema_version : String ,
576602 pub assail_report : AssailReport ,
577603 pub attack_results : Vec < AttackResult > ,
578604 pub total_crashes : usize ,
0 commit comments