fix: stabilize rule editor yaml roundtrip
This commit is contained in:
@@ -415,9 +415,9 @@ function parseRules(source: string): RuleSummary[] {
|
||||
group,
|
||||
risk: stripYamlValue(ruleBlock.match(/^\s+risk:\s*(.+)$/m)?.[1] || 'medium'),
|
||||
score: stripYamlValue(ruleBlock.match(/^\s+score:\s*(.+)$/m)?.[1] || '-'),
|
||||
type: stripYamlValue(ruleBlock.match(/^\s+type:\s*(.+)$/m)?.[1] || 'deterministic'),
|
||||
type: stripYamlValue(ruleBlock.match(/^\s{4}type:\s*(.+)$/m)?.[1] || 'deterministic'),
|
||||
checkTypes,
|
||||
logic: stripYamlValue(ruleBlock.match(/^\s+logic:\s*(.+)$/m)?.[1] || ''),
|
||||
logic: stripYamlValue(ruleBlock.match(/^\s{4}logic:\s*(.+)$/m)?.[1] || ''),
|
||||
subRules,
|
||||
subRuleIds: readList(ruleBlock, 'rules'),
|
||||
scope: scope.slice(0, 8),
|
||||
@@ -425,7 +425,7 @@ function parseRules(source: string): RuleSummary[] {
|
||||
stageCount: subRules.length,
|
||||
appliesIn: readFlexibleList(ruleBlock, 'applies_in'),
|
||||
prompt: prompts.join('\n\n'),
|
||||
description: stripYamlValue(ruleBlock.match(/^\s+desc:\s*(.+)$/m)?.[1] || '')
|
||||
description: stripYamlValue(ruleBlock.match(/^\s{4}desc:\s*(.+)$/m)?.[1] || '')
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user