Commit Graph
100 Commits
Author SHA1 Message Date
BFE EngineeringandClaude Opus 5.5 1e182a44e4 qemu: agent-test.sh counts a zombie child as killed (CI containers reap nothing)
ci / patches-apply (push) Successful in 1m1s
ci / test (pull_request) Successful in 9s
ci / kernel-build (pull_request) Skipped
ci / quality (pull_request) Successful in 28s
ci / mcdc (push) Successful in 35s
ci / bench (push) Successful in 7s
ci / test (push) Successful in 12s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / badges (push) Skipped
ci / qemu-tools (push) Successful in 2m21s
ci / bench (pull_request) Successful in 7s
ci / mcdc (pull_request) Successful in 35s
ci / kernel-symbols (push) Successful in 4m10s
ci / quality (push) Successful in 29s
ci / prune-artifacts (pull_request) Skipped
ci / qemu-tools (pull_request) Successful in 2m6s
ci / patches-apply (pull_request) Successful in 1m8s
ci / badges (pull_request) Skipped
ci / kernel-symbols (pull_request) Successful in 3m49s
Run 10403: under a CI job container's non-reaping PID 1 the script child
the deadline killed stays a zombie, and kill -0 still found it. The check
now reads the process state from /proc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS
2026-10-31 18:49:45 -06:00
BFE EngineeringandClaude Opus 5.5 bbc91618f8 qemu: agent-test.sh passes shellcheck (SC2016 on the guest-side script)
ci / quality (push) Successful in 34s
ci / badges (push) Skipped
ci / bench (pull_request) Successful in 1m5s
ci / prune-artifacts (pull_request) Skipped
ci / quality (pull_request) Successful in 35s
ci / badges (pull_request) Skipped
ci / test (push) Successful in 8s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / mcdc (push) Successful in 34s
ci / bench (push) Successful in 5s
ci / qemu-tools (push) Failing after 50s
ci / patches-apply (push) Successful in 21s
ci / test (pull_request) Successful in 20s
ci / mcdc (pull_request) Successful in 55s
ci / qemu-tools (pull_request) Failing after 49s
ci / patches-apply (pull_request) Successful in 1m29s
ci / kernel-build (pull_request) Skipped
ci / kernel-symbols (push) Successful in 4m52s
ci / kernel-symbols (pull_request) Successful in 5m54s
The qemu-tools job (run 10385) failed shellcheck on the single-quoted
script the test hands the agent: its expansions belong to the agent's
shell, so the info finding is disabled on that line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS
2026-10-31 18:11:34 -06:00
BFE EngineeringandClaude Opus 5.5 579ac260ca qemu: rig agent, a framed guest shell on its own serial port (flare-edge M9 soak-lite)
ci / test (push) Successful in 10s
ci / patches-apply (push) Successful in 25s
ci / quality (push) Successful in 36s
ci / badges (push) Skipped
ci / kernel-symbols (push) Successful in 4m38s
ci / mcdc (push) Successful in 37s
ci / bench (push) Successful in 6s
ci / qemu-tools (push) Failing after 15s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / test (pull_request) Successful in 9s
ci / prune-artifacts (pull_request) Skipped
ci / mcdc (pull_request) Successful in 34s
ci / bench (pull_request) Successful in 20s
ci / kernel-build (pull_request) Skipped
ci / qemu-tools (pull_request) Failing after 57s
ci / patches-apply (pull_request) Successful in 1m16s
ci / kernel-symbols (pull_request) Successful in 2m14s
ci / badges (pull_request) Skipped
ci / quality (pull_request) Successful in 2m51s
run.sh --agent SOCK adds a third pci-serial after ctl and rs485 (their
ttyS order is unchanged) and warden.agent on the command line. Stage-2
init then runs warden_agent (rootfs/etc/warden-lib.sh) on that port with
echo off: `@run ID SECS B64` runs a script and answers <<BEGIN ID>>, the
base64 of its output and <<END ID RC>>; `@chunk` pieces get past the
4095-byte cooked line; a script past its deadline is killed with its
process group and answers 124 (the panel BusyBox has no timeout). It is
the guest channel of flare-edge tools/soak/rig-qemu.py, which needs bus
reads and writes, the clock and /proc inside the gate image. Rig rootfs
only: no panel image carries it.

Tests: qemu/tests/agent-test.sh (sh and busybox sh, in CI) and new
run-sh-args-test.sh cases (agent last, warden.agent only with the flag).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS
2026-10-31 17:05:50 -06:00
BFE EngineeringandClaude Opus 5.5 61ecfac844 qemu: wait for the UI test hook to answer a ping before the first override (flare-edge#2602)
ci / quality (pull_request) Successful in 1m43s
ci / badges (pull_request) Skipped
ci / test (push) Successful in 11s
ci / prune-artifacts (push) Skipped
ci / quality (push) Successful in 26s
ci / qemu-tools (push) Successful in 4m32s
ci / kernel-symbols (push) Successful in 5m22s
ci / bench (push) Successful in 11s
ci / mcdc (push) Successful in 21s
ci / kernel-build (push) Skipped
ci / badges (push) Skipped
ci / patches-apply (push) Successful in 54s
ci / mcdc (pull_request) Successful in 18s
ci / bench (pull_request) Successful in 15s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 40s
ci / qemu-tools (pull_request) Successful in 2m3s
ci / kernel-symbols (pull_request) Successful in 3m59s
ci / test (pull_request) Successful in 26s
Right after boot the UI is still taking the broker's retained replay under
its per-tick bus budget, so a hook request queued behind it missed wthctl's
5 s bound and its own 5 s message expiry: the failsafe-ack flow's first
override was lost, or applied with its reply lost.

qmp.py now sends a run's first hook request only after the hook has
answered a ping. ping changes nothing, so it is retried while the bridge
reports no answer, up to HOOK_READY_S (90 s); the override itself goes out
once. A hook that never answers stays a fatal step with its own message.
Three offline tests in test_qmp_drive.py; removing the wait fails them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-30 22:07:14 -06:00
BFE EngineeringandClaude Opus 5.5 8fc32976a5 qemu: clear the two shellcheck notes in the prebuilt BusyBox check (flare-edge#2210)
ci / mcdc (push) Successful in 34s
ci / kernel-build (push) Skipped
ci / quality (push) Successful in 46s
ci / bench (push) Successful in 12s
ci / test (push) Successful in 9s
ci / test (pull_request) Successful in 24s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 21s
ci / prune-artifacts (push) Skipped
ci / patches-apply (push) Successful in 41s
ci / bench (pull_request) Successful in 6s
ci / mcdc (pull_request) Successful in 29s
ci / badges (push) Skipped
ci / kernel-symbols (push) Successful in 1m48s
ci / qemu-tools (push) Successful in 5m39s
ci / quality (pull_request) Successful in 1m44s
ci / badges (pull_request) Skipped
ci / qemu-tools (pull_request) Successful in 3m42s
ci / kernel-symbols (pull_request) Successful in 6m55s
CI's shellcheck 0.9.0 failed qemu-tools on #38: SC2015 on the
`[ -f ] && [ = ] || { ... }` refusal in qemu_get_busybox (now an if), and
SC2012 on the `ls | head` that picks a patch to edit in
busybox-panel-test.sh (now find | sort | head). No behaviour change.

Refs flare-edge#2210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-29 09:10:37 -06:00
BFE EngineeringandClaude Opus 5.5 820af4baaa qemu: let a job without the cross compiler use a prebuilt panel BusyBox (flare-edge#2210)
ci / test (push) Successful in 7s
ci / bench (push) Successful in 9s
ci / mcdc (push) Successful in 22s
ci / patches-apply (push) Successful in 50s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / qemu-tools (push) Failing after 27s
ci / quality (push) Successful in 1m17s
ci / badges (push) Skipped
ci / kernel-symbols (push) Successful in 7m7s
ci / test (pull_request) Successful in 9s
ci / bench (pull_request) Successful in 11s
ci / mcdc (pull_request) Successful in 13s
ci / patches-apply (pull_request) Successful in 54s
ci / qemu-tools (pull_request) Failing after 11s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / quality (pull_request) Successful in 1m27s
ci / badges (pull_request) Skipped
ci / kernel-symbols (pull_request) Successful in 4m10s
The flare-edge flow jobs get the rig BusyBox from the image build job's
artifact and have no cross compiler, so RIG_BUSYBOX=panel, which always ran
build-busybox.sh, could not be used there.

- qemu/lib.sh: qemu_busybox_panel_inputs, one sha256 over the source pin
  and every committed input under qemu/busybox/ (no compiler). With
  RIG_BUSYBOX=panel and BUSYBOX set, qemu_get_busybox takes that binary only
  when BUSYBOX.inputs equals the value for this tree; otherwise it fails
  closed. The source pin moved here from build-busybox.sh.
- qemu/build-busybox.sh writes <binary>.inputs next to the binary (also on
  the up-to-date path) and removes a stale one before a rebuild.
- busybox-panel-test.sh: missing, foreign and matching .inputs, a missing
  binary, and a config or patch edit changing the inputs.
- CI qemu-tools: a panel initramfs from the prebuilt binary.

Refs flare-edge#2210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-29 08:34:45 -06:00
BFE EngineeringandClaude Opus 5.5 37037926df qemu: build the panel's own BusyBox for the rig (flare-edge#2210)
ci / quality (push) Successful in 2m25s
ci / badges (push) Skipped
ci / mcdc (push) Successful in 29s
ci / prune-artifacts (push) Skipped
ci / test (push) Successful in 13s
ci / bench (push) Successful in 10s
ci / patches-apply (push) Successful in 24s
ci / kernel-build (push) Skipped
ci / mcdc (pull_request) Successful in 21s
ci / bench (pull_request) Successful in 17s
ci / test (pull_request) Successful in 14s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / qemu-tools (push) Successful in 4m32s
ci / kernel-symbols (push) Successful in 4m28s
ci / patches-apply (pull_request) Successful in 57s
ci / qemu-tools (pull_request) Successful in 3m8s
ci / kernel-symbols (pull_request) Successful in 6m42s
ci / quality (pull_request) Successful in 2m19s
ci / badges (pull_request) Skipped
The rig runs busybox.net's 1.31.0 multiarch binary, not the image's 1.37.0
with its applet config, so a script calling an applet or option the panel
lacks (#1903 setpriv --reuid, #2002 stat, #1349 flock -w) passes in the rig
and breaks on a panel.

- qemu/busybox/panel.config: the image's config, rebuilt from Buildroot
  2025.02.8 busybox.config plus 0001-busybox-applets.patch, resolved for
  1.37.0 as Buildroot does. patches/: Buildroot's 11 busybox patches.
  rig.fragment: static link and BusyBox's own passwd readers only.
  applets.txt and help.txt: the bench a capture (image 417a66b).
- qemu/build-busybox.sh: pinned 1.37.0 source, fails on any Kconfig rewrite
  of the config, an applet list other than the panel's, or a dynamic binary.
- qemu/lib.sh: RIG_BUSYBOX=panel selects it (default stays multiarch);
  the bounded verified download is now qemu_fetch_verified.
- warden.shell uses warden_console_shell: cttyhack where it exists, else
  setsid -c on the console tty (the panel's BusyBox has no cttyhack).
- CI: offline tests in qemu-tools, a build there checked against every
  applet's --help from the panel through qemu-user, and a second boot smoke
  with the panel initramfs in kernel-build.

Refs flare-edge#2210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-29 07:36:25 -06:00
BFE EngineeringandClaude Opus 5.5 b4596ed737 kernel: keep the arm32 vDSO clock off the virtual counter (#35)
ci / test (push) Successful in 31s
ci / bench (push) Successful in 14s
ci / mcdc (push) Successful in 26s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / quality (push) Successful in 1m18s
ci / badges (push) Skipped
ci / bench (pull_request) Successful in 10s
ci / patches-apply (push) Successful in 52s
ci / qemu-tools (push) Successful in 3m26s
ci / kernel-symbols (push) Successful in 5m12s
ci / test (pull_request) Successful in 8s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / badges (pull_request) Skipped
ci / qemu-tools (pull_request) Successful in 2m59s
ci / mcdc (pull_request) Successful in 19s
ci / patches-apply (pull_request) Successful in 52s
ci / quality (pull_request) Successful in 1m15s
ci / kernel-symbols (pull_request) Successful in 6m57s
On the RV1106 the boot firmware does not enter the kernel in HYP mode and
leaves CNTVOFF non-zero. The DT timer node lists no virtual-timer PPI, so
the kernel keeps time on the physical counter, while the arm32 vDSO always
reads the virtual one: on bench a clock_gettime() ran 738.9 s ahead of the
kernel clock (pure offset, -0.1 ppm over 30 s) and every absolute deadline
taken from it expired minutes late (flare-edge#2319, the #2311 reset loop).

New patch 82-arch-timer-vdso-phys-counter.patch:
- rv1106.dtsi and rv1106-warden-m2.dts: the timer node carries
  arm,cpu-registers-not-fw-configured. The kernel keeps the physical
  timer it uses today, and arch/arm/kernel/vdso.c drops the vDSO clock
  symbols, so libc goes straight to the syscall.
- arm_arch_timer.c: on arm32, a kernel on the physical counter without
  HYP mode sets the counter's vdso_clock_mode to VDSO_CLOCKMODE_NONE, the
  safety net for a device tree without the property. QEMU -M virt (virtual
  PPI present) is unchanged.

tests/arch-timer/check-vdso-counter.py checks both guards in the patched
tree; CI's patches-apply job runs it and its 12 regression cases.

Fixes #35
Refs flare-edge#2319

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-29 03:37:08 -06:00
BFE EngineeringandClaude Opus 5.5 a9f2b9b26a qemu: ui-drive waits for the chain start on an init-chain boot (flare-edge#2295)
ci / test (pull_request) Successful in 24s
ci / mcdc (pull_request) Successful in 17s
ci / badges (push) Skipped
ci / test (push) Successful in 9s
ci / qemu-tools (push) Successful in 1m27s
ci / bench (pull_request) Successful in 5s
ci / mcdc (push) Successful in 12s
ci / bench (push) Successful in 5s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / patches-apply (push) Successful in 43s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 24s
ci / quality (pull_request) Successful in 2m35s
ci / kernel-symbols (pull_request) Successful in 5m7s
ci / quality (push) Successful in 1m28s
ci / qemu-tools (pull_request) Successful in 1m36s
ci / badges (pull_request) Skipped
ci / kernel-symbols (push) Successful in 5m2s
ui-drive.sh --init-chain boots with warden.initchain, where sbin/init starts
the UI through the panel's S99lvgl and prints "init: chain started N
script(s)"; the direct-start line "init: starting warden-ui" is never
printed. ui-drive.sh still waited for that line, so the first flare-edge
"QEMU UI shipped init chain" run (job 99350) gave "warden-ui never started"
after 180 s on a chain that had booted cleanly.

The wait moves to qemu/tests/ui-start.sh (sourced by ui-drive.sh and
ui-shot.sh): wait_ui_started picks the marker by mode and, on a chain boot,
fails at once on WARDEN-QEMU-INITCHAIN-EMPTY or a failed S99lvgl instead of
at the deadline.

Tests: new qemu/tests/ui-start-test.sh (27 checks, in CI): every marker is
the one sbin/init or warden-lib.sh prints in that mode, the job 99350
console counts as started in chain mode, empty and failed chains fail fast,
a dead VM and a silent console fail with their own messages, and both
drivers wait through the helper. The old ui-drive.sh fails 4 checks.

Fixes flare-edge#2295

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-28 17:17:14 -06:00
BFE Engineering 333c237949 Merge remote-tracking branch 'origin/rebuild' into rb/ln-init-chain-boot
ci / test (push) Skipped
ci / mcdc (push) Skipped
ci / bench (push) Skipped
ci / qemu-tools (push) Skipped
ci / kernel-symbols (push) Skipped
ci / patches-apply (push) Skipped
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / quality (push) Skipped
ci / badges (push) Skipped
ci / bench (pull_request) Successful in 20s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / quality (pull_request) Successful in 42s
ci / test (pull_request) Successful in 15s
ci / mcdc (pull_request) Successful in 1m3s
ci / kernel-symbols (pull_request) Successful in 5m24s
ci / qemu-tools (pull_request) Successful in 1m58s
ci / patches-apply (pull_request) Successful in 31s
ci / badges (pull_request) Skipped
2026-10-28 11:38:54 -06:00
BFE EngineeringandClaude Opus 5.5 f04a31dc06 qemu: ui-drive --init-chain and the assert_ui_chain verb (flare-edge#2210)
ci / qemu-tools (push) Successful in 3m26s
ci / test (push) Successful in 25s
ci / bench (push) Successful in 18s
ci / mcdc (push) Successful in 32s
ci / quality (push) Successful in 35s
ci / badges (push) Skipped
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / patches-apply (push) Successful in 24s
ci / kernel-symbols (push) Successful in 5m45s
ui-drive.sh --init-chain DIR lays the panel's scripts over the rootfs
(ROOTFS_OVERLAY) and boots with warden.initchain; it refuses a missing
directory or one without etc/init.d/S99lvgl before anything is built.

qmp.py assert_ui_chain [ACCOUNT] reads the guest over the control channel
(@procs, @cat) and fails unless exactly one warden-ui and one warden-ui-run
loop run, the UI's real, effective, saved and filesystem uids are all the
account's (never 0), the safe-mode flag is absent and /tmp/warden-ui.log
holds no exit or refusal of warden-ui-run. tests/scripts/init-chain-ui.txt
runs it at about T+120 s.

Tests: UiChainVerb in test_qmp_drive.py (12 cases, among them the #1903
case: no UI, safe mode, three exits); 6 of 6 mutants caught.
rootfs-overlay.sh gains the three ui-drive.sh --init-chain checks.

Refs flare-edge#2210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-28 10:39:31 -06:00
BFE EngineeringandClaude Opus 5.5 a4bbfbd83b qemu: boot the UI through the panel's shipped init chain (flare-edge#2210)
ci / prune-artifacts (push) Skipped
ci / patches-apply (push) Successful in 24s
ci / bench (pull_request) Successful in 16s
ci / test (push) Successful in 24s
ci / mcdc (push) Successful in 29s
ci / kernel-build (push) Skipped
ci / test (pull_request) Successful in 10s
ci / quality (push) Successful in 39s
ci / badges (push) Skipped
ci / mcdc (pull_request) Successful in 30s
ci / bench (push) Successful in 10s
ci / qemu-tools (push) Successful in 3m16s
ci / qemu-tools (pull_request) Successful in 2m34s
ci / kernel-symbols (pull_request) Successful in 1m54s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 55s
ci / quality (pull_request) Successful in 1m36s
ci / badges (pull_request) Skipped
ci / kernel-symbols (push) Successful in 4m24s
The rig's stage-2 init starts /usr/bin/warden-ui directly as root, so it
never ran S03warden-accounts, S99lvgl or warden-ui-run: no privilege drop,
respawn loop or safe mode was exercised, and the BusyBox setpriv bug of
flare-edge #1903 left every rebuild image without a UI while CI was green.

- mkimage.sh: ROOTFS_OVERLAY lays a directory of panel files over the
  rootfs of both slots, modes kept. Only etc/ and usr/ at its top, no
  symlinks; a refused overlay writes no image.
- sbin/init: with warden.initchain on the command line it runs
  /etc/init.d/S00-S09 before the bus and S10-S99 after the payload daemons,
  in place of the direct UI start (warden_init_chain in warden-lib.sh). The
  splash handover is marked done and warden-ui-run gets "-b fbdev". A chain
  boot without scripts prints WARDEN-QEMU-INITCHAIN-EMPTY and starts no UI.
- warden_rig_bus_owners: when the accounts exist, cred/ui belongs to
  warden-ui and the cred directory to group warden-bus, as S10bus does.
- Tests: init-chain-test.sh (19 checks, also under busybox sh) and
  rootfs-overlay.sh (17 scenarios, images read back with debugfs), both in CI.

Refs flare-edge#2210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-28 10:35:29 -06:00
BFE Engineering de1b973aa4 Merge remote-tracking branch 'origin/rebuild' into rb/ln-hook-payload
ci / test (pull_request) Successful in 33s
ci / kernel-build (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 44s
ci / mcdc (push) Skipped
ci / bench (push) Skipped
ci / test (push) Skipped
ci / patches-apply (push) Skipped
ci / kernel-build (push) Skipped
ci / qemu-tools (push) Skipped
ci / kernel-symbols (push) Skipped
ci / prune-artifacts (push) Skipped
ci / quality (push) Skipped
ci / badges (push) Skipped
ci / mcdc (pull_request) Successful in 26s
ci / bench (pull_request) Successful in 9s
ci / quality (pull_request) Successful in 2m10s
ci / prune-artifacts (pull_request) Skipped
ci / qemu-tools (pull_request) Successful in 2m36s
ci / badges (pull_request) Skipped
ci / kernel-symbols (pull_request) Successful in 4m29s
2026-10-27 19:04:26 -06:00
BFE EngineeringandClaude Opus 5.5 eebfd23a96 qemu: test_qmp_drive.py removes its temp dirs (Fixes #30)
ci / mcdc (push) Successful in 13s
ci / bench (push) Successful in 5s
ci / prune-artifacts (push) Skipped
ci / test (push) Successful in 10s
ci / qemu-tools (push) Successful in 1m22s
ci / kernel-build (push) Skipped
ci / patches-apply (push) Successful in 48s
ci / quality (push) Successful in 57s
ci / badges (push) Skipped
ci / kernel-symbols (push) Successful in 4m7s
Every temp dir the module makes (a drive's out dir per run_script, the
console and QMP socket dirs) now lands under one root per run, removed at
exit; a run used to leave about 40 dirs in $TMPDIR. TempDirs runs one test
of each kind in a child under a fresh TMPDIR and checks it is empty after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-27 18:11:14 -06:00
BFE EngineeringandClaude Opus 5.5 06b86e68b4 qemu: payload-dir.sh uses if blocks (shellcheck SC2015)
ci / test (push) Successful in 19s
ci / bench (push) Successful in 13s
ci / quality (push) Successful in 1m35s
ci / badges (push) Skipped
ci / mcdc (push) Successful in 14s
ci / qemu-tools (push) Successful in 2m47s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / patches-apply (push) Successful in 39s
ci / kernel-symbols (push) Canceled after 4m16s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-27 17:56:23 -06:00
BFE EngineeringandClaude Opus 5.5 9998182ef5 qemu: PAYLOAD_DIR lets one run boot its own payload set
ci / kernel-build (push) Canceled after 0s
ci / quality (push) Canceled after 0s
ci / badges (push) Canceled after 0s
ci / test (push) Canceled after 0s
ci / mcdc (push) Canceled after 0s
ci / bench (push) Canceled after 0s
ci / qemu-tools (push) Canceled after 0s
ci / kernel-symbols (push) Canceled after 0s
ci / patches-apply (push) Canceled after 0s
ci / prune-artifacts (push) Canceled after 0s
mkimage.sh copies PAYLOAD_DIR (default qemu/payload) into /usr/bin of both
slots and fails closed when it is not a directory; ui-drive.sh checks for
warden-ui in the same directory. flare-edge boots the hook set (production
payload plus the test-flavor UI and wthctl) for a flow that pins documents
while the other flows of a batch keep reading qemu/payload (flare-edge#2054).

qemu/tests/payload-dir.sh builds the images on a copy of qemu/ and reads
both rootfs slots back with debugfs; wired into CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-27 17:55:23 -06:00
BFE EngineeringandClaude Opus 5.5 dd15eac1a8 qemu: drive a flow's override step through the UI test hook
ci / kernel-build (push) Skipped
ci / patches-apply (push) Successful in 59s
ci / test (pull_request) Successful in 29s
ci / bench (pull_request) Successful in 5s
ci / bench (push) Successful in 13s
ci / qemu-tools (push) Successful in 1m56s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 1m5s
ci / kernel-symbols (push) Successful in 4m0s
ci / quality (pull_request) Successful in 1m51s
ci / test (push) Successful in 15s
ci / mcdc (push) Successful in 30s
ci / prune-artifacts (push) Skipped
ci / mcdc (pull_request) Successful in 30s
ci / qemu-tools (pull_request) Successful in 1m18s
ci / badges (pull_request) Skipped
ci / quality (push) Successful in 2m5s
ci / badges (push) Skipped
ci / kernel-symbols (pull_request) Successful in 5m14s
flowc compiles a flow's `override` action to `override TOPIC DOC|null`,
and a test-flavor warden-ui answers the override verb on test/req/ui, but
the rig driver had no such verb and the control bridge only reached the
UI's old FIFO, so a flow using it failed with an unknown command
(flare-edge #2054).

qmp.py `override` sends the request through the control bridge: the args
JSON in `@hookdoc` / `@hookdoc+` pieces of 2000 bytes (the ctl port is a
cooked tty that cuts a line at 4095 bytes; a document may be 16 KiB),
then `@hook override`. The bridge runs the payload's wthctl as bus user
testhook and answers its reply. ok:true passes, ok:false fails with the
hook's err, and a request that never reached the hook (no client, no
bus, no reply, a reply that is not a hook envelope) is fatal. The rig bus
writes a testhook credential. Only plain words reach the client.

ctl-bridge-test.sh covers the pieces, single use of the args, the word
filter, ok:false, no reply and no client, now also under busybox sh in
CI; test_qmp_drive.py covers the verb's ok, fail and fatal rows.

Refs flare-edge #2054.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-27 13:46:00 -06:00
BFE EngineeringandClaude Opus 5.5 5494b87dc3 qemu: start the device bus when the payload carries a broker
ci / test (push) Successful in 28s
ci / prune-artifacts (push) Skipped
ci / patches-apply (push) Successful in 1m2s
ci / mcdc (push) Successful in 29s
ci / bench (push) Successful in 12s
ci / mcdc (pull_request) Successful in 11s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / kernel-build (push) Skipped
ci / quality (push) Successful in 27s
ci / badges (push) Skipped
ci / qemu-tools (pull_request) Successful in 1m9s
ci / patches-apply (pull_request) Successful in 57s
ci / test (pull_request) Successful in 26s
ci / bench (pull_request) Successful in 16s
ci / quality (pull_request) Successful in 1m29s
ci / kernel-symbols (pull_request) Successful in 6m50s
ci / qemu-tools (push) Successful in 2m15s
ci / kernel-symbols (push) Successful in 4m42s
ci / badges (pull_request) Skipped
A panel runs one mosquitto on /run/warden/bus/bus.sock (flare-edge S10bus)
and every daemon and the UI talk over it; the rig had no broker, so the
Rust warden-modbus and the UI's bus client could not run there (flare-edge
#1754, the #1050 QEMU half). Stage-2 init now starts the broker before the
payload daemons when the payload carries a static mosquitto, with the
panel's paths: the socket under sock/ with the bus.sock link, and a fresh
0400 credential file per bus user under cred/. The rig broker takes any
user and loads no plugin (the rig is a test instrument; a static broker
loads none). A payload without a broker boots as before.

qemu/tests/init-rig-bus-test.sh covers no broker, a listening broker (layout,
modes, config), a broker that exits or never listens, bad user names and the
init order, under sh and busybox sh; with WARDEN_TEST_MOSQUITTO_DIR a real
mosquitto carries a message between two users logged in by credential file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-26 15:32:51 -06:00
BFE EngineeringandClaude Opus 5.5 44b96074ed qemu, build: bound the busybox and kernel fetches
ci / kernel-symbols (push) Successful in 7m23s
ci / bench (pull_request) Successful in 31s
ci / mcdc (pull_request) Successful in 38s
ci / patches-apply (pull_request) Successful in 59s
ci / kernel-symbols (pull_request) Successful in 5m20s
ci / bench (push) Successful in 34s
ci / patches-apply (push) Successful in 1m6s
ci / qemu-tools (push) Successful in 2m37s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / qemu-tools (pull_request) Successful in 2m46s
ci / test (push) Successful in 40s
ci / mcdc (push) Successful in 33s
ci / test (pull_request) Successful in 43s
ci / quality (push) Successful in 1m56s
ci / badges (push) Skipped
ci / quality (pull_request) Successful in 1m27s
ci / badges (pull_request) Skipped
qemu_get_busybox and fetch-kernel-tarball.sh ran curl with no connect
timeout, stall limit or total cap. A server that answered and then went
silent held the flare-edge QEMU UI gate build job until its 30 minute
timeout, with no retry (flare-edge #1588, run 7391 job 63953).

- qemu/lib.sh: each attempt gives up below 1 KiB/s for 20 s, or after
  60 s in all; curl retries once, the 3-attempt loop stays. Limits are
  overridable through BB_FETCH_* for the tests.
- build/fetch-kernel-tarball.sh: 20 s connect timeout, abort below
  10 KiB/s for 30 s, 600 s cap. The download lands in a temp file and is
  renamed on success, so a failed fetch no longer leaves a partial
  tarball that the next run takes as present and rejects on its sha256.
- Tests: busybox-fetch.sh serves a stalling local HTTP endpoint to the
  real curl (hung for the full 60 s guard before, fails in about 9 s
  after); new tests/fetch-kernel-tarball suite (bounded argv, no partial
  file, refetch after a failure, reuse of a matching tarball; 6 of 9
  checks red before). Both wired into CI and shellcheck.

Refs blueflare/flare-edge#1588

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-23 00:23:47 -06:00
BFE EngineeringandClaude Opus 5.5 b7be6f7fbe qemu: name the cause when warden-ui stops answering a flow
ci / patches-apply (pull_request) Successful in 52s
ci / mcdc (push) Successful in 32s
ci / test (push) Successful in 24s
ci / kernel-build (pull_request) Skipped
ci / bench (push) Successful in 14s
ci / qemu-tools (push) Successful in 2m29s
ci / prune-artifacts (push) Skipped
ci / test (pull_request) Successful in 24s
ci / quality (push) Successful in 1m52s
ci / mcdc (pull_request) Successful in 31s
ci / bench (pull_request) Successful in 18s
ci / kernel-build (push) Skipped
ci / patches-apply (push) Successful in 52s
ci / badges (push) Skipped
ci / kernel-symbols (push) Successful in 5m55s
ci / qemu-tools (pull_request) Successful in 2m6s
ci / prune-artifacts (pull_request) Skipped
ci / quality (pull_request) Successful in 1m38s
ci / badges (pull_request) Skipped
ci / kernel-symbols (pull_request) Successful in 6m17s
flare-edge #1528: on the lenovo QEMU runner warden-ui stopped answering for
30 to 60 s at a time (bridge no-reply, presses not consumed) and then
recovered. Re-run jobs lose their failed-flow artifacts, so nothing showed
whether the host starved the VM, the guest CPU was saturated, the guest
waited on I/O, or warden-ui was blocked in an idle guest.

qmp.py drive() now probes the first three such failures of a run: over 2 s
it samples host load and PSI, the VM's vCPU thread CPU (query-cpus-fast
thread-id), the guest /proc/stat and every guest process's stat line, and
appends one line to the step's detail (verdict, numbers, top guest
processes, processes in D state). The detail reaches the job log, so the
answer survives a re-run. The control bridge answers the new `@procs`
command itself, so the probe works while the UI is stuck.

Tests: test_qmp_drive.py StallProbe (parsers, verdicts, CPU deltas, the
vCPU thread sampler, a bounded probe on no-reply steps and none on a plain
mismatch); ctl-bridge-test.sh checks `@procs` with no UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-22 06:31:07 -06:00
BFE EngineeringandClaude Opus 5.5 b94fd156b4 qemu: control bridge waits out a slow UI and never hands on a late reply
ci / test (push) Successful in 2m34s
ci / mcdc (push) Successful in 48s
ci / bench (push) Successful in 25s
ci / qemu-tools (push) Successful in 4m5s
ci / patches-apply (push) Successful in 2m26s
ci / quality (push) Successful in 1m36s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / kernel-symbols (push) Successful in 7m19s
ci / badges (push) Skipped
ci / mcdc (pull_request) Successful in 56s
ci / bench (pull_request) Successful in 17s
ci / test (pull_request) Successful in 2m29s
ci / patches-apply (pull_request) Successful in 1m25s
ci / qemu-tools (pull_request) Successful in 4m54s
ci / quality (pull_request) Successful in 2m16s
ci / badges (pull_request) Skipped
ci / kernel-symbols (pull_request) Successful in 5m57s
The bridge waited 5 s for warden-ui's reply. On the lenovo QEMU host a
page build outran it: the bridge answered an empty reply, and the UI's
late reply then landed after the next command's remove and was read as
that command's answer (flare-edge#1448: "page is ''", a nav answered
with the previous hit).

The loop moves to warden_ctl_bridge in etc/warden-lib.sh so a host test
reaches it. The wait is 30 s (WARDEN_CTL_WAIT_S); a timeout answers
"bridge: no reply from warden-ui ...", which qmp.py raises as a rig
fault, and the next command first drains the late reply. Replies slower
than 5 s are logged on the console with their time. qmp.py's control
socket timeout is 90 s so it outlasts the bridge's wait.

Tests: qemu/tests/ctl-bridge-test.sh (new, in CI), test_qmp_drive.py.

Refs flare-edge#1448

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-21 00:32:37 -06:00
BFE EngineeringandClaude Opus 5.5 be4ad86230 qemu: power-signal test waits for the trap install (#22)
ci / mcdc (pull_request) Successful in 16s
ci / test (push) Successful in 10s
ci / mcdc (push) Successful in 17s
ci / bench (push) Successful in 5s
ci / qemu-tools (push) Successful in 50s
ci / patches-apply (push) Successful in 24s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / kernel-symbols (push) Successful in 2m40s
ci / test (pull_request) Successful in 9s
ci / quality (push) Successful in 34s
ci / badges (push) Skipped
ci / bench (pull_request) Successful in 7s
ci / qemu-tools (pull_request) Successful in 54s
ci / prune-artifacts (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 27s
ci / kernel-symbols (pull_request) Successful in 2m30s
ci / kernel-build (pull_request) Skipped
ci / quality (pull_request) Successful in 44s
ci / badges (pull_request) Skipped
init-power-signals-test.sh slept a fixed 0.5 s before sending each signal.
On a loaded runner the shell had not installed its traps yet, so SIGTERM
took its default action and the case failed with nothing written.

Each case now polls /proc/<pid>/status until SigCgt has the signal's bit
(10 s hang backstop, WARDEN_TEST_TRAP_WAIT_S), and fails clearly if the
handler never appears. Regression: a case whose handler install is held
back 1.5 s (fails on the old fixed sleep), plus a check that the wait gives
up on a shell without a handler.

Fixes #22

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-17 17:51:08 -06:00
BFE EngineeringandClaude Opus 5.5 6f931bf3ad qemu: input consumption wait is a hang backstop (flare-edge#1138)
ci / bench (push) Successful in 8s
ci / qemu-tools (push) Successful in 57s
ci / patches-apply (push) Successful in 23s
ci / test (push) Successful in 12s
ci / mcdc (push) Successful in 21s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / quality (push) Successful in 55s
ci / kernel-symbols (push) Successful in 2m45s
ci / kernel-symbols (pull_request) Successful in 2m17s
ci / badges (push) Skipped
ci / qemu-tools (pull_request) Successful in 55s
ci / patches-apply (pull_request) Successful in 24s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / quality (pull_request) Successful in 28s
ci / badges (pull_request) Skipped
ci / test (pull_request) Successful in 11s
ci / bench (pull_request) Successful in 6s
ci / mcdc (pull_request) Successful in 13s
The runner waited 2 s for the guest to count an injected press or
release. On a loaded runner the release that opens the drawer took
longer, so navigation/drawer-drag-release-policy failed both attempts
although the UI handled the swipe. The wait is now a 20 s hang backstop;
a wait over 2 s still passes and puts "slow guest: input consumed after
N s" in the step's detail.

Regression: test_swipe_release_counted_late_on_a_loaded_guest_passes
(release counted 2.5 s after the drag; fails with the 2 s bound), plus
a prompt-release case and a never-counted case bounded by the backstop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
2026-10-17 14:24:59 -06:00
BFE Engineering 8c4870c6fb Allow seeded QEMU flow setup
ci / mcdc (pull_request) Successful in 12s
ci / bench (pull_request) Successful in 3s
ci / qemu-tools (pull_request) Successful in 42s
ci / patches-apply (pull_request) Successful in 15s
ci / test (push) Successful in 13s
ci / test (pull_request) Successful in 12s
ci / mcdc (push) Successful in 11s
ci / bench (push) Successful in 5s
ci / qemu-tools (push) Successful in 43s
ci / patches-apply (push) Successful in 18s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / quality (push) Successful in 30s
ci / badges (push) Skipped
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / quality (pull_request) Successful in 1m39s
ci / badges (pull_request) Skipped
2026-10-04 18:29:49 -06:00
BFE EngineeringandClaude Opus 5.5 b18ed3888b relays: refuse a WARDEN_GPIO_ROOT too long for PATH_MAX
ci / test (push) Successful in 16s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / bench (push) Successful in 11s
ci / patches-apply (push) Successful in 22s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / quality (push) Successful in 37s
ci / badges (push) Skipped
ci / qemu-tools (pull_request) Successful in 45s
ci / qemu-tools (push) Successful in 49s
ci / test (pull_request) Successful in 17s
ci / mcdc (pull_request) Successful in 19s
ci / bench (pull_request) Successful in 8s
ci / mcdc (push) Successful in 23s
ci / patches-apply (pull_request) Successful in 22s
ci / quality (pull_request) Successful in 34s
ci / badges (pull_request) Skipped
Sysfs paths were built in fixed 80/96-byte stack buffers with unchecked
snprintf, so a root longer than about 70 bytes was truncated and both relays
silently read as unavailable.

Each operation now formats all of its paths up front into PATH_MAX buffers
and checks every snprintf return. A root whose longest path does not fit is
refused with a stderr line and the call reports unavailable, off or no-op;
nothing is ever truncated. The export argument comes from a constant table
instead of runtime formatting.

Regression tests: a 200-byte root through the fake io (full path reaches
the backend), the exact PATH_MAX boundary, one byte over (refused and logged
on available, get and set, io untouched), and a real scratch tree under a
root over 200 bytes. MC/DC stays at 100% (50/50 conditions).

Fixes #10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01441BzdGcvQmXkiN2qDjfZg
2026-10-02 11:01:40 -06:00
BFE EngineeringandClaude Opus 5 e12bb2c554 Implement RV1106 USB2 PHY signal tuning
Cherry-picked onto the pinned SDK so the ONLY delta versus the pin is this
patch -- the xHCI controller-death investigation needs a controlled build.

The forward-port omitted the vendor driver's rv1106_usb2phy_tuning with the
note "the phy is functional without it". It is functional, but not reliable:
with these registers at reset defaults the HS link is electrically marginal
under sustained traffic, a bulk transfer eventually stalls, and the r8152
Tx-timeout recovery issues an xHCI Stop Endpoint command the controller never
answers. Measured carrier-on to death over four runs: 14s, 519s, 521s, 584s.

Refs flare-edge#160

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MVGTC78dgCGfRANNKjoPea
2026-09-22 12:11:14 -06:00
BFE EngineeringandClaude Fable 5 3d3b35459e 6.18 boot-splash chain: seamless VOP takeover, drm-logo reservation, gzip kernel, chosen-bootargs dedup
Kernel-side captures for the flare-edge warden-bootimprovements work,
photon-verified on warden-c8a3:

- rockchip_drm_vop.c vop_initial(): when U-Boot left the VOP scanning the
  boot logo (window enabled, not in standby), skip the AHB/dclk resets and
  window disables, and hold clocks + a runtime-PM reference until the first
  real vop_enable() drops them. The logo now survives the DRM bind; the
  only remaining blank is ~1.3s at the splash's own first modeset.
  KNOWN LOOSE END: a deferred-probe rebind runs the takeover twice and the
  first bind's held references are never dropped (a clk/PM leak that keeps
  the VOP domain on -- harmless for an always-on HMI, should be released in
  unbind eventually).
- rv1106-warden.dts: /reserved-memory/drm-logo@0 placeholder that U-Boot's
  fdt fixup stamps with the logo framebuffer (observed: addr=0xdf00000
  size=0x71000, kernel reserves it 'map non-reusable'); chosen bootargs
  drop earlyprintk (with earlycon it doubled every console line at 115200).
- Kernel config switched KERNEL_XZ -> KERNEL_GZIP: post-'Starting kernel'
  silence 4.2s -> 0.8s; the zImage grows past the old 11.95MB cap, which
  flare-edge sdk-patches 0007 removes (fdt_addr_r 12M -> 128M).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014L3eBF6wBXC55uJoZuUfS6
2026-09-01 16:57:46 -06:00
BFE EngineeringandClaude Fable 5 55b7cd5afa dts: document why usbdrd_dwc3 carries no extcon (D1-mod VBUS pins extcon to peripheral)
Tried extcon = <&u2phy> for 5.10 parity (2026-09-01) and reverted the same
day: bench/router panels self-source VBUS on the OTG port, so bvalid is
always high and extcon locks the role to peripheral, overriding debugfs mode
writes and orphaning a plugged USB NIC. Role stays manual (dwc3 debugfs mode,
router=host / client=gadget), with the switch sequence living in flare-edge
S26usbhost. See the usb2phy power-on issue for the remaining probe-time gap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014L3eBF6wBXC55uJoZuUfS6
2026-09-01 14:45:07 -06:00
BFE Engineering 249c311953 ci: self-hosted code quality grade and badge
A new quality job runs the linter battery (clippy, cppcheck, shellcheck,
ruff, lizard, jscpd, cargo-audit per crate, scc for the LOC denominator)
and feeds tools/quality/score.py: findings convert to SQALE remediation
minutes, debt ratio grades A-F on SonarQube's published grid, and a
separate worst-of security axis can only drag the overall grade down.
The job uploads the full quality.json breakdown and fails when the
security grade is worse than C.

The badges job now renders all four SVGs in-runner with anybadge
(shields hex palette); the previous img.shields.io curls were the one
external-service dependency left in the pipeline. quality.svg is seeded
at the current locally-computed grade (A, debt ratio 0.42%).

Also fixes the two ruff findings the battery surfaced in flowgen.py.
2026-08-31 16:18:38 -06:00
BFE Engineering 53bc57fbf8 ci: unbreak workflow YAML (colon in unquoted step name)
The style pass rewrote an em dash as a colon inside an unquoted name:
scalar, which YAML reads as a nested mapping. Comma instead; file
re-validated with a YAML parse.
2026-08-31 13:09:42 -06:00
BFE Engineering 18f6c77617 docs: drop the README Downstream section 2026-08-31 12:58:10 -06:00
BFE Engineering 42fb386f60 docs: ASCII typography and style normalization across all repo text
Replace every em dash with real punctuation (rewrites, not hyphen swaps)
in docs, code comments, scripts, configs, and the port records; convert
en dashes, curly quotes, ellipsis glyphs, arrows, and section signs to
ASCII; drop machine-writing tell phrases from living docs. ADR titles
now use a colon. The M2 bring-up DTS model string carried an em dash
into the patch series and its record echoes; fixed at both, and the full
series re-verified to apply cleanly onto pristine 6.18.46. One comment
in freshness.h deliberately names the em dash glyph the UI renders as
the unknown mark; that is data, kept as prose naming it.

Verified: cargo tests (sim, config-lint, rs485-bridge), shellcheck,
both driver MC/DC harnesses, patches-apply.
2026-08-31 12:31:27 -06:00
BFE Engineering e3a6026ba5 docs: README leads with the vendor-SDK comparison
Drop the Why / What Works sections and the product-origin story; the
text before Quick Start is now one comparison table of the upgrades over
the vendor SDK. Coverage methodology stays in the internal docs as the
reliability standard rather than the project's identity.
2026-08-31 08:27:42 -06:00
BFE Engineering 8677f8d061 docs: tighten README and core docs
Second conciseness pass per review feedback: bullets and tables over
prose (vendor-SDK failings, repo layout, sim models, kernel-port
rationale, QEMU scenarios), duplicated content cut (provenance pointer,
scenario prose the qemu README already carries). Also fixes two stale
claims in architecture.md: the flared seam unification and real-image
boot both landed (flare-edge #110, PR #8) but were still marked pending.
2026-08-31 08:19:51 -06:00
BFE Engineering ed62a7d099 Merge remote-tracking branch 'origin/main' into docs-reposition 2026-08-31 08:00:33 -06:00
BFE Engineering 643a05bffa docs: the device sim runs the full UI in a window (make it discoverable) 2026-08-31 07:58:34 -06:00
BFE Engineering d465d97b99 docs: repo renamed to bfe-core1106-sdk
The last product-first artifact after ADR-0008 was the repo name itself.
Current and forward-looking references updated; period-bound history in
the ADRs keeps the old name, with the rename recorded in ADR-0008.
Crate names, WARDEN_* env vars, and binaries are unchanged.
2026-08-31 07:17:00 -06:00
BFE Engineering 31c6d2496d docs: mark the NPU feasibility study as point-in-time context
Its 'our boards' / 'this product' phrasing predates the repositioning
(ADR-0008); a banner marks the context instead of rewriting a dated study.
2026-08-30 22:20:16 -06:00
BFE Engineering c756622c96 docs: reposition as the 86 Panel development environment
The repo's documentation framed it as a support repo for one product
(WardenOS). Since going public the real audience is anyone with a Luckfox
Pico 86 Panel: a maintained 6.18 kernel, an off-device development loop,
and a device simulator that exist nowhere else for this board. Reframe the
README and top-level docs board-first, with WardenOS documented as the
downstream consumer it is (ADR-0008).

Also an editorial pass over the whole doc set:
- every H1/H2 is now a short title, not a sentence (ADRs, qemu/, patches/,
  drivers/, architecture, NPU feasibility, config-lint, payload); workflow
  flowchart titles fixed at the source in tools/flowgen.py and regenerated
  with fresh bench numbers
- README Quick Start commands verified against the scripts; requirements
  corrected (curl, bare python, gcc >= 14) and the MC/DC gate added as a
  step (run green locally on gcc 14.2)
- dropped the 'needs python (not python3)' vendor dig: build-kernel.sh
  inherited the same requirement (filed #10 to remove it)
- glossed MC/DC and HPMCU on first use; marked the tests/uboot-ab
  reference as flare-edge; deduplicated the three-simulator list into the
  root README table
2026-08-30 22:19:12 -06:00
BFE EngineeringandClaude Fable 5 084df85450 docs: repo moved to the blueflare-energy org — update references
The transfer removes the last personal-name slug from the project's
public surface; old URLs redirect but the badge and ADR references now
point at the canonical home.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 20:59:05 -06:00
BFE EngineeringandClaude Fable 5 7ab07a35d3 qemu: real-image milestone — boot an actual flare-edge build in the VM
mkimage gains --rootfs-image/--oem-image (raw ext4 matched pair placed
into slot A, size-checked fail-closed; slot B keeps the skeleton as a
known-good fallback), and stage-1 rc now hands the live devtmpfs to the
new root across switch_root — busybox switch_root moves nothing, our
skeleton init remounted defensively, but a REAL image's getty opens
/dev/console immediately and looped on ENOENT without it.

Verified with the 2026-08-24 flare-edge build (rootfs 192M + oem 26M):
the image's own rcS chain runs on the 6.18 virt kernel, real daemons
start (warden-modbus confirmed running via root shell; the shipped
0.2.4 flared reproduces flare-edge#106 exactly, and S99hciinit reports
the issue-#4 btlpm symptom — the VM doubles as a faithful reproducer of
known field bugs), and a getty answers on the console.
qemu/tests/real-image-boot.sh asserts switch_root + daemon starts +
login prompt, credential-free. REAL-IMAGE-BOOT-PASS.

Regression sweep after the shared-path changes: OTA-APPLY-PASS,
PORTAL-SCENARIO-PASS, UI-SHOT-PASS, boot smoke OK.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 11:00:02 -06:00
BFE EngineeringandClaude Fable 5 d63c2117c1 qemu: full OTA apply scenario — write rootfs_b, flip AvbABData, boot it
Closes the loop every prior harness stopped short of, entirely
off-hardware: the real flared (WARDEN_HARD_RESET-gated build) pulls a
real signed tier-1 .wfw whose payload is a BOOTABLE rootfs stamped
0.0.2, verifies it, writes /dev/block/by-name/rootfs_b inside disk.img,
and flips the AvbABData (slot B: priority 15, 3 tries, unsuccessful —
the exact pre-first-boot arming state, round-tripped through a portal
check-in). The harness then boots slot _b and asserts the applied
version + marker are what runs. OTA-APPLY-PASS verified end to end.

- mkimage: the misc partition now carries REAL provisioned AvbABData
  (bytes mirror flare-edge's provisioning defaults) — slotctl fail-closes
  on bad AB magic before writing, which a zeroed misc tripped.
- run.sh --allow-apply / cmdline warden.fwapply: per-boot opt-in that
  makes stage-2 init export WARDEN_FW_ALLOW_APPLY=1; never the default.
- stage-2 init also exports WARDEN_HARD_RESET=0 (the CRU poke is fatal on
  virt, same class as the HPMCU probe); the harness performs the reboot.
- ADR-0006 boundary documented in the scenario and README: BCB slot
  CHOICE and the physical reset remain emulated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 10:40:08 -06:00
BFE EngineeringandClaude Fable 5 c258a2da68 build: produce the matched 6.18 module set (issue #4 root cause)
The hermetic build only ever made zImage+dtb — no 6.18 .ko set existed,
so the panel's only aic8800_btlpm.ko was the stale 5.10 build, which
fails the struct-module ABI check at load. New WARDEN_MODULES_COLLECT
env runs the full `make modules` (required: zImage alone emits no
Module.symvers, so per-directory M= builds cannot link) and collects the
listed dirs' modules fail-closed; CI's kernel-build collects
drivers/net/wireless/aic8800 and ships the .ko files in the artifact.

Verified: all three aic8800 modules (bsp 326K, fdrv 1.5M, btlpm 36K)
compile clean against 6.18, and bsp+btlpm INSMOD WITH RC=0 on the 6.18
kernel in the qemu/ device sim — no linkonce/this_module ABI error;
btlpm's rfkill init runs and only hardware power-up fails (no AIC silicon
on virt, expected). On-panel BT bring-up remains bench-gated (c8a3
currently dark).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 09:56:43 -06:00
BFE EngineeringandClaude Fable 5 1d7dec167e clock diagnostics for issue #3: probe, VM sanity scenario, fix plan
The qemu/ device sim answered the first question off-board: the same
kernel family under -M virt gives musl vDSO rate ratio 0.99963 — the
generic 6.18 armv7 vDSO is correct, so the board symptom is RV1106
register state (CNTFRQ/CNTVOFF, firmware-owned, secure-world boot chain).

- qemu/tests/clockprobe: interval-based musl probe separating RATE error
  (CNTFRQ) from boot OFFSET (CNTVOFF) — the original single absolute
  sample cannot distinguish them.
- qemu/tests/clock-sanity.sh: VM regression guard asserting the vDSO rate
  within 1% (PASSES: 1.00026); cross-builds the probe and stages it as
  payload itself.
- kernel/rv1106-enablement/timer/PLAN.md: the DT fix
  (arm,cpu-registers-not-fw-configured + measured clock-frequency on the
  board dts) gated on the two bench measurements; c8a3 is currently
  physically dark, needs hands at the bench.
- clockprobe joins the CI test loop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 09:49:50 -06:00
BFE EngineeringandClaude Fable 5 abbc690277 ci: silence SC2187 on the busybox-sh shebangs (shellcheck 0.9 vs 0.10)
ubuntu-latest ships shellcheck 0.9.0, which warns that ash scripts are
checked as dash; 0.10 (local) does not. shell=dash is the accurate dialect
for busybox ash. Verified clean under BOTH versions; boot smoke re-run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 09:02:33 -06:00
BFE EngineeringandClaude Fable 5 f5c2cc9a42 review: iteration-3 fixes (convergence pass)
- ci-cd.md phrasing made time-invariant (true before and after the
  visibility flip; the prior wording asserted a state not yet real).
- ui-shot: liveness check before the tap QMP call too — the commit-message
  claim of "before every QMP call" is now actually true.
- busybox fetcher checks its pin before downloading, mirroring the
  kernel-tarball fetcher's ordering.
- Fragment disable-arm: absence of a deps-gated symbol is a valid disable
  outcome; only "still set" is fatal (the iteration-2 symmetrization
  overcorrected). Negative-tested both directions under set -e.

Iteration 3 produced four findings, none blocking, all applied — the
recursive review is converged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 08:45:46 -06:00
BFE EngineeringandClaude Fable 5 973a414f07 review: iteration-2 fixes (fragment assertion, evidence paths, hardening)
- build-kernel.sh fragment assertion: survives a missing trailing newline
  (the read footgun, reproduced) and treats an absent symbol on a disable
  line as FATAL, symmetric with the enable arm.
- fetch-kernel-tarball.sh checks the pin before downloading; both fetchers
  add --retry-connrefused.
- mkimage rejects '.'/'..' state keys.
- ui-shot: VM liveness checked before every QMP call, console.log preserved
  as evidence on every failure path, repaint deadline widened to 90s with
  the contended-runner rationale documented.
- rs485-bridge: overflow discards back off one gap and rate-limit their log
  line, mirroring the accept-loop fix; clippy nit fixed.
- .gitignore ignores *.elf/*.map so the untracked artifacts cannot silently
  return; CI shellcheck glob now covers build/ and the rootfs boot scripts
  (directives added for the deliberate in-guest source paths).
- Docs: NPU parity row matches its sibling verification docs; line-pinned
  audit cross-references unpinned; CROSS_COMPILE documented in the build
  header; payload README lists warden-ui; ci-cd tense settled.

Verified: guards negative-tested (bad state keys, no-newline fragment);
boot smoke, portal scenario, ui-shot all PASS; 53 tests green; shellcheck
clean across the widened glob; clippy zero.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 08:34:47 -06:00
BFE EngineeringandClaude Fable 5 2756de0b46 review: iteration-1 fixes across CI, bridge, VM harness, and docs
CI/pipeline:
- KERNEL_TARBALL passed as a YAML env literal '~' was never tilde-expanded
  and would have failed every hosted kernel-build dispatch; the path is now
  exported from the shell. Verified reproducible before the fix.
- Every job gets timeout-minutes; boot smoke uses timeout -k so a wedged
  qemu is SIGKILLed instead of holding the job.
- Tarball fetch + fail-closed sha256 verification deduplicated into
  build/fetch-kernel-tarball.sh (with curl retries), used by build-kernel.sh
  and both CI jobs. busybox fetch gains retries too.
- ccache layer for kernel-build (cache keyed on defconfig+patches) recovers
  the incremental-compile speed the ephemeral-runner move cost.
- build-kernel.sh now asserts every fragment option survived olddefconfig —
  merge_config -m pastes text and Kconfig silently drops unmet symbols.

rs485-bridge:
- pending-buffer cap (2x max RTU ADU) instead of unbounded growth;
  explicit accept-loop error handling with backoff instead of .flatten();
  per-arm inline bounds instead of the string-keyed lookup whose default
  would have mis-bounded a future get-input; control-socket cleanup errors
  surfaced; flag-shaped values rejected in arg parsing; doc example uses a
  private mktemp dir. Test timing margins widened for contended runners
  (gap 25->120ms, 60x margin on the split-frame test).

VM harness:
- stage-1/stage-2 boot scripts share one validated slot parser and one
  by-name populator (qemu/rootfs/etc/warden-lib.sh) — the duplicated
  parser had already diverged on validation; userdata/oem mount failures
  now fail fast with a greppable sentinel; udhcpc fallback keys off the
  interface actually having an address; switch_root applet guarded.
- boot-smoke delegates the qemu invocation to run.sh (machine shape lives
  in ONE place); run.sh port 0 disables a hostfwd.
- mkimage: unknown partition names fail at build time; DISK_END is a max,
  not last-entry; --state keys validated as filenames.
- portal-scenario: mock readiness is asserted (no silent fall-through),
  hostfwd port collisions retried, mount-failure sentinel fails fast.
- ui-shot: fixed sleeps replaced with bounded screendump polling; the
  repaint assertion is real and documented as such. qmp.py loses its
  module-global and gains argv validation.

Docs/scrub: bench-host paths and the site AP name removed from six more
port docs and two evidence tables; path-bearing build artifacts (.elf,
.map) untracked (the 154-byte firmware .bin is path-free and stays);
ADR-0003 marked visibility-superseded by ADR-0007; stale section
cross-reference fixed; flare-edge noted as private for outside readers;
stale root-level review report removed per the new workspace rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 08:19:17 -06:00
BFE EngineeringandClaude Fable 5 b667ff5b1e license: GPL-2.0-only repo-wide
Replaces the dual MIT/Apache-2.0 licensing (and its GPL carve-out) with a
single GPL-2.0-only license for the whole repository: coherent with the
kernel patch series it exists to carry, the embedded-Linux norm, and the
stack's openness principle — anyone shipping products on this SDK publishes
their changes. GPL-2.0 (not 3) deliberately: the Installation-Information
clause of GPLv3 sits badly with WardenOS's signed A/B firmware chain.
LICENSE is now the canonical GPLv2 text; crate manifests updated;
inbound = outbound noted in the README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 07:44:32 -06:00
BFE EngineeringandClaude Fable 5 16368bb871 public-readiness: remove internal person-name attributions from docs
Decision/directive lines keep their dates and content, drop the name;
hands-on confirmations become "confirmed by hand at the panel"; a dangling
CLAUDE.md reference becomes "repo policy". Upstream vendor author
attributions in the GPL kernel sources (MODULE_AUTHOR, copyright headers,
LKML citations) are third-party legal attributions and stay.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 07:27:57 -06:00
BFE EngineeringandClaude Fable 5 5155224594 public-readiness: scrub internal details, split licensing, hosted kernel-build
Preparing the repo to go public (ADR-0007):

- CI: kernel-build moves from the self-hosted runner to ubuntu-latest
  (installs its own cross toolchain + qemu, caches the pristine tarball).
  On a public repo a registered self-hosted runner is reachable from
  approved fork-PR workflows — i.e. arbitrary code on private
  infrastructure — and the build never actually needed the SDK host.
  ADR-0004 marked superseded-in-part; docs/ci-cd.md rewritten (site
  specifics now live only in the private deployment log).
- Licensing: LICENSE gains the GPL-2.0 carve-out for patches/ and the
  kernel source excerpts (Linux derivatives; per-driver provenance was
  already tracked in PROVENANCE.md); patches/README.md states it too.
- Scrubbed from the tip: bench-unit dev credentials and its gadget IP
  (m2-boot notes), the site AP SSID+BSSID and a neighboring AP's BSSID
  and the device WLAN MAC (wifi bring-up evidence — BSSIDs are
  geolocatable), the runner mesh IP. NOTE: these remain in git history;
  decision on a pre-publication history rewrite is separate.
- Emoji cleanup across 21 tracked files (kernel port docs, review report,
  enforce-mcdc.sh) per repo text conventions: status marks became
  [x]/[wip]/[ ]/OK plain text.
- "[maintainer]-gated" process phrasing normalized to "maintainer-gated"
  (attributions in dated evidence docs kept).

Verified: zero emojis tracked; scrub grep clean; patches carry no internal
references; ci.yml parses; shellcheck unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 07:25:57 -06:00
BFE EngineeringandClaude Fable 5 fea36faaec docs(ci-cd): runner provisioned with qemu-system-arm (boot smoke unblocked)
Installed 2026-08-30 on bfe-mpc-0640 (QEMU 10.0.11; cpio/curl already
present); recorded in flare-deployment deploy-log. End-to-end CI check of
the smoke step waits on the account-wide Actions billing stall.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-30 07:12:44 -06:00
BFE EngineeringandClaude Fable 5 13b7d063a2 qemu: display + touch scenario, ADR-0006, docs
Phase 4+5 of the device sim:

- Display + touch verified end-to-end: virtio-gpu at 720x720 (fbdev
  emulation) renders the real WardenOS dashboard from the static LVGL
  fbdev+evdev UI build (flare-edge qemu-vm-support tools/build-ui-vm.sh);
  QMP input-send-event taps the Metrics tab and qemu/tests/ui-shot.sh
  asserts the repaint from screendumps. Two load-bearing QEMU flags found
  and documented: -global virtio-mmio.force-legacy=false (gpu/input are
  VERSION_1-only) and the 200ms press hold (an instantaneous press+release
  lands inside one LVGL indev poll and never clicks).
- qemu/tests/qmp.py: minimal QMP client (screendump, tap, quit).
- stage-2 init starts warden-ui when present and fb0 exists.
- docs/decisions/0006-qemu-device-sim.md: virt-not-custom-board, the
  enters-at-kernel boundary, fragment policy, naming, consequences.
- docs/architecture.md: new section 7 (device emulation), order-of-work
  item 7; modbus cross-reference to the bridge.
- qemu/README.md: emulated-vs-not table, scenarios, gotchas, host/runner
  requirements. docs/ci-cd.md: runner needs one-time qemu-system-arm
  install (fail-closed smoke until then, [maintainer]-gated). Repo README updated.

Final sweep on this commit: shellcheck clean, bridge 7/7 tests, boot smoke
PASS, portal scenario PASS (check-in + fw pull + signed .wfw download),
ui-shot PASS (touch navigates to Metrics) — all under the final flags.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-29 20:16:36 -06:00
BFE EngineeringandClaude Fable 5 c7e06514ad qemu: RS485 bridge to sim, portal E2E scenario, CI wiring
Phase 3 of the device sim, all verified on QEMU 10.0.11:

- qemu/rs485-bridge/: std-only crate bridging a QEMU serial chardev (unix
  socket) to warden_sim::ModbusSlave — gap-based RTU framing (CRC failures
  degrade to real-slave silence), line-protocol control socket for register
  seeding and fault injection (drop/exception/clear), bounds-checked so a
  scenario typo answers err instead of panicking the bus. 7 unit tests,
  bench in the sim_bench pattern. Verified end-to-end: guest master frame
  on /dev/ttyS4 (pci-serial) answered from the sim slave, CRC-correct.
- virt machine gains highmem=off: the 32-bit non-LPAE kernel cannot reach
  virt's default 40-bit PCIe ECAM (pci-host-generic EOVERFLOW); with it the
  full PCI set probes (16550A ttyS0, i6300esb).
- Watchdog scenario verified: guest arms /dev/watchdog, no petting, i6300esb
  resets the VM ~30s later (first environment where this arm is testable).
- qemu/tests/portal-scenario.sh: the real static-musl warden-flared inside
  the VM against flare-edge's mock portal on the host — authenticated
  check-in, firmware desired-state pull, and download of a real signed
  tier-1 .wfw offer, asserted from the portal log. Found and filed
  flare-edge#106 (fatal SIGBUS in the HPMCU boot-loaded probe on
  non-RV1106 memory maps); runs against a flared built from the
  qemu-vm-support fix branch.
- stage-2 init: WARDEN_FLARE_INSECURE=1 + WARDEN_HPMCU=0 (documented VM
  deviations), firmware-version stamp, newline-terminated state seeds.
- CI: rs485-bridge joins the test loop and bench job; new qemu-tools job
  (shellcheck + initramfs + disk image on hosted runners); kernel-build
  gains a fail-closed qemu boot-smoke step. All qemu scripts shellcheck-clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-29 19:59:44 -06:00
BFE EngineeringandClaude Fable 5 bf3c93cf85 qemu: device-sim bringup — boot smoke, A/B disk harness, virt kernel variant
The third simulator (deliberately not named "sim"): a QEMU -M virt VM that
boots the real 6.18.46 kernel and enters at -kernel zImage — everything below
(BootROM/idblock/U-Boot/real BCB A/B selection) is closed blobs + mask ROM
and is explicitly out of scope.

- qemu/mkinitramfs.sh: pinned static busybox (sha256 fail-closed) + rootfs/
- qemu/mkimage.sh: unprivileged sparse disk image with the device's canonical
  12-partition blkdevparts A/B layout (vda == mmcblk0 mapping)
- qemu/rootfs/: stage-1 init (by-name symlinks from PARTNAME uevents,
  whole-token warden.slot= parse, switch_root) + stage-2 init (userdata/oem
  mounts, slirp networking, payload daemon start)
- qemu/run.sh: runner with --slot/--rtc/--watchdog/--rs485/--qmp/--display
- qemu/configs/virt.fragment + WARDEN_KCONFIG_FRAGMENT hook in
  build/build-kernel.sh (canonical RV1106 build untouched when unset):
  adds PCI, pci-serial, i6300esb watchdog, WireGuard, virtio-gpu/input
- qemu/tests/boot-smoke.sh: sentinel-asserting boot test

Verified on QEMU 10.0.11: canonical zImage boots -M virt unmodified (the
feared DEBUG_UNCOMPRESS decompressor hang does not exist in 6.18); full
stack boots both slots; 12 by-name symlinks; userdata persists across
reboot; -rtc base=2021-01-01 reproduces the no-RTC wrong-clock class.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HUayid7W5w7jBdb9Rrj1K
2026-08-29 18:53:16 -06:00
BFE Engineering 44cdf2bf38 Merge pull request #2 from bfe-noah/artifact-gc
ci: automatic artifact GC for kernel builds (account-wide storage)
2026-08-26 12:53:07 -06:00
BFE Engineering 0833d61bfa ci: automatic artifact GC for kernel builds (account-wide storage)
Mirror flare-edge's artifact GC so the shared Actions storage quota can't fill
from either repo. A new prune-artifacts job (ubuntu, gh + built-in token,
actions:write) runs before the kernel-build upload and deletes older
kernel-rv1106 artifacts beyond the newest 3; kernel-build needs it. retention-days
14 -> 5 as the backstop. Best-effort so it never blocks a build. Completes the
account-wide auto-clear (an over-quota once blocked ALL runs, not just uploads).
2026-08-26 10:44:48 -06:00
BFE EngineeringandClaude Opus 4.8 94cd0bcd35 kernel/rv1106-enablement: mark as port-provenance; patches/ is canonical
The .c/.dts/.frag files here are a point-in-time port-provenance snapshot (with
standalone test programs + instructional fragments the narrative docs reference),
not a maintained second copy of the kernel delta. Add a prominent canonical-source
note so the snapshots (which can lag the final series, e.g. the clk CLK_IGNORE_UNUSED
fix) are never mistaken for current code. patches/ + build/build-kernel.sh remain the
single source of truth.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 18:10:09 -06:00
BFE EngineeringandClaude Opus 4.8 82b8bc91bb docs(ci-cd): runner installed + online, kernel-build verified (2026-08-25)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 17:40:24 -06:00
BFE EngineeringandClaude Opus 4.8 a804a35e08 ci: kernel-build artifact upload is best-effort (storage-quota resilience)
The kernel build itself is the gate; uploading the zImage/dtb can fail on an
account-wide GitHub artifact-storage-quota hit unrelated to the build. Mark the
upload continue-on-error so a good build isn't red-X'd by it. Outputs also remain
on the self-hosted runner host.

Verified: kernel-build compiled the RV1106 6.18.46 kernel end-to-end on
bfe-mpc-0640 (zImage 8.25 MB + rv1106-warden.dtb 37 KB); the patch series applied
(issue #1 fix confirmed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 17:16:36 -06:00
BFE EngineeringandClaude Opus 4.8 5e1b02ba60 kernel-build: apply patches outside the checkout + fail-loud sentinel (#1)
The kernel-build job set WORK inside the repo checkout, so build-kernel.sh's
`git apply` ran from a subdirectory of the warden-sdk git repo — where git apply
silently ignores out-of-subdir paths and exits 0 without applying anything. The
build then failed at the (never-created) rv1106-warden.dtb target, and the
unconditional `echo "applied"` had masked it.

- ci.yml: WORK -> ${{ runner.temp }}/kbuild-out (outside the checkout); artifact
  paths follow.
- build-kernel.sh: the patch loop now fails loudly instead of echoing on silent
  failure, and a post-apply sentinel assert (rv1106-warden.dts must exist) makes a
  silent no-op impossible to ship — the regression guard for this class.

Refs #1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 16:55:46 -06:00
BFE EngineeringandClaude Opus 4.8 5a9432b8bc ci: self-provision python + cross toolchain in kernel-build job
Make the self-hosted kernel-build runnable with zero manual toolchain/python setup
on the runner host (docs/ci-cd.md steps 3-4 move into the workflow):

- build/build-kernel.sh: honor a caller-provided CROSS_COMPILE (default stays the
  Luckfox uclibc prefix). The kernel is freestanding, so a generic arm cross
  compiler links it.
- kernel-build job: set CROSS_COMPILE=arm-linux-gnueabihf- (Debian
  gcc-arm-linux-gnueabihf, already on 0640) instead of depending on the ephemeral
  SDK checkout path; symlink python->python3 into $RUNNER_TEMP/bin on $GITHUB_PATH
  for the bare-`python` SDK quirk.
- docs/ci-cd.md: only steps 1-2 (systemd service + cgroup cap) still need 0640 sudo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 16:27:21 -06:00
BFE EngineeringandClaude Opus 4.8 4f060db1b1 ci: make main the canonical branch (badges guard, docs)
Point the badges job's branch guard at refs/heads/main and update the README /
ci-cd docs to name main as the canonical branch, ahead of establishing main from
bringup as the SDK's first main commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 16:18:36 -06:00
BFE EngineeringandClaude Opus 4.8 5a8b60ba3a review: iteration-2 fixes (fail-closed loader whole-name match + doc accuracy)
Second recursive pass: two adversarial re-reviewers verified the iteration-1 fixes.
Fuzz/empirical checks cleared the freshness min-budget rewrite (200k random trials),
the config-lint reg-token scanner, its UTF-8 boundary safety, and the build-kernel.sh
trap (5 exit scenarios) — no defects. Three items corrected here:

- config-lint is_known_safe_loader: match the WHOLE normalized loader name, not an
  unanchored substring. The iteration-1 allowlist swap kept `contains()`, so a future
  coprocessor whose name merely contained a boot word ("AudioLoader" ⊃ "loader",
  "SplRtos" ⊃ "spl", "Bl32" ≠ "bl31") would have been waved through — reopening the
  0x40000-brick false-negative the fail-closed change exists to prevent. Regression
  test added with those exact adversarial names.
- docs/architecture.md §3: the `cru` bullet no longer claims flared's devmem `Bus`
  seam is shipped — it lands when flare-edge consumes warden-sdk ([maintainer]-gated), which
  is what §7 item 3 already said. Resolves an in-document contradiction.
- drivers/README.md: modbus "11 pty scenarios" -> "8 pty scenarios + 3 wire/daemon
  checks (11 total)", matching flare-edge tools/modbus-sim's actual SCENARIOS list.
- docs/decisions/0002-mcdc-tiering.md: Consequences now describe the shared
  drivers/enforce-mcdc.sh + drivers/<name>/test/ layout actually built (not the
  per-driver dirs the ADR first anticipated); Rust MC/DC tooling reality noted.

config-lint: 9 tests pass; clippy clean under -D warnings; gitleaks clean. C drivers
untouched (still relays 40/40, freshness 66/66 MC/DC).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 16:02:22 -06:00
BFE EngineeringandClaude Opus 4.8 4ee4dfcf88 review: fix review findings (correctness, hardening, doc-accuracy)
First recursive code-review-harness pass over the authored SDK code (sim/,
config-lint, flowgen, drivers/{relays,freshness}, build/, ci.yml). Four parallel
dimension reviewers; all findings at every severity corrected per workspace rule.

Correctness / reliability:
- freshness.c min_budget_ms: use a `seen` flag, not `best==0`, as the empty
  sentinel — a zero-tolerance (max_stale_ms==0) binding was silently widened to a
  looser neighbour's budget. Regression test added; still 66/66 MC/DC.
- config-lint parse_reserved_ranges: match `reg` as a whole property token (ident
  boundary before, `=` after) so `reg-names` / a `region-*` label no longer
  mis-parses into a bogus reserved range.
- config-lint loader check: fail closed — flag any loader with a LOAD_ADDR that is
  not a known-safe boot component, instead of only known MCU names, so a future
  coprocessor ("Rtos"/"Bl32") can't slip past the 0x40000-brick gate.
- build-kernel.sh: sha256 verification is now mandatory (refuse to build if the pin
  is missing) and the mktemp scratch tree is removed on exit (trap), while a
  caller-provided WORK is left intact for CI artifact upload.

Test quality:
- freshness: added the age==max_stale boundary case and a clock-wraparound
  (now < last_ok) fail-safe-to-UNKNOWN test.
- relays: unsetenv(WARDEN_GPIO_ROOT) at main() so the NULL-env arm is hermetic.

Security / CI:
- ci.yml: top-level `permissions: contents: read` (badges overrides to write);
  pin taiki-e/install-action to commit SHA (v2.86.7).

Maintainability / docs:
- drivers/enforce-mcdc.sh: one shared, name-derived gate replaces the two
  copy-pasted per-driver scripts; Makefiles call ../../enforce-mcdc.sh.
- docs/architecture.md: §3/§4/§6/§7 rewritten to match reality — NPU/RGA models,
  config-lint, and the relays+freshness MC/DC harnesses are done; kernel §6 now
  reflects the 5.10->6.18.46 forward-port (ADR-0001), not the superseded plan44/6.6.
- README: status blurb + layout table corrected (kernel/, .github/; stale ci/ and
  patches/ descriptions fixed). hpmcu "8 tests" -> 7 in docs.
- freshness.{c,h}: ADR reference points at flare-edge ADR-0004 (warden-sdk's
  ADR-0004 is the CI runner — number collision).
- normalize rustfmt drift across sim/ + config-lint.

All green: sim 37 tests, config-lint 8 tests, both drivers 100% MC/DC (relays
40/40, freshness 66/66), clippy clean under -D warnings, gitleaks clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 15:48:52 -06:00
BFE EngineeringandClaude Opus 4.8 880b043506 docs+tools: workflow flowchart harness (P4) + drivers Tier-1/Tier-2 split
- tools/flowgen.py: generates docs/workflows/<name>.md — one outcome-first mermaid
  flowchart per workflow the SDK tests (hpmcu watchdog, modbus read, cru ladder,
  rga offload, relay drive, freshness contract), each stamped with its benchmark
  ns/op or 100% MC/DC result. Deterministic; reads the cargo-bench trend json.
- drivers/README.md: honest Tier-1 (relays + freshness, 100% MC/DC here now) vs
  Tier-2 (modbus/rga — serious testing + fault-injection + benchmarks via sim
  models; driver sources migrate in with the flare-edge unification) per ADR-0002/0005.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 15:22:58 -06:00
BFE EngineeringandClaude Opus 4.8 35829eaccb drivers/freshness: hardened + 100% MC/DC (Tier-1, the UI stale-number guard)
freshness.c (ADR-0004 freshness-contract engine) is pure logic via produce/render
callbacks — no hardware seam needed, the callbacks are the seam. Host harness reaches
100% MC/DC (66/66 conditions, 100% lines, 27 checks) by driving warden_fresh_decide
directly + the bind/tick/invalidate/min-budget state machine through fakes, with
-DFRESH_MAX=2 so the table-full and unused/hidden-slot arms are reachable. Directly
serves future-features-2's "never a stale number in the UI" requirement. The CI mcdc
job now enforces relays + freshness.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 15:18:51 -06:00
BFE EngineeringandClaude Opus 4.8 289ce7f42f ci: self-hosted warden-sdk runner registered + docs/ci-cd.md (P5)
Registered a 3rd repo-scoped runner on bfe-mpc-0640 (label warden-sdk,
bfe-mpc-0640-warden-sdk) per ADR-0004. It is offline pending the sudo-gated steps
(service install + CPUQuota/MemoryMax cgroup cap + toolchain/python provisioning),
documented in docs/ci-cd.md as a [maintainer] handoff. kernel-build stays dispatch-gated
and passes JOBS=4 as a belt-and-braces resource bound.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 14:31:29 -06:00
BFE EngineeringandClaude Opus 4.8 f2a9c0a32c kernel: RV1106 6.18.46 patch series + hermetic build wrapper (P1)
- patches/: the pristine-6.18.46 -> WardenOS delta as a 13-patch, subsystem-split
  series (223 files, ~136K lines: clk, pinctrl, DTs/mach, usb-phy, VOP/panel/rgb,
  mailbox, pvtm, rknpu, rga, aic8800 wifi, audio codec, thermal/rtc/adc/gmac/touch).
  Verified: every patch applies cleanly onto pristine (git apply --check), the full
  series reproduces the hardware-verified tree, and the applied source configures +
  builds the warden dtb + rockchip DRM drivers (rc=0).
- build/build-kernel.sh: fetch+verify pristine (sha256-pinned) -> apply series ->
  warden_defconfig -> zImage + rv1106-warden.dtb. build/warden_defconfig captured.
- CI: `patches-apply` (GitHub-hosted, cached tarball) enforces the series applies;
  `kernel-build` (self-hosted warden-sdk runner, dispatch-gated until registered)
  runs the full build and uploads the image.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 14:26:04 -06:00
BFE EngineeringandClaude Opus 4.8 6fcfb80e5a bench: dependency-free sim micro-benchmarks + CI bench job (P4)
benches/sim_bench.rs (harness=false, zero deps): fixed-iteration ns/op timing for
hpmcu_tick, cru_poll, modbus_read_holding, rga_improcess, membus_poke_peek. Human
timings to stdout, one JSON trend line per bench to stderr for CI capture. New CI
`bench` job smoke-runs them. Regression-vs-history gating is future work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 14:15:22 -06:00
BFE EngineeringandClaude Opus 4.8 85b0db7eee sim: RGA + NPU models (P3) — completes the RGA/RISC-V/NPU simulator requirement
- npu.rs: /proc/rknpu/load model (present-at-load% vs absent) mirroring sysmon's
  parse; 100% coverage.
- rga.rs: recording improcess() fake — logs dispatched blits + programmable
  IM_STATUS to drive the CPU-fallback path; the blit pixels aren't modelled, the
  dispatch logic is; 100% coverage.
- lib.rs re-exports NpuSim / RgaSim / Blit / Surface / Rect / ImStatus.
37 sim tests green; RISC-V (hpmcu) + RGA + NPU all simulated per future-features-2 §SDK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 14:12:10 -06:00
BFE EngineeringandClaude Opus 4.8 1752dea7b6 drivers/relays: hardened + 100% MC/DC (Tier-1, first driver)
Bring relays.c into warden-sdk/drivers/ behind a relay_io seam (ADR-0005): the
sysfs plumbing is an injectable backend, the gpio root is $WARDEN_GPIO_ROOT-
overridable. Host harness (drivers/relays/test/) reaches 100% MC/DC (40/40
conditions, 100% lines) by combining fake-io unit tests (logic branches incl.
export->node-appears) with real-sysfs integration tests over a scratch tree
(backend fopen/stat branches). CI `mcdc` job enforces 100% across drivers/*/test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 14:01:29 -06:00
BFE EngineeringandClaude Opus 4.8 d4f721c897 ci: commit Cargo.lock files for reproducible --locked builds
Fixes the `test` job failure (--locked rejected the absent lockfiles). sim has no
external deps; config-lint minimal — lockfiles are tiny and pin the toolchain deps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 13:53:11 -06:00
BFE EngineeringandClaude Opus 4.8 1d3298a408 ci: GitHub Actions pipeline — cargo test + llvm-cov + badges (P5 host-testable jobs)
test job runs cargo test across sim + config-lint and cargo-llvm-cov line coverage
on the sim crate; badges job renders loc/tests/coverage shields on push to bringup
([skip ci] + paths-ignore loop guard). mcdc/bench/kernel-build jobs land with
P2/P4/P1. README carries the CI + badge row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 13:48:22 -06:00
BFE EngineeringandClaude Opus 4.8 189f7aec38 sdk: bootstrap standalone repo (P0)
- Dual license (LICENSE / LICENSE-MIT / LICENSE-APACHE) matching the crate manifests.
- ADRs 0001-0005: kernel base (direct 5.10->6.18.46 forward-port), tiered MC/DC,
  standalone repo, CI runner (3rd repo-scoped runner on 0640), driver source-of-truth.
- README goal 1 reconciled to the verified 6.18.46 forward-port (was stale plan44/6.6).
- Drop tracked build objects (*.o now gitignored).
- Capture the display (VOP dclk-pol + WIN1) and GT911 touch bring-up VERIFIED docs
  + capabilities-audit update from this session.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 13:46:08 -06:00
BFE EngineeringandClaude Opus 4.8 19ff701deb kernel/rv1106: capabilities audit — correct stale reason cells
mailbox + NPU + pvtm all now show VERIFIED with accurate notes (the prior
reason cells still said 'unexercised'/'no userspace'/'deferred'). Only
crypto-accel (CPU crypto covers) and open-NPU-compute (person-year RE) remain,
both documented.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 08:37:42 -06:00
BFE EngineeringandClaude Opus 4.8 7e76553bd7 kernel/rv1106: HPMCU mailbox 100% VERIFIED + open NPU driver VERIFIED
MAILBOX (fully open A7<->RISC-V SCR1 round-trip, 5/5 exact echoes on c8a3):
- rockchip-mailbox.c: rv1106 has 1 shared IRQ, not 4/channel -> added
  rv1106_drv_data{num_chans=1} + compatible (rk3368 fallback assumed 4 -> probe
  failed 'IRQ index 1 not found').
- clk-rv1106.c: CLK_CORE_MCU (SCR1 core clock) marked CLK_IGNORE_UNUSED -
  6.18's clk_disable_unused() was switching off the coprocessor clock so a
  loaded firmware never ran (5.10 left it on).
- Open SCR1 echo firmware (scr1-echo/, 154B RV32IMC) + load/test scripts;
  A2B_INTEN on the MCU side + CMD-then-DAT (DAT=doorbell) order. Loaded via the
  proven hpmcu.rs SRAM path; do NOT kill warden-flared (dw-wdt). mailbox/VERIFIED.md.

NPU (open GPL rknpu 0.9.2 kernel driver on 6.18):
- DT fix: base npu node lacks interrupt-names, driver requests IRQ byname
  'npu_irq' -> probe bailed -ENXIO. Added interrupt-names='npu_irq'.
- Verified: [drm] Initialized rknpu 0.9.2 on minor 1; /dev/dri/card1;
  rknpu_version_test PASS (0.9.2 + hw version, full power/clock/reset path).
- Honest ceiling: open compute (regcmd compiler) is a from-scratch ~person-year
  RE project, no RV1106 prior art; ship the driver, no blob. npu/VERIFIED.md.

DRIVER-PARITY + CAPABILITIES-AUDIT updated; dts snapshot refreshed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 08:36:56 -06:00
BFE EngineeringandClaude Opus 4.8 54f961c6b6 kernel/rv1106: PVTM VERIFIED — both monitors probe + read (7th driver)
Whole-driver port (mainline has no rockchip pvtm): copied vendor rockchip_pvtm.c
+ pvtm.h. 6.18 deltas: thermal_zone opaque -> thermal_zone_get_temp; of_device.h.
Real blocker: vendor of_match_table wrapped rv1106 entries in #ifdef
CONFIG_CPU_RV1106 (nonexistent in mainline) -> devices+driver present but never
bound, probe silent. Dropped the guard -> both bind.

Verified: ff240000.pvtm + ff390000.pvtm probed; /sys/kernel/debug/pvtm/{core,pmu}/
value read ring-osc counts (71682 90462 / 35772). pvtm/PORT-DONE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 07:25:49 -06:00
BFE EngineeringandClaude Opus 4.8 aa25577095 kernel/rv1106: overnight run results + final capabilities ledger
Six drivers verified on hardware this run (wifi, TRNG, OTP, GMAC, SARADC,
audio). Final honest ledger: mailbox (fallback-binds, no client), crypto-v3
(CPU crypto covers), NPU (no open userspace), pvtm (DVFS-only) all deferred
with reasons — no unexplored capability gap. Morning bench tasks documented
(display connector, audible audio, wifi boot-time auto-load).

OVERNIGHT-RESULTS.md added.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 01:24:40 -06:00
BFE EngineeringandClaude Opus 4.8 cdbfd7bb72 kernel/rv1106: audio codec VERIFIED — sound card + PCM registers
Ported rv1106_codec.c (acodec) + rk_dsm.c (built, dsm disabled — panel uses
acodec) into 6.18 (6 ASoC API-delta fixes: gpiod, volsw unify, DAIFMT CBC/CBP
rename, remove->void, header swaps). simple-audio-card 'rv1106-acodec'.

Fixed the subagent's gap: cpu DAI SND_SOC_ROCKCHIP_I2S_TDM was left =m (module,
never loaded on bare _b boot) so the card stuck in 'asoc-simple-card: parse
error' deferred probe. Set it + SND_SOC_ROCKCHIP =y.

✅ VERIFIED on c8a3: /proc/asound/cards shows rv1106-acodec; aplay -l shows
card 0 device 0 ffae0000.i2s-rv1106-hifi; /dev/snd has pcmC0D0p + pcmC0D0c.
Audible speaker test deferred to the bench (with display).

Six drivers verified this run: wifi, TRNG, OTP, GMAC, SARADC, audio.
audio/PORT-PROGRESS.md; DRIVER-PARITY updated; dts snapshot refreshed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 01:22:35 -06:00
BFE EngineeringandClaude Opus 4.8 168b51d47e kernel/rv1106: capabilities audit — 5 verified this run + remaining assessment
Verified: wifi, TRNG, OTP, GMAC, SARADC. Honest remaining value/effort:
audio (next real capability), mailbox (small cleanup), crypto-v3 (defer —
CPU crypto covers the need), NPU (no open userspace), pvtm (low).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 01:03:38 -06:00
BFE EngineeringandClaude Opus 4.8 5aedb5e966 kernel/rv1106: SARADC VERIFIED — fixed -22 (vref-supply, not clk)
The saradc -22 was regulator_get_voltage on a dummy vref (no vref-supply in
DT), not the clk divider. Added vcc_1v8 fixed 1.8V regulator + vref-supply
(matching the vendor 86-panel). iio:device0 now reads both channels
(in_voltage0_raw=1023, in_voltage1_raw=246) — the adc-keys path works.

Five drivers verified this run: wifi, TRNG, OTP, GMAC, SARADC.
adc/SARADC-FIX.md; DRIVER-PARITY updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 01:01:24 -06:00
BFE EngineeringandClaude Opus 4.8 c7ba8781a4 kernel/rv1106: GMAC ethernet VERIFIED (100M link) + OTP verified
GMAC ✅ eth0 Link Up 100Mbps/Full on c8a3: ported rv1106_ops into mainline
dwmac-rk.c (VOGRF RMII mode/speed + integrated FEPHY powerup via CON0;
mainline set_speed/powerup split; bandgap trim omitted — analog opt the PHY
runs without). &gmac enabled; uses the internal ethernet-phy@2. gmac/PORT-DONE.md.

OTP ✅ now reads real data (px30_otp_read): 5211 02fe 084d 5231 ('MR1' chip id),
no timeout. rng-otp/PORT-DONE.md updated.

Batch A + GMAC complete — TRNG, OTP, GMAC all verified on hardware.
DRIVER-PARITY updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 00:54:01 -06:00
BFE EngineeringandClaude Opus 4.8 270211029d kernel/rv1106: batch A — TRNG verified + OTP (read fn corrected)
TRNG ✅ VERIFIED on c8a3: rv1106 trngv1 == rk3588 TRNG_V1 IP; one OF-table
entry reusing rk3588_soc_data. /dev/hwrng active, rng_current=rockchip-rng,
real HW entropy (c697503d... non-zero). Hardware entropy for the panel.

OTP 🔨: rockchip-otp0 nvmem device registers; added rv1106_data (6-clock
sbpi layout). First reg_read=rk3588_otp_read timed out ('timeout during read
setup'); corrected to px30_otp_read (user-mode OTPC_USER interface = the
vendor's rk3568_otp_read sequence). Cell reads re-verify next _b boot.

See rng-otp/PORT-DONE.md. dts snapshot refreshed (rng+otp enabled).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 00:44:35 -06:00
BFE EngineeringandClaude Opus 4.8 92905bf4d4 kernel/rv1106: M5 wifi VERIFIED on c8a3 — wlan0 scan works (module build)
On-hardware proof (self-built 6.18.46, _b slot): aic8800 modules load,
download firmware, wlan0 up ([device-mac]), iw scan finds real APs
incl. SSID BlueFlare @ -43dBm. RF path fully functional. See
wifi/VERIFIED-on-c8a3.md.

Two changes from the initial built-in attempt:
- Built-in =y DEADLOCKS: aicbsp_init's eager SDIO bring-up (device_initcall,
  sequential) blocks the dw_mmc controller probe that would enumerate the
  card it waits for (aicsdio.c:597 2s down_timeout -> unregister). Converted
  to modules (=m): AIC_WLAN_SUPPORT bool->tristate; loaded late, after the
  mmc-pwrseq enumerates the card — the vendor-proven flow.
- Restored fdrv's own md5.o (each .ko needs its own MD5; bsp doesn't export
  it). Refreshed kbuild snapshot accordingly.

Kernel-size fix (CONFIG_KERNEL_GZIP -> XZ): the wifi kernel's 12.12MB gzip
zImage overran U-Boot's DTB-at-0xc00000 load boundary (Sysmem Error, FLARE-AB
fell back to _a). XZ -> 8.15MB, ~4MB headroom; also correct for a firmware
kernel. Uncompressed Image ~30MB but the ARM decompressor relocates the FDT
at runtime, so only the U-Boot load-time overlap mattered.

DRIVER-PARITY: wifi ✅ M5; BT 🔨 (module built, HCI not yet exercised).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-25 00:34:25 -06:00
BFE EngineeringandClaude Opus 4.8 6897c9f93e kernel/rv1106: M5 AIC8800 wifi/BT port — build-verified, capture recipe
Driver built into self-built 6.18 (=y): zImage 12.7MB + rv1106-warden.dtb
build clean; System.map confirms aicbsp_sdio_driver, aicwf_sdio_driver,
rwnx_cfg80211_ops linked with correct bsp->fdrv->btlpm initcall order (host
nm/System.map — cross-nm/ar mis-list these, verify with System.map).

Recipe captured (driver .c is vendor GPL source in the SDK, not duplicated):
- kbuild/ — from-scratch in-tree Kconfig + Makefiles (bsp->fdrv->btlpm link
  order; tristate->default y; AIC_FW_PATH as a real Kconfig string symbol).
- wifi-dt-block.dtsi — sdio_pwrseq (mmc-pwrseq-simple, reset gpio1 PA2) +
  &sdmmc (mmc@ffaa0000, supports-sdio, cap-sdio-irq, non-removable).
- PORT-PROGRESS.md — full file->change log: ~30 timer/netdev renames, 7
  cfg80211_ops signature deltas, link_id args, wakeup_source API rewrite,
  49 bsp/fdrv symbol collisions renamed aicbsp_priv_*, rwnx_mesh restore.

Firmware present on both oem_a+oem_b (/oem/usr/ko/aic8800dc_fw); on-hardware
wlan0 verify next.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 23:34:39 -06:00
BFE EngineeringandClaude Opus 4.8 f7f9648f2a kernel/rv1106: scoped execution plan for remaining ports
Source-scoped the remaining capability ports while wifi builds:
- TRNG: rv1106 trngv1 registers byte-identical to rk3588 → ~2-line compat add
  reusing mainline rk3588_soc_data/rk3588_rng_read. Near-free hw entropy.
- GMAC: integrated EPHY (0x1234d400) already in mainline net/phy/rockchip.c;
  only the dwmac-rockchip rv1106 GRF ops + board node needed.
- OTP: add rv1106_data to mainline rockchip-otp.c (also feeds GMAC bandgap).
- audio/crypto-v3/npu/mailbox/pvtm scoped with verify steps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 23:11:23 -06:00
BFE EngineeringandClaude Opus 4.8 6767c50a07 kernel/rv1106: capabilities audit + driver-provenance/openness ledger
Capabilities audit — classify every RV1106 SoC block against a 6.18 driver:
GMAC (wired eth, enabled on-board), crypto-v3, trngv1 (hw RNG), OTP, mailbox,
NPU, audio codec/DSM, pvtm still to port; camera/ISP + SPI are N/A (no HW).

Provenance ledger — per [maintainer]'s openness directive extended to already-ported
drivers: every ported driver is GPL-2.0 kernel source (vendor-src or
mainline-sibling); the only binary in the whole path is on-device wifi-chip
firmware, which by construction cannot be host source. No vendor binary is
loaded into our kernel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 23:08:32 -06:00
BFE EngineeringandClaude Opus 4.8 fda84b4c27 kernel: RGA 2D accelerator ported (open-source vendor driver) — verified
Ported the vendor multicore RGA char-dev driver (drivers/video/rockchip/rga3/,
CONFIG_ROCKCHIP_MULTI_RGA) to 6.18 — WardenOS's librga uses /dev/rga, not V4L2.
On warden-c8a3: rga2 probe successful, hw_version 3.3.87975, /dev/rga +
/dev/dma_heap present. This is the CPU-savings 2D accelerator (LVGL UI offload).

6 mechanical 5.10->6.18 API fixes (platform remove->void, hrtimer_init->
hrtimer_setup, iommu_map* gfp arg, get_user_pages_remote vmas arg, MAX_ORDER
compat, MODULE_IMPORT_NS string). CMA via the default 64 MiB pool +
DMABUF_HEAPS_CMA (a custom linux,cma DT node hangs boot). Recipe + deltas in
rga/PORT-DONE.md. All open source (vendor C source).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 23:00:38 -06:00
BFE EngineeringandClaude Opus 4.8 749f73568a kernel: RTC + tsadc ported (open-source, from vendor source); npu/rga plans
RTC: ported the vendor rockchip,rv1106-rtc driver (rtc-rockchip.c) to 6.18 — one
API delta (rtc_register_device -> devm_rtc_register_device). Verified on
warden-c8a3: /dev/rtc0 registers and reads.

tsadc thermal: ported the rv1106 data + rk_tsadcv9_initialize + the TSADCV9/VOGRF
macros + code table from the vendor; adapted .chn_id[SENSOR_CPU] -> .chn_offset
for 6.18. Verified: thermal_zone0 "soc-thermal" reads 39.8 C.

i2s-tdm: rv1126 fallback compatible added (DAI builds; sound card needs the acodec
port next). saradc still -22 (clk-rv1106 SARADC divider — deferred).

Includes the NPU + RGA open-source port plans (research): rknpu kernel driver is a
small port (RV1106 config already in the vendor driver; 4 dead-code headers need
compat stubs) but no open userspace exists for this NPU gen; RGA = port the vendor
char-dev rga3 driver (WardenOS's librga uses /dev/rga, not V4L2), + a cma pool +
hrtimer_setup. All ports are open source (vendor C source / mainline siblings).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 22:48:39 -06:00
BFE EngineeringandClaude Opus 4.8 13ab5c7303 kernel: overnight autonomous completion plan (open-source-first, all drivers)
The brief: port/enable every remaining RV1106 hardware capability on 6.18,
open-source-first (source we own + can harden, never blobs), new drivers if
needed, zero capabilities left on the table. Priority: AIC8800 wifi/BT, RGA,
rknpu, RTC, tsadc, i2s, saradc-fix, eth0-gadget, then a full capabilities audit.
Display deferred to tomorrow (needs eyes on the panel). Pipelined: research
subagents ∥ port/build/verify on c8a3; krecover-hardened for resilience.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 22:35:05 -06:00
BFE EngineeringandClaude Opus 4.8 daed33056f kernel: sweep — usb2phy port (USB host up) + saradc data port
usb2phy: ported the RV1106 inno-usb2 phy config to 6.18 (rv1106_usb2phy_cfg;
fields map 1:1 except utmi_iddig->utmi_id and chg_mode->opmode; 5.10-only
iddig_output/en/bvalid_grf_sel dropped; phy_tuning left off, guarded so safe).
With PHY_ROCKCHIP_INNO_USB2=y + the u2phy/usbdrd/dwc3 DT enabled, verified on
warden-c8a3: the DWC3 comes up as xhci-hcd @ 0xffb00000 — USB host works. eth0
gadget just needs dr_mode=peripheral.

saradc: added rv1106_saradc_data (2-ch v2, matches the vendor) + the native
compatible. Driver now matches; probe still returns -22 (a clk-rate/setup detail,
not the data) — TODO.

Also captured: the growing board dts (USB nodes), the port fragments under usb/
and adc/. DRIVER-PARITY.md updated: ~14 drivers now at parity on 6.18.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 22:23:37 -06:00
BFE EngineeringandClaude Opus 4.8 5abf1c4468 kernel: M4 VOP display driver ported to 6.18 — binds on hardware (connector WIP)
The RV1106 VOP is the RV-series "lite" VOP (rockchip,rv1106-vop, VOP_VERSION 2.0xc),
mainline's VOP1 driver. Its sibling rv1126 is already in 6.18, so rv1106_vop reuses
rv1126's register sub-structs + VOP_FEATURE_INTERNAL_RGB + the smaller raster.

Verified on warden-c8a3: with the driver delta + DT (vop enabled with named
"ahb"/"dclk" resets, vop_out repointed to a panel-dpi 720x720 node, pwm-backlight
on pwm1), the VOP BINDS and DRM initialises (/dev/dri/card0), and the PWM backlight
comes up. The register data / version / feature / resets are validated.

Open: /sys/class/drm/card0 has no connector yet — rockchip_rgb_init isn't producing
one ("Cannot find any crtc"). Last mile of M4; needs a debug print in rgb_init + the
panel bus_format, and the pixels must be verified on the physical panel (can't be
checked over serial/ssh). Full recipe + next steps in display/README.md.

Also batch-2 config: GPIO_SYSFS, PWM_ROCKCHIP, crypto (aes/ccm/ctr/arc4), CFG80211,
DRM_ROCKCHIP/ROCKCHIP_VOP all =y; PSCI-style SMC removed via the psci-node deletion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 22:02:55 -06:00
BFE EngineeringandClaude Opus 4.8 79ef2df67a kernel: full-SoC DT transplant — batch-1 peripherals at parity on 6.18
Move from the hand-built minimal DT to the vendor rv1106.dtsi (full SoC:
pinctrl, gpio×5, dmac, cru+grf_cru, all peripherals), with our lean board DTS
(rv1106-warden.dts) enabling only the wall-HMI's needs — no camera/ISP/CSI.

Two deltas made it boot on 6.18: overwrite boot-mode.h with the vendor's (extra
BOOT_* constants) and DELETE the psci node (no secure monitor → SMC fault →
"Attempted to kill the idle task"). Recipe in dts/README.md.

Verified on warden-c8a3 (uname 6.18.46, full WardenOS userspace): pinctrl,
gpio0-4, pl330 DMA, uart1/2/4 (ttyS1/2/4), i2c3, dw-wdt (watchdog0) all probe.
DRIVER-PARITY.md tracks the remaining ports (VOP display, AIC8800 wifi, rknpu,
usb2phy, saradc-compat, RGA) toward full parity with the 5.10 kernel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 21:12:49 -06:00
BFE EngineeringandClaude Opus 4.8 b5a448fa84 kernel: M3 DONE — full WardenOS boots on the self-built 6.18 kernel
Adding the eMMC dw_mmc node (mmc@ffa90000, clocks from cru + grf_cru) was all M3
needed. On warden-c8a3 the 6.18 kernel enumerates the eMMC at HS200
(mmcblk0 8GTF4R 7.28 GiB), mounts the ext4 rootfs, runs /sbin/init, and starts
every WardenOS daemon. Serial root login confirms:

  Linux warden-c8a3 6.18.46 armv7l
  ps: warden-flared warden-modbus warden-mikrotik warden-asic warden-ui warden-flight

Expected M4/M5 gaps are clean failures: the 5.10 aic8800 wifi/BT .ko won't load on
6.18 (vermagic), and no backlight/framebuffer yet (no VOP node). Next: M4 display,
M5 AIC8800 SDIO port, M6 the rest; plus a lean defconfig + Buildroot-on-6.18.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 20:40:53 -06:00
BFE EngineeringandClaude Opus 4.8 f3087399f2 kernel: M2 DONE — self-built 6.18 boots on real RV1106 hardware (warden-c8a3)
The Linux 6.18.46 forward-port boots on the panel through our ported drivers,
verified on the serial console: earlycon, arch timer (BogoMIPS calibrated), our
clk-rv1106 CRU, pinctrl, and the mainline 8250 bound to uart2 clocked by our CRU
(ttyS2 16550A), then rootfs mount.

Two DT fixes got it past "Starting kernel":
- fdt placed high (load=0x08000000) so the bloated multi_v7 zImage (~20 MiB
  decompressed) stops overrunning the DTB at 0xc00000 (was: r2=0, "invalid dtb").
- added the rockchip,rv1106-grf-cru node (grf-clock-controller child of grf) so
  clk-rv1106's grf_ctx isn't NULL (was: panic in rockchip_clk_register_branches).
Console pinned to 115200 (readable on the CP2102 bench adapter; prod uses 1.5M).

The boot-image format and the A/B _b-slot safe-test method (which auto-reverted to
_a on every failed attempt) are in docs/m2-boot-on-c8a3.md. M3 next: lean defconfig
+ dw_mmc DT + our Buildroot userspace rebuilt on 6.18.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 19:31:37 -06:00
BFE EngineeringandClaude Opus 4.8 b21229c8aa docs: NPU-for-graphics feasibility assessment
Investigated whether the RV1106 NPU (RKNPU) could do 3D rendering or other
graphical work as we port its driver to 6.18. Verdict: no. Read the vendored
rknpu driver directly — it executes a pre-compiled regcmd list from Rockchip's
closed RKNN compiler; no register ISA, no arbitrary-kernel submit path. Only the
vertex-transform stage (GEMM) maps at all, and rasterization/depth/texture/
shading/framebuffer have no mapping to a conv/pool op set — absent, not slow. For
every CNN-shaped graphical candidate the SoC already has a better fit (RGA 2D,
idle RKIVE classic-CV), and there's no camera. Recommend porting rknpu.ko only
for future non-visual inference, never for graphics.

Caveat flagged in the doc: the no-rasterizer claim is from the RKNN op taxonomy +
architecture, not register-level ground truth (TRM Part 2 is unpublished).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 18:45:19 -06:00
BFE EngineeringandClaude Opus 4.8 d50934d048 kernel: M2 earlycon build — full 6.18 zImage + minimal RV1106 board DT
M1 is complete (clk + pinctrl + mach compile clean); this reaches M2's build
milestone. multi_v7_defconfig + configs/m2-earlycon.fragment builds an 11.8 MB
zImage with clk-rv1106.o and pinctrl-rockchip.o (our rv1106 data) compiled into
the full tree — no rv1106 warnings. dts/rv1106-warden-m2.dts (CPU, GIC-400, arch
timer, 256 MiB RAM, GRF, the CRU, uart2 as snps,dw-apb-uart) compiles clean at
W=1 with earlycon=uart8250,mmio32,0xff4c0000. Reproducible via build-m2.sh.

Boot is the next step and is on-hardware/attended: package zImage + dtb, load on
a bench unit with a recovery net, watch for the earlycon "it's alive". PORT-VERIFY
before trusting a boot: DDR size/base, the CPU clock mux, console baud.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 18:39:38 -06:00
BFE EngineeringandClaude Opus 4.8 435953799c sim: Modbus RTU slave model (ModbusSlave) on the RS-485 seam
The device counterpart to warden-modbus's master/scanner: request-frame in,
response-frame out, in host memory. CRC16 is byte-identical to the master
(poly 0xA001, low-first; known vector 01 03 00 00 00 01 -> 84 0A verified).
Implements the data plane — read/write holding & input registers, coils,
discrete inputs (FC 0x01-0x06, 0x0F, 0x10) + Report Slave ID (0x11) — with
exception replies (illegal function/address/value) and the two real-world
faults the master must survive: a device that silently ignores a request
(drop_next) and one that NAKs everything (force_exception). This is what the
modbus-master MC/DC harness drives against; MEI (0x2B/0x0E) is a follow-up.

11 tests, sim crate 25/25 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 18:04:38 -06:00
BFE EngineeringandClaude Opus 4.8 4a1ec1d84e tools: config-lint — MCU-load-vs-reserved-memory gate (0x40000 brick class)
The c8a3 brick was a memory-map fault no behavioural sim can catch: a
boot-loaded coprocessor firmware dropped at 0x40000, which is a reserved-memory
carve-out on Thunder-Boot boards but plain kernel RAM on ours. config-lint is
the static gate for it — parse the rkbin loader .ini for every LOADERn=Hpmcu
LOAD_ADDR, parse the target devicetree for reserved-memory ranges, fail if any
MCU load lands outside a reservation.

Tests encode the brick as a regression against the REAL Thunder-Boot .ini
(Hpmcu@0x40000): fails with no rtos@40000 node, passes once reserved; our
board's non-TB loader (no boot-loaded MCU) always passes. 6/6 green; CLI
verified against the on-disk rkbin .ini files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 17:56:33 -06:00