fix(simulation): apply PR #94 review suggestions
- validate_ron: add eligible_roles referential integrity check against defined RoleSpec.id values in zone-type templates - v01-yaml-content-audit.md: fix grep path from data/templates to server/data/templates in the superseded-files verification command - pre-commit hook: comment out nonexistent check-decision-ids script to stop per-commit warnings until the script is implemented Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -122,6 +122,8 @@ fn main() {
|
||||
eprintln!(" WARNING: no roles defined — generator will reject this");
|
||||
warnings += 1;
|
||||
}
|
||||
let role_ids: Vec<&str> =
|
||||
template.roles.iter().map(|r| r.id.as_str()).collect();
|
||||
for role in &template.roles {
|
||||
if role.behavior_primitives.is_empty() {
|
||||
eprintln!(
|
||||
@@ -131,6 +133,17 @@ fn main() {
|
||||
warnings += 1;
|
||||
}
|
||||
}
|
||||
for site in &template.social_site_types {
|
||||
for eligible in &site.eligible_roles {
|
||||
if !role_ids.contains(&eligible.as_str()) {
|
||||
eprintln!(
|
||||
" WARNING: social site '{}' references eligible_role '{}' which is not a defined role",
|
||||
site.site_type, eligible
|
||||
);
|
||||
warnings += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if warnings > 0 {
|
||||
process::exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user