Skip to content

fix(zeroclaw): add install playbook, fix manifest, add tests#6

Merged
ric03uec merged 21 commits intomainfrom
gsd/phase-04-installation-fleet-status
Mar 22, 2026
Merged

fix(zeroclaw): add install playbook, fix manifest, add tests#6
ric03uec merged 21 commits intomainfrom
gsd/phase-04-installation-fleet-status

Conversation

@ric03uec
Copy link
Owner

@ric03uec ric03uec commented Mar 22, 2026

Summary

  • Add Debian 13 support to platform constraint (was Ubuntu-only)
  • Fix zeroclaw manifest to use v0.5.7 and download binaries
  • Fix claw_user to use alias/key_id, never IP address
  • Persistent ansible logs in ~/.config/clawrium/logs/
  • Add ManifestParseError and zeroclaw compatibility tests

Test plan

  • make test passes (213 tests)
  • make lint passes
  • Manual test: clm install --claw zeroclaw --host kevin --yes succeeds

ATX Review Summary

Review 1: Rating 2/5

Blocking Issues

# Issue Location Recommendation
1 Debian 13 entry violates v1 Ubuntu-only constraint manifest.yaml:5-14 Removed constraint - now Ubuntu and Debian for v1
2 nodejs >=20.0.0 unavailable on Debian 13 stock repos manifest.yaml:13 Removed nodejs from armv7l entry
3 test_check_compatibility_zeroclaw_armv7l uses wrong OS version tests/test_registry.py:290-309 Fixed to use debian 13, added debian 12 incompatibility test
4 ManifestParseError branch completely untested tests/test_registry.py:45-50 Added 3 tests for YAML parsing errors

Warnings

# Issue Location Recommendation
1 Git clone uses mutable tag, no integrity verification playbooks/install.yaml:13-16 Changed to download release binaries instead of git clone
2 runner.rc never checked after ansible_runner.run() core/hardware.py:192-195, 233 Deferred - existing issue
3 Error message references deleted tmpdir path core/install.py:184-188, 210-214 Fixed - logs now in persistent ~/.config/clawrium/logs/
4 Dependency fields are dead config manifest.yaml Deferred - TODO exists
5 Zero test coverage for ubuntu aarch64/x86_64 zeroclaw entries Missing tests Added tests for both platforms
6 Inconsistent dependency schema across manifests manifest.yaml Deferred
7 test_load_manifest_zeroclaw has weak assertions tests/test_registry.py:276-288 Deferred
8 Version-pinned compatibility path untested registry.py:252-260 Deferred

Suggestions

# Suggestion
1 Add schema_version field to manifests
2 Add min_disk_mb to requirements
3 Document OS string normalization
4 Consider version at manifest level vs per-entry
5 Add entry-level field validation in load_manifest()
6 Test GPU-required failure path

Co-Authored-By: @atx-ci 269048218+atx-ci@users.noreply.github.com

🤖 Generated with Claude Code

Devashish and others added 21 commits March 21, 2026 21:03
Plan 4 plans for Installation & Fleet Status phase:
- 04-01: Core install module and Ansible playbooks (Wave 1)
- 04-02: Install CLI with interactive flow and progress (Wave 2)
- 04-03: Install state tracking and health check module (Wave 2)
- 04-04: Fleet status CLI command (Wave 3)

Covers requirements: INST-01, INST-02, INST-03, INST-04, STAT-01

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Base playbook installs Node.js 20+ and build-essential via NodeSource
- OpenClaw playbook creates opc-<hostname> user and clones repository
- Both playbooks are idempotent and use Ansible best practices
- Tests verify playbook structure and required elements
- run_installation validates claw exists and host is compatible
- Runs base playbook for system dependencies (Node.js, build tools)
- Runs claw-specific playbook for application installation
- Provides on_event callback for progress tracking
- Comprehensive error handling with clear messages
- 7 test cases covering success and failure paths
- Test claw selection prompt when --claw not provided
- Test host selection prompt when --host not provided
- Test flag overrides skip prompts
- Test confirmation summary display
- Test --yes skips confirmation
- Test cancellation exits cleanly
- Test InstallationError handling
- Test incompatibility detection and rejection
- Create install CLI command with claw/host selection
- Add confirmation dialog with installation summary panel
- Integrate Rich progress spinner for installation feedback
- Support --claw, --host, --yes flags for non-interactive use
- Handle incompatibility detection and clear error messages
- Exit 0 on cancellation, exit 1 on errors
- Register install command in main CLI app
- All 8 CLI install tests passing

Provides polished UX wrapper around core install module per D-01 hybrid
invocation pattern and D-02/D-03 progress/confirmation requirements.
- Remove dead code: current_stage variable and on_event callback
- Simplify progress update flow by using update_progress directly
- No behavior change, all tests still pass
- Extended host schema with claws dict tracking version, status, install time, errors
- install.py now sets 'installing' status before playbook execution
- install.py sets 'installed' status on success with timestamp
- install.py sets 'failed' status on exception with error message
- Added tests for host claw tracking (installed and failed states)
- Added tests for install state updates in run_installation function
- Added ClawStatus enum (RUNNING, STOPPED, UNKNOWN, NOT_INSTALLED)
- Implemented check_claw_health() for live SSH-based process checking
- Uses pgrep to detect node process owned by claw user
- Implemented check_all_claws_on_host() for checking all claws on a host
- Returns HealthResult with status, user, and error information
- Handles timeout, SSH failures, missing keys gracefully
- All tests pass with proper mocking of ansible_runner
- Created 04-03-SUMMARY.md documenting execution
- Updated STATE.md with plan 3 completion
- Updated ROADMAP.md progress (3/4 plans complete)
- Marked requirements INST-04 and STAT-01 complete
- Recorded decisions and metrics
…th claw-centric view

- Created status CLI command grouped by claw type per D-12
- Integrated live health checks per D-13
- Display shows host, version, user, status per D-14
- Added --host filter for single-host status view
- Color-coded status: green (running), red (stopped), yellow (unknown)
- Added 8 comprehensive test cases covering all scenarios
Security fixes:
- health.py: Validate claw_user against strict regex to prevent command injection
- install.yaml: Pin git clone to immutable version tag (not main branch)
- install.yaml: Set workspace directory mode to 0700 (not world-readable)

Reliability fixes:
- hosts.py: Move add_host/remove_host load-modify-save under _hosts_lock()
  to prevent TOCTOU races
- hosts.py: Add DuplicateHostError to prevent ghost entries
- base.yaml: Replace deprecated apt_key with get_url + signed-by pattern
  for Ubuntu 22.04+ compatibility

Test coverage:
- health.py: Add tests for invalid claw_user, host unreachable, unexpected output
- cli/status.py: Add test for installing status display
- cli/install.py: Add test for HostsFileCorruptedError propagation
- hosts.py: Add tests for update_host not found, duplicate host, get_host_by_key_id

Also fixes warnings:
- health.py: Distinguish runner_on_unreachable from runner_on_ok events
- health.py: Return UNKNOWN for unexpected output (not STOPPED)

ATX Review Summary
Review 1: Rating 3/5
Blocking issues: 6/6 resolved
Warnings: 8 (key ones fixed, rest are suggestions)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: @atx-ci <269048218+atx-ci@users.noreply.github.com>
- Lower min_memory_mb from 1024 to 512 for armv7l (Pi 2 has ~920MB usable)
- Add raspbian OS entries for Raspberry Pi OS compatibility
- Lower aarch64 RAM requirement from 2048 to 1024

Fixes compatibility check failing on Raspberry Pi 2 with zeroclaw.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Blocking issues resolved:
1. Create zeroclaw install playbook (was missing entirely)
2. Update nodejs requirement to >=20.0.0 (match base.yaml)
3. Add zeroclaw manifest and compatibility tests
4. Fix malformed manifest test to actually test code path

Tests: 207 passed

ATX Review Summary
Review 1: Rating 2/5
Blocking issues: 4/4 resolved

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: @atx-ci <269048218+atx-ci@users.noreply.github.com>
- Add Debian 13 support to platform constraint (was Ubuntu-only)
- Fix zeroclaw manifest to use v0.5.7 and correct arch requirements
- Fix install playbook to download binaries instead of git clone
- Fix claw_user generation to use alias/key_id, never IP address
- Move ansible logs to ~/.config/clawrium/logs/ (persistent)
- Show ansible output during installation (quiet=False)
- Add ManifestParseError tests for YAML parsing edge cases
- Add zeroclaw compatibility tests for ubuntu aarch64/x86_64
- Fix closure bug capturing exception in error handler
- Clean up unused imports and variables

ATX Review Summary
Review 1: Rating 2/5
Blocking issues:
| # | Issue | Recommendation |
|---|-------|----------------|
| 1 | Debian 13 entry violates v1 Ubuntu-only constraint | Removed constraint - now Ubuntu and Debian for v1 |
| 2 | nodejs >=20.0.0 unavailable on Debian 13 stock repos | Removed nodejs from armv7l entry |
| 3 | test_check_compatibility_zeroclaw_armv7l uses wrong OS version | Fixed to use debian 13, added debian 12 incompatibility test |
| 4 | ManifestParseError branch completely untested | Added 3 tests for YAML parsing errors |

Warnings:
| # | Issue | Recommendation |
|---|-------|----------------|
| 5 | Zero test coverage for ubuntu aarch64/x86_64 zeroclaw entries | Added tests for both platforms |

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: @atx-ci <269048218+atx-ci@users.noreply.github.com>
@ric03uec ric03uec merged commit fb6ffb5 into main Mar 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant