Commit graph

42 commits

Author SHA1 Message Date
5b1b915e14 Merge pull request 'merge/all-three-fixes' (#11) from merge/all-three-fixes into main
Reviewed-on: #11
2026-06-04 20:04:23 +02:00
332ffd30d0 Merge pull request 'Fix XFCE SVG icon sniffing (Sam & Codex)' (#9) from fix/xfce-svg-pixbuf-icons into main
Reviewed-on: #9
2026-06-04 20:04:23 +02:00
5faeae821c Merge pull request 'fix(clawdie): pin clawdie_db_path in staged rc.conf for visibility' (#8) from fix/clawdie-db-path-rcconf into main 2026-06-04 20:04:23 +02:00
41dd4d11cd Merge pull request 'fix: clawdie pre-build hardening + Codex handoff' (#6) from fix/clawdie-prebuild-hardening into main 2026-06-04 20:04:23 +02:00
a0884351ee Merge pull request 'feat: stage the simplified clawdie agent into the ISO (Sam & Claude)' (#5) from feat/clawdie-staging-onto-live-boot into main
Reviewed-on: #5
2026-06-04 20:04:23 +02:00
8febb8e506 Merge pull request 'pi/main-live-boot-xfce-colibri-fixes' (#4) from pi/main-live-boot-xfce-colibri-fixes into main
Simplifying Clawdie service
2026-06-04 20:04:23 +02:00
949ddbdeca Merge xfce-operator-usb: Colibri ISO staging (Sam & Claude)
# Conflicts:
#	AGENTS.md
2026-06-04 20:04:23 +02:00
6bade5d04e Merge xfce-operator-usb: AMD ASUS hardware lane + XFCE panel polish (Sam & Claude)
Consolidates the operator-USB work into main now that the AMD ASUS hardware-evidence collection is closed and Codex is parked. Brings the live-session hardware lane (XInput/libinput touchpad guard, internal audio + resolver bootstrap, hw-report with gated public upload, operator-USB branding) and the config-only XFCE panel polish (Pass 1 + Pass 2: branded Whisker PNG, xkb text mode, panel 40px, systray square-icons).

Conflict: doc/LLM-PROVIDER-HARNESS.md was evolved on both sides. Resolved as a union with no content lost — the xfce-side harness/provider/fabric restructure is the base, and main's two unique blocks (Verifying Key Cleanup flow, the 2D Platform x Harness matrix + populate/add procedures) are preserved. The doc owner may later dedupe the overlap between the two 1D matrices and the 2D matrix.

Verification debt stays explicit and open (not closed by this merge): XFCE visual-polish confirmation and the next rebuilt-image hardware retest, per doc/XFCE-PANEL-BUGS-HANDOFF.md and PLAN-OPERATOR-USB-NEXT.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 20:04:23 +02:00
b163cf1014 Merge xfce-operator-usb: Track F Colibri, DeepSeek smoke, LLM provider harness 2026-06-04 20:04:23 +02:00
b03e740fb7 Pin ISO npm global CLI versions
Use packages/npm-globals.txt as the source of truth for offline npm CLI tarballs, update Pi to 0.75.5, and keep Claude Code out of the XFCE USB path.

---

Build: not run — ISO build not requested

Tests: pass — sh -n fetch-npm-globals and shell-npm-globals; pinned npm pack smoke passed
2026-06-04 20:04:23 +02:00
1a7ef84935 Disable stock text installer on live image 2026-06-04 20:04:23 +02:00
1a2d0b1d1f Label installer root filesystem 2026-06-04 20:04:23 +02:00
e5496c247e Make installer image UEFI bootable 2026-06-04 20:04:23 +02:00
2617d000b3 Rebuild ISO payload tree before copying packages (Sam & Codex) 2026-06-04 20:04:23 +02:00
dc37b6fb86 Drop root for build-time npm and QML stages (Sam & Codex) 2026-06-04 20:04:23 +02:00
49242f4dab Prevent ISO npm bundle from running installer lifecycle 2026-06-04 20:04:23 +02:00
389cab3aa2 Make ISO build PATH independent 2026-06-04 20:04:23 +02:00
548d28a57a Cache Clawdie AI bundles by resolved commit 2026-06-04 20:04:23 +02:00
8cc2cca60e Add ISO build manifest metadata 2026-06-04 20:04:22 +02:00
f9cc62bb02 Bundle current Clawdie AI for install validation 2026-06-04 20:04:22 +02:00
835074ab8d Wire live installer commit path (Sam & Codex)
Live GUI installs now write runtime handoff files under /var/run/clawdie-installer, invoke bsdinstall script through a dedicated commit helper, persist the installed handoff for first HDD boot, and point the operator at /setup after reboot.

The live autologin user is restricted to a narrow sudoers rule for the commit helper and reboot only.

Build: pass
Tests: pass — sh -n + QML build + config-format + stubbed live-commit dry-run
Real-disk / bhyve install: NOT YET TESTED
2026-06-04 20:04:22 +02:00
3a9954f9ec Boot live installer session and narrow install-time contract (Sam & Codex) 2026-06-04 20:04:22 +02:00
23f4f1aaec feat(firstboot): unify setup import across USB and VPS 2026-06-04 20:04:22 +02:00
e6f91d4517 feat(iso): bundle clawdie-ai node_modules for offline install
- build.sh now runs npm ci at ISO build time and bundles node_modules into the clawdie-ai payload tarball\n- firstboot deploy ensures node_modules exist (fallback: npm ci, network required)\n- test mode skips venv/model seeding + verify to avoid host side effects\n- docs/tests updated to match
2026-06-04 20:04:22 +02:00
07f315d730 feat(iso): bundle claude/gemini/pi npm CLIs for offline first-boot install
Ships @anthropic-ai/claude-code, @google/gemini-cli, and
@mariozechner/pi-coding-agent as prebuilt .tgz tarballs on the install
media so the agent runtime has its CLI dependencies on first boot
without network access.

Critical: installs to /home/clawdie/.npm-global to match the
npm_config_prefix set by shell-system.sh in /etc/profile.d/clawdie.sh,
so the clawdie user's PATH (and the agent's commandExists() probes)
actually resolve the binaries.

- scripts/fetch-npm-globals.sh: npm pack the 3 CLIs into tmp/npm-globals/
- firstboot/shell-npm-globals.sh: offline install as clawdie user with
  matching prefix, runs between pkg setup and deploy
- build.sh: fetch + bundle into ${SHARE}/npm-globals/
- firstboot.sh: source module and run_step before deploy

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-04 20:04:22 +02:00
d46997d0e1 fix: auto-sudo fallback for pkg fetch privilege escalation
Problem: pkg fetch requires access to /var/db/pkg (root-only)
Solution: Implement automatic sudo retry with user-writable cache

Changes:
- Replace privileged pkg config call with hardcoded ABI
- Add PKG_CACHEDIR to ~/.pkg-cache (user-writable, persistent)
- Wrap pkg fetch with error detection → auto-retry with sudo on privilege error
- Wrap pkg repo with same pattern for metadata generation
- First build: one sudo prompt, then caches packages
- Subsequent builds: no privilege escalation needed (cache hits)

Benefits:
- No manual intervention required
- Scales to new agents (same automatic fallback)
- Minimum privilege: only pkg commands elevated
- CI/CD friendly: no interactive sudo needed

Tested: build.sh --skip-fetch completes successfully with 50GB ISO

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:22 +02:00
1bffa175c8 Unify ISO and fix GPU installation gap (Sam & ZAI)
BREAKING CHANGE: Removes --target and --gpu-driver flags, unified ISO for all use cases

## Phase 0: GPU Fix + Unified ISO

### Core Changes

**GPU Package Installation (FIXES CRITICAL GAP):**
- Add clawdie_shell_nvidia_install() function to shell-nvidia.sh
- NVIDIA drivers now installed after detection (previously only configured)
- Works offline (USB packages) or online (pkg install)
- Resolves issue where rc.conf was set but driver not installed

**Unified ISO Architecture:**
- Remove --target flag from build.sh (no more vps/baremetal branching)
- Remove --gpu-driver flag from build.sh (runtime detection instead)
- All packages included on every ISO (desktop + all GPU drivers)
- Single image works on VPS, baremetal, and cloud

**Runtime Detection:**
- Add shell-desktop.sh for display detection at firstboot
- VPS/cloud: no display → lightdm disabled (headless)
- Baremetal: display detected → lightdm enabled (Lumina desktop)
- GPU detection always runs, installs correct driver version

**Sudo Unification:**
- Replace all doas references with sudo across entire codebase
- Update AGENTS.md with system configuration guidelines
- Update all documentation (BUILD.md, README.md, REQUIREMENTS.md, etc.)
- Admin panel now uses sudo for privileged operations

### Files Modified

**Core System:**
- build.sh: Remove target/gpu-driver logic, unified package selection
- firstboot/firstboot.sh: Add desktop detection module
- firstboot/shell-nvidia.sh: Add package installation function (+33 lines)

**New Files:**
- firstboot/shell-desktop.sh: Display detection and desktop enablement
- packages/pkg-list-nvidia-all.txt: All three NVIDIA driver versions (390/470/590)
- .opencode/plans/phase0-gpu-fix-unified-iso.md: Implementation plan

**Documentation:**
- PLAN-UNIFY.md: Update Step 3 for unified approach
- REQUIREMENTS.md: Simplify (no target choice), update for sudo
- BUILD.md: Update for unified ISO, sudo commands
- README.md: Update installation instructions
- AGENTS.md: Add system configuration section (sudo standardization)
- ADMIN-PANEL.md: Update privileged operations to use sudo
- CLAWDIE-SHELL.md: Update example commands to sudo
- CLAWDIE-ISO-REFACTORED.md: Update access paths to sudo
- REFACTOR-SUMMARY.md: Update permissions section to sudo

### Benefits

**Simplicity:**
- One build command: ./build.sh (no flags needed)
- One ISO to test and maintain
- No wrong choices for users
- No documentation explaining target differences

**Flexibility:**
- VPS can use GUI via VNC (wayvnc always available)
- Baremetal can run headless (disable lightdm)
- Repurpose hardware without reinstall
- All GPU drivers available for any hardware

**Technical:**
- Fixes critical GPU driver installation gap
- Runtime detection replaces build-time decisions
- Disk overhead: ~650MB (1-2% of 50GB - acceptable)
- No runtime overhead on VPS (services disabled by detection)

### Testing Required

- [ ] Build unified ISO: ./build.sh
- [ ] Test on VPS (no display): lightdm disabled, packages installed
- [ ] Test on baremetal (display): lightdm enabled, Lumina boots
- [ ] Test on NVIDIA hardware: driver installed and loaded
- [ ] Test sudo commands work without password prompts
- [ ] Verify all doas references removed
2026-06-04 20:04:22 +02:00
c3599469e0 feat: rename cloud→vps, fix domain naming (Sam & Claude)
Breaking changes:
- --target cloud renamed to --target vps
- Default domain changed from "home.arpa" to "${agentname}.home.arpa"

Changes:
- build.cfg: TARGET="vps" (was cloud)
- build.sh: --target vps, error messages updated
- firstboot.sh: AGENT_DOMAIN defaults to ${agentname}.home.arpa
- vps/firstboot-vps.sh: TARGET=vps
- Rename cloud-path-test.sh → vps-path-test.sh
- Update integration-test.sh: clawdie.home.arpa
- Update MODULE-MANIFEST.md, shell-system.sh examples
- Update BUILD.md: "VPS target" (was "VPS/cloud target")

Why:
- "vps" is more precise than "cloud" (VPS != always cloud)
- ${agentname}.home.arpa follows mDNS standard
- .local collides with mDNS (as noted in shell-env.sh)

Migration: Update build scripts from --target cloud to --target vps
2026-06-04 20:04:22 +02:00
033d9ba0f4 feat: recommend Tailscale with optional opt-out (Sam & Claude)
- Change default FEATURE_TAILSCALE from NO to YES
- Add build-time warning if TAILSCALE_AUTHKEY not set
- Update firstboot wizard: Tailscale moves to screen 2
- Add summary screen showing Tailscale status
- Update shell-tailscale.sh to handle missing auth key gracefully
- Update BUILD.md with new recommended/optional flow

User experience:
  - With auth key: Tailscale auto-connects (secure)
  - Without auth key: Warning shown, build continues (public SSH)
  - Wizard allows enabling/disabling with clear warnings

No breaking changes - existing builds still work.
2026-06-04 20:04:22 +02:00
4c78af00f9 Tests pass for tmp/ restructuring; fix sparse-copy size display
Integration test: PASS (7/7 modules, state handoff OK)
Build --skip-fetch: PASS (7.3GB image at tmp/output/, DOS/MBR valid)

Add sync before du -sh so sparse image size reports correctly
instead of showing 512B.

Build: PASS | Tests: PASS (integration + build --skip-fetch)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-04 20:04:22 +02:00
60c35361a0 Make ISO builds cleaner by default (Sam & Codex)
---

Build: FAIL | Tests: FAIL — not run (deferred)
2026-06-04 20:04:22 +02:00
16252fb67c iso: sync clawdie-ai v1.0.2 + codex baseline (Sam & Codex) 2026-06-04 20:04:21 +02:00
74752134c1 feat(build): bake new agent config vars into ISO image
build.cfg now uses ${VAR:-} pattern so env vars take precedence,
enabling cloud builds with arbitrary agent config via environment.

build.sh step 6 now injects all new fields (AGENT_GENDER,
PI_TUI_PROVIDER, PI_TUI_MODEL, API keys, Telegram, embeddings)
into the baked build.cfg inside the image.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
46028a7e6d fix: locale-safe date in build.sh + dynamic ISO detection in bhyve-test.sh
- build.sh: force LC_TIME=C so date +%b always outputs "Mar" not "Mar."
  Prevents double-dot filenames (e.g. 30.mar..2026.img) on sl_SI locale
- bhyve-test.sh: auto-detect newest baremetal .img or accept path as $1
  Removes hardcoded filename that breaks after each new build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
01cbe6e962 refactor: replace XFCE/MATE/KDE with Lumina across all files
- Create packages/pkg-list-lumina.txt with Lumina desktop environment packages
- Delete pkg-list-xfce.txt, pkg-list-mate.txt, pkg-list-kde.txt
- Remove desktop-installer from pkg-list-desktop-base.txt
- build.cfg: DEFAULT_DESKTOP=lumina (sole supported DE)
- build.sh: use pkg-list-lumina.txt instead of pkg-list-xfce.txt
- BUILD.md: update DEFAULT_DESKTOP comment
- CLAWDIE-ISO.md: add deprecation notice, update all DE references to Lumina only

Lumina is the sole supported FreeBSD-native desktop environment as per
LUMINA-INTEGRATION.md and CLAWDIE-ISO-REFACTORED.md specifications.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
17f0259d6d build: Add SSH key and system password support
- Add --ssh-key flag for providing SSH public key at build time
- Add --root-password and --clawdie-password flags for custom system passwords
- Update build.cfg with SSH_PUBLIC_KEY, ROOT_PASSWORD, CLAWDIE_USER_PASSWORD
- Bake all security-related vars into ISO for firstboot access

Enables secure passwordless SSH auth and custom password provisioning.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
8a0418b23c build.sh: Add --target flag, cloud args, VARIANT IMAGE_NAME, pkg_list_all branch, bake runtime vars
- Add argument parsing for --target, --assistant-name, --domain, --tz
- Validate TARGET (cloud|baremetal) and enforce cloud requirements
- Replace GPU_SUFFIX logic with VARIANT-based IMAGE_NAME generation
  * Cloud: clawdie-iso-cloud-24.mar.2026.img
  * GPU: clawdie-iso-{amd,intel,nvidia}-24.mar.2026.img
  * Auto: clawdie-iso-baremetal-24.mar.2026.img
- Update pkg_list_all() with cloud branch (headless, no desktop, no GPU)
- Bake TARGET, GPU_DRIVER, ASSISTANT_NAME, AGENT_DOMAIN, TZ into ISO

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
0dd5402d6e build.sh: --gpu-driver parametrization + payload baking + IMAGE_SIZE fix
Major changes enable 6 GPU-specific ISO variants with pre-baked driver configuration:

1. Argument parsing: Add --gpu-driver flag with validation (intel|amd|nvidia-{590,470,390}|vesa)
2. IMAGE_NAME: Add GPU suffix to output filename:
   - clawdie-iso-intel-24.mar.2026.img (with --gpu-driver intel)
   - clawdie-iso-24.mar.2026.img (without flag, auto-detect)
3. pkg_list_all(): Conditional GPU package selection based on GPU_DRIVER
4. Payload baking (Step 6): Append GPU_DRIVER to build.cfg on ISO so firstboot
   can skip live pciconf detection—driver is pre-baked in kld_list at boot time
5. Fix IMAGE_SIZE usage: Replace hardcoded 25G with "${IMAGE_SIZE}" variable

Result: Firstboot reads GPU_DRIVER from build.cfg, writes kld_list to rc.conf,
and rc.d/kld loads driver early in boot (REQUIRE: NETWORKING) before clawdie-firstboot
service runs—guaranteeing ONE reboot instead of risking TWO.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
969f1d4007 build: Upgrade ISO builder for Clawdie Shell v0.9.0
Changes:
- Increase image size from 8G → 25G (accommodate bundled packages)
- Refactor image prep: create fresh 25GB UFS image with proper MBR/BSD partitioning
  (replaces simple memstick copy; enables larger filesystem + offline package cache)
- Remove KDE/MATE desktop options (focus to XFCE only)
- Fix FreeBSD download URL path (15.0 ISO-IMAGES)
- Add bsdinstall post-install hook variables (nonInteractive, PARTITIONS, DISTRIBUTIONS)
- Implement idempotent mdconfig reattachment for interrupted builds

Build workflow:
  ./build.sh --fetch-only    # Fetch packages (no root needed)
  ./build.sh --skip-fetch    # Assemble ISO (requires root for mdconfig/gpart/newfs)

Tested on FreeBSD 15.0-RELEASE-p4.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
7a9c051526 feat(build): unblock ISO payload injection
1. Determine memstick partition layout: /dev/\${MD}s2a (UFS)
2. Implement payload injection in build.sh steps 5-6
3. Create scripts/publish.sh to copy ISO to CMS nginx /downloads/
4. Fix --fetch-only to not require root (use temp pkg config)

All 4 quickstart tasks now unblocked. Next: test in bhyve VM.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
3d21e5fa36 feat: CI/CD pipeline, package lists, offline pkg-cache seeding
.forgejo/workflows/build.yml:
- Forgejo Actions pipeline: push to main + weekly cron + manual dispatch
- Two-stage: fetch-only (no root) → assemble ISO (root via sudo)
- Publishes ISO to CMS nginx downloads; Codeberg release entry (metadata only)
- Uploads packages/ as workflow artifact for pkg-cache seeding

packages/:
- pkg-list-host.txt     — host baseline (mirrors clawdie-ai infra/packages/)
- pkg-list-jails.txt    — union of all jail package lists
- pkg-list-desktop-base.txt — Xorg + drm base for all DEs
- pkg-list-xfce.txt / kde.txt / mate.txt / nvidia.txt — per-DE packages

build.sh:
- --fetch-only flag: downloads packages + memstick, no root, CI step 1
- Real pkg fetch loop: reads all pkg-list-*.txt, deduplicates, runs pkg fetch
- pkg repo step: generates offline repo metadata after fetch
- Resolves "latest" Clawdie version via Codeberg API

firstboot/firstboot.sh:
- Seeds zroot/pkg-cache from USB packages/ after desktop install
- npm run install-all runs fully offline — no internet needed for jails
- Creates ZFS dataset if not present, falls back to plain directory

runner/README.md:
- forgejo-runner install + register on FreeBSD
- Scoped sudoers entry (build.sh + publish.sh only)
- rc.d service setup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
61b00accb4 feat: initial clawdie-iso skeleton
USB installer for Clawdie-AI. Combines FreeBSD base install,
desktop-installer GPU/DE setup, and Clawdie-AI deployment into
a single rc.firstboot wizard flow.

Skeleton includes:
- build.cfg: FreeBSD 15.0-RELEASE-p4, amd64, XFCE default
- build.sh: 7-step build outline (fetch → inject → repack), stubs
- installerconfig: bsdinstall post-install hook, copies firstboot/ to HDD
- firstboot/rc.d/clawdie-firstboot: runs once on first HDD boot
- firstboot/firstboot.sh: tiered bsddialog wizard (identity, desktop,
  pi profile, auto-generated secrets, AGENTS.md seeding, npm prefix setup)
- firstboot/gpu-detect.sh: pciconf PCI ID → kld/xorg driver mapping
- CLAWDIE-ISO.md: full design doc (copied from clawdie-ai)

VirtualBox excluded. pkg latest default. LLM keys deferred to pi first-run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00