No description
  • Rust 99.3%
  • JavaScript 0.4%
  • HTML 0.2%
Find a file
Timur Gordon 19bd3498a4
Some checks failed
Build and Test / build (push) Failing after 1m5s
Build and Test / build (pull_request) Failing after 1m28s
fix: use compile-time path for seed dir auto-detection
Fall back to CARGO_MANIFEST_DIR when CWD isn't the workspace root,
so auto-seeding works when hero_services runs the binary from any
directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:38:56 +01:00
.forgejo/workflows ci: restrict test triggers to PRs and push to development/main 2026-02-11 19:10:03 -05:00
crates fix: use compile-time path for seed dir auto-detection 2026-02-24 14:38:56 +01:00
data/mock feat: raw JSON-RPC transport, correct binary naming, dual-bind HTTP 2026-02-24 11:54:41 +01:00
docs feat: raw JSON-RPC transport, correct binary naming, dual-bind HTTP 2026-02-24 11:54:41 +01:00
examples refactor: migrate from herolib_osis to hero_rpc_osis 2026-02-17 07:18:34 +01:00
http: chore: regenerate SDK with updated herolib deps 2026-02-13 01:37:26 +01:00
schemas feat: raw JSON-RPC transport, correct binary naming, dual-bind HTTP 2026-02-24 11:54:41 +01:00
scripts feat: add stable SIDs to all mock seed files for idempotent seeding 2026-02-11 21:14:53 -05:00
sdk refactor: migrate from herolib_osis to hero_rpc_osis 2026-02-17 07:18:34 +01:00
src feat: restructure hero_osis to 5-crate workspace 2026-02-23 20:12:05 +01:00
static feat: socket-per-context, hero_osis_ui crate, restructure plan 2026-02-23 18:55:08 +01:00
tests fix: correct e2e test URLs — context is 'root' not 'hero_osis' 2026-02-11 21:50:52 -05:00
.gitignore feat: change default context from hero_osis to root 2026-02-05 09:24:08 +01:00
buildenv.sh fix: hero_indexer port reference 3388→3386 2026-02-11 15:39:56 -05:00
Cargo.lock fix: admin UI context loading, Axum route syntax, mock seeding 2026-02-24 14:17:14 +01:00
Cargo.toml fix: remove [patch] section so builds work outside dev workspace 2026-02-24 12:22:34 +01:00
Dockerfile fix: healthcheck uses /api instead of / (root returns 404) 2026-02-09 10:26:50 -05:00
LICENSE Initial commit: Hero Osis OpenRPC Server 2026-02-04 20:23:30 +01:00
Makefile fix: admin UI context loading, Axum route syntax, mock seeding 2026-02-24 14:17:14 +01:00
README.md feat: Unix socket support, remove dotenvy 2026-02-16 02:57:34 +01:00

HeroOsis

A human-centric backend server entirely generated from schema definitions using OSIS (Object Storage with SmartID).

Quick Start

make run      # Build and run server
make dev      # Run with debug logging
make help     # Show all available commands

Server runs at http://127.0.0.1:3377/api:

  • RPC endpoints: /api/hero_osis/{domain}/rpc
  • DB Inspector: /api/hero_osis/{domain}/inspector

How It Works

HeroOsis is built on a schema-first architecture. All types, storage, RPC handlers, and documentation are auto-generated from .oschema files in specs/schemas/.

specs/schemas/{domain}/*.oschema  →  build.rs  →  Generated Code
                                         ↓
                    ┌────────────────────┼────────────────────┐
                    ↓                    ↓                    ↓
            src/{domain}/         sdk/rust/src/        docs/schemas/
            - types_generated.rs  - client code        - API docs
            - rpc_generated.rs
            - osis_server.rs

The herolib-osis crate handles:

  • OSchema parsing - Schema language for defining types
  • Code generation - Rust structs, builders, CRUD methods
  • Storage - Filesystem-based with SmartID identifiers
  • Full-text search - Tantivy-powered indexing
  • RPC server - JSON-RPC endpoints per domain

Example Schema

# specs/schemas/business/company.oschema
Company = {
    sid: sid                    # SmartID (auto-generated)
    name: str [rootobject]      # Marks as storable type, indexed
    description?: str [index]   # Optional, full-text indexed
    website?: str
    country?: str
    active: bool
    tags: [str]
}

Running cargo build generates:

  • Company struct with all fields
  • OsisBusiness handler with CRUD methods
  • RPC endpoint at /api/hero_osis/business/rpc
  • SDK client code

Domains

Domains are logical groupings of related types. Each domain compiles independently via feature flags.

Domain Description
calendar Events, planning, scheduling
files Documents, folders, sharing
finance Money, payments, transactions
communication Messages, channels, notifications
identity Profiles, sessions, contacts
projects Tasks, issues, requirements
code Source code, changes, releases
business CRM, deals, contracts
network Network nodes, marketplace
settings User preferences

Environment Variables

Variable Default Description
HERO_OSIS_BIND 127.0.0.1:3377 Server bind address (TCP or unix:/path/to.sock)
HERO_OSIS_DATA_DIR ~/hero/var/hero_osis/data Data directory
HERO_OSIS_SEED_DIR - Seed directory for auto-seeding

When managed by hero_zero, HERO_OSIS_BIND is set to unix:~/hero/var/sockets/hero_osis.sock and the service is accessed through hero_proxy at http://localhost:8080/hero_osis/api/.... For local development (make run), the default TCP address is used. See hero_zero sockets docs for the full architecture.

Seeding Data

make seed    # Seed from ./data/mock

Seed files are TOML with a _type field:

_type = "Company"
name = "ACME Corporation"
country = "US"
active = true

Important: For types with nested objects (like Theme), all top-level fields must come BEFORE [section] headers. See Seeding Documentation for details and common pitfalls.

RPC Usage

curl -X POST http://127.0.0.1:3377/api/hero_osis/business/rpc \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":"1","method":"company.list","params":{}}'

Methods: {type}.new, {type}.get, {type}.set, {type}.delete, {type}.list, {type}.find

Adding a New Domain

  1. Create schemas in specs/schemas/{domain}/*.oschema
  2. Add feature flag to Cargo.toml
  3. Register domain in build.rs
  4. Add handler in src/bin/server.rs
  5. Run cargo build

Resources

License

Apache-2.0