fix(zeroclaw): add install playbook, fix manifest, add tests#6
Merged
fix(zeroclaw): add install playbook, fix manifest, add tests#6
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.config/clawrium/logs/Test plan
make testpasses (213 tests)make lintpassesclm install --claw zeroclaw --host kevin --yessucceedsATX Review Summary
Review 1: Rating 2/5
Blocking Issues
manifest.yaml:5-14manifest.yaml:13tests/test_registry.py:290-309tests/test_registry.py:45-50Warnings
playbooks/install.yaml:13-16core/hardware.py:192-195, 233core/install.py:184-188, 210-214manifest.yamlmanifest.yamltests/test_registry.py:276-288registry.py:252-260Suggestions
Co-Authored-By: @atx-ci 269048218+atx-ci@users.noreply.github.com
🤖 Generated with Claude Code