Expand description
mesofact-dev — the dev-tier affordances, and nothing else.
This crate is deliberately small. The serving engine (Server, SSR
dispatch, the revalidate receiver, tenants, the same-origin proxy) used to
live here, which meant the prod mesofact-serve binary — which shipped
from this crate — linked the file watcher and the dev S3 surface. That broke
the dev/prod crate boundary W225 §2 relies on for its security claim
(“prod is clean by construction … the crate boundary already keeps it out of
prod”). It wasn’t: cleanliness rested on linker dead-stripping.
The engine now lives in the mesofact facade and this crate depends on
it, holding only the pieces that must never reach a prod binary:
watcher— the rebuild-on-change file watcher.s3— the local S3 surface that stands in for R2 duringdev(W225 §2 “local pond emulation”).app— the library-tier dev entry point,serve_app: the dev counterpart ofmesofact::serve_appfor a consumer whose routes are Rust handlers rather than a builtdist/tree. Read its module doc for what the dev half of that tier is and, just as load-bearing, what it deliberately is not.cli— themestoolchain CLI, and the two bin targets over it.
cli carries the prod verbs (serve, publish, new) as well as the
dev ones, so consumers learn one CLI — but it gets them by calling into
mesofact::cli, which is the direction that costs the prod binary
nothing. The boundary above is about what links into a binary, not about
which verbs a binary spells.
Engine types are re-exported below so existing mesofact_dev::Server-style
callsites keep working; new code should prefer mesofact::… directly.
@arch:see(.yah/docs/working/W225-mesofact-consumer-deployment-model.md)
Re-exports§
pub use app::serve_app;pub use app::DevServer;pub use app::DEV_STATE_DIR;pub use s3::DevS3;pub use s3::DEFAULT_BUCKET as DEV_S3_BUCKET;pub use watcher::BuildDriver;pub use watcher::WatchOptions;pub use watcher::Watcher;
Modules§
- app
- The library-tier dev entry point —
serve_app, the counterpart tomesofact::serve_appfor a consumer whose routes are Rust handlers. - cli
mes— the mesofact dev toolchain.- proxy
- Same-origin reverse proxy for the dev server (R513-F10, W207 Gap #1).
- revalidate
revalidate— the ephemeral revalidate receiver: the mesofact-native replacement for the standalonealmanac-servebinary (W225 §3/§4).- s3
- Dev-tier S3 surface (R490-F7).
- server
mesofact-dev— axum static-file server formesofact-staticworkload artifacts, with optional file-watch + auto-rebuild + atomic pointer swap.- ssr
- In-process SSR dispatch for
mode:"ssr"routes (R449-F2; supersedes the bun-subprocess implementation R434-F3 shipped). - tenants
- Multi-tenant
tenants/<id>.tomlregistry for the revalidate receiver. - watcher
- File-watch + auto-rebuild loop for
mesofact-staticworkloads.
Structs§
- Dist
Pointer - Shared, atomically-swappable pointer to the currently-served
html/directory. Cheap to clone; reads take a short read-lock. - Identity
- Logical identity of a running mesofact-dev: the
(service, component)the camp/reconciler spawned it for. Served verbatim at/__mesofact/infoso an adopter can confirm a listener on a given port is its dev server before adopting it, rather than blindly hijacking whatever holds the port (a cross-service host-port collision would otherwise silently serve the wrong site — R602-B4). - Proxy
Map - An ordered set of
prefix → backend base URLproxy routes. Matching is longest-prefix-first, so a more specific/auth/admincan shadow a broader/authif both are present. - Proxy
State - Shared proxy state: the route map plus a single reusable HTTP client. Held in
the server state and cloned (cheaply — both are
Arc-backed) per request. - Resilience
Policy - W181 v1 — schema mirror of
mesofact_core::manifest::ResiliencePolicy. - Retry
Policy - Server
- Static-file dev server for one
mesofact-staticworkload. - SsrChild
- In-process SSR dispatch + the data the router needs to use it.
- SsrSlot
- Swappable holder for the SSR child. The router reads
current()on every request; the watcher’s post-build hook installs (or rotates) the child after each successful gen flip. Cheap to clone. - SsrSpawn
Options - Options for
spawn. The workload directory anchors the state dir; the gen_dir is the snapshot the SSR runtime should resolve entrypoints against.
Constants§
- DEFAULT_
PORT - Default port for the local-static provider slot.
- DEFAULT_
RESILIENCE_ TIMEOUT_ MS - Default per-attempt request timeout when
resilience.timeout_msis unset.