# Conformance — kido-hal-arm64 vs kido.json + boot HAL interface (2026-10-14, second scaffold session)

## Boot HAL interface (kido-boot.h): every function pointer gets exactly one honest implementation or one loud stub

| Pointer         | Bare-metal impl (ARM64)              | Hosted double              | Status |
|-----------------|--------------------------------------|----------------------------|--------|
| console_putc    | QEMU virt PL011, TXFF-polled (REAL)  | putchar                    | MET    |
| console_puts    | PL011 string, CR/LF (REAL)           | fputs                      | MET    |
| timer_ticks     | CNTPCT_EL0 via MRS (REAL)            | monotonic counter (stated) | MET    |
| timer_hz        | CNTFRQ_EL0 via MRS (REAL; 0=unset)   | 1000 (stated)              | MET    |

Unknown board -> KIDO_ERR_NO_CONSOLE (loud, never a guessed address). RPi4 -> KIDO_ERR_STUB_REACHED (declared, init not written). Self-test asserts all four pointers non-NULL on KIDO_OK.

## Caps struct (kido_caps_t)

| Field      | Source                                              | Status  |
|------------|-----------------------------------------------------|---------|
| arch_name  | KIDO_ARCH_NAME ("arm64")                            | MET     |
| mem_base   | bootinfo from entry shim (firmware handoff)         | MET*    |
| mem_size   | bootinfo from entry shim                            | MET*    |
| timer_hz   | CNTFRQ_EL0 (REAL)                                   | MET     |
| has_fpu    | ID_AA64PFR0_EL1 FP field (REAL)                     | MET     |
| has_mmu    | ID_AA64MMFR0_EL1 presence (REAL); bring-up = STUB   | MET**   |

\* MET-by-contract: without bootinfo->mem_valid, probe fails LOUD with KIDO_ERR_STUB_REACHED (DTB/UEFI parse is kido-mem's job). Never invented.
\** Matches the boot header's own comment: "MMU present (bring-up is a STUB)".

## kido.json line-by-line

1. "portable and adaptive from the start" — MET. ARM64 specifics confined to this shim; portable logic stays out; drivers selected at boot from the board table (probe-then-adapt preserved).
2. "Compensates BUBO's x86-bound C heritage" — MET. Zero x86-isms; the header refuses non-ARM64/non-hosted compilation at compile time.
3. "built for where BUBO can't go" (ARM) — MET (draft). ARM64 is the first-class target; QEMU virt is the first real boot board.
4. "Two kernels, one organism ... divided by doll layer" — DEFERRED (inter-kernel protocol is kido-resonate's scope, correctly out of a HAL module).
5. "honest_status: deep build, Phase 4 ... no runnable Kido finalized" — MET-by-discipline. Entry shims, MMU bring-up, DTB parse, and kido_main all remain unwritten/stubbed; nothing here claims to boot.

## Deliberation items closed

- D-boot-1 (probe cost vs adaptivity): untouched — HAL preserves probe-then-adapt; board selection happens at boot from the shim-reported ID.
- New D-hal-1 (device-tree now vs later): overruled for this module — DTB parsing is kido-mem's job; the bootinfo struct is the honest seam.
- New D-hal-2 (hosted double fidelity): mitigated — the double tests the table-fill/probe contract discipline only; register primitives are arch and untestable hosted. Stated in the test report.

## Test report (ran for real, gcc 13.3.0, x86_64 host)

- `gcc -std=c11 -Wall -Wextra -Werror -fsyntax-only -DKIDO_HOSTED_TEST`: PASS, zero warnings.
- `gcc -std=c11 -Wall -Wextra -Werror -fsyntax-only -DKIDO_HOSTED_TEST -DKIDO_HAL_ARM64_SYNTAX_TEST`: PASS, zero warnings. (Parses the ARM64 MRS/PL011 paths; the assembler never runs on this host — execution proof waits for hardware or QEMU.)
- Self-test binary built and run: PASS (0 failures) across 7 checks — table wiring, unknown-board refusal, RPi4 loud stub, probe with/without bootinfo, NULL guards, live console emit.

## Remains

- Bare-metal entry shim (stack/BSS setup, EL1, bootinfo fill from DTB) — the HAL's caller, not yet written.
- Wiring: kido-boot.c adapt()'s bare-metal branch calling kido_hal_arm64_fill() — one-line change, deliberately NOT made (boot module was Gate-approved as-is; for N8toriousAi's review).
- RPi4 UART init (AUX/mini-UART + GPIO mux), DTB memory-map parse (kido-mem), MMU bring-up.
- Execution proof of the ARM64 paths: needs QEMU virt or hardware — N8toriousAi's call.
