Skip to content

Commit f54565a

Browse files
UnbreakableMJclaude
andcommitted
docs(claude): add architecture, commands, and pre-flight pitfalls
Adds a 30-second architecture overview, a concrete commands block (build / test / lint / xtask audits / nix dev shell), a pitfall about GPU/NPU crates being excluded from default-members, and corrects the stale Steelbore-era project-memory path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4aa2180 commit f54565a

1 file changed

Lines changed: 73 additions & 13 deletions

File tree

CLAUDE.md

Lines changed: 73 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,62 @@ turns.
1414

1515
---
1616

17+
## Architecture in 30 Seconds
18+
19+
14-crate workspace. The binary `caliper` depends only on `caliper-trace`
20+
(public API re-exports) and `caliper-tui`. `caliper-trace` re-exports from
21+
`caliper-crucible` (pipeline orchestrator). `caliper-crucible` drives the
22+
seven-stage DAG across the stage crates:
23+
24+
```
25+
Assayer → Smelt → Etch → Burin → Temper → Weld → Cast
26+
(route) (quant) (edge) (trace) (fit) (stitch) (write)
27+
```
28+
29+
`caliper-anvil` is the SIMD primitives layer — the only crate allowed
30+
`unsafe`. `caliper-bellows` (wgpu GPU) and `caliper-touchstone`
31+
(ONNX Runtime NPU) are feature-gated optional backends and excluded from
32+
`default-members` in the workspace `Cargo.toml`. `caliper-tui` is the
33+
`--format explore` ratatui interface, never depended on by library crates.
34+
35+
Status: pre-v0.1.0. Most crates are scaffolds with module-level docs;
36+
[`TODO.md §1`](TODO.md) drives the current sprint.
37+
38+
---
39+
40+
## Commands
41+
42+
### Build / test / lint
43+
- `cargo build --workspace` — builds default-members (CPU-only surface).
44+
- `cargo build -p caliper-bellows` / `-p caliper-touchstone` — GPU / NPU
45+
crates are excluded from `default-members` (heavy native deps: wgpu,
46+
ort/ONNX Runtime), so build them by name.
47+
- `cargo test --workspace` — full test suite.
48+
- `cargo test -p <crate> <name>` — run a single test (e.g.
49+
`cargo test -p caliper-smelt kmeans::tests::converges`).
50+
- `cargo test --test schema_roundtrip` — JSON-schema round-trip;
51+
a failure is P0 per pitfall #4 below.
52+
- `cargo +nightly miri test -p caliper-anvil` — Miri-validates the only
53+
crate where `unsafe` is allowed.
54+
- `cargo insta test` — TUI snapshot tests (`caliper-tui`).
55+
- `cargo clippy --workspace --all-targets -- -D warnings` — CI lint gate.
56+
- `cargo fmt --all --check` — CI format gate.
57+
58+
### Workspace audits (via `cargo xtask`, aliased in `.cargo/config.toml`)
59+
- `cargo xtask spdx-audit` — every source file has a GPL-3.0-or-later header.
60+
- `cargo xtask utf8-audit` — UTF-8 without BOM on every text file.
61+
- `cargo xtask network-audit` — no network I/O outside `caliper models pull`.
62+
- `cargo xtask cross-shell-test` — CLI round-trip under POSIX sh / Bash /
63+
Brush / Nushell / PowerShell / Ion.
64+
- `cargo deny check` (alias: `cargo deny`) — license + advisory + sources
65+
audits.
66+
67+
### Dev shell
68+
- `nix develop` — reproducible toolchain pinned in `flake.nix` +
69+
`rust-toolchain.toml` (Rust 1.88.0, Edition 2024).
70+
71+
---
72+
1773
## Before You Edit Any `.rs` File
1874

1975
Invoke the `rust-guidelines` skill. It is mandatory for every Rust touch, no
@@ -26,13 +82,13 @@ For non-Rust work, the relevant skills are:
2682
| You are about to … | Skill to invoke |
2783
|---------------------------------------------|---------------------------|
2884
| Touch any `.rs` file | `rust-guidelines` |
29-
| Touch any CLI surface, `--json`, schema | `steelbore-cli-standard` |
30-
| Touch agentic UX, AGENTS.md, MCP | `steelbore-agentic-cli` |
31-
| Touch TUI, palette, typography | `steelbore-standard` + `steelbore-theme-factory` |
32-
| Touch documents (PRD/PLAN/TODO/README/docs) | `steelbore-document-format` |
33-
| Run a shell command | `steelbore-cli-preference` + `steelbore-cli-shell` |
34-
| Install missing software | `steelbore-missing-pkg` |
35-
| Generic Steelbore compliance question | `steelbore-standard` |
85+
| Touch any CLI surface, `--json`, schema | `spacecraft-cli-standard` |
86+
| Touch agentic UX, AGENTS.md, MCP | `spacecraft-agentic-cli` |
87+
| Touch TUI, palette, typography | `spacecraft-standard` + `spacecraft-theme-factory` |
88+
| Touch documents (PRD/PLAN/TODO/README/docs) | `spacecraft-document-format` |
89+
| Run a shell command | `spacecraft-cli-preference` + `spacecraft-cli-shell` |
90+
| Install missing software | `spacecraft-missing-pkg` |
91+
| Generic Spacecraft Software compliance question | `spacecraft-standard` |
3692

3793
---
3894

@@ -41,7 +97,7 @@ For non-Rust work, the relevant skills are:
4197
- **File reads**`Read`. Never `cat`.
4298
- **File edits**`Edit` for diffs, `Write` for new files / full rewrites.
4399
- **Search**`rg` (ripgrep), `fd` for filenames. Never bare `grep` or `find`.
44-
See `steelbore-cli-preference` for the full mapping.
100+
See `spacecraft-cli-preference` for the full mapping.
45101
- **JSON inspection**`jaq`, not `jq`.
46102
- **Tests**`cargo test --workspace`. For TUI snapshots: `cargo insta test`.
47103
- **Lints**`cargo clippy --workspace --all-targets -- -D warnings`.
@@ -51,10 +107,10 @@ For non-Rust work, the relevant skills are:
51107

52108
## Output Style
53109

54-
- Match the [Steelbore Standard §12](https://Steelbore.com/standard) date/time
110+
- Match the [Spacecraft Software Standard §12](https://SpacecraftSoftware.org/standard) date/time
55111
rules in every commit message, log line, and PR description: ISO 8601 UTC
56112
with `Z` suffix. 24-hour time. Metric units.
57-
- Steelbore palette in any colored output. Void Navy `#000027` is the canonical
113+
- Spacecraft Software palette in any colored output. Void Navy `#000027` is the canonical
58114
background.
59115

60116
---
@@ -74,12 +130,16 @@ For non-Rust work, the relevant skills are:
74130
`cargo test --test schema_roundtrip` and a failing round-trip is a P0.
75131
5. **"Cache the model auto-download in `~/.cache`."** No. PFA §6 — no network
76132
I/O outside `caliper models pull`. The cache is read-only at runtime.
133+
6. **"`cargo build --workspace` is green, so my GPU change is fine."** No.
134+
`caliper-bellows` and `caliper-touchstone` are excluded from
135+
`default-members`. Build them by name (`cargo build -p caliper-bellows`)
136+
before claiming a GPU/NPU change works.
77137

78138
---
79139

80140
## Where to Stash Notes Between Sessions
81141

82-
Use the conversation memory (`/home/mj/.claude/projects/-steelbore-caliper/memory/`).
142+
Use the conversation memory (`/home/mj/.claude/projects/-spacecraft-software-caliper/memory/`).
83143
Anything you learn about the user's workflow preferences, project context, or
84144
non-obvious decisions belongs there — not in PR descriptions or comments.
85145

@@ -90,6 +150,6 @@ Memory files are *agent's* memory and are session-local.
90150

91151
## Maintainer
92152

93-
**Mohamed Hammad** &lt;[Mohamed.Hammad@Steelbore.com](mailto:Mohamed.Hammad@Steelbore.com)&gt;
153+
**Mohamed Hammad** &lt;[Mohamed.Hammad@SpacecraftSoftware.org](mailto:Mohamed.Hammad@SpacecraftSoftware.org)&gt;
94154
Copyright (c) 2026 Mohamed Hammad &nbsp;|&nbsp; License: GPL-3.0-or-later
95-
[https://Caliper.Steelbore.com/](https://Caliper.Steelbore.com/)
155+
[https://Caliper.SpacecraftSoftware.org/](https://Caliper.SpacecraftSoftware.org/)

0 commit comments

Comments
 (0)