Architecture decision: Freeze the existing planes and build one isolated daily-live lane.
Decision. Freeze the existing research estate at its current duties and build one isolated daily-live lane under lib/live-lane. The estate contains valuable custody, causality, replay and safety patterns; it is not the shortest dependency graph to live.
- Positive case: the system has real evidence machinery worth preserving: causal execution, immutable artifacts, paper fencing, recovery patterns and several load-bearing lanes. (Sources:
simplify-review/maintainability.md;simplify-review/schema.md.) - Rigorous verdict: proof and projection are spread across parallel schemas, statistics wrappers, receipt planes and disconnected forward paths, while durable trial authority and the sleeve-wide live contract were missing. (Sources: all four
simplify-review/*.mdreports.) - Boundary: tournament, first-hour, Touch-and-Turn, the search factory, the Supabase research plane and the paper mirror are FROZEN—not declared dead and not physically deleted.
The measured estate
The headline is structural duplication, not merely a large repository.
| Surface | Measured estate | Source |
|---|---|---|
| Code | 441,275 tracked code LOC: about 132,355 test LOC, 37,500 migration LOC and at most 271,420 other source LOC; plus 26,804 Markdown LOC and about 3,000 named fixture/golden LOC | simplify-review/maintainability.md |
| Unique-logic estimate | Roughly 190–215k LOC, explicitly low confidence; the auditable ceiling is 271,420 LOC | simplify-review/maintainability.md |
| Tests | About 132,355 LOC in the tracked-code census | simplify-review/maintainability.md |
| Migrations / tables / functions | 92 migrations; 259 persistent table declarations; 618 function declarations collapsing to 506 distinct names; 574 SECURITY DEFINER mentions | simplify-review/schema.md |
| Generated schema view | 91 public/paper tables exposed; research and broker-mirror omitted | simplify-review/schema.md |
| Receipts | 48 reported receipt/registry tables grouped into 8 concepts | simplify-review/duplicates.md |
| Forward paths | 5 planes: legacy promotion, 16-member v2, exact-40 v3, first-hour G3, and broker mirror | simplify-review/duplicates.md |
| Statistics | 6 apparent surfaces; about 355–370 LOC of reducible numeric duplication | simplify-review/duplicates.md |
| Strategy schemas | 8 executable schemas; overlapping v3/v4/forward-lite contracts add 4.9k LOC | simplify-review/duplicates.md |
| Dormant / consolidation surface | About 598–613 copied LOC, about 3.8k source-level dormant/orphaned LOC, and more than 15k LOC of forward/control-plane consolidation surface—not automatically deletable | simplify-review/duplicates.md |
Schema caution: these are source declarations, not a production occupancy census. The 259 declared tables and 506 distinct function names do not prove the reported live-catalog counts. (Source: simplify-review/schema.md.)
The four lenses
1. Duplication
Positive case: daily, historical-intraday and first-hour replay cores model different contracts and retain live callers; multiple engines are not automatically duplicates. (Source: simplify-review/duplicates.md.)
- Finding: parallel strategy schemas, statistical wrappers, receipt-heavy control planes and 5 graduation/deployment paths created several auditable roads but no single survivor-to-Alpaca road. (Source:
simplify-review/duplicates.md.) - Action: freeze expansion, preserve authorities, and postpone statistics/signal consolidation until versioned parity can be proved. (Source:
simplify-review/duplicates.md.)
2. Minimal live path
Positive case: reuse narrow Sharadar custody, point-in-time liquidity mechanics, walk-forward/bootstrap behaviour and intent-before-order recovery patterns. (Source: simplify-review/minimal-v1.md.)
- Finding: an isolated path was estimated at 3.5–5.5k production LOC over 16–24 focused days, versus 8–14k changed LOC, 20–35k inherited ownership surface and 28–45 days for tournament adaptation. (Source:
simplify-review/minimal-v1.md.) - Action: keep the live lane independent, with a thin strategy kernel, append-only trial ledger, isolated validation, separately controlled lockbox, multi-strategy netting/subledger, durable lease, reconciliation and one evidence record per day. (Source:
simplify-review/minimal-v1.md.)
3. Database/schema
Positive case: SIP and daily evidence are load-bearing; immutable custody and broker-safety semantics must remain. A defensible thin-live floor is 11–12 relations. (Source: simplify-review/schema.md.)
- Finding: the database is over-engineered for the September target, but cross-version foreign keys and runtime dependencies make immediate mass deletion the wrong critical-path work. (Source:
simplify-review/schema.md.) - Action: use a separate private live schema/gateway; do not turn the paper mirror into a live service. (Source:
simplify-review/schema.md.)
4. Maintainability
Positive case: causal accounting, runner/sharding, immutable verification, paper fencing and emergency flattening are appropriate complexity. The scrutinized runner has only 4 direct production importers. (Source: simplify-review/maintainability.md.)
- Finding: a representative discovery-gate change crosses about 8 core modules; shared minimum-session semantics reach at least 10; one cost profile appears in 11 production files. (Source:
simplify-review/maintainability.md.) - Action: after live, converge family metadata, execution descriptors, statistical kernels, cost primitives and durable trial authority while retaining legacy verifiers. (Source:
simplify-review/maintainability.md.)
The verdict taken
Freeze the estate; isolate the critical path.
- FROZEN — tournament: no new dependency from the daily-live lane; keep historical contracts and verifiers intact. (Sources:
simplify-review/minimal-v1.md;simplify-review/duplicates.md.) - FROZEN — first-hour: preserve current operational/custody evidence; do not delete by version suffix because later recovery/status functions still join earlier evidence. (Source:
simplify-review/schema.md.) - FROZEN — Touch-and-Turn: concluded and off the daily path; freezing saves attention rather than schema because it has 0 database objects. (Source:
simplify-review/schema.md.) - FROZEN — search factory: stop search expansion and new framework work on the live critical path. (Sources:
simplify-review/schema.md;simplify-review/maintainability.md.) - FROZEN — Supabase research plane: retain existing duties and evidence; do not import it into the isolated lane. (Source:
simplify-review/minimal-v1.md.) - FROZEN — paper mirror: retain its current paper-only duties and safety ideas; it is load-bearing but unsuitable as the live gateway. (Sources:
simplify-review/schema.md;simplify-review/minimal-v1.md.) - BUILT INSTEAD —
lib/live-lane: one thin daily path with no dependency on the frozen tournament, experiments, research or services estate. The path name is the implementation decision recorded by this publication brief; the architecture choice is sourced tosimplify-review/minimal-v1.md.
Concrete follow-ups
Finish the thin lane before cleaning the museum.
- Live path: complete the real broker executor, reconciliation, verified EOD refresh, durable single-writer lease and fail-closed monitoring/kill flow. (Source:
simplify-review/minimal-v1.md.) - Trial authority: persist preregistration, run, validation, unlock, live approval and kill events in one append-only hash-chained ledger. (Source:
simplify-review/minimal-v1.md.) - Aggregation: deterministically net survivor targets into one broker target while retaining virtual per-strategy subledgers. (Source:
simplify-review/minimal-v1.md.) - Schema boundary: create the isolated live gateway/schema and retain Alpaca as broker truth; do not copy bars into a new authority. (Source:
simplify-review/schema.md.) - Post-live consolidation: merge duplicated statistics, registries, signal mechanics and cost primitives only with golden-vector parity and legacy verifiers. (Sources:
simplify-review/duplicates.md;simplify-review/maintainability.md;simplify-review/minimal-v1.md.) - Delete gate: physical deletion waits until live/cutover, a production catalog and row-count census/export, and import, route, deployment and artifact/build-consumer audits all pass. (Sources: all four
simplify-review/*.mdreports.) - Possible later deletes: only then assess dead leases/heartbeats, draft first-hour cost objects, abandoned runtime state, unreachable mockups/specimens and superseded versions. (Sources:
simplify-review/schema.md;simplify-review/maintainability.md.)
Final verdict: the safest simplification is dependency subtraction now and physical deletion later.