src/main.rsis the binary entry point;src/fs.rscontains filesystem-facing logic.src/backend/hosts storage backends and cache/dedup logic (cache.rs,dedup.rs,general.rs).src/image/handles image formats and raw parsing (mod.rs,raw.rs).src/utils/contains shared helpers and test utilities.- Unit tests live beside the code they cover. Integration, CLI smoke, Redis,
and privileged mount tests live under
tests/.
cargo build --lockedbuilds the binary in debug mode.cargo build --locked --releaseproduces an optimized release build.cargo run -- --helpruns the CLI and prints usage/options.cargo test --lockedruns unit and non-privileged integration tests.cargo fmt --all -- --checkchecks formatting.
- Rust 2021 edition; follow standard rustfmt defaults (no repo-specific config).
- Use
snake_casefor functions/modules,CamelCasefor types,SCREAMING_SNAKE_CASEfor constants. - Prefer function and variable names that are both clear and as short as practical.
- Keep modules cohesive: backend logic stays under
src/backend/, image parsing undersrc/image/.
- Prefer small, deterministic unit tests; use
tempfilefor filesystem-related cases. - Run
cargo test --lockedbefore submitting changes that affect core logic. - Redis integration tests are gated by the Cargo feature
redis-integration-tests; they are not compiled in the defaultcargo testpath. - Run Redis integration tests with:
cargo test --locked --features redis-integration-tests redis_ -- --test-threads=1. - Redis integration tests require
DISTILL_FS_TEST_REDIS_URL=redis://host:6379/<non-zero-db>. - Because Redis integration tests
FLUSHDBthe target database before and after each test, the test harness rejects database zero and URLs without an explicit database number. - Privileged FUSE tests are ignored by default. See
README.mdfor their prerequisites and explicit commands. - Nydus privileged tests build RAFS v5 images; RAFS v6 is intentionally
rejected until the read path is moved to Nydus'
BlobDeviceflow.
- Commit messages in history are short, imperative, and capitalized (e.g., “Add support for …”).
- Keep the subject line focused on the change’s outcome; use the body for rationale when needed.
- Subject line (first line): maximum 72 characters.
- Body lines: maximum 72 characters per line.
- Remove unnecessary blank lines in commit messages; keep body compact.
- Before each commit, run
cargo fmtto ensure formatting is correct. - Use conventional commit prefixes:
feat:,fix:,refactor:,perf:,docs:,test:,chore:. - When creating or amending commits from the agent, write the message to a file and use
git commit -F <file>instead of inline-mtext. - PRs should include: a clear description, testing notes (
cargo test,cargo build), and any relevant logs or screenshots if behavior changes.
- Keep changes minimal and localized; avoid reformatting unrelated code.
- If you add new modules, update
mod.rsaccordingly and keep naming consistent with existing layout. - For build/test/validation in this repo, prefer the
pod-build-testskill and run inside the configured Kubernetes pod instead of local macOS. Use pod execution for the repo lint step as well, preferably via thepod-build-testskill'slintaction. - When running Redis integration tests in the pod, prefer:
pod-run test --repo-root <repo> --cmd 'cargo test --features redis-integration-tests redis_ -- --test-threads=1'. Thepod-runentrypoint comes from thepod-build-testskill, not from this repository.
- When resolving a skill, check the current project first, then the global Codex configuration directory.
- Project-local skills live under
.codex/skills/in this repository and take precedence when a skill with the same name exists in multiple locations. - If the skill is not present in the project, fall back to
$CODEX_HOME/skills/(for example,~/.codex/skills/).