Complements CLAUDE.md. Where CLAUDE.md is Claude-Code-specific,
this file is the neutral agent-onboarding document consumed by
OpenAI Codex CLI, Cursor, Aider, and similar tools.
- Name: ZAMAK
- Type: Rust bootloader (BIOS + UEFI, x86-64 / AArch64 / RISC-V 64 / LoongArch64)
- Status: active development; reference PRD v1.3.0
- Organisation: Spacecraft Software
- License: GPL-3.0-or-later on every source file
- Rust edition 2021, stable toolchain for production crates.
- Microsoft Pragmatic Rust Guidelines apply (see
rust-guidelinesskill in Claude Code, or the equivalent house style). #![no_std]for every bootloader crate.stdis permitted only inzamak-cliandzamak-test.#[repr(C)]on every struct that crosses the firmware / kernel boundary, plusconst_assert!on its size/offsets.- Panic policy:
panic = "abort"in release;panic!in library code is a bug unless explicitly justified. - Error handling: internal functions return
Result.process::exitis called only frommain.
- Unit tests live in
#[cfg(test)] mod testsat the bottom of each source file, or in a siblingtests/directory when they need a test fixture. proptestis used for address-arithmetic and parser invariants;cargo test --test proptests -p zamak-coreruns the suite.- QEMU-driven boot tests live in
zamak-test; the entry point iszamak-test --suite <name>. Suites in scope today:boot-smoke,asm-verification,linux-bzimage. - Miri:
cargo +nightly miri test -p zamak-core --lib. Anyasm!or raw-pointer shim has a#[cfg(miri)]stub that mocks the hardware interaction.
- Separate
.asmfiles (useglobal_asm!/asm!). unsafeblocks without a structured// SAFETY:comment (Preconditions / Postconditions / Clobbers / Worst-case).- Naked arithmetic on addresses. Use
checked_add,checked_sub,div_ceil, or the newtype wrappers inzamak_core::addr. - Panicking in
no_stdcode during normal flow. - Shell-specific idioms in the host CLI output. Default text output
must be POSIX-parseable with
grep/awk/cut/sed. - External dependencies with non-GPL-3.0-compatible licenses
(
cargo deny checkenforces this in CI). --local-timeflags or locale-dependent time formatting.
Every host CLI binary (zamak-cli today, future ones the same)
must conform to the Spacecraft Software Dual-Mode Self-Documenting
CLI Standard (v1.0.0):
--json/--format/ structured JSON error envelope on stderrschemaanddescribesub-commands- Exit codes 0/1/2/3/4/5 as documented in the CLI Standard
--dry-runon every write command, idempotent re-runsAI_AGENT/AGENT/CIenv detectionNO_COLOR/FORCE_COLOR/CLICOLORprecedence- ISO 8601 UTC timestamps, UTF-8 without BOM
zamak describe --json returns the authoritative capability
manifest at runtime β consult it instead of hard-coding flag lists.
Zamak/
βββ Cargo.toml # workspace root
βββ CHANGELOG.md # Keep-a-Changelog + ISO 8601 dates
βββ CLAUDE.md # Claude-Code-specific context
βββ AGENTS.md # (this file)
βββ SKILL.md # Spacecraft Software skill manifest
βββ CONTRIBUTING.md # human-contributor guide
βββ zamak-core/ # shared no-std library
βββ zamak-cli/ # host CLI (dual-mode)
βββ zamak-bios/ # BIOS stage-3
βββ zamak-uefi/ # UEFI loader (all arches)
βββ ...
βββ target/ # build output (gitignored)
Changes in these files must run the full test suite (cargo test --workspace + zamak-test --suite asm-verification) before merging:
zamak-core/src/arch/**β arch-specific low-level helperszamak-bios/src/entry.rs,mbr.rs,trampoline.rsβ inline asmzamak-uefi/src/main.rs,handoff.rsβ kernel hand-offzamak-core/src/protocol.rsβ Limine Protocol ABI
zamak describe --jsonβ live capability manifestzamak schema installβ install-command JSON Schemacargo xtaskβ currently unused; reserved for future task runner