feat(live): fix hw_harvest boot recursion and add optional first-open diagnostics #99

Merged
clawdie merged 4 commits from clawdie/feat/first-open-hw-diagnostics into main 2026-11-22 01:24:48 +01:00 AGit
Owner

Fixes the FreeBSD boot-time recursion bug in clawdie_hw_harvest where
/etc/rc.subr run_rc_script() sources the rc script with $0=/etc/rc
(leaving hardware-facts.json unwritten and leaking .harvest.flock into
boot daemons so manual onestart deadlocks in lockf).

Makes hardware diagnostics an explicit, optional first-open step right
before assistant naming:

  • Change live-image clawdie_hw_harvest_enable default from YES to NO.
  • Add /usr/local/bin/clawdie-hw-check to run the existing collector once,
    refresh the cockpit, and report honest hardware/VM facts + supported
    workloads (never overclaiming local AI models on low-RAM / VM guests).
  • Prompt with bsddialog ([ Run diagnostics ] / [ Skip ], plain fallback)
    in clawdie-firstboot-confirm before assistant naming; persist choice
    across reboots; keep interrupted/EOF prompts unstarted; continue on
    collector failure.
  • Allow clawdie_hw_harvest onereplay to exit 0 cleanly when zero snapshot
    artifacts exist (Skip -> memory workflow) while preserving fail-closed
    manifest verification on partial or corrupted snapshots.
  • Update cockpit provider wording from 'ready' to 'key loaded' when only
    key presence was checked, show 'skipped (run clawdie-hw-check)', and
    refuse to display a prior computer's hardware snapshot when SMBIOS
    system_uuid changes.
Fixes the FreeBSD boot-time recursion bug in clawdie_hw_harvest where /etc/rc.subr run_rc_script() sources the rc script with $0=/etc/rc (leaving hardware-facts.json unwritten and leaking .harvest.flock into boot daemons so manual onestart deadlocks in lockf). Makes hardware diagnostics an explicit, optional first-open step right before assistant naming: - Change live-image clawdie_hw_harvest_enable default from YES to NO. - Add /usr/local/bin/clawdie-hw-check to run the existing collector once, refresh the cockpit, and report honest hardware/VM facts + supported workloads (never overclaiming local AI models on low-RAM / VM guests). - Prompt with bsddialog ([ Run diagnostics ] / [ Skip ], plain fallback) in clawdie-firstboot-confirm before assistant naming; persist choice across reboots; keep interrupted/EOF prompts unstarted; continue on collector failure. - Allow clawdie_hw_harvest onereplay to exit 0 cleanly when zero snapshot artifacts exist (Skip -> memory workflow) while preserving fail-closed manifest verification on partial or corrupted snapshots. - Update cockpit provider wording from 'ready' to 'key loaded' when only key presence was checked, show 'skipped (run clawdie-hw-check)', and refuse to display a prior computer's hardware snapshot when SMBIOS system_uuid changes.
feat(live): fix hw_harvest boot recursion and add optional first-open diagnostics
All checks were successful
format-check / gates (pull_request) Successful in 2m50s
e955fed276
Fixes the FreeBSD boot-time recursion bug in clawdie_hw_harvest where
/etc/rc.subr run_rc_script() sources the rc script with $0=/etc/rc
(leaving hardware-facts.json unwritten and leaking .harvest.flock into
boot daemons so manual onestart deadlocks in lockf).

Makes hardware diagnostics an explicit, optional first-open step right
before assistant naming:
- Change live-image clawdie_hw_harvest_enable default from YES to NO.
- Add /usr/local/bin/clawdie-hw-check to run the existing collector once,
  refresh the cockpit, and report honest hardware/VM facts + supported
  workloads (never overclaiming local AI models on low-RAM / VM guests).
- Prompt with bsddialog ([ Run diagnostics ] / [ Skip ], plain fallback)
  in clawdie-firstboot-confirm before assistant naming; persist choice
  across reboots; keep interrupted/EOF prompts unstarted; continue on
  collector failure.
- Allow clawdie_hw_harvest onereplay to exit 0 cleanly when zero snapshot
  artifacts exist (Skip -> memory workflow) while preserving fail-closed
  manifest verification on partial or corrupted snapshots.
- Update cockpit provider wording from 'ready' to 'key loaded' when only
  key presence was checked, show 'skipped (run clawdie-hw-check)', and
  refuse to display a prior computer's hardware snapshot when SMBIOS
  system_uuid changes.
fix(live): tighten hw-check honesty, boot-disk exclusion, and memory preflight
All checks were successful
format-check / gates (pull_request) Successful in 2m51s
f57679a4ca
Addresses review findings from Codex, Pi, and the 3x3 audit before rebuilding:

- clawdie-hw-check: replace overclaimed 'Supported on this hardware' /
  'Workstation with memory' copy with 'Based on detected hardware' and
  'Memory workflow ... — may fit; choosing it will start and check the
  services'. Require snapshot-manifest.json so unverified snapshots do not
  render guidance (while letting onboarding continue). Stop classifying
  integrated AMD/Intel APUs (e.g. Ryzen 5700U / Lucienne / scfb) as
  discrete GPUs for local AI models.
- clawdie-firstboot-confirm: replace premature 'Max uses the results...'
  copy with truthful 'Results are shown here and in the status cockpit...'
- clawdie-system-probe: resolve diskid/* and gptid/* in
  _detect_boot_media_disks(), and fail closed to role=unknown (never
  install_candidate) when the live backing disk cannot be positively
  excluded against kern.disks.
- clawdie-hw-harvest-rc + clawdie-live-services: add read-only
  onepreflight before starting agent_vault/sova so Skip -> memory succeeds
  cleanly while damaged/uncommitted snapshots abort before starting any
  service with an actionable clawdie-hw-check hint.
- clawdie-jev-env + clawdie-max2-state: align offline Jev badge wording
  to '[Jev key loaded — System One]'.
- clawdie-jev-stage-gate: derive S1 ram_mb from ram_gb when absent and
  check zfs_pools instead of hardcoded 'or True' for zfs_root_present.
fix(live): require all live boot members resolved and three-state S1 zfs_root_present
All checks were successful
format-check / gates (pull_request) Successful in 2m44s
0b70b1b854
Addresses Pi's bounded recheck on f57679a:

- clawdie-system-probe: track _boot_all_resolved across every live pool
  member token in _boot_set instead of flipping on a single match, so a
  partially resolved mirror keeps resolved members as boot_media and
  marks all non-matching disks unknown (never install_candidate).
- clawdie-jev-stage-gate: honor CLAWDIE_SYSTEM_PROBE_BIN, derive S1
  zfs_root_present as a three-state value (True/False/None) directly from
  the root mount instead of whether any pool is imported, and emit a
  single 'hardware probe unavailable (no probe evidence)' failure when
  the probe fails rather than manufactured false negatives.
test(matrix): mock synthetic MAC for N-Quads scrubbing and keep /usr/local/bin on FreeBSD
All checks were successful
format-check / gates (pull_request) Successful in 2m42s
54976fc0c2
Fixes tests/server-matrix-and-oxigraph-harvest-test.sh failures on FreeBSD valhala (0b70b1b):

- Add a mock ifconfig emitting synthetic MAC 02🇩🇪ad:be:ef:42 so both
  Linux (debby) and FreeBSD (valhala) exercise the same MAC collection and
  N-Quads scrubbing path without depending on host NICs.
- Split the privacy check: verify SERIAL_DO_NOT_LEAK is absent from both
  JSON and N-Quads, and verify MAC addresses are captured in the local
  JSON fixture and completely absent from N-Quads.
- Keep /usr/local/bin in the Birth Certificate fixture PATH (after mock
  dirs) so FreeBSD python3 is found and sections 5-7 execute on valhala.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/clawdie-iso!99
No description provided.