Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a0e1aec
feat(core): extract math + engine spike from #6 (split PR 1)\n\n- mat…
flyingrobots Oct 27, 2025
1192a4c
docs(core): specify snapshot hash determinism (ordering and encoding)…
flyingrobots Oct 27, 2025
bbc2349
merge: origin/main into echo/split-core-math-engine; keep main's math…
flyingrobots Oct 27, 2025
345b971
WIP: park local changes before docs Makefile PR
flyingrobots Oct 27, 2025
cc87f0a
docs: update execution plan and decision log for PR #7; fmt code
flyingrobots Oct 27, 2025
09946a6
Apply suggestions from code review
flyingrobots Oct 27, 2025
585130d
core: enforce deterministic scheduler ordering; live tx lifecycle; O(…
flyingrobots Oct 27, 2025
eadc1fa
tests(math): add isolated math coverage for Vec3 normalize degeneracy…
flyingrobots Oct 27, 2025
582ddb1
engine: enforce duplicate rule-name policy; tests: tighten tolerances…
flyingrobots Oct 27, 2025
6bc0870
docs(math): clarify Euler order and M*v convention in Mat4::rotation_…
flyingrobots Oct 27, 2025
858d1e9
demo: remove LazyLock; compute motion rule id on demand (lock-free); …
flyingrobots Oct 27, 2025
e30efb8
demo/motion: hardcode BLAKE3 rule id for "motion/update" (zero-CPU, z…
flyingrobots Oct 27, 2025
5e3b00b
thread CompactRuleId through PendingRewrite; add reserve gate tests a…
flyingrobots Oct 27, 2025
10e5e48
scheduler: add finalize_tx and call from Engine::commit; telemetry co…
flyingrobots Oct 27, 2025
30e2734
toolchain: pin Rust 1.68 across crates; add rust-toolchain.toml; set …
flyingrobots Oct 27, 2025
46a444a
docs: design note for telemetry graph snapshot for reproducible repla…
flyingrobots Oct 27, 2025
ca73498
docs: update execution plan + decision log; add structured session de…
flyingrobots Oct 27, 2025
18ec786
Removes a file I didn't want to commit oops
flyingrobots Oct 27, 2025
9570959
Remove another junk file I acceidentally committed
flyingrobots Oct 27, 2025
0b1243f
demo/motion: add hash-stability test for MOTION_RULE_ID; expand rustd…
flyingrobots Oct 27, 2025
bdaa239
engine/tests/docs: enforce invariants, expand docs, and harden math
flyingrobots Oct 28, 2025
ab5fe5b
deps(core): tighten semver pins to 1.0 series; regenerate Cargo.lock …
flyingrobots Oct 28, 2025
a08f861
ci: rustfmt code to satisfy fmt check; fix FFI attributes (use #[no_m…
flyingrobots Oct 28, 2025
df2fc0b
clippy: zero warnings
flyingrobots Oct 28, 2025
3d276ee
hooks+CI: fail-fast local hooks and MSRV/rustdoc CI jobs
flyingrobots Oct 28, 2025
9a3ff55
demo: doc example fix; guarded footprint parity; ports id domain sepa…
flyingrobots Oct 28, 2025
a512bd7
core(ports/footprint/engine/scheduler/tests): address final PR#7 feed…
flyingrobots Oct 28, 2025
234eed4
hooks(pre-push): print 🎯 bunny heartbeat -> "🐰 BunBun 🐇"
flyingrobots Oct 28, 2025
c9e7187
docs: update execution plan + decision log for PR #7 finalize (reacha…
flyingrobots Oct 28, 2025
1e8c69a
core: address latest PR #7 review nits
flyingrobots Oct 28, 2025
0b4fdaa
core(engine/tests): enforce join_fn invariant; remove expect panic; a…
flyingrobots Oct 28, 2025
9b68612
docs(execution-plan): log 2025-10-28 engine/tests updates (join_fn in…
flyingrobots Oct 28, 2025
6837ff9
core(tx,engine-tests): TxId #[repr(transparent)] + const accessors; a…
flyingrobots Oct 28, 2025
431515a
core(footprint,lib): fix PortKey layout docs and implementation (dir=…
flyingrobots Oct 28, 2025
dcd1bb8
docs(roadmap): fix markdownlint spacing (blank lines around headings/…
flyingrobots Oct 28, 2025
e9bca17
style(fmt): apply rustfmt changes to mat4 Default, TxId const fns, an…
flyingrobots Oct 28, 2025
2350d8a
core(engine/tx/docs/math):
flyingrobots Oct 28, 2025
64e68d2
docs(math,tx): clarify rotation_axis_angle normalization+zero-axis; T…
flyingrobots Oct 28, 2025
01988e6
docs(lib): fix clippy::doc_lazy_continuation by separating list and p…
flyingrobots Oct 28, 2025
95526ec
Update crates/rmg-core/src/tx.rs
flyingrobots Oct 28, 2025
622d1f5
Update .github/workflows/ci.yml
flyingrobots Oct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail
FILE="${1:-}"
if [[ -z "$FILE" || ! -f "$FILE" ]]; then
echo "[commit-msg] Missing commit message file. Usage: commit-msg <path>" >&2
exit 1
fi

SUBJECT=$(head -n1 "$FILE")
if [[ -z "${SUBJECT// /}" ]]; then
echo "[commit-msg] Empty subject line is not allowed." >&2
exit 1
fi

# Discourage WIP commits (built-in regex; avoid spawning grep)
if [[ "$SUBJECT" =~ ^[[:space:]]*[Ww][Ii][Pp]\b ]]; then
echo "[commit-msg] Please avoid 'WIP' in commit subjects. Tell a short story instead." >&2
exit 1
fi

# Soft length guidance (warn only)
LEN=${#SUBJECT}
if (( LEN > 72 )); then
echo "[commit-msg] Note: subject exceeds 72 chars ($LEN). Consider wrapping for readability." >&2
fi

exit 0
99 changes: 63 additions & 36 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,53 +1,80 @@
#!/usr/bin/env bash
set -euo pipefail

# Enforce coupling between PRNG algorithm/version and golden regression vector.

PRNG_FILE="crates/rmg-core/src/math/prng.rs"

# Only run if the PRNG file is staged
if ! git diff --cached --name-only | grep -qx "$PRNG_FILE"; then
if [[ "${SKIP_HOOKS:-}" == 1 ]]; then
exit 0
fi

DIFF=$(git diff --cached -- "$PRNG_FILE" || true)

# Heuristics to detect algorithm changes: edits to these functions imply behavior change
if echo "$DIFF" | grep -E '^(\+|-)\s*(fn\s+next_u64|fn\s+from_seed_u64|fn\s+from_seed\(|fn\s+next_int\()' >/dev/null; then
ALGO_CHANGED=1
else
ALGO_CHANGED=0
# 1) PRNG coupling guard (existing logic)
PRNG_FILE="crates/rmg-core/src/math/prng.rs"
if git diff --cached --name-only | grep -qx "$PRNG_FILE"; then
DIFF=$(git diff --cached -- "$PRNG_FILE" || true)
if echo "$DIFF" | grep -E '^(\+|-)\s*(fn\s+next_u64|fn\s+from_seed_u64|fn\s+from_seed\(|fn\s+next_int\()' >/dev/null; then
ALGO_CHANGED=1
else
ALGO_CHANGED=0
fi
if echo "$DIFF" | grep -E 'PRNG_ALGO_VERSION' >/dev/null; then
VERSION_CHANGED=1
else
VERSION_CHANGED=0
fi
if echo "$DIFF" | grep -E 'next_int_golden_regression|assert_eq!\(values,\s*vec!\[' >/dev/null; then
GOLDEN_CHANGED=1
else
GOLDEN_CHANGED=0
fi
FAIL=0
if [[ "$ALGO_CHANGED" -eq 1 && "$VERSION_CHANGED" -eq 0 ]]; then
echo "pre-commit: PRNG algorithm changed but PRNG_ALGO_VERSION was not bumped." >&2
FAIL=1
fi
if [[ "$VERSION_CHANGED" -eq 1 && "$GOLDEN_CHANGED" -eq 0 ]]; then
echo "pre-commit: PRNG_ALGO_VERSION bumped but golden regression vector was not updated." >&2
FAIL=1
fi
if [[ "$FAIL" -eq 1 ]]; then
echo "pre-commit: Refusing commit. Update algorithm version and golden regression together." >&2
exit 1
fi
fi

# Version bump present?
if echo "$DIFF" | grep -E 'PRNG_ALGO_VERSION' >/dev/null; then
VERSION_CHANGED=1
else
VERSION_CHANGED=0
# 2) Enforce toolchain pin (matches rust-toolchain.toml)
if command -v rustup >/dev/null 2>&1; then
PINNED=$(awk -F '"' '/^channel/ {print $2}' rust-toolchain.toml 2>/dev/null || echo "")
ACTIVE=$(rustup show active-toolchain 2>/dev/null | awk '{print $1}')
if [[ -n "$PINNED" && "$ACTIVE" != "$PINNED"* ]]; then
echo "pre-commit: Active toolchain '$ACTIVE' != pinned '$PINNED'. Run: rustup override set $PINNED" >&2
exit 1
fi
fi

# Golden regression vector updated?
if echo "$DIFF" | grep -E 'next_int_golden_regression|assert_eq!\(values,\s*vec!\[' >/dev/null; then
GOLDEN_CHANGED=1
else
GOLDEN_CHANGED=0
fi
# 3) Format check (fast)
cargo fmt --all -- --check

FAIL=0
if [[ "$ALGO_CHANGED" -eq 1 && "$VERSION_CHANGED" -eq 0 ]]; then
echo "pre-commit: PRNG algorithm changed but PRNG_ALGO_VERSION was not bumped." >&2
FAIL=1
# 4) Docs guard (scaled): only require docs when core public API changed
STAGED=$(git diff --cached --name-only)
CORE_API_CHANGED=$(echo "$STAGED" | grep -E '^crates/rmg-core/src/.*\.rs$' | grep -v '/tests/' || true)
if [[ -n "$CORE_API_CHANGED" ]]; then
echo "$STAGED" | grep -Fx 'docs/execution-plan.md' >/dev/null || { echo 'pre-commit: docs/execution-plan.md must be updated when core API changes.' >&2; exit 1; }
echo "$STAGED" | grep -Fx 'docs/decision-log.md' >/dev/null || { echo 'pre-commit: docs/decision-log.md must be updated when core API changes.' >&2; exit 1; }
fi

if [[ "$VERSION_CHANGED" -eq 1 && "$GOLDEN_CHANGED" -eq 0 ]]; then
echo "pre-commit: PRNG_ALGO_VERSION bumped but golden regression vector was not updated." >&2
FAIL=1
# 5) Lockfile guard: ensure lockfile version is v3 (compatible with MSRV cargo)
if [[ -f Cargo.lock ]]; then
VER_LINE=$(grep -n '^version = ' Cargo.lock | head -n1 | awk -F'= ' '{print $2}')
if [[ "$VER_LINE" != "3" && "$VER_LINE" != "3\r" ]]; then
echo "pre-commit: Cargo.lock must be generated with Cargo 1.68 (lockfile v3)." >&2
echo "Run: cargo +1.68.0 generate-lockfile" >&2
exit 1
fi
fi

if [[ "$FAIL" -eq 1 ]]; then
echo "pre-commit: Refusing commit. Update algorithm version and golden regression together." >&2
exit 1
fi
# 6) Targeted clippy + check for changed crates (fast-ish)
CRATES=$(echo "$STAGED" | sed -n 's#^crates/\([^/]*\)/.*#\1#p' | sort -u)
for c in $CRATES; do
cargo clippy -p "$c" --all-targets -- -D warnings -D missing_docs
cargo check -p "$c" --quiet
done

exit 0

54 changes: 54 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
set -euo pipefail
PINNED="${PINNED:-1.68.0}"

for cmd in cargo rustup rg; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "[pre-push] missing dependency: $cmd. Install it and retry." >&2
exit 1
fi
done

echo "🐰 BunBun 🐇"

if [[ "${SKIP_HOOKS:-}" == 1 ]]; then
exit 0
fi

echo "[pre-push] fmt"
cargo +"$PINNED" fmt --all -- --check

echo "[pre-push] clippy (workspace)"
cargo +"$PINNED" clippy --all-targets -- -D warnings -D missing_docs

echo "[pre-push] tests (workspace)"
cargo +"$PINNED" test --workspace

# MSRV check for rmg-core
echo "[pre-push] MSRV check (rmg-core @ $PINNED)"
if rustup run "$PINNED" cargo -V >/dev/null 2>&1; then
cargo +"$PINNED" check -p rmg-core --all-targets
else
echo "[pre-push] MSRV toolchain $PINNED not installed. Install via: rustup toolchain install $PINNED" >&2
exit 1
fi

# Rustdoc warnings guard (core API)
echo "[pre-push] rustdoc warnings gate (rmg-core)"
RUSTDOCFLAGS="-D warnings" cargo +"$PINNED" doc -p rmg-core --no-deps

# Banned patterns
echo "[pre-push] scanning banned patterns"
# Match any crate-level allow(...) that includes missing_docs; exclude telemetry.rs explicitly
if rg -n '#!\[allow\([^]]*missing_docs[^]]*\)\]' --glob '!crates/rmg-core/src/telemetry.rs' crates >/dev/null; then
echo "pre-push: crate-level allow(missing_docs) is forbidden (except telemetry.rs)." >&2
rg -n '#!\[allow\([^]]*missing_docs[^]]*\)\]' --glob '!crates/rmg-core/src/telemetry.rs' crates | cat >&2 || true
exit 1
fi
if rg -n "\#\[unsafe\(no_mangle\)\]" crates >/dev/null; then
echo "pre-push: #[unsafe(no_mangle)] is invalid; use #[no_mangle]." >&2
rg -n "\#\[unsafe\(no_mangle\)\]" crates | cat >&2 || true
exit 1
fi

exit 0
4 changes: 4 additions & 0 deletions .githooks/pre-rebase
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
echo "[pre-rebase] Rebase is disallowed for this repository. Use merge instead." >&2
exit 1

47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
with:
submodules: false
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
Expand All @@ -31,11 +32,18 @@ jobs:
with:
submodules: false
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- name: rustup override stable
run: rustup toolchain install stable && rustup override set stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: cargo clippy
env:
RUSTUP_TOOLCHAIN: stable
run: cargo clippy --all-targets -- -D warnings -D missing_docs

test:
Expand All @@ -46,11 +54,17 @@ jobs:
with:
submodules: false
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: rustup override stable
run: rustup toolchain install stable && rustup override set stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: cargo test
env:
RUSTUP_TOOLCHAIN: stable
run: cargo test
- name: PRNG golden regression (rmg-core)
run: cargo test -p rmg-core --features golden_prng -- tests::next_int_golden_regression
Expand Down Expand Up @@ -86,3 +100,36 @@ jobs:
echo 'docs/decision-log.md must be updated when non-doc files change.';
exit 1;
}

msrv:
name: MSRV (rmg-core @ 1.68)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false
- uses: dtolnay/rust-toolchain@1.68.0
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: cargo check (rmg-core)
run: cargo check -p rmg-core --all-targets

rustdoc:
name: Rustdoc (rmg-core warnings gate)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: rustup override stable
run: rustup toolchain install stable && rustup override set stable
- uses: Swatinem/rust-cache@v2
- name: rustdoc warnings gate
env:
RUSTUP_TOOLCHAIN: stable
run: RUSTDOCFLAGS="-D warnings" cargo doc -p rmg-core --no-deps
Loading
Loading