Skip to content

Complete SigOps Agent — Rust binary, 4 modules, 18 tests - #1

Merged
diskhacker merged 1 commit into
mainfrom
claude/conversation-summary-UT2b8
Apr 12, 2026
Merged

Complete SigOps Agent — Rust binary, 4 modules, 18 tests#1
diskhacker merged 1 commit into
mainfrom
claude/conversation-summary-UT2b8

Conversation

@diskhacker

@diskhacker diskhacker commented Apr 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rust agent binary: config, discovery, heartbeat, executor
  • 4 built-in tools: sigops.restart, sigops.http, sigops.condition, sigops.wait
  • Input sanitization, 3600s safety cap, Bearer auth
  • 18 tests, cargo build + clippy clean, CI pipeline

Summary by CodeRabbit

  • New Features

    • Introduced sigops agent application with CLI and environment variable configuration support
    • Automatic host and tool discovery capabilities
    • Task execution engine supporting service restarts, HTTP operations, condition evaluation, and delays
    • Server heartbeat mechanism for agent monitoring and communication
  • Chores

    • Added automated CI/CD pipeline for builds and testing
    • Updated build configuration

…covery, task execution

Complete implementation of the SigOps infrastructure agent in Rust:

- config.rs: CLI args + env vars via clap (server URL, agent ID, tenant, token, interval)
- discovery.rs: Host info collection + tool discovery (systemctl, docker, kubectl, curl, etc.)
- heartbeat.rs: HTTP heartbeat client with JSON payload to SigOps server
- executor.rs: Task execution engine with 4 built-in tools:
  - sigops.restart: Service restart with input sanitization
  - sigops.http: HTTP requests via curl
  - sigops.condition: Numeric expression evaluation
  - sigops.wait: Timed delay with 3600s max
- main.rs: Tokio async runtime, heartbeat loop, tracing logging

Infrastructure:
- GitHub Actions CI (Rust toolchain + cache + build + test + clippy)
- 18 unit tests, all passing
- Cargo.lock committed for reproducible builds

Dependencies: tokio, reqwest, serde, clap, tracing, uuid, hostname, thiserror

https://claude.ai/code/session_016BNDbB5ERJFsXQZiuL6tL1
@diskhacker
diskhacker merged commit 107a2dd into main Apr 12, 2026
0 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 84497e60-634a-4cad-935e-3f30a564d6a7

📥 Commits

Reviewing files that changed from the base of the PR and between 7169093 and 885eecd.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • .gitignore
  • Cargo.toml
  • src/config.rs
  • src/discovery.rs
  • src/executor.rs
  • src/heartbeat.rs
  • src/main.rs

📝 Walkthrough

Walkthrough

This PR introduces a complete Rust agent application that discovers system tools, collects host information, and sends periodic heartbeats to a configured server. It includes CLI configuration, local task execution handlers, and HTTP heartbeat functionality with proper error handling and logging.

Changes

Cohort / File(s) Summary
Infrastructure & Build
.github/workflows/ci.yml, .gitignore, Cargo.toml
Added GitHub Actions CI workflow (build, test, clippy on main/claude/* and PRs), updated .gitignore to exclude /target, and defined Rust project manifest with dependencies for async execution, HTTP, serialization, logging, and CLI parsing.
Configuration Management
src/config.rs
Added CLI argument parser struct supporting environment variables and defaults, with agent ID auto-generation via UUID when unspecified.
System Discovery
src/discovery.rs
Added tool discovery by probing installed executables for version info and host information collection (hostname, OS, optional IP).
Task Execution
src/executor.rs
Added task dispatcher supporting four built-in handlers: service restart, HTTP requests, numeric condition evaluation, and duration-bounded waits, with execution timing and error capture.
Server Communication
src/heartbeat.rs
Added HTTP client for sending agent heartbeat payloads (identity, host info, tools) to a configured server with bearer authentication and error handling.
Application Entry
src/main.rs
Added async main entry point wiring configuration, logging, discovery, and an infinite heartbeat loop with periodic retry and sleep intervals.

Sequence Diagram

sequenceDiagram
    participant Agent as Agent (main.rs)
    participant Config as Config Parser
    participant Discovery as Discovery Module
    participant Executor as Task Executor
    participant Server as Server

    Agent->>Config: Parse CLI args & env vars
    Config-->>Agent: Config with defaults

    Agent->>Discovery: Collect host info & discover tools
    Discovery-->>Agent: HostInfo + [DiscoveredTools]

    Agent->>Server: POST /api/v1/agents/heartbeat
    Note over Agent,Server: HeartbeatPayload<br/>(agent_id, tenant_id, host_info, tools)
    Server-->>Agent: HeartbeatResponse

    rect rgba(200, 150, 100, 0.5)
    Note over Agent: Loop every heartbeat_interval seconds
    Agent->>Server: Send heartbeat (async)
    Server-->>Agent: Acknowledge or error
    Agent->>Agent: Sleep for interval
    end

    Note over Agent,Executor: When task received (future):<br/>Executor handles tool dispatch
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop, hop, heartbeat goes the bouncing friend,
Tools discovered, host info to send,
Tasks executed with restarts and waits,
A new agent emerges to automate fates! 🐇✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/conversation-summary-UT2b8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants