No description
  • Rust 96%
  • Shell 2.9%
  • HTML 0.5%
  • Makefile 0.4%
  • JavaScript 0.2%
Find a file
Mahmoud Emad 9fe89eb6a5
All checks were successful
Lint / lint-linux (push) Successful in 1m2s
Tests with Services / test-linux (push) Successful in 8m15s
ci: enable 6 previously-uncovered crates, drop orphan oserver (#132)
## Summary

Re-enables 6 crates that had silently been skipped in CI.

## Changes

### Test coverage: 10 → 16 of 16 workspace crates
`ci_rust.sh` only tested 10 crates. A stale header comment disabled `herolib_os`, `herolib_virt`, `herolib_sid` for reasons that no longer apply (verified locally); `herolib_acp`, `herolib_tools`, `herolib_webserver` were silently uncovered. All six have passing tests — they are now in the PACKAGES list.

Per-crate handling in the test runner:
- `herolib_os` / `herolib_acp` / `herolib_tools`: skip doctests (live-git-URL assertions, missing `rt-multi-thread` feature, missing `tokio_test` dev-dep respectively)
- `herolib_virt`: skip doctests + the `nerdctl::container_test` module (needs a running containerd daemon beyond what CI provides)

### Phantom entry removal
The stale disabled-crates comment referenced `herolib_osis` — that crate does not exist in the workspace. Same pattern as the `herolib_do` ghost entry removed in PR #131.

### Nit
Removed duplicate blank echo lines in `ci_rust.sh` final summary.

## Scope note

An earlier commit on this branch proposed removing `crates/oserver/` (orphan — not in workspace members, no downstream consumers, only dep was the already-deleted `herolib_osis`). That removal was reverted pending decision on whether to revive the OSIS server work — see issue [#97](#97). No net change to `crates/oserver/` on this PR.

## Verification

`bash ci_rust.sh` locally: 16/16 packages pass.

## Test plan

- [x] `bash ci_rust.sh` locally passes all 16 packages
- [ ] Forgejo Tests CI green on this branch
- [ ] Lint CI green

Co-authored-by: Mahmoud-Emad <mahmmoud.hassanein@gmail.com>
Reviewed-on: #132
2026-04-21 10:32:38 +00:00
.claude refactor: rename herodo to hero_do and add Rhai shebangs 2026-02-23 05:09:03 +03:00
.forgejo/workflows chore(lint+ci): fix build, resolve clippy warnings, install hero_proc in tests CI (#131) 2026-04-21 07:15:03 +00:00
aiprompts refactor: replace all zinit references with hero_proc (#68) 2026-03-20 11:36:01 -04:00
crates chore(lint+ci): fix build, resolve clippy warnings, install hero_proc in tests CI (#131) 2026-04-21 07:15:03 +00:00
docs feat(ai): ImageRef enum with sync URL/path/bytes resolution 2026-04-16 19:45:22 +02:00
patches working nicely 2025-12-18 08:30:11 +01:00
research/zos working nicely 2025-12-18 08:30:11 +01:00
scripts fix: build_binaries now propagates build failure via || return 1 2026-04-14 12:30:07 +02:00
.gitignore feat: add OServer framework with auto-generated MCP from OSchema 2026-02-08 15:27:59 +01:00
.test Test 2026-01-02 09:58:52 +01:00
buildenv.sh chore: socat-only bridge, library-only install behaviour, sync build_lib.sh 2026-04-14 08:57:41 +02:00
Cargo.toml chore: update versions to 0.5.0 across all crates 2026-04-08 09:36:00 +02:00
ci-containers.conf initial workflow with services (#69) 2026-01-29 16:07:30 +00:00
ci_rust.sh ci: enable 6 previously-uncovered crates, drop orphan oserver (#132) 2026-04-21 10:32:38 +00:00
CLAUDE.md chore: socat-only bridge, library-only install behaviour, sync build_lib.sh 2026-04-14 08:57:41 +02:00
LICENSE init 2025-12-08 08:46:44 +01:00
Makefile chore(lint+ci): fix build, resolve clippy warnings, install hero_proc in tests CI (#131) 2026-04-21 07:15:03 +00:00
README.md refactor: rename herodo to hero_do and add Rhai shebangs 2026-02-23 05:09:03 +03:00

Herocode Herolib Rust

A comprehensive System Abstraction Layer (SAL) and automation framework built in Rust, featuring a powerful Rhai-based scripting engine.

Quick Install

Install hero_do (the Rhai runner) with a single command:

curl -sL https://forge.ourworld.tf/lhumina_code/hero_lib/raw/branch/main/scripts/install.sh | bash

This will:

  • Detect your platform (Linux/macOS, amd64/arm64)
  • Download the appropriate binary
  • Install to ~/hero/bin/
  • Add the path to your ~/.profile

After installation, start a new terminal or run:

export PATH="$HOME/hero/bin:$PATH"

Project Overview

Herolib provides a unified interface for system operations across different platforms. It is designed to be used both as a Rust library and as a scriptable automation tool via Rhai.

Key Packages

Package Description
os Core system operations: Filesystem, Git, Network, Process management, and System Profiling.
mos Multi-OS Service layer: Network namespaces, VETH setup, Dashboard UI, and System Facts.
virt Virtualization and Containerization: CloudHypervisor integration and Buildah/Nerdctl wrappers.
clients Integrated API clients for Redis, Postgres, MQTT, VastAI, Hetzner, Mycelium, and more.
crypt Cryptographic primitives, HTTP signatures, and key management (Ed25519, Symmetric).
vault Secure key and address management for various cryptographic applications.
core Common utilities, HeroScript DSL, Text processing, and Logger.
ai AI integration for chat, embeddings, and transcription.

Development & CI

The project uses a multi-stage CI pipeline to ensure both Rust code and Rhai scripts are fully functional.

Build & Management

The project uses a centralized Makefile for all common tasks.

Command Description
make build PKG=<name> Build a specific package (e.g., make build PKG=core)
make install PKG=<name> Build and install a package binary to ~/hero/bin/
make run PKG=<name> Build and run a package binary (e.g., make run PKG=mos)
make docs PKG=<name> Generate documentation for a specific package
make build-all Build all packages in the workspace
make install-all Install all available binaries
make docs-all Generate documentation for all packages
make hero_do Specialized target to build the hero_do shell
make test Run full CI (Rust tests + Rhai scripts)
make test-rust Run Rust unit and integration tests
make test-rhai Run Rhai script tests
make clean Clean all build artifacts

CI Scripts

Script Description
ci.sh Main CI Entry Point: Runs all Rust unit tests and triggers the Rhai CI runner.
ci_rhai.sh Rhai Test Runner: Executes all valid Rhai scripts in the repository with exclusion management and reporting.

Test Tracking

We maintain a real-time status of all Rhai scripts in RHAI_TRACKING.md. This file tracks which scripts are CI-ready, which are intentionally skipped, and their current execution status.

Automation with Rhai

Herolib exposes most of its functionality to the Rhai scripting language. This allows you to write powerful system automation scripts without recompiling Rust code.

Example: Checking Package Installation

if !package_is_installed("git") {
    print("Installing git...");
    package_install("git");
} else {
    print("Git is already installed.");
}

Running Scripts

Use the hero_do command to run any Rhai script:

hero_do path/to/script.rhai

Prerequisites

  • Rust toolchain (latest stable)
  • Git
  • Cargo login (only for maintainers publishing to crates.io)

License

See LICENSE for details.


Happy coding!