-
Notifications
You must be signed in to change notification settings - Fork 0
Organize agentd-runner internals into modules with shared test fixtures #35
Copy link
Copy link
Open
Description
Summary
crates/agentd-runner/src/lib.rs is a single 3000-line file containing the entire runner: public types, validation, container lifecycle, resource management, script generation, utility functions, and all tests. Concerns are interleaved and the test suite rebuilds the same fake-podman scaffolding from scratch in each test.
This structure makes the crate harder to review (findings scatter across unrelated code), harder to maintain (changes in one concern sit adjacent to another), and expensive to extend (each new test copies and adapts a ~60-line shell script).
Constraints
- The public API is unchanged:
SessionSpec,SessionInvocation,SessionOutcome,RunnerError,ResolvedEnvironmentVariable,EnvironmentNameValidationError,run_session, andvalidate_environment_nameremain the crate's public surface. - All existing tests pass with identical behavior — this is a pure structural refactor.
- The crate remains a single Rust crate (
agentd-runner); the restructuring is internal modules, not new crates. - The integration tests in
tests/session_lifecycle.rsremain a separate test target.
Acceptance Criteria
- Each distinct concern in the production code lives in its own module within the crate. A reader can navigate to any concern without scanning unrelated code.
- The fake-podman test infrastructure is a shared fixture. Adding a new test that needs fake-podman requires configuring the fixture's behavior, not writing a new shell script.
-
cargo test -p agentd-runnerpasses. -
cargo clippy -p agentd-runner --all-targets -- -D warningspasses. -
cargo fmt --checkpasses.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels