swactor/crates/dashboard
Zachery Aaron Shores-Chmielewski b887e941cb feat(engine): substrate-neutral execution engine abstraction
Introduce the swactor engine: a swactor-owned composite that retains a
selected execution substrate, drives the core runtime, and hosts the
async/blocking/timer work that backs actors. Integrations receive one
cloneable EngineHandle and never construct or borrow a raw Tokio
runtime/handle.

Engine crate (crates/engine):
- The contract: spawn / spawn_blocking / timer / interval / now, a
  per-implementation capability model with construction-time binding
  (require()), and engine-owned time. The engine owns all progression;
  actor handlers stay synchronous and never .await.
- TokioBackend owns the Tokio runtime and schedules core ticks and
  supporting futures on it; SteppingBackend is a single-threaded
  deterministic scheduler with virtual time (the non-Tokio portability
  proof). Core is driven through its existing tick() surface; a
  self-rescheduling CoreDriver is installed at construction and is the
  sole place permitted to call try_tick.

iroh-driver:
- Receives an EngineHandle instead of a raw Tokio Handle. Accepts,
  reads, dials, writes, endpoint construction, and teardown schedule
  through it; required capabilities (tasks/timers/io) are validated
  before the endpoint binds. Engine-hosted interval pumps drive
  actor-bridge, datastream, and edge ingress.

myelin:
- One node/orchestrator engine owns core, protocol tick injection, and
  transport progression; the application loop only drains
  integration-owned queues. Stage-shard process readers, delayed actor
  messages, helper stdout/stderr, prompt RPC, and CPU sampling all
  schedule through the engine (spawn_blocking / engine tasks / timers).
- Removed the split-engine APIs: install_actor_bridge_pump(period) and
  spawn_protocol_ticker(period) use each component's stored engine;
  deleted the no-op pump_network callback and its plumbing; deleted the
  dashboard raw-Tokio/standalone-runtime conveniences.

Enforcement:
- A clippy disallowed-methods boundary forbids direct runtime/scheduling/
  time/core-driving bypasses, denied in swactor-engine, iroh-driver, and
  myelin. Retained excluded uses (VastAI provider, provider process
  supervision/log capture, OS-signal/stdin/process-control sequencing)
  carry narrow allowances with reasons.

Verification:
- Engine contract + unit tests (incl. the SteppingBackend portability
  proof), iroh integration tests (capability rejection before binding,
  multi-node actor behavior), and a production execution-composition
  smoke test that observes engine-driven actor progress with no ambient
  Tokio runtime and no manual tick/pump. Workspace all-target/all-feature
  clippy and tests are green.

Specs co-located with their crates: ENGINE_SPEC.md in crates/engine,
IROH_DRIVER_SPEC.md in crates/iroh-driver. VastAI remains explicitly out
of scope pending its separate redesign.
2026-08-11 00:23:03 +04:00
..
src feat(engine): substrate-neutral execution engine abstraction 2026-08-11 00:23:03 +04:00
.gitignore feat: stability for deployment and distribution (#44) 2026-02-19 14:39:33 +00:00
AGENTS.md feat: actor view panels for the dashboard 2026-08-03 14:18:24 +04:00
Cargo.lock refactor(dashboard): rebuild around swactor worker view 2026-06-25 11:29:16 +04:00
Cargo.toml feat: proper README, LICENSE, and our first quick example 2026-08-06 00:53:16 +04:00
README.md feat: actor view panels for the dashboard 2026-08-03 14:18:24 +04:00

dashboard

Read-only HTML/SSE dashboard over incoming datastream frames.

The crate owns the Axum server, bounded raw frame window, and view registry. Component crates can keep their own view implementations beside their code and register them through DashboardHandle::register_view. The built-in swactor views are hosted here because worker/actor/message processing is universal to swactor programs: the worker page, and the actor overview (fused roster) plus per-actor dossier.

Routes

  • GET / — dashboard index
  • GET /events — raw incoming frames as SSE
  • GET /api/frames — recent raw frame window
  • GET /api/views — registered view metadata
  • GET /view/datastream/live — generic live explorer over retained and incoming datastream frames
  • GET /api/view/datastream/live — bounded per-stream/channel explorer snapshot
  • GET /view/fleet — compact fleet overview and focused machine telemetry
  • GET /api/view/fleet — fleet and machine telemetry JSON snapshot
  • GET /view/swactor/workers — built-in worker page
  • GET /api/view/swactor/workers — worker page JSON snapshot
  • GET /view/swactor/actor-overview — built-in actor overview + roster page
  • GET /api/view/swactor/actor-overview — actor overview JSON snapshot
  • GET /view/swactor/actor-dossier — built-in per-actor dossier page
  • GET /api/view/swactor/actor-dossier — actor dossier JSON snapshot

All state is derived from observed frames. The dashboard sends no control signals back to producers.