refactor(simulation): Sprint 31 — split atlas.rs into modules #111

Closed
jpmschweitzer wants to merge 0 commits from sprint-31/server into main
Owner

Summary

  • Split monolithic atlas.rs (2119 lines) into 8 focused modules under src/bin/atlas/
  • Modules: main.rs (thin dispatch), common.rs (shared types/helpers), show.rs, mutate.rs, stats.rs, systems.rs, author.rs, sync_wiki.rs
  • No behavior change — pure refactoring of code organization
  • Closes #776

Verification

  • cargo build --bin atlas — clean, 0 warnings
  • cargo clippy -- -D warnings — clean
  • cargo test --lib — 1147 passed, 0 failed
  • CLI smoke tests: stats, corridor-status, show-system, list-bodies all verified against baseline

Architecture

  • common.rs is the dependency leaf — shared types + DB helpers
  • All command modules depend only on common
  • main.rs dispatch: each match arm is module::cmd_fn(&conn, args...)
  • Commands enum stays in main.rs only — no leaking into modules
## Summary - Split monolithic `atlas.rs` (2119 lines) into 8 focused modules under `src/bin/atlas/` - Modules: main.rs (thin dispatch), common.rs (shared types/helpers), show.rs, mutate.rs, stats.rs, systems.rs, author.rs, sync_wiki.rs - No behavior change — pure refactoring of code organization - Closes #776 ## Verification - `cargo build --bin atlas` — clean, 0 warnings - `cargo clippy -- -D warnings` — clean - `cargo test --lib` — 1147 passed, 0 failed - CLI smoke tests: `stats`, `corridor-status`, `show-system`, `list-bodies` all verified against baseline ## Architecture - `common.rs` is the dependency leaf — shared types + DB helpers - All command modules depend only on `common` - `main.rs` dispatch: each match arm is `module::cmd_fn(&conn, args...)` - Commands enum stays in `main.rs` only — no leaking into modules
jpmschweitzer added 4 commits 2026-04-05 09:40:53 +02:00
Extract 2119-line monolithic atlas.rs into 8 focused modules under
src/bin/atlas/: main.rs (thin dispatch), common.rs (shared types and
DB helpers), show.rs, mutate.rs, stats.rs, systems.rs, author.rs,
and sync_wiki.rs. Commands enum stays in main.rs; each match arm
delegates to module::cmd_fn(&conn, args). No behavior change.

Closes #776.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The refactor from &Commands to individual parameters exposed the
13-argument signature to clippy. Allow attribute is appropriate
here — the parameters map 1:1 to DB columns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

Review: sprint-31/server -> main (type: code)

Reviewers: Hoshe (code quality), Tyre (architecture)

Hoshe (Code Quality): REQUEST_CHANGES

Refactor is correct — all 16 subcommands present, logic faithfully moved. One structural issue.

# File Severity Issue
1 server/CHANGELOG.md warning Changelog written to wrong file. Project CHANGELOG lives at root CHANGELOG.md. Delete server/CHANGELOG.md and add entry to root.
2 server/src/bin/atlas/mutate.rs suggestion cmd_add_body takes 13 params with #[allow(clippy::too_many_arguments)] — consider BodyArgs struct in future.

Tyre (Architecture): APPROVE

Clean star-topology module decomposition. No circular dependencies. Follows Rust binary crate conventions correctly.

# File Severity Issue
1 show.rs:48-76 warning cmd_show_body manually duplicates 16-column SELECT from common::query_bodies. Should use shared query_body_by_id helper — maintenance trap.
2 systems.rs suggestion Positional idx counter with let _ = idx suppression — needs clarifying comment.

Verdict: CHANGES REQUESTED

Fix the changelog location (Hoshe #1). The show.rs SQL duplication (Tyre #1) is a follow-up ticket, not a blocker.

## Review: sprint-31/server -> main (type: code) Reviewers: Hoshe (code quality), Tyre (architecture) ### Hoshe (Code Quality): REQUEST_CHANGES Refactor is correct — all 16 subcommands present, logic faithfully moved. One structural issue. | # | File | Severity | Issue | |---|------|----------|-------| | 1 | `server/CHANGELOG.md` | warning | Changelog written to wrong file. Project CHANGELOG lives at root `CHANGELOG.md`. Delete `server/CHANGELOG.md` and add entry to root. | | 2 | `server/src/bin/atlas/mutate.rs` | suggestion | `cmd_add_body` takes 13 params with `#[allow(clippy::too_many_arguments)]` — consider `BodyArgs` struct in future. | ### Tyre (Architecture): APPROVE Clean star-topology module decomposition. No circular dependencies. Follows Rust binary crate conventions correctly. | # | File | Severity | Issue | |---|------|----------|-------| | 1 | `show.rs:48-76` | warning | `cmd_show_body` manually duplicates 16-column SELECT from `common::query_bodies`. Should use shared `query_body_by_id` helper — maintenance trap. | | 2 | `systems.rs` | suggestion | Positional `idx` counter with `let _ = idx` suppression — needs clarifying comment. | ### Verdict: CHANGES REQUESTED Fix the changelog location (Hoshe #1). The `show.rs` SQL duplication (Tyre #1) is a follow-up ticket, not a blocker.
jpmschweitzer added 1 commit 2026-04-05 09:57:01 +02:00
Remove erroneous server/CHANGELOG.md and add the atlas split entry
to the project root CHANGELOG.md where it belongs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

Review Round 2: APPROVED

Changelog fix confirmed — server/CHANGELOG.md deleted, entry moved to root CHANGELOG.md under [Unreleased].

Merged to main.

## Review Round 2: APPROVED Changelog fix confirmed — `server/CHANGELOG.md` deleted, entry moved to root `CHANGELOG.md` under `[Unreleased]`. Merged to main.
jpmschweitzer closed this pull request 2026-04-05 09:59:59 +02: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#111