chore: justfile, Cargo.toml, vscode config, crates README, cm.md

This commit is contained in:
shoney.arickathil 2026-08-10 14:11:49 +02:00
parent 80046556af
commit 4bcd8bb074
5 changed files with 49 additions and 30 deletions

View file

@ -3,6 +3,7 @@
"recommendations": [ "recommendations": [
"bierner.markdown-mermaid", // renders ```mermaid blocks in the markdown preview "bierner.markdown-mermaid", // renders ```mermaid blocks in the markdown preview
"rust-lang.rust-analyzer", "rust-lang.rust-analyzer",
"humao.rest-client" // reference/rest/*.rest files "humao.rest-client", // .dev/reference/rest/*.rest files
"ms-vscode.cpptools" // C debugging (launch.json cppdbg configs, runtime/)
] ]
} }

View file

@ -5,7 +5,7 @@
# docs/plan/done/01-scafolding-crates.md. They are commented out of the # docs/plan/done/01-scafolding-crates.md. They are commented out of the
# workspace until their phase activates — uncomment each one as code lands. # workspace until their phase activates — uncomment each one as code lands.
# #
# The v1 writeonce blog crates at `reference/crates/` are a separate nested # The v1 writeonce blog crates at `.dev/reference/crates/` are a separate nested
# workspace, excluded here so the root build stays focused on the new runtime. # workspace, excluded here so the root build stays focused on the new runtime.
[workspace] [workspace]
@ -32,7 +32,7 @@ members = [
# "crates/app", # phase 06 target — ##app manifest # "crates/app", # phase 06 target — ##app manifest
] ]
exclude = [ exclude = [
"reference/crates", ".dev/reference/crates",
] ]
[workspace.dependencies] [workspace.dependencies]

View file

@ -1,27 +1,27 @@
# `crates/` — the `.wo` runtime # `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. Fifteen crates make up the new runtime. Only `rt/` carries real code today (Stage 2); the other fourteen are **planned** per the 7-phase design — scaffolds were deleted 2026-08-08; recreate each crate when its phase activates, so extraction from `rt` stays a mechanical move.
> 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/`](../reference/crates/) to distinguish the generations. > 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 [`.dev/reference/crates/`](../.dev/reference/crates/) to distinguish the generations.
## Map ## Map
| Phase | Crate | Purpose | Status | | Phase | Crate | Purpose | Status |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| 2 | [`ql`](./ql/) | `.wo` grammar — lexer, parser, AST | placeholder | | 2 | `ql` | `.wo` grammar — lexer, parser, AST | planned |
| 2 | [`value`](./value/) | tagged `Value` + dotted-path helpers | placeholder | | 2 | `value` | tagged `Value` + dotted-path helpers | planned |
| 2 | [`engine`](./engine/) | in-memory executor (rel / doc / graph) + schema catalog | placeholder | | 2 | `engine` | in-memory executor (rel / doc / graph) + schema catalog | planned |
| 2 | [`txn`](./txn/) | transaction coordinator — MVCC, `RETURNING` alias table | placeholder | | 2 | `txn` | transaction coordinator — MVCC, `RETURNING` alias table | planned |
| 2 | [`db`](./db/) | top-level facade — `open()`, `Tx`, `Query`, `Subscribe` | placeholder | | 2 | `db` | top-level facade — `open()`, `Tx`, `Query`, `Subscribe` | planned |
| 3 | [`wal`](./wal/) | write-ahead log — io_uring + fsync + recovery | placeholder | | 3 | `wal` | write-ahead log — io_uring + fsync + recovery | planned |
| 4 | [`sub`](./sub/) | live subscriptions — delta frames on commit | placeholder | | 4 | `sub` | live subscriptions — delta frames on commit | planned |
| 4 | [`http`](./http/) | wire protocol — REST / GraphQL-over-WS / native codec | placeholder | | 4 | `http` | wire protocol — REST / GraphQL-over-WS / native codec | planned |
| 5 | [`gen`](./gen/) | codegen — `.wo type` → Go / TS / Rust / Python clients | placeholder | | 5 | `gen` | codegen — `.wo type` → Go / TS / Rust / Python clients | planned |
| 6 | [`policy`](./policy/) | RBAC + row-level rules compiled into planner rewrites | placeholder | | 6 | `policy` | RBAC + row-level rules compiled into planner rewrites | planned |
| 6 | [`logic`](./logic/) | `on <event>` triggers + `fn ... in txn` interpreter | placeholder | | 6 | `logic` | `on <event>` triggers + `fn ... in txn` interpreter | planned |
| 6 | [`service`](./service/) | `service rest/graphql/native` endpoint dispatch | placeholder | | 6 | `service` | `service rest/graphql/native` endpoint dispatch | planned |
| 6 | [`ui`](./ui/) | `##ui` screens → SSR HTML + client runtime | placeholder | | 6 | `ui` | `##ui` screens → SSR HTML + client runtime | planned |
| 6 | [`app`](./app/) | `##app` route manifest + startup hooks | placeholder | | 6 | `app` | `##app` route manifest + startup hooks | planned |
| — | [`rt`](./rt/) | **active** — Stage-2 monolith + the `wo` binary | **shipped** | | — | [`rt`](./rt/) | **active** — Stage-2 monolith + the `wo` binary | **shipped** |
## Why `rt/` is monolithic right now ## Why `rt/` is monolithic right now
@ -49,6 +49,6 @@ cargo run --bin wo -- run docs/examples/blog # serve the blog sample
## What's outside this directory ## What's outside this directory
- [`../reference/crates/`](../reference/crates/) — the v1 writeonce blog (13 crates, nested workspace). Preserved for reference per [docs/runtime/database/07-wo-seg-migration.md](../docs/runtime/database/07-wo-seg-migration.md). Keeps its `wo-*` prefix. - [`../.dev/reference/crates/`](../.dev/reference/crates/) — the v1 writeonce blog (13 crates, nested workspace). Preserved for reference per [docs/runtime/database/07-wo-seg-migration.md](../docs/runtime/database/07-wo-seg-migration.md). Keeps its `wo-*` prefix.
- [`../prototypes/wo-db/`](../prototypes/wo-db/) — C++ prototype of the query-layer engine (~2k lines). The reference implementation this Rust port follows at the language level. - [`../prototypes/wo-db/`](../prototypes/wo-db/) — C++ prototype of the query-layer engine (~2k lines). The reference implementation this Rust port follows at the language level.
- [`../docs/plan/`](../docs/plan/) — planning documents for in-flight work (the `.md` files directly under `plan/` are upcoming phases; `plan/done/` holds completed ones). [`plan/done/01-scafolding-crates.md`](../docs/plan/done/01-scafolding-crates.md) is the authoritative scope doc for the 14 new placeholders. - [`../docs/plan/`](../docs/plan/) — planning documents for in-flight work (the `.md` files directly under `plan/` are upcoming phases; `plan/done/` holds completed ones). [`plan/done/01-scafolding-crates.md`](../docs/plan/done/01-scafolding-crates.md) is the authoritative scope doc for the 14 new placeholders.

View file

@ -7,11 +7,11 @@ scaffold sibling crates, multi-app ecommerce, REST + concurrency docs
and apps/storefront, with shared/ types/logic/components, per-app and apps/storefront, with shared/ types/logic/components, per-app
app.wo + wo.toml, and reusable .htmlx components (layout, money, app.wo + wo.toml, and reusable .htmlx components (layout, money,
order-row) order-row)
- add reference/rest/{blog,ecommerce}.rest — VS Code/JetBrains HTTP - add .dev/reference/rest/{blog,ecommerce}.rest — VS Code/JetBrains HTTP
request files driving the running prototype, including 501/404/405 request files driving the running prototype, including 501/404/405
expectations for stubbed endpoints expectations for stubbed endpoints
- add docs/plan/09-concurrency-scaleout.md and docs/plan/ui/00-overview.md; - add docs/plan/09-concurrency-scaleout.md and docs/plan/ui/00-overview.md;
refine docs/plan/assembly/02-writeonce-stance.md refine docs/plan/assembly/02-writeonce-stance.md
- refresh templates (about, article, header/footer, home, layout, styles) - refresh templates (about, article, header/footer, home, layout, styles)
and add static favicon/logo and add static favicon/logo
- add infra/sync.sh and tighten .gitignore for reference/ symlinks - add infra/sync.sh and tighten .gitignore for .dev/reference/ symlinks

View file

@ -4,16 +4,16 @@
hello: hello:
cargo run --bin wo -- run docs/examples/hello cargo run --bin wo -- run docs/examples/hello
# C runtime reference (prototypes/wo-rt-c): build, serve, CRUD round-trip, shut down # C runtime reference (runtime/): build, serve, CRUD round-trip, shut down
# Phase A: thread-per-core — each connection hashes to one shard (SO_REUSEPORT), # Phase A: thread-per-core — each connection hashes to one shard (SO_REUSEPORT),
# so a list may land on a different shard than the create. The counters on / # so a list may land on a different shard than the create. The counters on /
# show the spread. WO_THREADS=4 keeps the demo output readable. # show the spread. WO_THREADS=4 keeps the demo output readable.
rt-c-demo port="8085" threads="4": rt-c-demo port="8085" threads="4":
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
make -C prototypes/wo-rt-c make -C runtime
data=$(mktemp -d /tmp/wo-demo-XXXXXX) data=$(mktemp -d /tmp/wo-demo-XXXXXX)
WO_PORT={{port}} WO_THREADS={{threads}} WO_DATA=$data ./prototypes/wo-rt-c/wo-rt & WO_PORT={{port}} WO_THREADS={{threads}} WO_DATA=$data ./runtime/wo-rt &
server=$! server=$!
trap 'kill $server 2>/dev/null; sleep 0.3; rm -rf $data' EXIT trap 'kill $server 2>/dev/null; sleep 0.3; rm -rf $data' EXIT
base=http://127.0.0.1:{{port}} base=http://127.0.0.1:{{port}}
@ -26,18 +26,36 @@ rt-c-demo port="8085" threads="4":
curl -s "$base/api/notes"; echo curl -s "$base/api/notes"; echo
echo "--- spread:"; curl -s "$base/"; echo echo "--- spread:"; curl -s "$base/"; echo
# wovm VM core (runtime/src): build the binary
wovm-build:
make -C runtime wovm
# wovm full gate: unit suite (ASan+UBSan), ISO dispatch flavor, CLI smoke
wovm-test:
make -C runtime test
make -C runtime test-iso
bash runtime/test/cli_smoke.sh
# woc compiler front (compiler/): build the executable
woc-build:
dune build --root compiler
# woc gate: unit tests (test_diag) + golden suite (runner, WOC_BLESS=1 to update)
woc-test:
dune runtest --root compiler
# phase-F benchmark: reads, durable writes, 10k idle conns (scaled geometry) # phase-F benchmark: reads, durable writes, 10k idle conns (scaled geometry)
rt-c-bench port="8085" threads="8" conns="64": rt-c-bench port="8085" threads="8" conns="64":
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
make -C prototypes/wo-rt-c clean >/dev/null make -C runtime clean >/dev/null
make -C prototypes/wo-rt-c CFLAGS="-O2 -Wall -Wextra -std=c11 -DSLOTS_PER_SHARD=262144" wo-rt bench >/dev/null make -C runtime CFLAGS="-O2 -Wall -Wextra -std=c11 -DSLOTS_PER_SHARD=262144" wo-rt bench >/dev/null
data=$(mktemp -d /tmp/wo-bench-XXXXXX) data=$(mktemp -d /tmp/wo-bench-XXXXXX)
WO_PORT={{port}} WO_THREADS={{threads}} WO_DATA=$data ./prototypes/wo-rt-c/wo-rt >/dev/null 2>&1 & WO_PORT={{port}} WO_THREADS={{threads}} WO_DATA=$data ./runtime/wo-rt >/dev/null 2>&1 &
server=$! server=$!
trap 'kill $server 2>/dev/null; sleep 0.3; rm -rf $data; make -C prototypes/wo-rt-c clean >/dev/null; make -C prototypes/wo-rt-c wo-rt bench >/dev/null' EXIT trap 'kill $server 2>/dev/null; sleep 0.3; rm -rf $data; make -C runtime clean >/dev/null; make -C runtime wo-rt bench >/dev/null' EXIT
base=127.0.0.1; for _ in $(seq 1 40); do curl -s "http://$base:{{port}}/healthz" >/dev/null && break; sleep 0.25; done base=127.0.0.1; for _ in $(seq 1 40); do curl -s "http://$base:{{port}}/healthz" >/dev/null && break; sleep 0.25; done
B=./prototypes/wo-rt-c/bench/bench B=./runtime/bench/bench
echo "wo-rt-c ({{threads}} shards, durable WAL):" echo "wo-rt-c ({{threads}} shards, durable WAL):"
$B $base {{port}} {{conns}} 5 /healthz $B $base {{port}} {{conns}} 5 /healthz
$B $base {{port}} {{conns}} 5 / $B $base {{port}} {{conns}} 5 /