3.6 KiB
3.6 KiB
Project Conventions — reikhelm
Ground truth every dispatched agent reads. Plan lives at .dev/2026-05-28-procgen-map-core/.
Toolchain & environment (CRITICAL)
- Rust 1.96.0 stable,
aarch64-apple-darwin, via rustup. ~/.cargo/binis NOT on the non-interactive shell PATH. Every shell command that runscargo,rustc, orrustupMUST first export it:
Put this at the front of the same Bash invocation as your cargo command. If you forget it you'll getexport PATH="$HOME/.cargo/bin:$PATH"command not found: cargo.- Run all cargo commands from the workspace root
/Users/caspar/Projects/reikhelm.
Dependency versions (RESOLVED by Task 1)
rand0.10.1,rand_chacha0.10.0,rand_core0.10.1,serde1.0.228 (derive),macroquad0.4.15.- This is the rand 0.10 line — newer than 0.8/0.9. Verify exact API paths against the compiler:
ChaCha8RngimplementsSeedableRng(seed_from_u64(u64)/from_seed([u8;32]));rand_core::RngCoregivesnext_u32/next_u64. To minimize exposure to rand's churning trait paths (SliceRandom→IndexedRandom/IndexedMutRandomacross 0.8→0.9), prefer buildingrange/chance/choose/shuffledirectly onRngCore::next_u64(e.g. Fisher–Yates shuffle from our ownrange) — also more transparent for determinism.cargo buildis the arbiter.
Git
- Repo is initialized in Task 1; work happens on the default branch (no feature branch — greenfield bring-up, explicitly authorized by the session goal).
- Each task commits with the exact message given in its task file's
## Commitsection. - End every commit message body with this trailer (on its own line, preceded by a blank line):
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> - Commit only the files your task created/modified. Do not commit
/target(gitignored).
Module wiring ownership
- A task that CREATES a module file also appends its own
pub mod <name>;to the parent (lib.rsorpasses/mod.rsorrecipes/mod.rs) — EXCEPT the parallel pass batch (Tasks 7–11): for those, the orchestrator pre-wirespasses/mod.rsand pre-creates empty stub files, so pass implementers ONLY edit their own pass file and never touchmod.rs.
Determinism rules (load-bearing — spec §7)
- All generation randomness flows through
reikhelm_core::rng::Rng(ChaCha8). Neverthread_rng/rand::random(). - Never
std::collections::hash_map::DefaultHasherfor anything that affects generation — it's version-unstable. RNGforkuses an explicit integer mix (splitmix64 / FNV-style). - No
HashMap/HashSetiteration order may influence generated output (use sorted/BTreeMapor index order where order matters). - Same seed → byte-identical
Map, every run, every machine.
Rust style
- Derive traits rather than hand-impl where possible (
Clone, Copy, Debug, PartialEq, Eq, serde). - Public items get a
///doc comment. Keep functions small and total — no panics on valid input. - Grid writes go through bounds-safe accessors; OOB is a no-op, never a panic (spec §8).
- Prefer iterators/combinators over index loops where it reads cleanly. This is a learning-Rust project: favor clear, idiomatic code over clever code.
- Tests live in an inline
#[cfg(test)] mod tests { use super::*; ... }at the bottom of the module file.
Reporting (for dispatched implementers)
End your report with a STATUS line: DONE, DONE_WITH_CORRECTIONS, NEEDS_CONTEXT, or BLOCKED.
Paste the actual cargo test output (not "tests pass"). List every file you created/modified. If you deviated from the task spec, say why.