validation: extract deterministic slice runner - #430
Conversation
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughValidation execution is modularized into shared runner utilities, runtime-secret handling, reliability policy helpers, and a dedicated pytest-backed slice runner. Existing validation lanes delegate to these modules, with tests covering nonzero pytest exits and corrupted reliability artifacts. ChangesValidation runner modularization
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Validator
participant SliceRunner
participant Pytest
participant ReliabilityPolicy
participant LaneHarness
Validator->>SliceRunner: run validation slice
SliceRunner->>Pytest: execute configured pytest command
Pytest-->>SliceRunner: return exit code and output
SliceRunner->>ReliabilityPolicy: load and evaluate reliability samples
ReliabilityPolicy-->>SliceRunner: return policy result
SliceRunner->>LaneHarness: finalize validation result and artifacts
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/easycat/validation/_runner_support.py`:
- Around line 13-22: Replace the loose CommandRunner Callable alias with a typed
Protocol defining __call__ using the expected command positional argument and
keyword-only env and cwd parameters, returning CommandResult. Preserve the
existing CommandResult contract and update any required typing imports so
injected runners are checked against this explicit signature.
In `@src/easycat/validation/_slice_runner.py`:
- Around line 259-297: Update the reliability-loading flow around
load_reliability_failure and _load_reliability so a successful validation
returns and reuses the already parsed samples instead of rereading and reparsing
reliability_path. Propagate the parsed samples through the caller, while
preserving the existing failure behavior and artifact construction via
build_reliability_artifact and reliability_budget_failure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c26c6fc3-8376-4854-962b-4339cfb70a12
📒 Files selected for processing (7)
src/easycat/validation/_environment.pysrc/easycat/validation/_lane_harness.pysrc/easycat/validation/_reliability_policy.pysrc/easycat/validation/_runner_support.pysrc/easycat/validation/_slice_runner.pysrc/easycat/validation/runner.pytests/validation/test_slice_runner.py
Problem
validation/runner.pymixed four different orchestration domains with subprocess execution, environment policy, reliability artifact policy, and deterministic pytest-slice assembly. The 1,639-line module had nine direct complexity findings;run_validation_slicealone owned selector policy, command construction, filesystem layout, redaction, reliability evaluation, artifact projection, and final reporting.Changes
validation/_slice_runner.pyvalidation.runneras the existing facade while reducing it to 1,376 linesValidation
115 passed: complete validation guard plus focused slice contracts55 passed: runner, latency, live, baseline, and slice regression setruff format --check .ruff check . --no-cacheReferences
Summary by CodeRabbit
New Features
Bug Fixes