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
34 changes: 22 additions & 12 deletions .agent-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@

## Current System State

**v0.3.0 in progress — Milestone 6 complete (PR open).** Full mechanism library implemented:
base ABC + context, static draws, influence transforms, latent scoring, conversion hazard,
stage transitions, count intensities, categorical influence, measurement proxies, and
motif-family-aware mechanism assignment. 437 tests passing.
**v0.4.0 in progress — Milestone 7 complete (PR open).** Full simulation engine implemented:
per-lead mutable state, 90-day daily-step loop, touch/session/sales-activity emission,
HazardTransition stage advancement, ConversionHazard final-close, and post-conversion
opportunity/customer/subscription creation. 490 tests passing.

---

## Active Task Breakdown — Milestone 7: Simulation Engine (v0.3.0)
## Active Task Breakdown — Milestone 8: Observation Model (v0.4.0)

Goal: Run the first real evolving world and derive conversion outcomes from events.
Goal: Transform the hidden simulated world into realistic CRM-like observations.

- [ ] **1. World state** (`simulation/state.py`) — per-lead mutable state during simulation
- [ ] **2. Simulation engine** (`simulation/engine.py`) — daily step loop, 90-day horizon
- [ ] **3. Event generation** — touches/sessions derived from count mechanisms
- [ ] **4. Stage advancement** — HazardTransition drives funnel progression
- [ ] **5. Conversion derivation** — ConversionHazard fires event; sets `converted_within_90_days`
- [ ] **1. Snapshot builder** (`render/snapshots.py`) — lead-anchored flat feature snapshot
- [ ] **2. Relational export** (`render/relational.py`) — DataFrame per table from SimulationResult
- [ ] **3. Task export** (`render/tasks.py`) — train/valid/test Parquet split for `converted_within_90_days`
- [ ] **4. Manifest builder** (`render/manifests.py`) — bundle manifest.json
- [ ] **5. Bundle writer** (`api/bundle.py`) — `WorldBundle.save(path)`

---

Expand All @@ -35,7 +35,17 @@ Goal: Run the first real evolving world and derive conversion outcomes from even

## Completed Phases

### Milestone 6 — Mechanism Layer v1 ✓ (v0.3.0 in PR)
### Milestone 7 — Simulation Engine ✓ (v0.4.0 in PR)
- `simulation/state.py`: `LeadSimState` — per-lead mutable state (stage, dwell, converted, churned, sql_day)
- `simulation/engine.py`: `simulate_world()` — 90-day daily-step loop; `SimulationResult` output type
- Churn: daily 0.4% probability → `closed_lost`
- Stage advance: `HazardTransition` drives mql → … → negotiation
- Conversion: `ConversionHazard` fires from `negotiation` → `closed_won`
- Touch emission: `RecencyDecayIntensity` per day; session (30% of touch-days) and sales-activity (20% at sql+) emission
- Post-sim: `OpportunityRow` for sql+ leads; `CustomerRow` + `SubscriptionRow` for `closed_won` leads
- 45 new tests; total 490 passing

### Milestone 6 — Mechanism Layer v1 ✓ (v0.3.0 merged)
- `mechanisms/base.py`: `Mechanism` ABC, `MechanismContext`, `MechanismSummary`, `MechanismAssignment`
- `mechanisms/static.py`: `CategoricalDraw`, `BoundedNumericDraw`, `MixtureDraw`
- `mechanisms/influence.py`: `AdditiveInfluence`, `LogisticInfluence`, `SaturatingInfluence`, `ThresholdInfluence`, `InteractionTerm`
Expand Down
Loading
Loading