feat(simulation): Sprint 27 server — zone templates, Clippy, audit #94

Closed
jpmschweitzer wants to merge 0 commits from server into main
Owner

Summary

Sprint 27 server team deliverables — all 5 tickets complete:

  • #669 — Move content/ under server/ (colocate with consumer)
  • #663 — Add ZoneTypeTemplate, LocationSpec, and supporting structs for D-142 zone-type architecture. Both existing RON files validate and deserialize correctly.
  • #635 — Fix all Clippy warnings (84 files, 2411+/1341-). Server now passes cargo clippy -- --deny warnings cleanly. Tuned .clippy.toml thresholds for Bevy ECS signatures.
  • #637 — Add cargo audit with make audit target, wired into make pre-pr and pre-commit hook (conditional on Cargo.toml/Cargo.lock changes). RUSTSEC-2025-0141 (bincode) ignored pending #636.
  • #672 — Survey 63 v0.1 YAML files: 14 deprecated, 25 convertible, 4 superseded, 20 infrastructure. No deletions — flag-only audit document.

Verification

  • cargo check — clean
  • cargo clippy -- --deny warnings — zero warnings
  • cargo test --lib — 1147 tests pass
  • cargo audit — 0 vulnerabilities (1 allowed warning)
  • tooling/validate-ron server/content/global/zone-types/rural_agricultural.ron zone_type — passes

Test plan

  • make pre-pr-server passes
  • RON deserialization tests for both zone-type templates pass
  • make audit runs without error
  • Content paths resolve correctly after content/server/content/ move
## Summary Sprint 27 server team deliverables — all 5 tickets complete: - **#669** — Move `content/` under `server/` (colocate with consumer) - **#663** — Add `ZoneTypeTemplate`, `LocationSpec`, and supporting structs for D-142 zone-type architecture. Both existing RON files validate and deserialize correctly. - **#635** — Fix all Clippy warnings (84 files, 2411+/1341-). Server now passes `cargo clippy -- --deny warnings` cleanly. Tuned `.clippy.toml` thresholds for Bevy ECS signatures. - **#637** — Add `cargo audit` with `make audit` target, wired into `make pre-pr` and pre-commit hook (conditional on Cargo.toml/Cargo.lock changes). RUSTSEC-2025-0141 (bincode) ignored pending #636. - **#672** — Survey 63 v0.1 YAML files: 14 deprecated, 25 convertible, 4 superseded, 20 infrastructure. No deletions — flag-only audit document. ## Verification - `cargo check` — clean - `cargo clippy -- --deny warnings` — zero warnings - `cargo test --lib` — 1147 tests pass - `cargo audit` — 0 vulnerabilities (1 allowed warning) - `tooling/validate-ron server/content/global/zone-types/rural_agricultural.ron zone_type` — passes ## Test plan - [ ] `make pre-pr-server` passes - [ ] RON deserialization tests for both zone-type templates pass - [ ] `make audit` runs without error - [ ] Content paths resolve correctly after `content/` → `server/content/` move
jpmschweitzer added 5 commits 2026-03-17 12:08:41 +01:00
Content files (RON templates, YAML campaigns, gauntlet data) are consumed
exclusively by the server. Colocate them at server/content/ and update all
path references in Rust source, tooling scripts, and schema files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implement the zone-type template architecture: ZoneTypeTemplate (behavior
pools per zone category), LocationSpec (instance metadata with role weights),
SocialSiteTypeSpec, RoleWeight, and LocationSocialSite. Add deserialization
tests for rural_agricultural.ron and industrial_freight.ron. Existing ZoneSpec
kept for backward compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix all Clippy warnings across the server codebase (2411 insertions, 1341
deletions). Raise type-complexity-threshold to 750 and too-many-arguments
to 12 in .clippy.toml for idiomatic Bevy ECS system signatures. The server
now passes `cargo clippy -- --deny warnings` cleanly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add `make audit` target running `cargo audit` with an advisory ignore for
RUSTSEC-2025-0141 (bincode, tracked by #636). Wire audit into `make pre-pr`
and `make pre-pr-server`. Add conditional cargo audit to the pre-commit hook
(triggers only when Cargo.toml/Cargo.lock are staged).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Survey 63 YAML files across content/, data/templates/, and client/data/:
14 deprecated (named NPC detective arc), 25 convertible (reusable schemas,
enums, factions), 4 already-superseded, 20 infrastructure. No deletions —
flag-only audit with recommended disposition priorities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Owner

Review: server → main (type: code) — PR #94

Hoshe (Code Quality): APPROVE

Well-executed sprint. ZoneTypeTemplate/LocationSpec structs are clearly specified and thoroughly tested. Clippy enforcement banning HashMap/HashSet is the right call for determinism. Cargo audit setup is correctly scoped. All changes are suggestion-level only.

# File Severity Issue
1 blueprint.rs:~299 suggestion No test for modifier hint matching a category with zero entries then falling back with trace log firing.
2 generator_spike.rs:~514 suggestion pick_role unreachable fallback to roles[0] — should be unreachable!() or commented.
3 generator_spike.rs:~541 suggestion build_behavior_pools calls assemble_behaviors with context_filter: None — needs a note that production will need context from NPC assignment.
4 .config/hooks/pre-commit:24 suggestion Hook calls tooling/check-decision-ids which doesn't exist yet. Degrades gracefully but will warn on every commit.
5 server/audit.toml:9 suggestion Ignored advisory has no expiry mechanism. Add sprint target comment.
6 v01-yaml-content-audit.md:89 suggestion Grep command targets data/templates but actual path is server/data/templates/.
7 triangle_escalation.rs:333-340 suggestion Dead first world/entity setup — only second world is asserted against.
8 storyteller/mod.rs:~554 suggestion f32 exact equality comment relies on weights being powers of two. Add constraint note.

Tyre (Architecture): APPROVE

Clean D-142 implementation. Template/instance separation is correct — ZoneTypeTemplate (behavior pool, no weights) vs LocationSpec (weights, overrides, concrete sites). All new code uses BTreeMap/VecDeque — D-010 determinism compliance intact. No HashMap anywhere.

# File Severity Issue
1 generator_spike.rs:312-318 suggestion Hardcoded min_npcs: 1, max_npcs: 6 for all social sites. Add TODO pointing at LocationSocialSite as eventual source.
2 generator_spike.rs:356 suggestion traits_contradict duplicated from npc/generate.rs. Flag for integration ticket to expose as pub(crate).
3 blueprint.rs module suggestion ZoneSpec (legacy) and ZoneTypeTemplate (D-142) coexist. Add #[deprecated] to ZoneSpec once LocationSpec can fully drive the generator.
4 validate_ron.rs:125-137 suggestion No referential integrity check — eligible_roles values aren't validated against RoleSpec.id in the same template. Easy win for copy team authoring errors.
5 audit.toml suggestion Add expected resolution sprint to the ignored advisory comment.
6 storyteller/mod.rs header suggestion Module docs still reference v0.1 detective arc framing. Known debt, audit flagged it.
7 .config/hooks/pre-commit:30 suggestion Add comment clarifying why cd "$REPO_ROOT/server" is needed for worktree compatibility.

Verdict: APPROVED

All issues are suggestion-level only. Both reviewers approve. Clean merge.

Three easy-win suggestions will be applied post-merge:

  1. eligible_roles referential integrity in validate_ron
  2. Grep path fix in v01-yaml-content-audit.md
  3. Pre-commit hook — remove nonexistent check-decision-ids call
## Review: server → main (type: code) — PR #94 ### Hoshe (Code Quality): APPROVE Well-executed sprint. ZoneTypeTemplate/LocationSpec structs are clearly specified and thoroughly tested. Clippy enforcement banning HashMap/HashSet is the right call for determinism. Cargo audit setup is correctly scoped. All changes are suggestion-level only. | # | File | Severity | Issue | |---|------|----------|-------| | 1 | blueprint.rs:~299 | suggestion | No test for modifier hint matching a category with zero entries then falling back with trace log firing. | | 2 | generator_spike.rs:~514 | suggestion | `pick_role` unreachable fallback to `roles[0]` — should be `unreachable!()` or commented. | | 3 | generator_spike.rs:~541 | suggestion | `build_behavior_pools` calls `assemble_behaviors` with `context_filter: None` — needs a note that production will need context from NPC assignment. | | 4 | .config/hooks/pre-commit:24 | suggestion | Hook calls `tooling/check-decision-ids` which doesn't exist yet. Degrades gracefully but will warn on every commit. | | 5 | server/audit.toml:9 | suggestion | Ignored advisory has no expiry mechanism. Add sprint target comment. | | 6 | v01-yaml-content-audit.md:89 | suggestion | Grep command targets `data/templates` but actual path is `server/data/templates/`. | | 7 | triangle_escalation.rs:333-340 | suggestion | Dead first world/entity setup — only second world is asserted against. | | 8 | storyteller/mod.rs:~554 | suggestion | f32 exact equality comment relies on weights being powers of two. Add constraint note. | ### Tyre (Architecture): APPROVE Clean D-142 implementation. Template/instance separation is correct — `ZoneTypeTemplate` (behavior pool, no weights) vs `LocationSpec` (weights, overrides, concrete sites). All new code uses BTreeMap/VecDeque — D-010 determinism compliance intact. No HashMap anywhere. | # | File | Severity | Issue | |---|------|----------|-------| | 1 | generator_spike.rs:312-318 | suggestion | Hardcoded `min_npcs: 1, max_npcs: 6` for all social sites. Add TODO pointing at `LocationSocialSite` as eventual source. | | 2 | generator_spike.rs:356 | suggestion | `traits_contradict` duplicated from `npc/generate.rs`. Flag for integration ticket to expose as `pub(crate)`. | | 3 | blueprint.rs module | suggestion | `ZoneSpec` (legacy) and `ZoneTypeTemplate` (D-142) coexist. Add `#[deprecated]` to `ZoneSpec` once LocationSpec can fully drive the generator. | | 4 | validate_ron.rs:125-137 | suggestion | No referential integrity check — `eligible_roles` values aren't validated against `RoleSpec.id` in the same template. Easy win for copy team authoring errors. | | 5 | audit.toml | suggestion | Add expected resolution sprint to the ignored advisory comment. | | 6 | storyteller/mod.rs header | suggestion | Module docs still reference v0.1 detective arc framing. Known debt, audit flagged it. | | 7 | .config/hooks/pre-commit:30 | suggestion | Add comment clarifying why `cd "$REPO_ROOT/server"` is needed for worktree compatibility. | ### Verdict: APPROVED All issues are suggestion-level only. Both reviewers approve. Clean merge. Three easy-win suggestions will be applied post-merge: 1. `eligible_roles` referential integrity in validate_ron 2. Grep path fix in v01-yaml-content-audit.md 3. Pre-commit hook — remove nonexistent `check-decision-ids` call
jpmschweitzer closed this pull request 2026-03-17 12:17:54 +01:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jpmschweitzer/settled-reach#94