feat(simulation): test client binary + text renderer (Sprint 8 server) #28

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

Summary

  • #481: Snapshot text renderer library (server/src/bridge/text_renderer.rs) — format_snapshot_text(&ObserverSnapshot) -> String pub-exported, entity labels as kind:entity_id sorted by distance, 10 unit tests
  • #480: Test client binary scaffolding (tooling/test-client/) — standalone crate with CLI (--connect, --replay, --text, --json, --quiet, --golden, --ticks), exit codes 0/1/2, golden file JSON diff, JSONL replay loader
  • Rustfmt formatting pass on existing server source and test files (no logic changes)

Completes Sprint 8 server work (22/22 tickets done).

Test plan

  • Server: 462 tests pass (423 unit + integration + serialization)
  • Test client: builds clean, clippy clean, rustfmt clean
  • Architecture review by Tyre — conditional approve, 2 must-fix items resolved (binary name, input serialization format)
  • QA validation by Hoshe — full checklist passed
  • Reviewer: verify binary name is settled-reach-test-client in Cargo.toml
  • Reviewer: verify rmp_serde::to_vec (not to_vec_named) in main.rs line 155

🤖 Generated with Claude Code

## Summary - **#481**: Snapshot text renderer library (`server/src/bridge/text_renderer.rs`) — `format_snapshot_text(&ObserverSnapshot) -> String` pub-exported, entity labels as kind:entity_id sorted by distance, 10 unit tests - **#480**: Test client binary scaffolding (`tooling/test-client/`) — standalone crate with CLI (--connect, --replay, --text, --json, --quiet, --golden, --ticks), exit codes 0/1/2, golden file JSON diff, JSONL replay loader - Rustfmt formatting pass on existing server source and test files (no logic changes) Completes Sprint 8 server work (22/22 tickets done). ## Test plan - [x] Server: 462 tests pass (423 unit + integration + serialization) - [x] Test client: builds clean, clippy clean, rustfmt clean - [x] Architecture review by Tyre — conditional approve, 2 must-fix items resolved (binary name, input serialization format) - [x] QA validation by Hoshe — full checklist passed - [ ] Reviewer: verify binary name is `settled-reach-test-client` in Cargo.toml - [ ] Reviewer: verify `rmp_serde::to_vec` (not `to_vec_named`) in main.rs line 155 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jpmschweitzer added 5 commits 2026-02-18 01:41:00 +01:00
format_snapshot_text(&ObserverSnapshot) -> String pub-exported from
server crate. Entity labels as kind:entity_id sorted by distance,
room name stubbed as (unknown) until Gauntlet constants land.
10 unit tests. Consumed by tooling/test-client for --text mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Separate workspace crate at tooling/test-client/ importing bridge
types from server crate. CLI: --connect, --replay, --text, --json,
--quiet, --golden, --ticks. Exit codes: 0=success, 1=golden mismatch,
2=connection error. Golden file comparison with recursive JSON diff.
JSONL replay loader for tick-scheduled input sending.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Formatting-only changes across server source and test files.
No logic changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Follows existing tooling crate pattern (content-converter, line-previewer).

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

Review: server → main (PR #28, type: code)

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

Hoshe (Code Quality): APPROVE

Solid infrastructure work with thorough test coverage.

# File Severity Issue
1 test-client/src/main.rs:69-74 warning --text flag silently redundant — never read in OutputMode selection. --text --json gives Json with no warning. Fix: clap ArgGroup or --format text|json|quiet.
2 test-client/src/main.rs:~131 suggestion serde_json::to_string_pretty().unwrap() breaks consistent error-handling pattern. Replace with unwrap_or_else.
3 text_renderer.rs suggestion Entity distance (Manhattan) vs NearbyInteraction.distance may use different metrics — clarifying comment worthwhile.
4 golden.rs suggestion Root JSON path starts with . (.tick not tick) — looks like typo in CI output.
5 replay.rs suggestion Document tick offset: "line 0 = inputs sent in response to snapshot 1."

Tyre (Architecture): APPROVE

Disciplined test infrastructure consistent with D-020 and D-030. Text renderer has excellent coverage (10 tests). Golden diff is clean.

# File Severity Issue
1 text_renderer.rs warning Lives in bridge/ but never used by server binary. Better home: dev_support/ or behind feature flag. Track for relocation.
2 test-client/Cargo.toml warning Path dependency exposes entire server crate. Long-term: extract settled-reach-bridge sub-crate. Track it.
3 text_renderer.rs:8 suggestion Redundant use crate::knowledge::types::{...} — already re-exported through bridge::types::* glob.
4 main.rs:~130 suggestion Golden comparison only checks final snapshot. Per-tick golden files needed for Gauntlet wow-moment testing.
5 main.rs:~130 suggestion tick_count variable name ambiguous — a replay_index alias with comment would clarify.
6 Cargo.toml suggestion Standalone Cargo.lock intentional. Confirm CI/Makefile builds with explicit --manifest-path.

Verdict: APPROVED

## Review: server → main (PR #28, type: code) Reviewers: Hoshe (code quality), Tyre (architecture) ### Hoshe (Code Quality): APPROVE Solid infrastructure work with thorough test coverage. | # | File | Severity | Issue | |---|------|----------|-------| | 1 | test-client/src/main.rs:69-74 | warning | `--text` flag silently redundant — never read in OutputMode selection. `--text --json` gives Json with no warning. Fix: clap ArgGroup or `--format text\|json\|quiet`. | | 2 | test-client/src/main.rs:~131 | suggestion | `serde_json::to_string_pretty().unwrap()` breaks consistent error-handling pattern. Replace with `unwrap_or_else`. | | 3 | text_renderer.rs | suggestion | Entity distance (Manhattan) vs NearbyInteraction.distance may use different metrics — clarifying comment worthwhile. | | 4 | golden.rs | suggestion | Root JSON path starts with `.` (`.tick` not `tick`) — looks like typo in CI output. | | 5 | replay.rs | suggestion | Document tick offset: "line 0 = inputs sent in response to snapshot 1." | ### Tyre (Architecture): APPROVE Disciplined test infrastructure consistent with D-020 and D-030. Text renderer has excellent coverage (10 tests). Golden diff is clean. | # | File | Severity | Issue | |---|------|----------|-------| | 1 | text_renderer.rs | warning | Lives in `bridge/` but never used by server binary. Better home: `dev_support/` or behind feature flag. Track for relocation. | | 2 | test-client/Cargo.toml | warning | Path dependency exposes entire server crate. Long-term: extract `settled-reach-bridge` sub-crate. Track it. | | 3 | text_renderer.rs:8 | suggestion | Redundant `use crate::knowledge::types::{...}` — already re-exported through `bridge::types::*` glob. | | 4 | main.rs:~130 | suggestion | Golden comparison only checks final snapshot. Per-tick golden files needed for Gauntlet wow-moment testing. | | 5 | main.rs:~130 | suggestion | `tick_count` variable name ambiguous — a `replay_index` alias with comment would clarify. | | 6 | Cargo.toml | suggestion | Standalone Cargo.lock intentional. Confirm CI/Makefile builds with explicit `--manifest-path`. | ### Verdict: APPROVED
jpmschweitzer closed this pull request 2026-02-18 01:57:14 +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#28