@@ -79,7 +79,7 @@ pub fn {inverse_fn}({params}) -> Result<InverseResult, OblibeniserError> {{
7979 let result = {forward_fn}_mirror_undo({param_csv})?;
8080
8181 // Log the inverse execution to the audit trail.
82- AUDIT_TRAIL.lock().unwrap( ).record(
82+ AUDIT_TRAIL.lock().expect("TODO: handle error" ).record(
8383 "{inverse_fn}",
8484 &hash_params(&[{param_refs}]),
8585 );
@@ -135,7 +135,7 @@ pub fn {inverse_fn}({params}, mutation_log: &MutationLog) -> Result<InverseResul
135135 }}
136136
137137 // Record the replay in the audit trail.
138- AUDIT_TRAIL.lock().unwrap( ).record(
138+ AUDIT_TRAIL.lock().expect("TODO: handle error" ).record(
139139 "{inverse_fn}",
140140 &hash_params(&[{param_refs}]),
141141 );
@@ -160,10 +160,10 @@ pub fn {op_name}_logged({params}) -> Result<MutationLog, OblibeniserError> {{
160160 {forward_fn}_with_log({param_csv}, &mut log)?;
161161
162162 // Store the log for potential future undo.
163- MUTATION_LOGS.lock().unwrap( ).insert(log.id(), log.clone());
163+ MUTATION_LOGS.lock().expect("TODO: handle error" ).insert(log.id(), log.clone());
164164
165165 // Record in audit trail.
166- AUDIT_TRAIL.lock().unwrap( ).record(
166+ AUDIT_TRAIL.lock().expect("TODO: handle error" ).record(
167167 "{op_name}",
168168 &hash_params(&[{param_refs}]),
169169 );
@@ -203,7 +203,7 @@ pub fn {inverse_fn}(snapshot: &StateSnapshot) -> Result<InverseResult, Oblibenis
203203 restore_state(snapshot)?;
204204
205205 // Record the restoration in the audit trail.
206- AUDIT_TRAIL.lock().unwrap( ).record(
206+ AUDIT_TRAIL.lock().expect("TODO: handle error" ).record(
207207 "{inverse_fn}",
208208 &format!("snapshot_seq_{{}}", snapshot.at_sequence),
209209 );
@@ -229,18 +229,18 @@ pub fn {op_name}_with_snapshot({params}) -> Result<StateSnapshot, OblibeniserErr
229229 {forward_fn}({param_csv})?;
230230
231231 // Record in audit trail.
232- AUDIT_TRAIL.lock().unwrap( ).record(
232+ AUDIT_TRAIL.lock().expect("TODO: handle error" ).record(
233233 "{op_name}",
234234 &hash_params(&[{param_refs}]),
235235 );
236236
237237 // Push onto the undo stack with the snapshot.
238- UNDO_STACK.lock().unwrap( ).push(UndoEntry {{
238+ UNDO_STACK.lock().expect("TODO: handle error" ).push(UndoEntry {{
239239 operation_name: "{op_name}".to_string(),
240240 forward_params: serialize_params(&[{param_refs}]),
241241 inverse_params: vec![],
242242 snapshot: Some(snapshot.clone()),
243- audit_sequence: AUDIT_TRAIL.lock().unwrap( ).len() as u64 - 1,
243+ audit_sequence: AUDIT_TRAIL.lock().expect("TODO: handle error" ).len() as u64 - 1,
244244 }});
245245
246246 Ok(snapshot)
@@ -383,7 +383,7 @@ fn capture_params_state(params: &[&dyn std::fmt::Debug]) -> String {{
383383/// Capture full application state (application-specific — implement per project).
384384fn capture_state() -> Result<StateSnapshot, OblibeniserError> {{
385385 Ok(StateSnapshot {{
386- at_sequence: AUDIT_TRAIL.lock().unwrap( ).len() as u64,
386+ at_sequence: AUDIT_TRAIL.lock().expect("TODO: handle error" ).len() as u64,
387387 data: vec![],
388388 }})
389389}}
@@ -458,21 +458,21 @@ max-entries = 1000
458458[undo]
459459max-depth = 50
460460"# ;
461- let m = manifest:: parse_manifest ( toml) . unwrap ( ) ;
462- parser:: parse_manifest ( & m) . unwrap ( )
461+ let m = manifest:: parse_manifest ( toml) . expect ( "TODO: handle error" ) ;
462+ parser:: parse_manifest ( & m) . expect ( "TODO: handle error" )
463463 }
464464
465465 #[ test]
466466 fn test_generate_inverses_count ( ) {
467467 let parsed = test_manifest ( ) ;
468- let inverses = generate_inverses ( & parsed) . unwrap ( ) ;
468+ let inverses = generate_inverses ( & parsed) . expect ( "TODO: handle error" ) ;
469469 assert_eq ! ( inverses. len( ) , 3 ) ;
470470 }
471471
472472 #[ test]
473473 fn test_mirror_inverse_contains_function ( ) {
474474 let parsed = test_manifest ( ) ;
475- let inverses = generate_inverses ( & parsed) . unwrap ( ) ;
475+ let inverses = generate_inverses ( & parsed) . expect ( "TODO: handle error" ) ;
476476 let mirror = & inverses[ 0 ] ;
477477 assert_eq ! ( mirror. function_name, "insert_inverse" ) ;
478478 assert ! ( mirror. code. contains( "pub fn insert_inverse" ) ) ;
@@ -482,7 +482,7 @@ max-depth = 50
482482 #[ test]
483483 fn test_log_replay_inverse_contains_log ( ) {
484484 let parsed = test_manifest ( ) ;
485- let inverses = generate_inverses ( & parsed) . unwrap ( ) ;
485+ let inverses = generate_inverses ( & parsed) . expect ( "TODO: handle error" ) ;
486486 let replay = & inverses[ 1 ] ;
487487 assert_eq ! ( replay. strategy, InverseStrategy :: LogReplay ) ;
488488 assert ! ( replay. code. contains( "mutation_log" ) ) ;
@@ -492,7 +492,7 @@ max-depth = 50
492492 #[ test]
493493 fn test_snapshot_inverse_contains_restore ( ) {
494494 let parsed = test_manifest ( ) ;
495- let inverses = generate_inverses ( & parsed) . unwrap ( ) ;
495+ let inverses = generate_inverses ( & parsed) . expect ( "TODO: handle error" ) ;
496496 let snapshot = & inverses[ 2 ] ;
497497 assert_eq ! ( snapshot. strategy, InverseStrategy :: Snapshot ) ;
498498 assert ! ( snapshot. code. contains( "restore_state" ) ) ;
@@ -502,7 +502,7 @@ max-depth = 50
502502 #[ test]
503503 fn test_generate_inverse_module_complete ( ) {
504504 let parsed = test_manifest ( ) ;
505- let module = generate_inverse_module ( & parsed) . unwrap ( ) ;
505+ let module = generate_inverse_module ( & parsed) . expect ( "TODO: handle error" ) ;
506506 assert ! ( module. contains( "SPDX-License-Identifier: PMPL-1.0-or-later" ) ) ;
507507 assert ! ( module. contains( "Generated by oblibeniser" ) ) ;
508508 assert ! ( module. contains( "pub fn insert_inverse" ) ) ;
0 commit comments