refactor: move lead-scoring render under schemes/lead_scoring/render/ [LTV-Pf.2]#110
Merged
Merged
Conversation
… [LTV-Pf.2] Second half of the physical reorg (LTV-Pf). Relocates the lead-scoring render modules under the scheme and splits the one genuinely-shared piece out of the envelope. Hard break, no shims (D12); byte-identical output. - git mv snapshots.py, relational_snapshot_safe.py, tasks.py → leadforge/schemes/lead_scoring/render/. - Split render/relational.py: the 9-table assembler `to_dataframes` (+ _TABLE_SOURCES) moved to schemes/lead_scoring/render/relational.py; the scheme-agnostic `write_relational_tables` stays in leadforge/render/relational.py (now a small shared writer module). `leadforge.render` remains the shared envelope (write_relational_tables + manifests). - Rewrote importers: the three moved modules repo-wide; `to_dataframes` imports to the scheme path; `write_relational_tables` import unchanged. - CHANGELOG "Moved" table extended; CLAUDE.md Repository Map + canonical layout updated; roadmap Pf.2 + agent-plan updated. - tests/schemes/test_module_layout.py: render modules added to the moved set; new tests assert the shared envelope stays and the relational split landed (to_dataframes in scheme, not in shared render). Verified byte-identical to pre-reorg main (14/14 files); full suite 1524 passed / 51 skipped; ruff + mypy clean (89 source files); scripts compile. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Link PR #110; advance status. Next: LTV-Pg (scaffold schemes/lifecycle/). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Refactors the lead-scoring scheme’s render layer by relocating render modules under leadforge/schemes/lead_scoring/render/ and splitting the relational export into a scheme-owned “assembler” (to_dataframes) and a shared “writer” (write_relational_tables) that remains in leadforge/render/.
Changes:
- Moved lead-scoring render modules (
snapshots,relational_snapshot_safe,tasks) under the lead-scoring scheme and rewired imports across tests/scripts. - Split
leadforge.render.relationalso onlywrite_relational_tablesremains in the shared envelope;to_dataframesmoved toleadforge.schemes.lead_scoring.render.relational. - Updated documentation/roadmap/changelog to reflect the new layout and added module-layout tests to lock in the boundary.
Reviewed changes
Copilot reviewed 24 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/validation/test_leakage_probes.py | Updates imports/doc refs to the scheme-owned snapshot-safe relational export. |
| tests/test_difficulty_modulation.py | Updates imports for snapshot difficulty distortion helpers after module move. |
| tests/schemes/test_module_layout.py | Expands layout-lock tests to include render-module moves and the relational split boundary. |
| tests/render/test_snapshot_windowed.py | Updates snapshot builder import to new scheme path. |
| tests/render/test_render.py | Updates imports to new scheme paths for to_dataframes, build_snapshot, and task split writer. |
| tests/render/test_relational_snapshot_safe.py | Updates snapshot-safe relational export import to new scheme path. |
| tests/integration/test_snapshot_safe_bundle.py | Updates doc refs to snapshot-safe relational export new path. |
| scripts/spike_category_signal.py | Updates snapshot builder import to new scheme path. |
| scripts/build_v7_snapshot.py | Updates snapshot builder import to new scheme path. |
| scripts/build_v6_snapshot.py | Updates snapshot builder import to new scheme path. |
| scripts/build_v5_snapshot.py | Updates snapshot builder import to new scheme path. |
| scripts/build_v4_snapshot.py | Updates snapshot builder import to new scheme path. |
| scripts/build_midproject_lead_scoring.py | Updates snapshot builder import to new scheme path. |
| leadforge/validation/leakage_probes.py | Updates internal comment to reflect new location of the snapshot-safe writer module. |
| leadforge/schemes/lead_scoring/render/tasks.py | Updates docstring cross-ref to moved build_snapshot. |
| leadforge/schemes/lead_scoring/render/snapshots.py | Relocated lead snapshot builder (and difficulty distortion helpers) under the scheme. |
| leadforge/schemes/lead_scoring/render/relational.py | New scheme-owned relational table assembler to_dataframes. |
| leadforge/schemes/lead_scoring/render/relational_snapshot_safe.py | New scheme-owned snapshot-safe projection for relational tables. |
| leadforge/schemes/lead_scoring/render/init.py | Establishes the scheme render package. |
| leadforge/schemes/lead_scoring/init.py | Rewires scheme bundle writer imports to new render module locations and keeps shared writer import unchanged. |
| leadforge/render/relational.py | Becomes the shared, scheme-agnostic relational-table writer (write_relational_tables) only. |
| leadforge/render/manifests.py | Updates doc refs to the new snapshot-safe relational module path. |
| leadforge/exposure/filters.py | Updates doc refs to the new snapshot-safe relational module path. |
| docs/ltv/roadmap.md | Marks Pf.2 as completed and updates narrative of what moved/split. |
| CLAUDE.md | Updates repo layout documentation to reflect new scheme-owned render structure. |
| CHANGELOG.md | Updates breaking internal import-path move table and clarifies shared envelope responsibilities. |
| .agent-plan.md | Updates plan status to reflect Pf.2 details and current sequencing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…dataframes history (self-review) [LTV-Pf.2] Self-review caught that the relational.py split lost git history and left two files named relational.py. Both files shared the basename, so git's same-path heuristic recorded the scheme file (which inherits to_dataframes + _TABLE_SOURCES, the bulk of the original) as a brand-new ADD and the gutted shared remnant as a MODIFY — breaking `git blame`/`log --follow` on to_dataframes, and contradicting the history-preservation standard Pf.1 set. Fix: rename the shared writer module leadforge/render/relational.py → leadforge/render/relational_io.py. With the basename collision gone, git now records the scheme file as R067 (rename of the original — to_dataframes history preserved back to M8 #13) and relational_io.py as a clean ADD. Bonus: no more ambiguous duplicate `relational.py` (the shared writer is scheme-agnostic and isn't "relational"-specific anyway). - Importers of write_relational_tables updated (scheme __init__, test). - test_module_layout.py: assert the shared writer is at render.relational_io and the flat `leadforge.render.relational` module is gone. - CHANGELOG "Moved" table + CLAUDE.md (both layout sections) updated. Verified byte-identical (14/14); full suite 1532 passed / 51 skipped; ruff + mypy clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
pr-agent-context report: No unresolved review comments, failing checks, or actionable patch coverage gaps were found on PR #110 in repository https://github.com/leadforge-dev/leadforge. Treat this PR as all clear unless new signals appear.Run metadata: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second half of the physical reorg (
LTV-Pf.2, milestoneLTV-M2).Relocates the lead-scoring render modules under the scheme and splits the
one genuinely-shared piece out of the envelope. Hard break, no shims (D12);
byte-identical output.
Changes
git mvsnapshots.py,relational_snapshot_safe.py,tasks.py→leadforge/schemes/lead_scoring/render/.render/relational.py: the 9-table assemblerto_dataframes(+
_TABLE_SOURCES) moved toschemes/lead_scoring/render/relational.py; thescheme-agnostic
write_relational_tablesstays inleadforge/render/relational.py(now a small shared writer module).leadforge.renderremains the shared envelope:write_relational_tablesmanifests.to_dataframesimports → scheme path;
write_relational_tablesimport unchanged.leadforge.render.snapshotsleadforge.schemes.lead_scoring.render.snapshotsleadforge.render.relational_snapshot_safeleadforge.schemes.lead_scoring.render.relational_snapshot_safeleadforge.render.tasksleadforge.schemes.lead_scoring.render.tasksleadforge.render.relational:to_dataframesleadforge.schemes.lead_scoring.render.relational:to_dataframesleadforge.render.relational:write_relational_tablesWhy this boundary
Verified before moving: no shared/envelope module imports these at runtime
(the apparent envelope "imports" were all docstring
:func:cross-refs). So themove introduces no new shared→scheme runtime imports — clean.
Verification
ruff+mypyclean (89 sourcefiles);
compileall scripts/clean.tests/schemes/test_module_layout.pyextended: render modules added to themoved set; new tests assert the shared envelope stays and the relational split
landed (
to_dataframesin the scheme, not in sharedrender).BUNDLE_SCHEMA_VERSIONunchanged.Next
LTV-Pg— scaffoldschemes/lifecycle/and relocate the lead-scoringschemaspecs (the last piece of the reorg).
🤖 Generated with Claude Code