Skip to content

refactor: move lead-scoring render under schemes/lead_scoring/render/ [LTV-Pf.2]#110

Merged
shaypal5 merged 3 commits into
mainfrom
refactor/move-lead-scoring-render
Jun 10, 2026
Merged

refactor: move lead-scoring render under schemes/lead_scoring/render/ [LTV-Pf.2]#110
shaypal5 merged 3 commits into
mainfrom
refactor/move-lead-scoring-render

Conversation

@shaypal5

Copy link
Copy Markdown
Contributor

Summary

Second half of the physical reorg (LTV-Pf.2, milestone LTV-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 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.
  • Importers rewritten: the three moved modules repo-wide; to_dataframes
    imports → scheme path; write_relational_tables import unchanged.
old new
leadforge.render.snapshots leadforge.schemes.lead_scoring.render.snapshots
leadforge.render.relational_snapshot_safe leadforge.schemes.lead_scoring.render.relational_snapshot_safe
leadforge.render.tasks leadforge.schemes.lead_scoring.render.tasks
leadforge.render.relational:to_dataframes leadforge.schemes.lead_scoring.render.relational:to_dataframes
leadforge.render.relational:write_relational_tables (unchanged — shared)

Why this boundary

Verified before moving: no shared/envelope module imports these at runtime
(the apparent envelope "imports" were all docstring :func: cross-refs). So the
move introduces no new shared→scheme runtime imports — clean.

Verification

✅ BYTE-IDENTICAL vs pre-reorg main (14 files)
  • Full suite 1524 passed / 51 skipped; ruff + mypy clean (89 source
    files); compileall scripts/ clean.
  • tests/schemes/test_module_layout.py extended: render modules added to the
    moved set; new tests assert the shared envelope stays and the relational split
    landed (to_dataframes in the scheme, not in shared render).
  • BUNDLE_SCHEMA_VERSION unchanged.

Next

LTV-Pg — scaffold schemes/lifecycle/ and relocate the lead-scoring schema
specs (the last piece of the reorg).

🤖 Generated with Claude Code

… [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>
Copilot AI review requested due to automatic review settings June 10, 2026 19:58
@shaypal5 shaypal5 added this to the dataset: leadforge-ltv-v1 milestone Jun 10, 2026
@shaypal5 shaypal5 added type: refactor Code change with no behavior difference layer: render render/ bundle and artifact output status: needs review Ready for review dataset: leadforge-ltv-v1 Issue/PR scoped to the b2b_saas_ltv_v1 LTV dataset workstream labels Jun 10, 2026
Link PR #110; advance status. Next: LTV-Pg (scaffold schemes/lifecycle/).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.relational so only write_relational_tables remains in the shared envelope; to_dataframes moved to leadforge.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>
@github-actions

Copy link
Copy Markdown

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:

Tool ref: v4
Tool version: 4.0.21
Trigger: commit pushed
Workflow run: 27303048172 attempt 1
Comment timestamp: 2026-06-10T20:07:45.978884+00:00
PR head commit: 5ea70a0a674dfcc777fc5f765f171526a363296c

@shaypal5 shaypal5 merged commit 10dbc19 into main Jun 10, 2026
9 of 10 checks passed
@shaypal5 shaypal5 deleted the refactor/move-lead-scoring-render branch June 10, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dataset: leadforge-ltv-v1 Issue/PR scoped to the b2b_saas_ltv_v1 LTV dataset workstream layer: render render/ bundle and artifact output status: needs review Ready for review type: refactor Code change with no behavior difference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants