Skip to content

Commit 074eb63

Browse files
authored
Merge pull request #16 from stlab/sean-parent/begin-crate
feat: add begin crate — Dioxus + D3 property model visualizer
2 parents c2029c1 + 073b83a commit 074eb63

20 files changed

Lines changed: 8827 additions & 244 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,21 @@ jobs:
2323

2424
- name: Cache dependencies
2525
uses: Swatinem/rust-cache@v2
26-
26+
2727
- name: Check formatting
2828
run: cargo fmt --check
2929

30-
- name: Build all workspace members
31-
run: cargo build --workspace --verbose
32-
33-
- name: Run tests for all workspace members
34-
run: cargo test --workspace --verbose -- --nocapture
35-
36-
- name: Run clippy on all workspace members
37-
run: cargo clippy --workspace -- -D warnings
30+
- name: Build workspace (excluding begin app)
31+
run: cargo build --workspace --exclude begin --verbose
32+
33+
- name: Check begin app (renderer-agnostic)
34+
run: cargo check -p begin --no-default-features
35+
36+
- name: Run tests for workspace (excluding begin app)
37+
run: cargo test --workspace --exclude begin --verbose -- --nocapture
38+
39+
- name: Clippy workspace (excluding begin app)
40+
run: cargo clippy --workspace --exclude begin -- -D warnings
41+
42+
- name: Clippy begin app (renderer-agnostic)
43+
run: cargo clippy -p begin --no-default-features -- -D warnings

CLAUDE.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,31 @@ cargo doc --lib --no-deps --open --workspace
3535
```
3636

3737
Sanitizer runs require nightly and a target triple (e.g. `x86_64-apple-darwin` or `x86_64-unknown-linux-gnu`):
38+
3839
```bash
3940
RUSTFLAGS=-Zsanitizer=address cargo +nightly test -Zbuild-std --target <triple> --lib --workspace
4041
RUSTFLAGS=-Zsanitizer=thread cargo +nightly test -Zbuild-std --target <triple> --workspace
4142
RUSTFLAGS=-Zsanitizer=leak cargo +nightly test -Zbuild-std --target <triple> --workspace
4243
```
4344

45+
## Git Workflow
46+
47+
Always create a feature branch before making changes. If the current branch is `main`, create a
48+
branch first:
49+
50+
```bash
51+
git checkout -b <username>/<feature-name>
52+
```
53+
54+
Never commit directly to `main`.
55+
56+
## Project Status
57+
58+
This project has not been released yet and has no clients. The API is not stable and may change at
59+
any time. The project is in **active development** and is not yet feature-complete. Prefer
60+
redesigning any components rather than patching them or layering on top of them. The goal is to have a
61+
**clean, correct, and efficient** implementation.
62+
4463
## Architecture
4564

4665
This is a workspace with three crates:
@@ -53,12 +72,12 @@ This is a workspace with three crates:
5372

5473
The runtime is a **stack-based expression evaluator** built in four layers of increasing type safety:
5574

56-
| Layer | File | Role |
57-
|-------|------|------|
58-
| `RawStack` | `raw_stack.rs` | Byte-aligned unsafe stack; `push<T>` returns padding bool, `pop<T>` requires it |
59-
| `RawSegment` | `raw_segment.rs` | Op list + closure storage + per-op dropper functions |
60-
| `DynSegment` | `dyn_segment.rs` | Runtime type-checking wrapper; maintains `stack_ids: Vec<StackInfo>` |
61-
| `Segment<Args, Stack>` | `segment.rs` | Zero-cost compile-time phantom wrapper; `Args: IntoList`, `Stack: List` |
75+
| Layer | File | Role |
76+
| ---------------------- | ---------------- | ------------------------------------------------------------------------------- |
77+
| `RawStack` | `raw_stack.rs` | Byte-aligned unsafe stack; `push<T>` returns padding bool, `pop<T>` requires it |
78+
| `RawSegment` | `raw_segment.rs` | Op list + closure storage + per-op dropper functions |
79+
| `DynSegment` | `dyn_segment.rs` | Runtime type-checking wrapper; maintains `stack_ids: Vec<StackInfo>` |
80+
| `Segment<Args, Stack>` | `segment.rs` | Zero-cost compile-time phantom wrapper; `Args: IntoList`, `Stack: List` |
6281

6382
The compile-time type system uses **cons-cell heterogeneous lists** (`CStackList<H,T>` / `CNil`) defined in `c_stack_list.rs` and `list_traits.rs`.
6483

@@ -77,6 +96,7 @@ The compile-time type system uses **cons-cell heterogeneous lists** (`CStackList
7796
## Code Style
7897

7998
### Avoid heap allocations
99+
80100
- Pass `&str` / `&[T]` rather than cloning into `String` / `Vec<T>`
81101
- Use generics or `fn` pointers instead of `Box<dyn Trait>` when the type set is statically known
82102
- Return `&[T]` or `impl Iterator` over owned collections when the data already lives elsewhere
@@ -98,11 +118,13 @@ Every function must have a `///` doc comment written in **contract style**. The
98118
If you cannot write a simple contract for a function, treat that as a signal that the design needs improvement.
99119

100120
Additional rules:
121+
101122
- For parser functions, the grammar production is the summary: `/// \`additive_expression = multiplicative_expression { ("+" | "-") multiplicative_expression }.\``
102123
- Use `# Examples` for all public APIs.
103124
- Modules use `//!` with a usage tutorial.
104125

105126
**Example:**
127+
106128
```rust
107129
/// Removes and returns the top element.
108130
///
@@ -123,4 +145,5 @@ Derive tests from the **contract and public interface only** — do not read or
123145
Precondition violations have unspecified behavior and should not be tested. Tests written against the implementation risk encoding bugs rather than verifying intent.
124146

125147
### Fallible ops
148+
126149
Operations that can fail use `.op1r` / `.op2r` variants (returning `Result`) rather than `.op1` / `.op2`. Arithmetic on signed integers must use `checked_*` operations, not wrapping arithmetic.

0 commit comments

Comments
 (0)