Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 14 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ jobs:
run: cargo test --locked --workspace --all-targets
- name: CLI project gates
run: |
cargo run --locked -p uhura-cli -- fmt --check examples/instagram/client
# Project-wide formatting remains gated on RFC 0003 comment
# attachment; the formatter refuses to erase the evidence catalogue's
# authored comments.
cargo run --locked -p uhura-cli -- check examples/instagram/client --deny-warnings
cargo run --locked -p uhura-cli -- trace examples/instagram/client --script=demo > /dev/null
cargo run --locked -p uhura-cli -- trace examples/instagram/client --script=feed_like_refused_scenario --expanded > /dev/null

- name: Check out Spock integration source
uses: actions/checkout@v4
with:
repository: gridaco/spock
ref: 66edad443660361ec98414f212203868408dcdc5
ref: e99d1af1b045b7db744da77f1415b83b65064dc2
path: .ci/spock
submodules: false
persist-credentials: false
Expand Down Expand Up @@ -200,7 +202,7 @@ jobs:
import sys

state = json.loads(pathlib.Path(sys.argv[1]).read_text())
assert state["protocol"] == "uhura-editor-state/2"
assert state["protocol"] == "uhura-editor-state/5"
assert isinstance(state["sourceRevision"], int)
assert state["sourceRevision"] >= 1
render = state["render"]
Expand All @@ -210,12 +212,18 @@ jobs:
assert isinstance(render["authoring"]["targets"], list)
assert render["authoring"]["targets"]
assert isinstance(render["authoring"]["entries"], list)
assert render["authoring"]["entries"]
assert render["authoring"]["entries"] == []
assert isinstance(render["groups"], list)
assert render["groups"]
assert all(isinstance(preview["documentation"], dict) for preview in render["previews"])
assert all(isinstance(preview["provenance"]["occurrences"], list) for preview in render["previews"])
assert any(preview["documentation"]["declarationDocId"] for preview in render["previews"])
assert all(
preview["documentation"] == {
"declarationDocId": None,
"exampleDocId": None,
}
for preview in render["previews"]
)
assert any(preview["provenance"]["occurrences"] for preview in render["previews"])
PY

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
/web/node_modules
/web/dist
/examples/instagram/client/providers/dist
/examples/instagram/client/build
/examples/applications/*/answers/*/build
/examples/programs/answers/*/build
.DS_Store
51 changes: 29 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The Uhura spike workspace. Cargo language commands are independently
# buildable; browser assets are separate build/package products (RFC 0002).
# Design: docs/working-group/instagram-spike-design.md.
# The Uhura workspace. Cargo language commands are independently buildable;
# browser assets are separate build/package products (RFC 0002).
# Active incubation design: docs/spec/drafts/0.4/README.md.
[workspace]
resolver = "3"
members = ["crates/*"]
Expand All @@ -26,14 +26,17 @@ same-file = "1"
ttf-parser = "0.25"
brotli = "7"
wuff = { version = "0.2.8", default-features = false }
num-bigint = { version = "0.4", features = ["serde"] }
num-integer = "0.1"
num-traits = "0.2"
unicode-ident = "1"

# Internal
uhura-base = { path = "crates/uhura-base" }
uhura-syntax = { path = "crates/uhura-syntax" }
uhura-port = { path = "crates/uhura-port" }
uhura-check = { path = "crates/uhura-check" }
uhura-core = { path = "crates/uhura-core" }
uhura-fixture = { path = "crates/uhura-fixture" }
uhura-editor-model = { path = "crates/uhura-editor-model" }
uhura-host = { path = "crates/uhura-host" }
uhura-cli = { path = "crates/uhura-cli" }
Expand Down
88 changes: 56 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# Uhura

Uhura is a declarative UI language and deterministic experience runtime.
Uhura is a frontend builder system whose core is a deterministic state-machine
language with an explicit, opt-in Web UI profile.

An Uhura program defines what an interface presents, the local UI state that
drives it, and how semantic events advance that state. The checker validates
elements, handlers, commands, and outcomes before the program runs. The runtime
then evaluates the program into a renderer-neutral semantic view.
An Uhura machine defines configuration, owned state, typed inputs, atomic
reactions, ordered commands, and a pure public observation. The checker
validates that complete program before it runs. The active 0.4 frontend
evaluates Rust-shaped core source and explicit `use uhura::ui;` Web
presentation without changing that semantic boundary. Evidence uses the same
frontend and adds source-authored scenarios, checkpoints, pins, and static
examples without creating a second execution model.

Uhura owns experience behavior, not pixels or product truth. Renderers own
layout and presentation; providers own authoritative data and operations.
Uhura owns experience behavior, not pixels or product truth. The browser owns
layout and presentation; admitted adapters own browser capabilities and access
to authoritative data and operations.

## What it provides

- A closed, checkable language for pages, components, surfaces, and events.
- Deterministic state transitions and replayable interaction traces.
- Typed ports for fixture-backed tests and live providers.
- A closed, checkable language for deterministic state machines.
- Optional checked Web presentations, semantic events, and surfaces.
- Deterministic reactions, checkpoints, evidence, and interaction traces.
- Typed ports admitted against exact adapter ownership and contract identities.
- A read-only Editor for browsing checked previews.
- A Play mode for running the experience against a provider.
- Native and Wasm runtimes with conformance tests.
- One canonical engine used natively and through Wasm, with cross-boundary
conformance tests.

The full-stack Instagram project in
[`examples/instagram/`](examples/instagram/) exercises the complete workflow;
Expand All @@ -41,54 +48,60 @@ be authoritative in both systems.

## Run the example

From the repository root, install and build the browser application once:
From the Uhura repository root, build the Wasm engine and browser application
once:

```sh
cd web
corepack pnpm install --frozen-lockfile
corepack pnpm build
cd ..
corepack pnpm@10.11.0 -C web install --frozen-lockfile
scripts/build-wasm.sh
corepack pnpm@10.11.0 -C web build
```

Start the complete framework example with the npm-distributed Spock CLI:
Open the independently checkable Instagram client in the Uhura Editor:

```sh
npx --yes spock@0.5.0 start examples/instagram
cargo run --locked -p uhura-cli -- editor examples/instagram/client
```

The Editor opens at <http://127.0.0.1:4000/>. Use its Play action or open
<http://127.0.0.1:4000/play> to run the experience against the seeded Spock
authority on the same origin.
The Editor opens at <http://127.0.0.1:8787/>. To run Play against the complete
seeded Spock authority on one origin, use the framework command documented by
the [Instagram example](examples/instagram/).

Useful commands:

```sh
# Check a project
cargo run --locked -p uhura-cli -- check examples/instagram/client
# Check source, lower one machine program, and execute all authored evidence
cargo run --locked -p uhura-cli -- check \
examples/instagram/client --deny-warnings

# Run Uhura Editor without the Spock authority
cargo run --locked -p uhura-cli -- editor examples/instagram/client
# Start Play as the primary route; Editor remains available at /
cargo run --locked -p uhura-cli -- play examples/instagram/client

# Run a deterministic interaction trace
# Serialize one source-authored evidence scenario as canonical JSONL
cargo run --locked -p uhura-cli -- trace examples/instagram/client \
--script=like-refused --expanded
--script=feed_like_refused_scenario --expanded

# Test the Rust workspace
cargo test --workspace
cargo test --locked --workspace

# Check the browser application
(cd web && corepack pnpm check)
corepack pnpm@10.11.0 -C web check
```

`check` and `trace` use the same checked program and evidence runner that feed
Editor previews. `--script` selects an authored `scenario`; it is not a
fixture-script language or an alternate runtime.

## Repository layout

- [`crates/`](crates/) — checker, runtime, Wasm bindings, and CLI.
- [`crates/`](crates/) — checker, runtime, host, Wasm bindings, CLI, and the
[single-engine acceptance crate](crates/uhura-tests/).
- [`web/`](web/) — Editor and Play browser application.
- [`examples/`](examples/) — language-design program and application harnesses, plus the full-stack Instagram example.
- [`docs/doctrine/`](docs/doctrine/) — durable language doctrine and review principles.
- [`docs/spec/`](docs/spec/) — stable router for disposable drafts and future version specifications.
- [`docs/widgets/`](docs/widgets/) — stable capability taxonomy and version-scoped catalogues.
- [`docs/implementation/`](docs/implementation/) — current non-normative code ownership and contributor change routes.
- [`docs/rfcs/`](docs/rfcs/) — historical proposals and supersedable decisions.
- [`docs/studies/`](docs/studies/) — stable research router with disposable study leaves.

Expand All @@ -101,12 +114,22 @@ Uhura's behavioral language is being reviewed from first principles. The
[design principles](docs/doctrine/principles.md) define the questions, while
these references provide the current evidence:

- [Uhura 0.4 incubation candidate](docs/spec/drafts/0.4/) consolidates the
active design: a source-neutral transaction kernel, Rust-shaped
machine source, Svelte-shaped `ui`, and modular source that lowers to one
global machine IR.
- [Language necessity and surface reuse](docs/studies/language-necessity-and-surface-reuse.md)
asks whether Uhura needs an independently owned language at all.
- [Program harnesses](examples/programs/README.md) provide language-neutral
L0–L2 problems for comparing candidate semantics.
- [A0 Return Desk](examples/applications/a0-return-desk/README.md) provides the
parallel practical application-transfer problem.
- [Uhura 0.4](examples/programs/answers/uhura-0.4/) exercises the current
candidate against L0–L2; the application harness carries the corresponding
A0 answer. [Relay B3](docs/spec/drafts/relay-b3/) is the short historical
pointer for the experiment that preceded this shape. It is not a runtime,
module, authored language, or product boundary. Retired source remains
recoverable from Git history rather than executable in the current tree.
- [Transactional state-machine language prior art](docs/studies/transactional-state-machine-language-prior-art.md)
compares Scilla, FSM-Hume, Lustre/SCADE, Kôika/Bluespec, Elm, and adjacent
models.
Expand All @@ -126,7 +149,8 @@ policy may change while the language and toolchain are being established.

- [Documentation index and authority](docs/README.md)
- [Language doctrine](docs/doctrine/README.md)
- [Specification router and current v0 draft](docs/spec/README.md)
- [Widget taxonomy and current v0 draft](docs/widgets/README.md)
- [Specification router and historical design drafts](docs/spec/README.md)
- [Widget taxonomy and version-scoped catalogues](docs/widgets/README.md)
- [Current implementation map](docs/implementation/README.md)
- [RFC index](docs/rfcs/README.md)
- [Studies](docs/studies/README.md)
Loading
Loading