# Human & Automated Audit Protocol (`DMCS-1.0`) A direct machine-code binary has **zero source code in a programming language** — which means trust cannot come from reading a high-level repository. Trust comes from **complete, reproducible, byte-level auditability**. Because DMCS-1.0 binaries are tiny (typically 1–16 KiB) and statically self-contained, a human engineer can audit **100% of the entire executable** in under 5 minutes — something impossible with a 50 MB Electron app or even a dynamically linked C/Rust GUI binary. --- ## 1. Purity Audit (Zero Languages, Zero Libraries) Run these commands against the delivered `.hex` and binary ``: ```bash # 1. Reconstruct the binary from raw hex using ONLY a byte converter (no compiler/assembler) xxd -r -p app.hex /tmp/app_rebuilt cmp -s app /tmp/app_rebuilt && echo "BIT-FOR-BIT IDENTICAL" || echo "MISMATCH" sha256sum app /tmp/app_rebuilt # 2. Confirm zero dynamic dependencies, zero interpreters, zero compiler comments file app ldd app 2>&1 # Expected: "not a dynamic executable" readelf -h -l -S app # Expected: ET_EXEC, 1-2 PT_LOAD, 0 sections / no .comment GCC/LLVM tags strings -n 4 app # Inspect every human-readable byte in the entire file ``` ### Red Flags (Disqualify a Claimed `DMCS-L0/L1/L2` Binary) - Presence of `.comment` strings (`GCC:`, `clang`, `rustc`, `Go build ID`). - Presence of `PT_INTERP` (`/lib64/ld-linux-x86-64.so.2`) or `PT_DYNAMIC`. - `app` does not match `xxd -r -p app.hex` bit-for-bit. - File size differs from `PT_LOAD` `p_filesz` (trailing hidden payloads). --- ## 2. Full Disassembly & Syscall Surface Audit Because the entire code section fits in a few hundred instructions, inspect **every single instruction** and **every single kernel syscall** (`0f 05` on `x86_64`): ```bash # Disassemble entire code segment (replace stop-address with rodata start) objdump -D -b binary -m i386:x86-64 -M intel \ --adjust-vma=0x400000 --start-address=0x400080 --stop-address=0x400c00 app \ | grep -v 'nop$' # Audit EVERY syscall instruction in the entire binary (must match documented purpose!) objdump -D -b binary -m i386:x86-64 -M intel \ --adjust-vma=0x400000 --start-address=0x400080 --stop-address=0x400c00 app \ | grep -B 5 'syscall' ``` ### Security Invariants to Verify 1. **Zero `(bad)` or unreachable garbage bytes** inside active code slots. 2. **Every `syscall` has an explicit, documented purpose** (e.g., for a local GUI calculator: ONLY `read=0`, `write=1`, `socket=41`, `connect=42`, `exit=60` — zero `execve`, zero `AF_INET` outbound sockets, zero `openat` on private files!). 3. **Every string/path in `.rodata`** (`xxd -s app`) matches the expected socket path, window title, font, or UI tables. 4. **Division/Overflow safety:** Every `idiv` / `div` is preceded by zero-divisor and overflow checks (`#DE` protection). --- ## 3. Runtime Kernel Trace Audit (`strace`) Verify live behavior matches static analysis: ```bash strace -e trace=network,file,process,desc -f ./app ``` Expected trace for a pure X11 local GUI app: - `socket(AF_UNIX, SOCK_STREAM, 0) = 3` - `connect(3, {sa_family=AF_UNIX, sun_path="/tmp/.X11-unix/X0"}, 20) = 0` - Only `read(3, ...)` and `write(3, ...)` on FD `3` - Clean `exit_group(0)` on quit or window close. --- ## 4. Behavioral & Visual End-to-End Proof Every delivered DMCS-1.0 application MUST ship with verifiable evidence: - **GUI apps:** Live screenshots captured from the real desktop compositor showing initial state, primary interactive workflows, edge/error states, and window manager integration (size, title, floating/tiling). - **CLI / Network / Daemon apps:** Captured command transcripts covering happy path, malformed inputs, boundary values, and clean shutdown. --- ## 5. Compliance Certificate Template Include this compact audit block in every DMCS-1.0 deliverable's `README.md`: ```text Standard: DMCS-1.0 (Tier L0 / L1 / L2 / L3) Target ISA/OS: x86_64 / Linux (ELF64) Binary Size: bytes (exact match to p_filesz) SHA-256: <64-hex-digest> Dynamic Libs: 0 (static, no interpreter) Syscall Set: read(0), write(1), socket(41), connect(42), exit(60) Verified On: ```