Skip to content

Commit 1c9d5be

Browse files
synthesis: add audit export secret examples
1 parent a8ab5c7 commit 1c9d5be

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
@@ -527,6 +527,8 @@ const FORMULA_EXAMPLE_GROUPS: &[FormulaExampleGroup] = &[
527527
r#"always([+PURGE_DEBUG_BUNDLES] true -> eventually(<+NOTIFY_SUPPORT_ENGINEERING_OWNER> true))"#,
528528
r#"always([+DIAGNOSTIC_REPORT_SECRET_LEAKED] true -> (<+PURGE_DIAGNOSTIC_REPORTS> true | <+REVOKE_DIAGNOSTIC_EXPOSED_CREDENTIALS> true))"#,
529529
r#"always([+PURGE_DIAGNOSTIC_REPORTS] true -> eventually(<+NOTIFY_DIAGNOSTICS_OWNER> true))"#,
530+
r#"always([+AUDIT_EXPORT_SECRET_LEAKED] true -> (<+PURGE_AUDIT_EXPORTS> true | <+REVOKE_AUDIT_EXPOSED_CREDENTIALS> true))"#,
531+
r#"always([+PURGE_AUDIT_EXPORTS] true -> eventually(<+NOTIFY_COMPLIANCE_OWNER> true))"#,
530532
r#"next(<+APPROVE> true)"#,
531533
r#"next((<+APPROVE> true | [<+REJECT>] true))"#,
532534
r#"<+WAIT> true until <+APPROVE> true"#,
@@ -5243,6 +5245,18 @@ F2: formula generated_2 {
52435245
));
52445246
}
52455247

5248+
#[test]
5249+
fn synthesis_list_includes_audit_export_secret_leak_prompt_examples() {
5250+
let output = synthesis_list_text();
5251+
5252+
assert!(output.contains(
5253+
"always([+AUDIT_EXPORT_SECRET_LEAKED] true -> (<+PURGE_AUDIT_EXPORTS> true | <+REVOKE_AUDIT_EXPOSED_CREDENTIALS> true))"
5254+
));
5255+
assert!(output.contains(
5256+
"always([+PURGE_AUDIT_EXPORTS] true -> eventually(<+NOTIFY_COMPLIANCE_OWNER> true))"
5257+
));
5258+
}
5259+
52465260
#[test]
52475261
fn synthesis_list_includes_escrow_progression_prompt_examples() {
52485262
let output = synthesis_list_text();
@@ -15458,6 +15472,22 @@ gfp(X, []((X)) & ([<+ARCHIVE>] true))
1545815472
verify_synthesized_model(&model, &formulas).unwrap();
1545915473
}
1546015474

15475+
#[test]
15476+
fn verify_synthesized_model_accepts_audit_export_secret_leak_prompt_examples() {
15477+
let formulas = parse_formula_strings(&[
15478+
"always([+AUDIT_EXPORT_SECRET_LEAKED] true -> (<+PURGE_AUDIT_EXPORTS> true | <+REVOKE_AUDIT_EXPOSED_CREDENTIALS> true))"
15479+
.to_string(),
15480+
"always([+PURGE_AUDIT_EXPORTS] true -> eventually(<+NOTIFY_COMPLIANCE_OWNER> true))"
15481+
.to_string(),
15482+
]);
15483+
let model = modality_lang::formula_synthesis::synthesize_from_formulas(
15484+
"AuditExportSecretLeak",
15485+
&formulas,
15486+
);
15487+
15488+
verify_synthesized_model(&model, &formulas).unwrap();
15489+
}
15490+
1546115491
#[test]
1546215492
fn verify_synthesized_model_accepts_mixed_alternatives_with_signer_requirement() {
1546315493
let formulas = parse_formula_strings(&[

0 commit comments

Comments
 (0)