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:
@@ -21,7 +21,8 @@ run_check() {
|
||||
|
||||
# --- Checks ---
|
||||
run_check "tooling/check-fact-ids" "fact_id validation"
|
||||
run_check "tooling/check-decision-ids" "decision ID duplication"
|
||||
# TODO: uncomment when tooling/check-decision-ids is implemented
|
||||
# run_check "tooling/check-decision-ids" "decision ID duplication"
|
||||
|
||||
# Run cargo audit only when Cargo.toml or Cargo.lock changed
|
||||
if git diff --cached --name-only | grep -qE '(Cargo\.toml|Cargo\.lock)$'; then
|
||||
|
||||
@@ -86,7 +86,7 @@ These files were authored before the RON zone-type system. The zone-type RON fil
|
||||
| `server/data/templates/terminal-social-site.yaml` | Social site definitions in RON zone-type files |
|
||||
| `server/data/templates/terminal-triangle-01.yaml` | Triangle definitions will move to RON format via #663 |
|
||||
|
||||
**Edge case:** verify with `grep -r "data/templates"` that no Rust code still loads these paths before deletion. The `generator_spike.rs` binary uses `content/global/` paths, not `data/templates/`.
|
||||
**Edge case:** verify with `grep -r "data/templates" server/src/` that no Rust code still loads these paths before deletion. The `generator_spike.rs` binary uses `content/global/` paths, not `data/templates/`.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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