/ roadmap.md
roadmap.md
  1  # roadmap
  2  
  3  ## Goal
  4  
  5  Build a browser-first, local-first replicated event substrate with a Rust/WASM engine, TypeScript host adapters, Dexie-backed IndexedDB persistence, and reference social applications layered on top.
  6  
  7  ## Milestone 0 — Workspace hardening
  8  
  9  Deliverables:
 10  - root `Makefile`
 11  - stable workspace scripts
 12  - baseline docs, specs, and contribution rules
 13  - deterministic unit tests for engine and browser host adapters
 14  
 15  Exit criteria:
 16  - `make test` runs Rust and TypeScript unit tests
 17  - `make build` documents the intended wasm + app build path
 18  - `AGENTS.md`, `docs/`, and `specs/` describe architecture and constraints
 19  
 20  ## Milestone 1 — Core engine v0
 21  
 22  Deliverables:
 23  - append-only event envelope
 24  - deterministic ordering and deduplication
 25  - validated event application path
 26  - topic-filtered Reddit-like projection
 27  - export/import batch support
 28  
 29  Exit criteria:
 30  - core replica accepts valid events and rejects invalid votes
 31  - projections are deterministic under reordered batches
 32  - engine API is wasm-safe and host-agnostic
 33  
 34  ## Milestone 2 — Browser host and persistence
 35  
 36  Deliverables:
 37  - Dexie event store
 38  - browser host runtime
 39  - bootstrap from IndexedDB into the wasm engine
 40  - write-through persistence for accepted local events
 41  - remote batch import path
 42  
 43  Exit criteria:
 44  - refresh survives page reload
 45  - duplicate events do not multiply on disk
 46  - host runtime tests cover bootstrap, append, and batch import behavior
 47  
 48  ## Milestone 3 — Identity and signing
 49  
 50  Deliverables:
 51  - actor/device key model
 52  - event signing in Rust
 53  - signature verification policy
 54  - key export/import story for browser clients
 55  
 56  Exit criteria:
 57  - unsigned or invalidly signed events can be rejected by policy
 58  - a device identity can be rotated without corrupting prior history
 59  
 60  ## Milestone 4 — Replication protocol
 61  
 62  Deliverables:
 63  - peer cursor model
 64  - topic subscription model
 65  - sync framing and transport-neutral protocol messages
 66  - pull, push, and delta reconciliation
 67  
 68  Exit criteria:
 69  - replicas can exchange only missing events
 70  - one peer can catch up from another using cursors instead of full replay
 71  
 72  ## Milestone 5 — WebRTC transport
 73  
 74  Deliverables:
 75  - signaling path
 76  - WebRTC data-channel transport
 77  - reconnect and retry logic
 78  - topic-scoped batch exchange
 79  
 80  Exit criteria:
 81  - two browser peers can synchronize without manual copy-paste
 82  - server fallback remains available when direct peer transport fails
 83  
 84  ## Milestone 6 — Policies and moderation
 85  
 86  Deliverables:
 87  - retention policy model
 88  - topic pinning and pruning
 89  - blocklists and capability-based moderation events
 90  - local trust and filtering rules
 91  
 92  Exit criteria:
 93  - a node can choose what to retain
 94  - local moderation rules affect projection without rewriting history
 95  
 96  ## Milestone 7 — Generalization layer
 97  
 98  Deliverables:
 99  - substrate-level object schemas
100  - app adapters for Reddit-like and Twitter-like products
101  - typed projection interfaces
102  - capability model for app extensions
103  
104  Exit criteria:
105  - same engine can back at least two reference apps with different views
106  - domain-specific event families do not leak storage or transport details
107  
108  ## Milestone 8 — CRDT module
109  
110  Deliverables:
111  - optional CRDT document object family
112  - bridge between event-log substrate and CRDT document payloads
113  - rich text or wiki reference surface
114  
115  Exit criteria:
116  - collaborative documents can sync without making the entire system CRDT-first
117  
118  ## Milestone 9 — Production readiness
119  
120  Deliverables:
121  - observability hooks
122  - migration/versioning plan
123  - compaction strategy
124  - service worker and offline shell
125  - packaging and deployment notes
126  
127  Exit criteria:
128  - upgrades do not strand old data
129  - local stores can be compacted without violating append-only protocol semantics