Reviewing Diosix
Every code and documentation change in Diosix must pass a rigorous,
multi-perspective audit before commit or merge. Never rubber-stamp changes, and
never sign off on broken, incomplete, or unverified code. The review criteria
below mirror developing-diosix and documenting-diosix 1:1 so that applying
the authoring skills eliminates pre-commit and pre-merge rework.
Mandatory 4-Step Verification Workflow
- Build, Completeness & Test Gate (Table Stakes):
- Verify the feature is 100% implemented as designed with zero
TODOstubs, dead code, or mocked production paths. - When refactoring files over the 500-line limit, never truncate
functionality or unit tests; always componentize oversized files into
cohesive subfolders (
vm/run.zig,panes/modal.zig,tests/gui.zig) rather than flatprefix_subname.zigfiles, and verify every submodule is referenced in its parent'stestblock (_ = @import("vm/run.zig");) sozig build testexecutes its unit tests. - Verify unit tests are co-located in the
.zigsource files they test and integration tests reside in separatetests/directories. - Scope file-format and line/column checks to tracked source directories
(
build.zig,hypervisor,tools,scripts) rather than running unscoped recursive globs across.zig-cache/orzig-out/. - Run
./scripts/build.sh test --summary alland./scripts/build.shuntil 100% of compilation and test steps pass with zero warnings or leaks.
- Verify the feature is 100% implemented as designed with zero
- 4-Persona Deep Review:
- Audit every modified file and its surrounding context through four
distinct lenses:
- Skeptical Veteran Engineer (completeness, idioms, subfolder
hierarchy instead of flat
prefix_subname.zigfiles, lowercase hex literals0xfff, named constants/helpers likePAGE_OFFSET_MASKandcrossesPageBoundaryinstead of magic bitmasks, zero copy-paste duplication ofSpinlock/alignment/path validators, no historical candidate-list fallback arrays likeDEFAULT_GUEST_CANDIDATESfor co-versioned internal paths, explicit fixed-widthu64ABI types instead ofusize, explicitusizetype annotations on@min/@maxwith literals, componentizing >500-line files without truncation, <=80-col limit, dynamic vs. static buffers, externalizing policy to build/run-time config, no on-the-fly binary/ELF/image synthesis in Zig, no generated files insidetools/overlay-common/) - Paranoid Security Expert (hypervisor blast-radius isolation,
single-copy double-fetch/TOCTOU prevention on guest memory, IRQ-safe
locking via
atomic.Spinlock, crypto/page zeroization, checked arithmetic bounds) - Diosix Maintainer (modularity, readability,
defer/errdefer, ABIcomptimesize/offset assertions, external-contract backwards compatibility vs. atomic in-tree migration, submodule test coverage) - Beginner & Expert User (zero-toil UX, clear English errors, config flexibility, performance)
- Skeptical Veteran Engineer (completeness, idioms, subfolder
hierarchy instead of flat
- Audit every modified file and its surrounding context through four
distinct lenses:
- Rust-Style Borrow-Checker & Pointer Lifetime Audit:
- Manually trace every pointer, slice, and allocation across all control flow paths to guarantee zero Use-After-Free (UAF), double-free, pointer invalidation on resize/remap, or dangling stack references.
- Documentation, Spelling & Style Gate:
- Verify
docs/matches all code changes (including SBI FIDs, C struct types, CLI flags, and modularized file paths), is written in clear, grammatically correct American English with verified spelling, and complies withdocs/style-guide.mdanddocs/development.md. - Re-run
zig fmt --check build.zig hypervisor tools scriptsand./scripts/build.sh test --summary allafter any review fixes.
- Verify
- When Unsure, Stop and Ask the Lead Maintainer: If a review uncovers an architectural trade-off or missing primitive, stop and ask the lead maintainer for direction before making assumptions.
Focused Reference Guides
Consult these reference checklists during every review:
- The 4 Review Personas Checklist: Detailed inspection criteria for the Skeptical Veteran Engineer, Paranoid Security Expert, Diosix Maintainer, and Beginner/Expert User.
- Borrow-Checker Audit: Step-by-step methodology for tracing pointer provenance, lifetimes, aliasing mutability, and cross-privilege memory safety in Zig.
- Pre-Commit Gates:
Concrete verification commands and sign-off criteria required before
committing or merging to
develorstable.