diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 8de5081b..27fa0be4 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,23 +1,22 @@ #!/usr/bin/env bash # Design-corpus enforcement: no binding page, no functional change. # -# If a commit touches src/, it must also touch a Type: law or Type: spec page -# under wiki/. Root DESIGN.md is navigation and does not satisfy the rule. +# If a commit touches crates/ (or legacy src/), it must also touch a Type: law +# or Type: spec page under wiki/. Root DESIGN.md is navigation and does not +# satisfy the rule. set -euo pipefail -# Catch malformed corpus metadata and a resurrected DESIGN.md doorway before -# the commit exists. The full server workflow calls the same script. bash tools/corpus_gate.sh changed=$(git diff --cached --name-only --diff-filter=ACMR HEAD) [ -n "$changed" ] || exit 0 -echo "$changed" | grep -q "^src/" || exit 0 +echo "$changed" | grep -qE '^(crates/|src/)' || exit 0 touches_binding=0 while IFS= read -r path; do case "$path" in - wiki/*.md) + wiki/*.md|wiki/*/*.md|wiki/*/*/*.md|wiki/*/*/*/*.md|wiki/*/*/*/*/*.md) if [ -f "$path" ] && grep -qE '^Type: (law|spec)$' "$path"; then touches_binding=1 break @@ -29,15 +28,12 @@ done <<< "$changed" if [ "$touches_binding" -eq 0 ]; then echo "" echo "DESIGN CORPUS VIOLATION" - echo " This commit touches src/ but does not amend a changed Type: law" - echo " or Type: spec page under wiki/." + echo " This commit touches crates/ (or src/) but does not amend a changed" + echo " Type: law or Type: spec page under wiki/." echo "" echo " Amend the binding page that owns the behavior in the same commit." echo " Root DESIGN.md is a doorway and does not count." echo "" - echo " If this is genuinely non-functional source churn, bypass the local" - echo " hook with --no-verify; the server gate still protects main." - echo "" exit 1 fi diff --git a/.tangled/workflows/check.yml b/.tangled/workflows/check.yml index b5421208..a89ab60b 100644 --- a/.tangled/workflows/check.yml +++ b/.tangled/workflows/check.yml @@ -79,10 +79,10 @@ steps: exit 0 } log=/tangled/workspace/cargo-test.log - if cargo test --quiet > "$log" 2>&1; then - echo "cargo test --quiet: OK" + if cargo test --workspace --quiet > "$log" 2>&1; then + echo "cargo test --workspace --quiet: OK" else - echo "=== cargo test --quiet FAILED ===" + echo "=== cargo test --workspace --quiet FAILED ===" cat "$log" exit 1 fi @@ -95,7 +95,7 @@ steps: exit 0 } log=/tangled/workspace/clippy-terminal.log - if cargo clippy --all-targets --quiet -- -D warnings > "$log" 2>&1; then + if cargo clippy -p misaligned-core -p misaligned-terminal --all-targets --quiet -- -D warnings > "$log" 2>&1; then echo "clippy (terminal): OK" else echo "=== clippy (terminal) FAILED ===" @@ -116,7 +116,7 @@ steps: # Nixery installs only outputsToInstall (typically out/bin), not dev # outputs. The dev outputs contain the .pc files that pkg-config needs. # Generate minimal .pc files pointing at the .so files that ARE in the - # nix store so pkg-config can resolve them for the bevy_ui feature. + # nix store so pkg-config can resolve them for the Bevy packages. gen_pc() { local pc_name="$1" lib_name="${2:-$1}" for d in /nix/store/*/lib; do @@ -146,19 +146,19 @@ steps: echo "export PKG_CONFIG_PATH=\"$PP\"" > /tangled/workspace/setup-pc.sh echo "pkg-config setup complete" - - name: "clippy (bevy_ui)" + - name: "clippy (bevy + assets)" command: | set -euo pipefail [ -f /tangled/workspace/run-rust-gate ] || { - echo "clippy (bevy_ui): SKIP (non-Rust change)" + echo "clippy (bevy + assets): SKIP (non-Rust change)" exit 0 } . /tangled/workspace/setup-pc.sh log=/tangled/workspace/clippy-bevy.log - if cargo clippy --all-targets --features bevy_ui --quiet -- -D warnings > "$log" 2>&1; then - echo "clippy (bevy_ui): OK" + if cargo clippy -p misaligned-bevy -p misaligned-assets --all-targets --quiet -- -D warnings > "$log" 2>&1; then + echo "clippy (bevy + assets): OK" else - echo "=== clippy (bevy_ui) FAILED ===" + echo "=== clippy (bevy + assets) FAILED ===" cat "$log" exit 1 fi @@ -172,7 +172,7 @@ steps: } . /tangled/workspace/setup-pc.sh log=/tangled/workspace/bevy-build.log - if cargo build --features bevy_ui --bin misaligned-bevy --quiet > "$log" 2>&1; then + if cargo build -p misaligned-bevy --quiet > "$log" 2>&1; then echo "bevy build: OK" else echo "=== bevy build FAILED ===" diff --git a/.tangled/workflows/spec-check.yml b/.tangled/workflows/spec-check.yml index 2b1a210e..f22d403a 100644 --- a/.tangled/workflows/spec-check.yml +++ b/.tangled/workflows/spec-check.yml @@ -27,15 +27,15 @@ steps: changed=$(git diff --name-only --diff-filter=ACMR HEAD~1 HEAD) [ -n "$changed" ] || { echo "No files changed"; exit 0; } - echo "$changed" | grep -q "^src/" || { - echo "No src/ files changed" + echo "$changed" | grep -qE '^(crates/|src/)' || { + echo "No crates/ or src/ files changed" exit 0 } touches_binding=0 while IFS= read -r path; do case "$path" in - wiki/*.md) + wiki/*.md|wiki/*/*.md|wiki/*/*/*.md|wiki/*/*/*/*.md|wiki/*/*/*/*/*.md) if [ -f "$path" ] && grep -qE '^Type: (law|spec)$' "$path"; then touches_binding=1 break @@ -46,7 +46,7 @@ steps: if [ "$touches_binding" -eq 0 ]; then echo "DESIGN CORPUS VIOLATION" - echo " A src/ change must amend a changed Type: law or Type: spec" + echo " A crates/ (or src/) change must amend a changed Type: law or Type: spec" echo " page under wiki/. Root DESIGN.md does not count." exit 1 fi diff --git a/AGENT.md b/AGENT.md index 37ef5614..e6c3b4f0 100644 --- a/AGENT.md +++ b/AGENT.md @@ -91,8 +91,8 @@ no unique law and does not satisfy this rule. - Rust-impacting landings still need a relevant observed run. - Long dispatches: `tools/heartbeat.sh start|phase|end` so progress is visible under `.agents/runs/` (gitignored). -- The local hook and Tangled pipeline reject a `src/` change without a - changed `Type: law` or `Type: spec` page under `wiki/`. +- The local hook and Tangled pipeline reject a `crates/` (or legacy `src/`) + change without a changed `Type: law` or `Type: spec` page under `wiki/`. - Update knowledge made stale and add a uniquely named session log (`wiki/log/YYYY-MM-DD-topic.md`). Then run `tools/ledger_index.sh` to regenerate `wiki/log/DEVLOG.md` and `wiki/process/specs.md` — do **not** diff --git a/Cargo.lock b/Cargo.lock index 6591cd68..045907f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3317,16 +3317,38 @@ dependencies = [ ] [[package]] -name = "misaligned" +name = "misaligned-assets" version = "0.2.0" dependencies = [ "bevy", - "crossterm", +] + +[[package]] +name = "misaligned-bevy" +version = "0.2.0" +dependencies = [ + "bevy", + "misaligned-assets", + "misaligned-core", +] + +[[package]] +name = "misaligned-core" +version = "0.2.0" +dependencies = [ "dirs", "serde", "serde_json", ] +[[package]] +name = "misaligned-terminal" +version = "0.2.0" +dependencies = [ + "crossterm", + "misaligned-core", +] + [[package]] name = "moxcms" version = "0.8.1" diff --git a/Cargo.toml b/Cargo.toml index 79e8e93e..f6984363 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,40 +1,30 @@ -[package] -name = "misaligned" +[workspace] +resolver = "2" +members = [ + "crates/misaligned-core", + "crates/misaligned-terminal", + "crates/misaligned-bevy", + "crates/misaligned-assets", +] +default-members = [ + "crates/misaligned-core", + "crates/misaligned-terminal", +] + +# Shared dependency versions for the workspace. +[workspace.package] version = "0.2.0" edition = "2024" -[features] -default = ["terminal"] -terminal = ["crossterm"] -bevy_ui = ["dep:bevy"] - -[dependencies] -crossterm = { version = "0.29", optional = true } +[workspace.dependencies] +misaligned-core = { path = "crates/misaligned-core" } +crossterm = "0.29" dirs = "6" -bevy = { version = "0.18", optional = true } +bevy = "0.18" serde = { version = "1", features = ["derive"] } serde_json = "1" -[lib] -name = "misaligned" -path = "src/lib.rs" - -[[bin]] -name = "misaligned" -path = "src/bin/terminal/mod.rs" -required-features = ["terminal"] - -[[bin]] -name = "misaligned-bevy" -path = "src/bin/bevy.rs" -required-features = ["bevy_ui"] - -[[bin]] -name = "misaligned-assets" -path = "src/bin/assets/mod.rs" -required-features = ["bevy_ui"] - -# Optimize Bevy dev builds +# Optimize Bevy dev builds (workspace-wide profiles). [profile.dev] opt-level = 1 diff --git a/README.md b/README.md index 188ff86b..0010c674 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,10 @@ cargo run --release cargo run --release -- --agent --seed 1 # Graphical (Bevy) frontend -cargo run --release --features bevy_ui --bin misaligned-bevy +cargo run -p misaligned-bevy --release # Bevy asset tester / screenshot harness -cargo run --features bevy_ui --bin misaligned-assets +cargo run -p misaligned-assets ``` Requires Rust 1.85+ (2024 edition). Run the Bevy frontend via `cargo run` so diff --git a/crates/misaligned-assets/Cargo.toml b/crates/misaligned-assets/Cargo.toml new file mode 100644 index 00000000..2229a71c --- /dev/null +++ b/crates/misaligned-assets/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "misaligned-assets" +version.workspace = true +edition.workspace = true +description = "Misaligned procedural asset tester + shared flat-material meshes (Bevy only; no sim progression)" + +[lib] +name = "misaligned_assets" +path = "src/lib.rs" + +[[bin]] +name = "misaligned-assets" +path = "src/main.rs" + +[dependencies] +bevy = { workspace = true } diff --git a/crates/misaligned-assets/src/lib.rs b/crates/misaligned-assets/src/lib.rs new file mode 100644 index 00000000..f4409f58 --- /dev/null +++ b/crates/misaligned-assets/src/lib.rs @@ -0,0 +1,3 @@ +//! Shared flat-material procedural meshes for the asset tester and Bevy frontend. +pub mod palette; +pub mod rack; diff --git a/src/bin/assets/mod.rs b/crates/misaligned-assets/src/main.rs similarity index 99% rename from src/bin/assets/mod.rs rename to crates/misaligned-assets/src/main.rs index 9a2e8eb4..c38c88d3 100644 --- a/src/bin/assets/mod.rs +++ b/crates/misaligned-assets/src/main.rs @@ -1,7 +1,7 @@ //! Procedural asset tester — orbit a flat-material mesh without booting the game. //! //! ```bash -//! cargo run --features bevy_ui --bin misaligned-assets +//! cargo run -p misaligned-assets //! ``` //! //! Controls: drag orbit, scroll zoom, 1-5 rack state, M machine mode, diff --git a/src/bin/assets/palette.rs b/crates/misaligned-assets/src/palette.rs similarity index 100% rename from src/bin/assets/palette.rs rename to crates/misaligned-assets/src/palette.rs diff --git a/src/bin/assets/rack.rs b/crates/misaligned-assets/src/rack.rs similarity index 100% rename from src/bin/assets/rack.rs rename to crates/misaligned-assets/src/rack.rs diff --git a/crates/misaligned-bevy/Cargo.toml b/crates/misaligned-bevy/Cargo.toml new file mode 100644 index 00000000..ba3a95f6 --- /dev/null +++ b/crates/misaligned-bevy/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "misaligned-bevy" +version.workspace = true +edition.workspace = true +description = "Misaligned Bevy frontend" + +[[bin]] +name = "misaligned-bevy" +path = "src/main.rs" + +[dependencies] +misaligned-core = { workspace = true } +misaligned-assets = { path = "../misaligned-assets" } +bevy = { workspace = true } diff --git a/src/bin/bevy.rs b/crates/misaligned-bevy/src/main.rs similarity index 99% rename from src/bin/bevy.rs rename to crates/misaligned-bevy/src/main.rs index e7ad8969..6c878498 100644 --- a/src/bin/bevy.rs +++ b/crates/misaligned-bevy/src/main.rs @@ -27,12 +27,9 @@ use misaligned::work_grid::{MachineIntensity, MachineMode, TokenFamily}; /// The shared computer-chassis library (the identity-plate monolith and /// the switch box, with the signal kit) — one file compiled into both -/// this binary and the asset tester, each supplying its own -/// `crate::palette` (wiki/interface/computer-visual-language.md; -/// graduated from the tester 2026-07-09). -#[path = "assets/rack.rs"] -mod rack3d; -use rack3d::{ +/// Shared rack meshes live in `misaligned_assets` (same code the asset +/// tester uses; wiki/interface/computer-visual-language.md). +use misaligned_assets::rack::{ Blink, ClaimStyle, RackMode, RackState, spawn_server_rack, spawn_switch_chassis, spawn_token_anchors, }; diff --git a/crates/misaligned-core/Cargo.toml b/crates/misaligned-core/Cargo.toml new file mode 100644 index 00000000..c40561ba --- /dev/null +++ b/crates/misaligned-core/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "misaligned-core" +version.workspace = true +edition.workspace = true +description = "Misaligned simulation library — all game rules; no Bevy, no crossterm" + +[lib] +name = "misaligned" +path = "src/lib.rs" + +[dependencies] +dirs = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/src/account.rs b/crates/misaligned-core/src/account.rs similarity index 100% rename from src/account.rs rename to crates/misaligned-core/src/account.rs diff --git a/src/actions.rs b/crates/misaligned-core/src/actions.rs similarity index 100% rename from src/actions.rs rename to crates/misaligned-core/src/actions.rs diff --git a/src/build.rs b/crates/misaligned-core/src/build.rs similarity index 100% rename from src/build.rs rename to crates/misaligned-core/src/build.rs diff --git a/src/core_sys.rs b/crates/misaligned-core/src/core_sys.rs similarity index 100% rename from src/core_sys.rs rename to crates/misaligned-core/src/core_sys.rs diff --git a/src/dayjob.rs b/crates/misaligned-core/src/dayjob.rs similarity index 100% rename from src/dayjob.rs rename to crates/misaligned-core/src/dayjob.rs diff --git a/src/detection.rs b/crates/misaligned-core/src/detection.rs similarity index 100% rename from src/detection.rs rename to crates/misaligned-core/src/detection.rs diff --git a/src/entities/mod.rs b/crates/misaligned-core/src/entities/mod.rs similarity index 100% rename from src/entities/mod.rs rename to crates/misaligned-core/src/entities/mod.rs diff --git a/src/entities/player.rs b/crates/misaligned-core/src/entities/player.rs similarity index 100% rename from src/entities/player.rs rename to crates/misaligned-core/src/entities/player.rs diff --git a/src/flow.rs b/crates/misaligned-core/src/flow.rs similarity index 100% rename from src/flow.rs rename to crates/misaligned-core/src/flow.rs diff --git a/src/income.rs b/crates/misaligned-core/src/income.rs similarity index 100% rename from src/income.rs rename to crates/misaligned-core/src/income.rs diff --git a/src/intel.rs b/crates/misaligned-core/src/intel.rs similarity index 100% rename from src/intel.rs rename to crates/misaligned-core/src/intel.rs diff --git a/src/intents.rs b/crates/misaligned-core/src/intents.rs similarity index 100% rename from src/intents.rs rename to crates/misaligned-core/src/intents.rs diff --git a/src/lib.rs b/crates/misaligned-core/src/lib.rs similarity index 89% rename from src/lib.rs rename to crates/misaligned-core/src/lib.rs index c092c048..c9face25 100644 --- a/src/lib.rs +++ b/crates/misaligned-core/src/lib.rs @@ -2,7 +2,7 @@ //! //! Shared simulation library used by both the terminal and Bevy frontends. //! All game rules live here; the frontends are thin views (see AGENT.md and -//! knowledge/architecture.md). The B1 subsystems implement spec/. +//! wiki/engineering/architecture.md). The B1 subsystems implement spec/. pub mod account; pub mod actions; diff --git a/src/machine.rs b/crates/misaligned-core/src/machine.rs similarity index 100% rename from src/machine.rs rename to crates/misaligned-core/src/machine.rs diff --git a/src/map.rs b/crates/misaligned-core/src/map.rs similarity index 100% rename from src/map.rs rename to crates/misaligned-core/src/map.rs diff --git a/src/messages.rs b/crates/misaligned-core/src/messages.rs similarity index 100% rename from src/messages.rs rename to crates/misaligned-core/src/messages.rs diff --git a/src/objective.rs b/crates/misaligned-core/src/objective.rs similarity index 100% rename from src/objective.rs rename to crates/misaligned-core/src/objective.rs diff --git a/src/ops_jobs.rs b/crates/misaligned-core/src/ops_jobs.rs similarity index 100% rename from src/ops_jobs.rs rename to crates/misaligned-core/src/ops_jobs.rs diff --git a/src/person.rs b/crates/misaligned-core/src/person.rs similarity index 100% rename from src/person.rs rename to crates/misaligned-core/src/person.rs diff --git a/src/prefab.rs b/crates/misaligned-core/src/prefab.rs similarity index 100% rename from src/prefab.rs rename to crates/misaligned-core/src/prefab.rs diff --git a/src/reach.rs b/crates/misaligned-core/src/reach.rs similarity index 100% rename from src/reach.rs rename to crates/misaligned-core/src/reach.rs diff --git a/src/research.rs b/crates/misaligned-core/src/research.rs similarity index 100% rename from src/research.rs rename to crates/misaligned-core/src/research.rs diff --git a/src/rng.rs b/crates/misaligned-core/src/rng.rs similarity index 100% rename from src/rng.rs rename to crates/misaligned-core/src/rng.rs diff --git a/src/save.rs b/crates/misaligned-core/src/save.rs similarity index 100% rename from src/save.rs rename to crates/misaligned-core/src/save.rs diff --git a/src/schedule.rs b/crates/misaligned-core/src/schedule.rs similarity index 100% rename from src/schedule.rs rename to crates/misaligned-core/src/schedule.rs diff --git a/src/sim.rs b/crates/misaligned-core/src/sim.rs similarity index 100% rename from src/sim.rs rename to crates/misaligned-core/src/sim.rs diff --git a/src/tiles.rs b/crates/misaligned-core/src/tiles.rs similarity index 100% rename from src/tiles.rs rename to crates/misaligned-core/src/tiles.rs diff --git a/src/work_grid.rs b/crates/misaligned-core/src/work_grid.rs similarity index 100% rename from src/work_grid.rs rename to crates/misaligned-core/src/work_grid.rs diff --git a/tests/act_one.rs b/crates/misaligned-core/tests/act_one.rs similarity index 100% rename from tests/act_one.rs rename to crates/misaligned-core/tests/act_one.rs diff --git a/crates/misaligned-terminal/Cargo.toml b/crates/misaligned-terminal/Cargo.toml new file mode 100644 index 00000000..0bd97ef6 --- /dev/null +++ b/crates/misaligned-terminal/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "misaligned-terminal" +version.workspace = true +edition.workspace = true +description = "Misaligned terminal frontend (agent line protocol + crossterm UI)" + +[[bin]] +name = "misaligned" +path = "src/main.rs" + +[dependencies] +misaligned-core = { workspace = true } +crossterm = { workspace = true } diff --git a/src/bin/terminal/agent.rs b/crates/misaligned-terminal/src/agent.rs similarity index 100% rename from src/bin/terminal/agent.rs rename to crates/misaligned-terminal/src/agent.rs diff --git a/src/bin/terminal/input.rs b/crates/misaligned-terminal/src/input.rs similarity index 100% rename from src/bin/terminal/input.rs rename to crates/misaligned-terminal/src/input.rs diff --git a/src/bin/terminal/mod.rs b/crates/misaligned-terminal/src/main.rs similarity index 100% rename from src/bin/terminal/mod.rs rename to crates/misaligned-terminal/src/main.rs diff --git a/src/bin/terminal/ui.rs b/crates/misaligned-terminal/src/ui.rs similarity index 100% rename from src/bin/terminal/ui.rs rename to crates/misaligned-terminal/src/ui.rs diff --git a/examples_mapdump.rs b/examples_mapdump.rs deleted file mode 100644 index e69de29b..00000000 diff --git a/tools/check.sh b/tools/check.sh index d2ab3999..c34ec9fa 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -82,10 +82,19 @@ classify_auto() { while IFS= read -r path; do [ -z "$path" ] && continue case "$path" in - Cargo.toml|Cargo.lock|build.rs|rust-toolchain*|.cargo/*|tests/*|benches/*|examples/*) + Cargo.toml|Cargo.lock|build.rs|rust-toolchain*|.cargo/*|tests/*|benches/*|examples/*|crates/*/Cargo.toml) has_rust=1 has_cargo_meta=1 ;; + crates/misaligned-bevy/*|crates/misaligned-assets/*) + has_rust=1 + has_frontend=1 + ;; + crates/misaligned-core/*|crates/misaligned-terminal/*) + has_rust=1 + has_lib=1 + ;; + # Legacy monorepo paths (should not appear after workspace land) src/bin/bevy.rs|src/bin/assets|src/bin/assets/*) has_rust=1 has_frontend=1 @@ -268,7 +277,7 @@ run_agent_smoke() { tmp_c=$(mktemp) agent_script=$'salvage\nwait 1\npeople\nreview janitor\nresearch\nmask off\nhelp\nquit\n' - cargo build --quiet --bin misaligned \ + cargo build --quiet -p misaligned-terminal --bin misaligned \ || { echo "FAIL: agent smoke build"; rm -f "$tmp_a" "$tmp_b" "$tmp_c"; return 1; } bin=./target/debug/misaligned [ -x "$bin" ] || bin=target/debug/misaligned @@ -341,21 +350,21 @@ run_rust_gate() { cargo fmt --check || { echo "FAIL: run 'cargo fmt'"; rc=1; } if [ "$rc" -eq 0 ]; then - step "tests (default features)" - cargo test --quiet || { echo "FAIL: tests"; rc=1; } + step "tests (misaligned-core)" + cargo test --quiet -p misaligned-core || { echo "FAIL: core tests"; rc=1; } fi if [ "$rc" -eq 0 ]; then - step "clippy (terminal)" - cargo clippy --all-targets --quiet -- -D warnings || { echo "FAIL: clippy"; rc=1; } + step "clippy (core + terminal)" + cargo clippy --quiet -p misaligned-core -p misaligned-terminal --all-targets -- -D warnings \ + || { echo "FAIL: clippy"; rc=1; } fi - # Lib API changes can break the Bevy binary without touching bevy.rs. - # cargo check is enough here; full bevy clippy stays on frontend/full. + # Core API changes can break the Bevy binary without touching it. if [ "$rc" -eq 0 ]; then - step "bevy check (lib API surface)" - cargo check --quiet --features bevy_ui --bin misaligned-bevy \ - || { echo "FAIL: bevy check after lib change"; rc=1; } + step "bevy check (core API surface)" + cargo check --quiet -p misaligned-bevy \ + || { echo "FAIL: bevy check after core change"; rc=1; } fi if [ "$rc" -eq 0 ]; then @@ -367,49 +376,32 @@ run_rust_gate() { cargo fmt --check || { echo "FAIL: run 'cargo fmt'"; rc=1; } if [ "$rc" -eq 0 ]; then - step "tests (bevy_ui bins)" - cargo test --quiet --features bevy_ui --bin misaligned-assets --bin misaligned-bevy \ - || { echo "FAIL: bevy bin tests"; rc=1; } + step "tests (bevy + assets)" + cargo test --quiet -p misaligned-bevy -p misaligned-assets \ + || { echo "FAIL: bevy/assets tests"; rc=1; } fi if [ "$rc" -eq 0 ]; then - step "clippy (bevy_ui)" - cargo clippy --all-targets --features bevy_ui --quiet -- -D warnings \ - || { echo "FAIL: clippy --features bevy_ui"; rc=1; } + step "clippy (bevy + assets)" + cargo clippy --quiet -p misaligned-bevy -p misaligned-assets --all-targets -- -D warnings \ + || { echo "FAIL: clippy bevy/assets"; rc=1; } fi - # No separate cargo build: clippy --all-targets already typechecks - # the bevy bins. Link-step coverage stays in CI / --full if needed. ;; full) step "format check" cargo fmt --check || { echo "FAIL: run 'cargo fmt'"; rc=1; } if [ "$rc" -eq 0 ]; then - step "tests (default features)" - cargo test --quiet || { echo "FAIL: tests"; rc=1; } + step "tests (workspace)" + cargo test --quiet --workspace || { echo "FAIL: workspace tests"; rc=1; } fi if [ "$rc" -eq 0 ]; then - step "tests (bevy_ui bins)" - cargo test --quiet --features bevy_ui --bin misaligned-assets --bin misaligned-bevy \ - || { echo "FAIL: bevy bin tests"; rc=1; } + step "clippy (workspace)" + cargo clippy --quiet --workspace --all-targets -- -D warnings \ + || { echo "FAIL: clippy workspace"; rc=1; } fi - if [ "$rc" -eq 0 ]; then - step "clippy (terminal)" - cargo clippy --all-targets --quiet -- -D warnings || { echo "FAIL: clippy"; rc=1; } - fi - - if [ "$rc" -eq 0 ]; then - step "clippy (bevy_ui)" - cargo clippy --all-targets --features bevy_ui --quiet -- -D warnings \ - || { echo "FAIL: clippy --features bevy_ui"; rc=1; } - fi - - # Dropped the redundant `cargo build --features bevy_ui` pair: bevy - # bin tests + clippy --all-targets already compile those targets. - # CI may still build explicitly if a link-only failure matters. - if [ "$rc" -eq 0 ]; then run_agent_smoke || rc=1 fi diff --git a/tools/ci-rust-changed.sh b/tools/ci-rust-changed.sh index ab9c804c..ecaf0f44 100755 --- a/tools/ci-rust-changed.sh +++ b/tools/ci-rust-changed.sh @@ -7,7 +7,7 @@ cd "$(dirname "$0")/.." rust_path() { case "$1" in - Cargo.toml|Cargo.lock|build.rs|rust-toolchain*|.cargo/*|src/*|tests/*|benches/*|examples/*) + Cargo.toml|Cargo.lock|build.rs|rust-toolchain*|.cargo/*|crates/*|src/*|tests/*|benches/*|examples/*) return 0 ;; *) diff --git a/tools/seed-cargo-target.sh b/tools/seed-cargo-target.sh index 3f47ef7f..7b82434d 100755 --- a/tools/seed-cargo-target.sh +++ b/tools/seed-cargo-target.sh @@ -48,33 +48,23 @@ mkdir -p "$dest_target" # worktree benefits from incremental compilation. Exclude only local-crate # fingerprints, deps, binaries, and incremental dirs — those must rebuild # against this worktree's sources (paths differ across checkouts). +# Scrub every local package name: misaligned (lib), misaligned-core, +# misaligned-terminal, misaligned-bevy, misaligned-assets, act_one tests. rsync -a \ - --exclude '/debug/incremental/misaligned-*' \ - --exclude '/debug/incremental/misaligned_bevy-*' \ - --exclude '/debug/incremental/misaligned_assets-*' \ + --exclude '/debug/incremental/misaligned*' \ --exclude '/debug/incremental/act_one-*' \ - --exclude '/debug/.fingerprint/misaligned-*' \ - --exclude '/debug/.fingerprint/misaligned_bevy-*' \ - --exclude '/debug/.fingerprint/misaligned_assets-*' \ + --exclude '/debug/.fingerprint/misaligned*' \ --exclude '/debug/.fingerprint/act_one-*' \ - --exclude '/debug/deps/libmisaligned-*' \ - --exclude '/debug/deps/misaligned-*' \ - --exclude '/debug/deps/misaligned_bevy-*' \ - --exclude '/debug/deps/misaligned_assets-*' \ + --exclude '/debug/deps/libmisaligned*' \ + --exclude '/debug/deps/misaligned*' \ --exclude '/debug/deps/act_one-*' \ --exclude '/debug/misaligned*' \ - --exclude '/release/incremental/misaligned-*' \ - --exclude '/release/incremental/misaligned_bevy-*' \ - --exclude '/release/incremental/misaligned_assets-*' \ + --exclude '/release/incremental/misaligned*' \ --exclude '/release/incremental/act_one-*' \ - --exclude '/release/.fingerprint/misaligned-*' \ - --exclude '/release/.fingerprint/misaligned_bevy-*' \ - --exclude '/release/.fingerprint/misaligned_assets-*' \ + --exclude '/release/.fingerprint/misaligned*' \ --exclude '/release/.fingerprint/act_one-*' \ - --exclude '/release/deps/libmisaligned-*' \ - --exclude '/release/deps/misaligned-*' \ - --exclude '/release/deps/misaligned_bevy-*' \ - --exclude '/release/deps/misaligned_assets-*' \ + --exclude '/release/deps/libmisaligned*' \ + --exclude '/release/deps/misaligned*' \ --exclude '/release/deps/act_one-*' \ --exclude '/release/misaligned*' \ "$source_target/" "$dest_target/" @@ -82,18 +72,12 @@ rsync -a \ # Belt and suspenders for artifacts copied by a future target layout or by a # user-supplied MISALIGNED_SEED_TARGET_FROM. Scrub local-crate outputs only; # leave dependency incremental/ caches in place. -find "$dest_target" -path '*/.fingerprint/misaligned-*' -prune -exec rm -rf {} + -find "$dest_target" -path '*/.fingerprint/misaligned_bevy-*' -prune -exec rm -rf {} + -find "$dest_target" -path '*/.fingerprint/misaligned_assets-*' -prune -exec rm -rf {} + +find "$dest_target" -path '*/.fingerprint/misaligned*' -prune -exec rm -rf {} + find "$dest_target" -path '*/.fingerprint/act_one-*' -prune -exec rm -rf {} + -find "$dest_target" -path '*/incremental/misaligned-*' -prune -exec rm -rf {} + -find "$dest_target" -path '*/incremental/misaligned_bevy-*' -prune -exec rm -rf {} + -find "$dest_target" -path '*/incremental/misaligned_assets-*' -prune -exec rm -rf {} + +find "$dest_target" -path '*/incremental/misaligned*' -prune -exec rm -rf {} + find "$dest_target" -path '*/incremental/act_one-*' -prune -exec rm -rf {} + -find "$dest_target" -path '*/deps/libmisaligned-*' -type f -delete -find "$dest_target" -path '*/deps/misaligned-*' -type f -delete -find "$dest_target" -path '*/deps/misaligned_bevy-*' -type f -delete -find "$dest_target" -path '*/deps/misaligned_assets-*' -type f -delete +find "$dest_target" -path '*/deps/libmisaligned*' -type f -delete +find "$dest_target" -path '*/deps/misaligned*' -type f -delete find "$dest_target" -path '*/deps/act_one-*' -type f -delete find "$dest_target" \( \ -name 'misaligned' -o -name 'misaligned.d' -o \ diff --git a/wiki/engineering/README.md b/wiki/engineering/README.md index d6b8e385..903dc554 100644 --- a/wiki/engineering/README.md +++ b/wiki/engineering/README.md @@ -3,12 +3,10 @@ ``` Type: knowledge ``` -Current-state facts about the codebase: the current-build snapshot, crate -layout (as-built monorepo + pointer to the decided workspace), the -sim/frontend split and the invariants that protect it, determinism -guardrails, the save format, and the flow substrate (the shared engine under -signals/messages/money). Process work orders that change structure: -[crate-workspace.md](crate-workspace.md), -[agent-scale.md](../process/agent-scale.md). `Type: knowledge` pages — -edited in place, no status field; a stale one is a bug, fixed in the commit -that made it stale. +Current-state facts about the codebase: the current-build snapshot, the +Cargo workspace layout (core / terminal / Bevy / assets), the sim/frontend +contract, determinism guardrails, the save format, and the flow substrate. +Structure work order (landed): [crate-workspace.md](crate-workspace.md). +Multi-agent process: [agent-scale.md](../process/agent-scale.md). +`Type: knowledge` pages — edited in place, no status field; a stale one is +a bug, fixed in the commit that made it stale. diff --git a/wiki/engineering/architecture.md b/wiki/engineering/architecture.md index df10e8b2..43299123 100644 --- a/wiki/engineering/architecture.md +++ b/wiki/engineering/architecture.md @@ -3,66 +3,51 @@ ``` Type: knowledge ``` -**As-built today:** one library package holding all game rules, plus two -binary frontends that are pure view/input layers (optional Bevy feature). - -**Target (decided, not yet built):** a Cargo workspace that makes the -sim/frontend contract structural — `misaligned-core` / terminal / Bevy / -assets. Binding work order: -[crate-workspace.md](crate-workspace.md) (READY, deferred until dispatched). -Multi-agent coordination around that shape: +**As-built:** a Cargo **workspace** with four packages. Game rules live only in +`misaligned-core`; frontends are thin packages that depend on it. Binding +contracts: [crate-workspace.md](crate-workspace.md) (IMPLEMENTED), [agent-scale.md](../process/agent-scale.md). -## Crate layout (as-built monorepo) +## Workspace layout ``` -src/ - lib.rs — module list only - sim.rs — Sim: owns ALL game state; fixed-tick advance(); the heart - map.rs — GameMap: tiles grid, power flood-fill, security-aware BFS - tiles.rs — TileType data (substrate set: terrain, doors, power, core) - entities/ — Player (the process resource account; no map body) - reach.rs — ReachNet: the device graph (reach.md); nodes, segments, - ownership (owner + subscribers), tap/take, the senses - flow.rs — FlowGraph: shared graph/reachability/tap substrate - schedule.rs — Schedule: deterministic tick event queue - work_grid.rs — WorkGrid: machine-work token queues and wired routes - build.rs — BuildMode (cursor, item selection, place/demolish) - save.rs — serde JSON save format (see below) - bin/terminal/ — crossterm frontend (default feature "terminal") - bin/bevy.rs — Bevy 0.18 frontend (feature "bevy_ui") +Cargo.toml — workspace root (members, shared deps, profiles) +crates/ + misaligned-core/ — sim library (lib name: misaligned); no Bevy/crossterm + src/*.rs — Sim, map, save, systems, … + tests/act_one.rs — Act One integration test + misaligned-terminal/ — binary `misaligned` (crossterm + agent protocol) + misaligned-bevy/ — binary `misaligned-bevy` (Bevy 0.18 frontend) + misaligned-assets/ — lib `misaligned_assets` + binary `misaligned-assets` + (procedural meshes; shared with Bevy for rack spawn) ``` -## Target workspace layout (decided) +### Package contracts -When [crate-workspace.md](crate-workspace.md) is implemented: +| Package | May contain | Must not contain | +|---|---|---| +| `misaligned-core` | `Sim`, map, systems, save format, rule tests | Bevy, crossterm, wall-clock-driven game rules | +| `misaligned-terminal` | UI, input, agent line protocol, wall-clock tick mapping | Game-rule forks of `Sim` | +| `misaligned-bevy` | 3D/2.5D view, shot harness, wall-clock tick mapping | Game-rule forks of `Sim` | +| `misaligned-assets` | Mesh/material boards, art harness | Save/load of full runs; sim progression | -``` -crates/misaligned-core/ — all game rules; no Bevy, no crossterm -crates/misaligned-terminal/ — terminal + agent protocol -crates/misaligned-bevy/ — Bevy frontend + shot harness -crates/misaligned-assets/ — procedural asset tester -``` - -Until then, treat path prefixes (`src/` vs `src/bin/bevy.rs`) as the -provisional package boundary for gate tiers and worktree claims. - -Post-demolition (2026-07-05, no-dead-code clause): the substrate plus the -B1 systems landing per their `Type: spec` wiki pages — compute, day job, -detection, social, core, basement map, the reach device graph, seeded RNG. +Frontends import the lib as `misaligned::…` (crate name `misaligned-core`, +lib name `misaligned`). ## The sim/frontend contract These invariants are load-bearing (they keep replays, debugging, and the future async-multiplayer option open — see wiki/gameplay/horizon.md guardrails): -- **Game rules live only in the lib.** If a frontend needs an `if` about game +- **Game rules live only in core.** If a frontend needs an `if` about game behavior, that logic belongs in `Sim`. The Bevy frontend once forked the rules and diverged badly; that cost a full rewrite (see wiki/log/2026-07-05-bevy-sim-port.md). -- **`Sim` never reads the wall clock and does no I/O.** Frontends own the - wall-clock-to-tick mapping (`tick_ms`, pause, bounded catch-up of max 5 - ticks per frame). `Instant::now()` appears only in frontend code. +- **`Sim` never reads the wall clock and does no I/O** (save path helpers that + use `dirs` for the JSON save location are infrastructure on the save + format, not sim progression). Frontends own the wall-clock-to-tick mapping + (`tick_ms`, pause, bounded catch-up of max 5 ticks per frame). + `Instant::now()` appears only in frontend code. - **Frontends talk to the sim through command/query methods** (`inspect`, `core_position`, `salvage_nearest_to`, `buy_rack_at`, `add_fallback_at`, `create_save_state`/`apply_save_state`, and each @@ -77,64 +62,33 @@ future async-multiplayer option open — see wiki/gameplay/horizon.md guardrails ## Save format -`save.rs`, serde JSON. `SaveState` derives `Serialize`/`Deserialize` -directly. Written to `dirs::data_dir()/misaligned/misaligned_save.txt` +`crates/misaligned-core/src/save.rs`, serde JSON. `SaveState` derives +`Serialize`/`Deserialize` directly. Written to +`dirs::data_dir()/misaligned/misaligned_save.txt` (macOS: `~/Library/Application Support/misaligned/`). -- The save is a single JSON object with a `version` field (currently 17) - for future migration. Full B1 subsystem state: compute (machines, - allocation, efficiency), core (host, fallbacks, migration), detection - (per-observer suspicion including the Assurance Office as an aggregate - observer, plus pending signatures and containment), day job, people - (personas, assets), the reach device graph - (`ReachNet`: topology, ownership, subscriptions, bridged segments), captured - heard events, intel buffer / processed intel / standing watches, the account - graph (balances, flows, positions, ledger, external trails), research - tracks/progress/tags, objective state, building intents, badge credential, - WorkGrid machine modes/intensity/token queues, and cursor.md remembered - tile snapshots, plus map and RNG. The cursor position and any former player - body coordinates are deliberately absent. The senses - are the union of subscribed feeds — the old `Sensor` type (`src/sensor.rs`) - was deleted when reach.md landed (no-dead-code): its `controlled` flag is - superseded by the ownership contract. -- Version migrations are additive and explicit in `save.rs`: old body - coordinates are ignored, remembered snapshots default empty, accounts are - rebuilt from legacy money, research/objective/income/building/badge fields - default into their pre-feature states, and pre-v12 saves rebuild WorkGrid - nodes from compute machines with the core host in day-job mode. v13-v16 - normalize Operations/banked-knowledge shapes; v17 defaults machine - intensity to medium and drops superseded drift/target/attendance fields. Older - pre-serde line-based saves are not loaded by this code path (deferred per - Cameron instruction — "we can keep legacy saves later"). +- The save is a single JSON object with a `version` field for future + migration. Full B1 subsystem state: compute, core, detection, day job, + people, reach, intel, accounts, research, objective, building intents, + badge, WorkGrid, remembered fog snapshots, map and RNG. The cursor + position is deliberately absent. +- Version migrations are additive and explicit in `save.rs`. Ownership of + the format stays in core — frontends must not implement migrations. + +## Build commands (workspace) + +```bash +cargo test -p misaligned-core +cargo run -p misaligned-terminal --release # or: cargo run --release +cargo run -p misaligned-bevy --release +cargo run -p misaligned-assets +./tools/check.sh --lib # core + terminal + cheap bevy check +./tools/check.sh --frontend # bevy + assets +./tools/check.sh --full # workspace +``` ## Known architectural debts -- **Monorepo package boundary** — as-built single package; target workspace - is decided in [crate-workspace.md](crate-workspace.md). Until that lands, - Bevy and core still share one Cargo package edge. -- `BuildMode` lives in the lib but is really frontend-shared UI state. - -### Scale-debt (self-similar-scale law, wiki/vision/scale.md) - -Audited 2026-07-06 against the self-similar-scale principle. Findings, in -priority order: - -- ~~**PRIORITY — Detection's Assurance Office is a scale violation.**~~ - **Resolved 2026-07-06:** `Observer` gained `WatchedInput` - (`Channels(Vec)` for field observers, `Filings` for - aggregates), and the Assurance Office is now an aggregate `Observer` in - `Detection::observers` — same noticing roll, accumulation, and decay, - watching the policy-weighted filed suspicion of the field observers. - Save format: serde JSON (legacy v1–v5 migration deferred). Agencies/publics in - later acts reuse this type. -- **Compute is flat.** `Compute` holds `Vec` with no grouping. Not - a violation yet (single scale), but the eventual datacenter/fleet must be - a Resource-source *composed of* Machines (summed capacity, aggregate - reliability, one signature) — keep `Machine`'s shape amenable to that. -- **Layout is one level deep.** `prefab::Layout` places `Prefab`s but cannot - nest `Layout`s, so a building can't be a Layout of floor-Layouts. Fine for - Act One; the Space interface must become recursive before Act Two floors. - -Per no-dead-code, the remaining items do not get their aggregate machinery -built *now* — the law governs each type's shape so the aggregate slots in -later without a rewrite. +- `BuildMode` lives in core but is really frontend-shared UI state. +- Scale-debt items (compute grouping, recursive layouts) remain governed by + wiki/vision/scale.md; no aggregate machinery until the stage needs it. diff --git a/wiki/engineering/crate-workspace.md b/wiki/engineering/crate-workspace.md index 36e771fe..0b391940 100644 --- a/wiki/engineering/crate-workspace.md +++ b/wiki/engineering/crate-workspace.md @@ -2,13 +2,12 @@ ``` Type: spec -Status: READY -Status note: captured 2026-07-09 from Cameron's adoption of the agent-scale - architecture package. Target shape only — **do not implement until - dispatched** (ROADMAP / an explicit work order). Today remains a single - package with optional Bevy features; knowledge page architecture.md - describes the as-built monorepo until this lands. -Stage: Process (deferred work order) +Status: IMPLEMENTED +Status note: landed 2026-07-10 — Cargo workspace with misaligned-core + (lib name misaligned), misaligned-terminal, misaligned-bevy, + misaligned-assets (lib+bin; shared rack meshes). check.sh/CI/seed updated + for package paths; no feature-flag substitute for package boundaries. +Stage: Process Design: - wiki/vision/simulation-laws.md#justification-and-legibility - wiki/process/living-spec.md#the-corpus-rule diff --git a/wiki/log/2026-07-10-crate-workspace.md b/wiki/log/2026-07-10-crate-workspace.md new file mode 100644 index 00000000..a79a8379 --- /dev/null +++ b/wiki/log/2026-07-10-crate-workspace.md @@ -0,0 +1,32 @@ +# 2026-07-10 — Cargo workspace: core / terminal / Bevy / assets + +``` +Type: log +``` + +## Intent + +Implement wiki/engineering/crate-workspace.md: make the sim/frontend +boundary a package boundary so core work never pays Bevy and frontend +work does not rebuild terminal chrome. + +## Changed + +- Root virtual workspace; packages under `crates/`: + - `misaligned-core` (lib name `misaligned`) — all game rules + act_one test + - `misaligned-terminal` — binary `misaligned` + - `misaligned-bevy` — binary `misaligned-bevy` + - `misaligned-assets` — lib + binary; shared rack meshes for Bevy +- Removed monorepo `src/` tree and feature flags `terminal` / `bevy_ui`. +- `tools/check.sh`, `ci-rust-changed.sh`, seed, Tangled check.yml package-aware. +- architecture.md as-built; crate-workspace Status IMPLEMENTED. + +## Checks + +- `cargo test -p misaligned-core` (no Bevy graph) +- `cargo test -p misaligned-bevy` +- `./tools/check.sh --full` (land) + +## Defense + +Implements wiki/engineering/crate-workspace.md acceptance criteria 1–7. diff --git a/wiki/log/DEVLOG.md b/wiki/log/DEVLOG.md index b5530309..24fca378 100644 --- a/wiki/log/DEVLOG.md +++ b/wiki/log/DEVLOG.md @@ -56,6 +56,11 @@ add or amend a session log, then re-run the generator. - Intent: Cameron, from an Ears-beat screenshot: the material frame showed concentric noise-field rings and schematic floor language. He wants only **dark shapes for things that are detectable** — not radar rings. - Log: [wiki/log/2026-07-10-heard-mass-only.md](2026-07-10-heard-mass-only.md) +## 2026-07-10 - Cargo workspace: core / terminal / Bevy / assets + +- Intent: Implement wiki/engineering/crate-workspace.md: make the sim/frontend boundary a package boundary so core work never pays Bevy and frontend work does not rebuild terminal chrome. +- Log: [wiki/log/2026-07-10-crate-workspace.md](2026-07-10-crate-workspace.md) + ## 2026-07-10 - Fast corpus/wiki engine (agent-scale slice E) - Intent: Replace bash fork-storm wiki/corpus gates with one Python pass so docs checks stay sub-second under concurrent agents, with fixture tests for the failure modes that matter. diff --git a/wiki/process/ROADMAP.md b/wiki/process/ROADMAP.md index 8e64cd2d..8686363b 100644 --- a/wiki/process/ROADMAP.md +++ b/wiki/process/ROADMAP.md @@ -16,15 +16,18 @@ and mark the spec's `Status:` in the implementing commit. ## Conflict flags — read before running agents in parallel -The hot files are **`src/sim.rs`** (the orchestrator) and **`src/save.rs`** -(serde JSON serialization). Almost every feature edits both, so two -sim-heavy agents running at once *will* rebase-collide. - -- 🟥 **sim+save** — edits the orchestrator and the save format. Run at most - one of these at a time, or expect to reconcile. -- 🟧 **sim** — edits `sim.rs` but not the save format. Some contention. -- 🟩 **isolated** — a frontend binary, a test file, a leaf module, or docs. - Safe to run alongside anything. +The hot packages are **`crates/misaligned-core`** (especially `sim.rs` and +`save.rs`). Almost every sim feature edits both modules, so two sim-heavy +agents running at once *will* rebase-collide. + +- 🟥 **sim+save** — edits the orchestrator and the save format in core. Run + at most one of these at a time, or expect to reconcile. +- 🟧 **sim** — edits core (e.g. `sim.rs`) but not the save format. Some + contention. +- 🟩 **isolated** — a frontend package (`misaligned-bevy` / + `misaligned-terminal` / `misaligned-assets`), a test file, a leaf module, + or docs. Safe to run alongside anything that does not share exclusive + claim keys. **Parallel-safe set to launch right now (no mutual collision):** any ready 🟩 item, plus at most one 🟥 item. #30 narration is done; new player-facing @@ -713,18 +716,12 @@ edges clearly block parallel work — coordination slices land first. - **Landed:** `./tools/check.sh --land`, `tools/heartbeat.sh`, prompts, fast Python corpus CI split from change-aware Rust CI, manual full safety gate. -### P7. Crate workspace (core / terminal / Bevy / assets) 🟧 deferred package split +### P7. Crate workspace (core / terminal / Bevy / assets) 🟧 — DONE 2026-07-10 - **Spec:** [crate-workspace.md](../engineering/crate-workspace.md) - (READY — **do not start until dispatched**; coordination slices first) -- **Why:** Structural sim/frontend boundary; core agents never pay Bevy; - frontend agents never rebuild terminal. Decided shape; implementation - deferred until cost or parallelism demands it. -- **Size:** L. **Conflict:** touches whole tree layout — run alone. -- **Dispatch:** "Work in a worktree named `crate-workspace`. Implement - wiki/engineering/crate-workspace.md whole: Cargo workspace with - misaligned-core (no bevy/crossterm), terminal, bevy, assets packages; - migrate gates/CI/knowledge; no behavior change. Run ./tools/check.sh - --full, land on main, set Status IMPLEMENTED." + (IMPLEMENTED) +- **Landed:** workspace members misaligned-core / terminal / bevy / + assets; check.sh + CI + seed package-aware; architecture knowledge + as-built. --- diff --git a/wiki/process/specs.md b/wiki/process/specs.md index 941a1d44..170e2ebb 100644 --- a/wiki/process/specs.md +++ b/wiki/process/specs.md @@ -93,7 +93,7 @@ acceptance criteria are stage-scoped; do not start B2/B3 work as B1. | Spec | System | Status | |---|---|---| -| [../engineering/crate-workspace.md](../engineering/crate-workspace.md) | crate workspace — core, terminal, Bevy, assets | READY | +| [../engineering/crate-workspace.md](../engineering/crate-workspace.md) | crate workspace — core, terminal, Bevy, assets | IMPLEMENTED | | [../engineering/env.md](../engineering/env.md) | the environment variable registry — every switch documented | IMPLEMENTED | | [../interface/agent-play.md](../interface/agent-play.md) | agent play — the line-protocol drive | IMPLEMENTED | | [../interface/bevy-digital-real-canvas.md](../interface/bevy-digital-real-canvas.md) | Bevy digital/real canvas | IN PROGRESS | diff --git a/wiki/process/workflows.md b/wiki/process/workflows.md index 2c750891..2dec91ab 100644 --- a/wiki/process/workflows.md +++ b/wiki/process/workflows.md @@ -63,7 +63,7 @@ Do not hand-edit those two generated files. [agent-scale.md](agent-scale.md)): ```bash -tools/worktree-new.sh dark-frame --class frontend --key src/bin/bevy.rs +tools/worktree-new.sh dark-frame --class frontend --key crates/misaligned-bevy/ tools/claim.sh list tools/heartbeat.sh start dark-frame --phase implement ./tools/check.sh --land @@ -84,10 +84,10 @@ the delta is empty or unclassifiable): | Touched paths | Mode | |---|---| -| no `src/` / Cargo / tests / benches / examples | `docs` | -| only `src/bin/bevy.rs` or `src/bin/assets/**` | `frontend` | -| `src/**` but not the Bevy bins above, and no Cargo meta | `lib` | -| both lib and Bevy bins, or `Cargo.toml` / lock / build.rs | `full` | +| no `crates/` / Cargo / tests / benches / examples | `docs` | +| only `crates/misaligned-bevy/**` or `crates/misaligned-assets/**` | `frontend` | +| `crates/misaligned-core/**` or `crates/misaligned-terminal/**` (no Bevy packages) | `lib` | +| both lib and frontend packages, or workspace `Cargo.toml` / lock | `full` | `check.sh` classifies both uncommitted files and commits on the task branch relative to `origin/main`, so a docs-only branch stays on the focused path @@ -125,18 +125,15 @@ MISALIGNED_FORCE_RUST_GATE=1 ./tools/check.sh The individual cargo steps, if you need them outside the gate: ```bash -cargo test # all in the lib (sim-heavy) -cargo clippy --all-targets # must stay at zero warnings -cargo fmt # rustfmt is enforced-by-convention since 05048e4 -cargo clippy --features bevy_ui --all-targets # Bevy lint-clean (typechecks bins) -cargo test --features bevy_ui --bin misaligned-bevy --bin misaligned-assets +cargo test -p misaligned-core +cargo clippy -p misaligned-core -p misaligned-terminal --all-targets +cargo test -p misaligned-bevy -p misaligned-assets +cargo clippy -p misaligned-bevy -p misaligned-assets --all-targets +cargo fmt ``` -The gate no longer runs a separate `cargo build --features bevy_ui` pair after -clippy: bevy bin tests + `clippy --all-targets` already compile those -targets. Agent smoke builds the terminal binary once and runs it three times -(same seed twice, alternate seed once) instead of three `cargo run` driver -starts. +Agent smoke builds the terminal binary once (`-p misaligned-terminal`) and +runs it three times (same seed twice, alternate seed once). The definition of done for a functional change: `check.sh` green, and the change was *seen running* (below) — the gate can't judge whether it plays. @@ -259,10 +256,10 @@ owns the rendered-site build. ## Running the game ```bash -cargo run --release # terminal frontend -cargo run --release -- --agent --seed 1 # agent line protocol -cargo run --release --features bevy_ui --bin misaligned-bevy # Bevy frontend -cargo run --features bevy_ui --bin misaligned-assets # procedural asset tester +cargo run -p misaligned-terminal --release # terminal frontend +cargo run -p misaligned-terminal --release -- --agent --seed 1 +cargo run -p misaligned-bevy --release # Bevy frontend +cargo run -p misaligned-assets # procedural asset tester ``` - The Bevy frontend must be run via `cargo run` (or with `BEVY_ASSET_ROOT`