Skip to content

Commit 3f33b58

Browse files
synthesis: add crash dump secret examples
1 parent e799416 commit 3f33b58

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

rust/modality/src/cmds/synthesize.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ const FORMULA_EXAMPLE_GROUPS: &[FormulaExampleGroup] = &[
511511
r#"always([+ROTATE_VAULTED_SECRETS] true -> eventually(<+NOTIFY_SECURITY_OWNER> true))"#,
512512
r#"always([+ERROR_LOG_SECRET_LEAKED] true -> (<+REDACT_ERROR_LOGS> true | <+REVOKE_LOG_EXPOSED_CREDENTIALS> true))"#,
513513
r#"always([+REDACT_ERROR_LOGS] true -> eventually(<+NOTIFY_OBSERVABILITY_OWNER> true))"#,
514+
r#"always([+CRASH_DUMP_SECRET_LEAKED] true -> (<+PURGE_CRASH_DUMPS> true | <+REVOKE_CRASH_EXPOSED_CREDENTIALS> true))"#,
515+
r#"always([+PURGE_CRASH_DUMPS] true -> eventually(<+NOTIFY_RUNTIME_OWNER> true))"#,
514516
r#"next(<+APPROVE> true)"#,
515517
r#"next((<+APPROVE> true | [<+REJECT>] true))"#,
516518
r#"<+WAIT> true until <+APPROVE> true"#,
@@ -5131,6 +5133,18 @@ F2: formula generated_2 {
51315133
));
51325134
}
51335135

5136+
#[test]
5137+
fn synthesis_list_includes_crash_dump_secret_leak_prompt_examples() {
5138+
let output = synthesis_list_text();
5139+
5140+
assert!(output.contains(
5141+
"always([+CRASH_DUMP_SECRET_LEAKED] true -> (<+PURGE_CRASH_DUMPS> true | <+REVOKE_CRASH_EXPOSED_CREDENTIALS> true))"
5142+
));
5143+
assert!(output.contains(
5144+
"always([+PURGE_CRASH_DUMPS] true -> eventually(<+NOTIFY_RUNTIME_OWNER> true))"
5145+
));
5146+
}
5147+
51345148
#[test]
51355149
fn synthesis_list_includes_escrow_progression_prompt_examples() {
51365150
let output = synthesis_list_text();
@@ -15218,6 +15232,22 @@ gfp(X, []((X)) & ([<+ARCHIVE>] true))
1521815232
verify_synthesized_model(&model, &formulas).unwrap();
1521915233
}
1522015234

15235+
#[test]
15236+
fn verify_synthesized_model_accepts_crash_dump_secret_leak_prompt_examples() {
15237+
let formulas = parse_formula_strings(&[
15238+
"always([+CRASH_DUMP_SECRET_LEAKED] true -> (<+PURGE_CRASH_DUMPS> true | <+REVOKE_CRASH_EXPOSED_CREDENTIALS> true))"
15239+
.to_string(),
15240+
"always([+PURGE_CRASH_DUMPS] true -> eventually(<+NOTIFY_RUNTIME_OWNER> true))"
15241+
.to_string(),
15242+
]);
15243+
let model = modality_lang::formula_synthesis::synthesize_from_formulas(
15244+
"CrashDumpSecretLeak",
15245+
&formulas,
15246+
);
15247+
15248+
verify_synthesized_model(&model, &formulas).unwrap();
15249+
}
15250+
1522115251
#[test]
1522215252
fn verify_synthesized_model_accepts_mixed_alternatives_with_signer_requirement() {
1522315253
let formulas = parse_formula_strings(&[

0 commit comments

Comments
 (0)