writeonce/crates
shoney.arickathil 48429c5a4a chore: keep only the log-watcher example (pre-merge cleanup)
- docs/examples/{agent-loop,blog,ecommerce,hello,mcp-think,pricing}
  removed; every deleted tree is preserved on branch
  cleanup/non-logwatcher-examples (snapshot of this branch pre-delete)
- justfile: hello/pricing/pricing-demo/pricing-pg-demo/hello-demo
  recipes removed with the examples they served (Rust-runtime demos);
  rt-c-* prototype recipes and every gate recipe stay
- crates/rt parser test article_debug: the blog fixture it read from
  disk now lives inline, same shape, so cargo test needs no example
- gates after cleanup: cargo test -p rt 69/0, oop-e2e 71/0, woc-test
  green, log-watcher 7/0

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 09:06:26 +02:00
..
rt chore: keep only the log-watcher example (pre-merge cleanup) 2026-08-15 09:06:26 +02:00
README.md Pivot to the .wo language runtime: design docs, phase plans 2026-04-21 02:48:45 +02:00

crates/ — the .wo runtime

Fifteen crates make up the new runtime. Only rt/ carries real code today (Stage 2); the other fourteen are empty placeholders scaffolded to match the 7-phase design so each phase's extraction work becomes a mechanical code move into an existing home.

The crate-name prefix wo- was dropped when the active project namespaced itself under wo (the binary, the file extension, the language). Internal imports read cleanly: use ql::Parser, use db::Tx, use http::router. The v1 codebase keeps its wo-* prefix in reference/crates/ to distinguish the generations.

Map

Phase Crate Purpose Status
2 ql .wo grammar — lexer, parser, AST placeholder
2 value tagged Value + dotted-path helpers placeholder
2 engine in-memory executor (rel / doc / graph) + schema catalog placeholder
2 txn transaction coordinator — MVCC, RETURNING alias table placeholder
2 db top-level facade — open(), Tx, Query, Subscribe placeholder
3 wal write-ahead log — io_uring + fsync + recovery placeholder
4 sub live subscriptions — delta frames on commit placeholder
4 http wire protocol — REST / GraphQL-over-WS / native codec placeholder
5 gen codegen — .wo type → Go / TS / Rust / Python clients placeholder
6 policy RBAC + row-level rules compiled into planner rewrites placeholder
6 logic on <event> triggers + fn ... in txn interpreter placeholder
6 service service rest/graphql/native endpoint dispatch placeholder
6 ui ##ui screens → SSR HTML + client runtime placeholder
6 app ##app route manifest + startup hooks placeholder
— rt active — Stage-2 monolith + the wo binary shipped

Why rt/ is monolithic right now

rt/ currently holds every module the runtime needs — lexer, parser, AST, in-memory engine, axum REST server — because shipping working Stage 2 was more important than hitting the final crate layout on day one. Each module inside rt/src/ is written with a target home in mind:

rt module Moves to Phase
token.rs + lexer.rs + ast.rs + parser.rs ql/ 2
engine.rs (Value + Row helpers) value/ 2
engine.rs (Engine + Catalog) engine/ 2
compile.rs engine/ 2
server.rs http/ + service/ 4 / 6
bin/wo.rs stays in rt/ (the binary) —

Extractions happen phase-by-phase — first one lands when a second caller appears (likely when Stage 3 needs the parser for raw-.wo HTTP requests).

Build & test

cargo build                                   # compiles all 15 crates
cargo test --lib                              # 14 unit tests (all in rt today)
cargo run --bin wo -- run docs/examples/blog  # serve the blog sample

What's outside this directory