mirror of
https://github.com/storytold/craft-libs.git
synced 2026-10-31 15:49:54 +00:00
The crate's record should hold what the decoder is built from, not the process that produced it. The starting assumptions, the plan, the container notes, the entropy-derivation log, the chart calibration, the probe scripts and their observational logs are not part of it. The frozen-table JSONs and tools/gen_tables.py stay, so src/tables.rs can still be regenerated and audited. Renumber the surviving documents 01-05 in reading order and update every reference to them, so the record reads in order and cites nothing that is no longer there. AGENTS.md and CLAUDE.md go back to main: repository instructions are not part of this change.
1.4 KiB
1.4 KiB
AGENTS.md
Shared Rust libraries for the Craft Apps. The shared standards live in
craftrules (../../craftrules on a dev machine): read its
AGENTS.md, then standards/never-crash.md, standards/engineering.md and standards/licensing.md.
- Never crash. Every crate's
lib.rsstarts with#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]. Nounsafe(the workspace forbids it). - New crates go in
crates/<name>, namedcraft-<name>, inherit the workspace package fields and lints, and are listed in[workspace.dependencies]. - No app code. A crate here must be useful to more than one app and must not depend on any app.
- Time goes through
chrono(workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month and day, and add the cycles back to the year (splitting seconds into hours, minutes and seconds is plain arithmetic). - Before merging:
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace.