Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .agent-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ and `LTV-Pe` (#108) merged (scheme protocol + render seam). `LTV-Pf` (physical
move, **hard break / no shims** per D12): Pf.1 (compute core —
simulation/mechanisms/structure) merged (#109); Pf.2 (lead-scoring render —
snapshots/relational_snapshot_safe/tasks moved + relational.py split so the
shared write_relational_tables stays in the envelope) opened as **#110**. Both
byte-identical. Sibling `leadforge-datasets-private` consumes bundle files, not
internals — no lockstep update needed (heads-up issue #8 filed). Next:
`LTV-Pg` (scaffold `schemes/lifecycle/` + relocate the lead-scoring schema specs).
shared write_relational_tables stays in the envelope) merged (#110). `LTV-Pg`
(schema reorg) split: Pg.1 (scaffold `schemes/lifecycle/` — lifecycle rows +
registries + LIFECYCLE_CONSTRAINTS moved there, stub LifecycleScheme registered)
opened as **#111**; Pg.2 (split the lead-scoring schema out of shared `schema/`)
pending. All M2 moves byte-identical. Sibling `leadforge-datasets-private`
consumes bundle files, not internals — no lockstep update needed (heads-up
issue #8). Next: `LTV-Pg.2`, then `LTV-Pc` (pLTV feature/task specs, authored in
`schemes/lifecycle/`), then `LTV-M3` (lifecycle population).

---

Expand Down
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ assembler (`to_dataframes`) moved to the scheme, and the scheme-agnostic writer
(`write_relational_tables`) moved to the new `leadforge.render.relational_io`
(renamed to avoid a basename clash with the scheme's `relational.py`).
`leadforge.render` remains the shared bundle-output envelope
(`relational_io` + `manifests`). The lead-scoring `schema`
specs relocate in a follow-up PR (LTV-Pg). Consumers importing internals (e.g.
(`relational_io` + `manifests`).

The lifecycle (`b2b_saas_ltv_v1`) entity rows + registries moved from
`leadforge.schema.entities` / `leadforge.schema.relationships` to the new
`leadforge.schemes.lifecycle.entities` / `leadforge.schemes.lifecycle.relationships`,
and a stub `lifecycle` scheme is registered alongside `lead_scoring`
(`available_schemes()` → `("lead_scoring", "lifecycle")`). The lead-scoring
`schema` specs relocate under `leadforge.schemes.lead_scoring` in a follow-up
PR (LTV-Pg.2). Consumers importing internals (e.g.
the `leadforge-datasets-private` build scripts) must update to the new paths;
the package stays on the `1.x` line (the public contract did not change).

Expand Down
26 changes: 16 additions & 10 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ leadforge/
schemes/ base.py (GenerationScheme protocol + SCHEME_REGISTRY);
lead_scoring/ — the lead-scoring scheme: __init__.py (build_world/
write_bundle) + simulation/, mechanisms/, structure/, render/
(moved in LTV-Pf.1/Pf.2). Lead-scoring schema specs migrate
here in LTV-Pg. See docs/ltv/design.md §2.5.
(moved in LTV-Pf.1/Pf.2);
lifecycle/ — the pLTV scheme (stub): entities.py, relationships.py
(scaffolded in LTV-Pg.1). Lead-scoring schema specs migrate
under lead_scoring/ in LTV-Pg.2. See docs/ltv/design.md §2.5.
render/ relational_io.py (write_relational_tables — shared writer), manifests.py
# shared bundle-output envelope
exposure/ modes.py, filters.py, redaction.py
Expand Down Expand Up @@ -244,14 +246,18 @@ leadforge/ # Python package root
│ └── dictionaries.py # Feature dictionary CSV writer
├── schemes/ # Generation schemes (peer pipelines) + registry
│ ├── base.py # GenerationScheme protocol + SCHEME_REGISTRY
│ └── lead_scoring/ # The lead-scoring scheme (LeadScoringScheme)
│ ├── __init__.py # build_world() + write_bundle()
│ ├── structure/ # Hidden world graph (WorldGraph, motifs, sampler)
│ ├── mechanisms/ # Node/edge behavior (policies, hazards, scores, …)
│ ├── simulation/ # World evolution (engine, population, state)
│ └── render/ # Lead-scoring render: snapshots, relational
│ # (to_dataframes), relational_snapshot_safe, tasks
│ # NOTE (LTV-M2 reorg in progress): lead-scoring schema specs split in LTV-Pg.
│ ├── lead_scoring/ # The lead-scoring scheme (LeadScoringScheme)
│ │ ├── __init__.py # build_world() + write_bundle()
│ │ ├── structure/ # Hidden world graph (WorldGraph, motifs, sampler)
│ │ ├── mechanisms/ # Node/edge behavior (policies, hazards, scores, …)
│ │ ├── simulation/ # World evolution (engine, population, state)
│ │ └── render/ # Lead-scoring render: snapshots, relational
│ │ # (to_dataframes), relational_snapshot_safe, tasks
│ └── lifecycle/ # The pLTV scheme (LifecycleScheme — stub until M3–M6)
│ ├── __init__.py # registers the stub scheme
│ ├── entities.py # lifecycle rows + LIFECYCLE_ROW_TYPES
│ └── relationships.py # LIFECYCLE_CONSTRAINTS
│ # NOTE (LTV-M2 reorg in progress): lead-scoring schema specs split in LTV-Pg.2.
│ # See docs/ltv/design.md §2.5 for the target layout.
├── render/ # Shared bundle-output envelope
│ ├── relational_io.py # write_relational_tables() — shared table writer
Expand Down
23 changes: 17 additions & 6 deletions docs/ltv/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protocol + registry, with the package physically reorganized into
|-----------|------------|-----|------------|
| `LTV-M0` | Planning + design lock | `LTV-Pa` | #102, #103 (+ scheme reframe) |
| `LTV-M1` | Lifecycle schema foundation | `LTV-Pb`, `LTV-Pc` | #104 (Pb) |
| `LTV-M2` | Generation-scheme architecture + physical reorg | `LTV-Pd`, `LTV-Pe`, `LTV-Pf`, `LTV-Pg` | #107 (Pd), #108 (Pe), #109 (Pf.1), #110 (Pf.2) |
| `LTV-M2` | Generation-scheme architecture + physical reorg | `LTV-Pd`, `LTV-Pe`, `LTV-Pf`, `LTV-Pg` | #107 (Pd), #108 (Pe), #109 (Pf.1), #110 (Pf.2), #111 (Pg.1) |
| `LTV-M3` | Customer population + lifecycle world | `LTV-Ph`, `LTV-Pi` | |
| `LTV-M4` | Lifecycle simulation engine | `LTV-Pj`, `LTV-Pk` | |
| `LTV-M5` | Customer snapshots + pLTV targets (both regimes) | `LTV-Pl`, `LTV-Pm` | |
Expand Down Expand Up @@ -132,11 +132,22 @@ Total: ~19 PRs across 9 milestones.
(The lead-scoring `schema` specs split lands with `LTV-Pg`.)
- Tests: full suite + hash-determinism green; public API imports unchanged.
- Labels: `type: refactor`, `layer: schema`, `layer: simulation`, `layer: render`
- [ ] **`LTV-Pg`** — `refactor: scaffold schemes/lifecycle/ + relocate LTV-Pb/Pc specs`.
Create `schemes/lifecycle/`; move the lifecycle entity rows (from #104) and
the `LTV-Pc` feature/task specs into it; register a stub `LifecycleScheme`
(pipeline methods raise `NotImplementedError` until M3–M6). Split any
remaining shared schema primitives out cleanly.
- [ ] **`LTV-Pg`** — `refactor: scaffold schemes/lifecycle/ + split lead-scoring schema`.
Split into two PRs to keep each tractable:
- [x] **`LTV-Pg.1`** — scaffold `schemes/lifecycle/`: moved the lifecycle
entity rows + `LIFECYCLE_ROW_TYPES`/`LIFECYCLE_TABLE_NAMES` (from #104) into
`schemes/lifecycle/entities.py` and `LIFECYCLE_CONSTRAINTS` into
`schemes/lifecycle/relationships.py`; registered a stub `LifecycleScheme`
(`build_world`/`write_bundle` raise `NotImplementedError` until M3–M6).
Shared primitives (`EntityRowProtocol`, `_empty_df`, `AccountRow`,
`FKConstraint`) stay in `schema/` and are imported. Byte-identical;
full suite green. (**PR #111**)
- [ ] **`LTV-Pg.2`** — split the **lead-scoring** schema: move the
lead-scoring entity rows / `ALL_ROW_TYPES` / `ALL_CONSTRAINTS` /
`LEAD_SNAPSHOT_FEATURES` / task specs into `schemes/lead_scoring/`, leaving
only genuinely shared primitives in `schema/`. (The lifecycle `LTV-Pc`
feature/task specs are authored directly in `schemes/lifecycle/` when M1's
`LTV-Pc` lands.)
- Tests: lifecycle registry imports from new home; lead-scoring unaffected.
- Labels: `type: refactor`, `layer: schema`

Expand Down
Loading
Loading