Skip to content

RAL-196: serve's wiring in its own file, so src/main.rs is the client's - #283

Merged
Castor-o7 merged 3 commits into
mainfrom
ral-196-serve-own-file
Nov 15, 2026
Merged

Castor-o7 merged 3 commits into
mainfrom
ral-196-serve-own-file

Conversation

@Castor-o7

Copy link
Copy Markdown
Owner

Follow-up to RAL-195, agreed with the watchman.

Why

src/main.rs held every command, serve among them, so the brief's builds section read "can't tell" for each story that touched it (three of eight on 2026-11-15).

What

  • src/serve.rs (new, the service's): serve's flags as serve::Args, their checks, and the service's start. Moved as they were, along with run_service, parse_rally_openers, read_github_token and parse_window.
  • Location::named in src/store.rs: how --db, --head-file and --db-password-file name the ledger, moved from main.
  • src/main.rs keeps Serve(rally::serve::Args) and one arm that passes it on.
  • builds: serve joins SERVICE_MODULES; main moves from shared to CLIENT_MODULES.

No change to what rally serve accepts or does: rally serve --help is byte-identical to the installed CLI's.

What still reaches the service from main.rs

The declarations of the global flags (--db, --head-file, --db-password-file) and the call that passes them to Location::named. Their meaning is in the store now. A change to those declarations alone would read as the client's.

Tests

  • main_only_passes_serve_on: main holds the one delegating arm and names nothing of server, RateLimit or evidence::Settings.
  • The builds tests use src/web.rs as the shared file where they used src/main.rs.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass locally, including the service tests that start rally serve.

docs/roadmap.md will conflict with #282; I'll merge main in once that lands.

🤖 Generated with Claude Code

Castor-o7 and others added 3 commits November 15, 2026 18:20
src/main.rs held every command, serve among them, so the brief's builds read "can't
tell" for each story that touched it. Serve's flags, their checks and the service's start
move to src/serve.rs, and how --db and --head-file name the ledger moves to the store, with
no change to what rally serve accepts or does. main only passes the command on, and a test
keeps it so. src/serve.rs is placed with the service's files and src/main.rs with the
client's.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
From the watchman's read: --db, --head-file and --db-password-file reach the service, so
main.rs mustn't declare them and still read as the client's. They move to
store::LedgerFlags, flattened into the CLI, and the test that main only passes serve on now
also refuses those declarations in main.rs. rally --help and rally serve --help are
unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Castor-o7
Castor-o7 merged commit dd08b2d into main Nov 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant