Repository navigation
refactor(core): collapse validation lane DSL and remove dead code (#805) - #901
Conversation
Problem: 68 validation lanes were spread across 5 files with 6 DSL builder functions that wrapped ExecutionSpec constructors plus a ValidationLaneFamily DSL that generated composite entries. The inheritance chain (LaneEntry → ExecutableScenario → NamedScenarioSource → ScenarioSpec → ScenarioProjectionSource → ScenarioMetadata) silently carried ~20 metadata fields and projection protocol methods through 7 levels. Solution: - Flattened LaneEntry to a plain dataclass with direct fields, removing ExecutableScenario inheritance while preserving projection protocol compatibility. - Deleted validation_lane_base.py (221 LOC): 6 builder functions (pytest_lane, devtools_lane, pipeline_probe_lane, polylogue_lane, memory_budget_lane, composite_lane) replaced with direct ExecutionSpec construction in catalog files. - Deleted validation_family_models.py (133 LOC): ValidationLaneFamily DSL generation flattened into direct composite LaneEntry declarations. - Merged validation_lane_catalog_composites.py (263 LOC) into validation_lane_catalog_contracts.py as direct declarations. - Updated validation_catalog.py, authored_scenario_catalog.py, quality_registry.py, render_quality_reference.py for the simplified contract. Files deleted: 3 (617 LOC). Net change: -268 LOC. Verification: deferred to wave batch per #852 policy. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e84a3bfda
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR refactors the devtools “validation lanes” catalog by removing the prior DSL/builder layers and flattening lane modeling, consolidating lane declarations into fewer modules and deleting several now-redundant files.
Changes:
- Replaced lane-builder helpers (e.g.,
pytest_lane,polylogue_lane,composite_lane) with directExecutionSpecconstruction inside the lane catalog(s). - Merged composite-lane declarations into the contracts catalog and deleted the former composites catalog + validation-family DSL modules.
- Flattened
LaneEntryfrom a deep inheritance chain into a standalone dataclass with explicit projection methods.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| devtools/validation_lane_catalog_live.py | Converts live lane declarations to direct LaneEntry(...) + *_execution(...) usage. |
| devtools/validation_lane_catalog_contracts.py | Converts contract lanes to direct LaneEntry(...) and inlines composite lane declarations. |
| devtools/validation_lane_catalog_composites.py | Deleted (composites moved into contracts catalog). |
| devtools/validation_lane_base.py | Deleted (DSL/builder wrappers removed). |
| devtools/validation_family_models.py | Deleted (validation-family DSL removed). |
| devtools/validation_catalog.py | Updates imports for new catalog layout; validation-family builder now returns empty. |
| devtools/render_quality_reference.py | Removes ValidationLaneFamily import; loosens family rendering typing. |
| devtools/quality_registry.py | Removes ValidationLaneFamily import; loosens validation_families typing. |
| devtools/lane_models.py | Flattens LaneEntry into a plain dataclass and implements projection methods directly. |
| devtools/authored_scenario_catalog.py | Removes ValidationLaneFamily import; loosens validation_families field type. |
Comments suppressed due to low confidence (1)
devtools/render_quality_reference.py:43
- _render_validation_family_table() was widened to tuple[object, ...] but still assumes each entry has .name/.description/.lanes with lane.name attributes. If validation families are truly removed, this table (and the corresponding docs section) should be deleted; otherwise introduce a small typed model/Protocol for “family view” instead of object so the renderer can’t silently accept incompatible inputs.
def _render_validation_family_table(entries: tuple[object, ...]) -> list[str]: # flattened — ValidationLaneFamily DSL removed in #805
lines = [
"| Family | Composite Lanes | Description |",
"| --- | --- | --- |",
]
for entry in entries:
lane_names = tuple(lane.name for lane in entry.lanes)
lines.append(f"| `{entry.name}` | {_format_code_list(lane_names)} | {entry.description} |")
return lines
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| artifact_targets: tuple[str, ...] = () | ||
| operation_targets: tuple[str, ...] = () | ||
| tags: tuple[str, ...] = () | ||
|
|
| def build_validation_family_entries() -> tuple[object, ...]: | ||
| """Return validation family entries (flattened — families are now direct composites).""" | ||
| return () |
Largest #805 simplification slice. 68 validation lanes were spread across five catalog files, plus the `validation_lane_base.py` builder DSL (six thin wrappers around `ExecutionSpec` constructors) and a `ValidationLaneFamily` model layer. `LaneEntry` inherited through a 7-level chain (`ExecutableScenario` → `NamedScenarioSource` → `ScenarioSpec` → `ScenarioProjectionSource` → `ScenarioMetadata`) carrying ~20 metadata fields and projection-protocol methods. - `LaneEntry` becomes a plain dataclass with direct fields (`name`, `description`, `timeout_s`, `category`, `execution`, `assertion`, `family`, `is_composite`, `sub_lanes`), removing `ExecutableScenario` inheritance while keeping projection-protocol compatibility through direct method implementations. - Deletes `validation_lane_base.py` (-221 LOC): six builder functions replaced with direct `ExecutionSpec` construction in the catalog files. - Deletes `validation_family_models.py` (-133 LOC): family / stage / composite DSL flattened into 14 direct composite `LaneEntry` declarations. - Deletes `validation_lane_catalog_composites.py` (-263 LOC): 14 family-generated + 11 standalone composites merged into `validation_lane_catalog_contracts.py`. - `validation_catalog.py`: removes imports of the deleted modules; `build_validation_family_entries()` returns an empty tuple. Net effect: 10 files +698/-966. Refs #805
Direct, no-PR. Local repair in `devtools/authored_scenario_catalog.py` after the #805 validation-lane collapse (PR #901): a typed `extend()` call was incorrectly rewritten to `to_projection_entry()` and broke `devtools render-quality-reference --check`. Reverts to the `.extend(...)` call with a focused `# type: ignore` for the still-loose intermediate type, and regenerates `docs/verification-catalog.md`. Refs #805
Largest #805 simplification slice. 68 validation lanes were spread across five catalog files, plus the `validation_lane_base.py` builder DSL (six thin wrappers around `ExecutionSpec` constructors) and a `ValidationLaneFamily` model layer. `LaneEntry` inherited through a 7-level chain (`ExecutableScenario` → `NamedScenarioSource` → `ScenarioSpec` → `ScenarioProjectionSource` → `ScenarioMetadata`) carrying ~20 metadata fields and projection-protocol methods. - `LaneEntry` becomes a plain dataclass with direct fields (`name`, `description`, `timeout_s`, `category`, `execution`, `assertion`, `family`, `is_composite`, `sub_lanes`), removing `ExecutableScenario` inheritance while keeping projection-protocol compatibility through direct method implementations. - Deletes `validation_lane_base.py` (-221 LOC): six builder functions replaced with direct `ExecutionSpec` construction in the catalog files. - Deletes `validation_family_models.py` (-133 LOC): family / stage / composite DSL flattened into 14 direct composite `LaneEntry` declarations. - Deletes `validation_lane_catalog_composites.py` (-263 LOC): 14 family-generated + 11 standalone composites merged into `validation_lane_catalog_contracts.py`. - `validation_catalog.py`: removes imports of the deleted modules; `build_validation_family_entries()` returns an empty tuple. Net effect: 10 files +698/-966. Refs #805
Direct, no-PR. Local repair in `devtools/authored_scenario_catalog.py` after the #805 validation-lane collapse (PR #901): a typed `extend()` call was incorrectly rewritten to `to_projection_entry()` and broke `devtools render-quality-reference --check`. Reverts to the `.extend(...)` call with a focused `# type: ignore` for the still-loose intermediate type, and regenerates `docs/verification-catalog.md`. Refs #805
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Collapsed the validation lane DSL from 5 files (1021 LOC) to 2 catalog
files plus simplified models, removing 3 files (617 LOC deleted) and
the 7-level ExecutableScenario inheritance chain from LaneEntry.
Problem
68 validation lanes were spread across 5 catalog files
(validation_lane_catalog_contracts.py, _live.py, _composites.py) plus
validation_lane_base.py (6 DSL builder functions) and
validation_family_models.py (ValidationLaneFamily DSL). The DSL
builder functions (pytest_lane, devtools_lane, pipeline_probe_lane,
polylogue_lane, memory_budget_lane, composite_lane) were thin wrappers
around ExecutionSpec constructors. LaneEntry inherited through
ExecutableScenario → NamedScenarioSource → ScenarioSpec →
ScenarioProjectionSource → ScenarioMetadata, carrying ~20 metadata
fields and projection protocol methods through 7 levels.
Per issue #805 recon, priority P0 was "Collapse validation lanes from
5 files to 2 files."
Solution
Flattened LaneEntry into a plain dataclass with direct fields
(
name,description,timeout_s,category,execution,assertion,family,is_composite,sub_lanes). RemovedExecutableScenario inheritance while preserving projection protocol
compatibility via direct method implementations.
Deleted
validation_lane_base.py(221 LOC): 6 builder functionsreplaced with direct ExecutionSpec construction (
pytest_execution,devtools_execution,composite_execution, etc.) in the catalogfiles.
Deleted
validation_family_models.py(133 LOC):ValidationLaneFamily/StageSpec/CompositeSpec DSL flattened into
14 direct composite LaneEntry declarations.
Deleted
validation_lane_catalog_composites.py(263 LOC):Merged 14 family-generated + 11 standalone composite lanes into
validation_lane_catalog_contracts.pyas direct LaneEntrydeclarations.
Updated
validation_catalog.py: Removed imports of deletedmodules.
build_validation_family_entries()returns empty tuple(families are now direct composites).
Updated
authored_scenario_catalog.py,quality_registry.py,render_quality_reference.py: Removed ValidationLaneFamilyreferences, changed
validation_familiestype totuple[object, ...].Net change: -268 LOC (698 insertions, 966 deletions).
Verification
Deferred to wave batch per #852 policy.
Co-Authored-By: Claude Opus 4.7 [email protected]