Fresh start: merge TTY, polish, squash to single initial commit #1

Closed
opened 2026-03-17 15:13:21 +00:00 by timur · 1 comment
Owner

Context

hero_init was forked from geomind_code/zinit. Per Kristof: zinit splits into my_init (simplified, for zos) and hero_init (advanced, for Hero OS). The fork carries zinit history — we want a clean start.

Plan

Step 1: Merge TTY feature

  • Merge development_tty2 into development_home27 (which has the zinit→hero_init rename)
  • Resolve any conflicts from the rename
  • Verify TTY features work with hero_init naming

Step 2: Polish

  • Ensure ALL references are hero_init (binary names, socket paths, env vars, docs)
  • Fix any broken tests
  • Update README.md for hero_init identity
  • Clean up ARCHITECTURE.md
  • Remove any zinit-specific artifacts
  • cargo test and cargo clippy clean

Step 3: Verify integration

  • Confirm hero_service in hero_rpc works with polished hero_init_sdk
  • Test full lifecycle (run/start/stop/status/logs)

Step 4: Squash history

  • Create orphan branch with single commit of entire polished codebase
  • Force-push as new development and main
  • Result: clean repo, no zinit history, single commit

hero_init keeps advanced features (vs my_init which strips them)

  • Jobs (one-shot tasks with DAG dependencies)
  • TTY/PTY support (interactive processes, WebSocket attach, xterm.js)
  • OpenRPC API (no TOML format, all programmatic)
  • Scheduling (cron), secrets management
  • Web UI with terminal

Crates

Crate Purpose
hero_init CLI binary (TUI, commands)
hero_init_server Server (process supervisor, RPC)
hero_init_sdk Rust SDK client
hero_init_lib Core library (DB, types)
hero_init_ui Web UI (dashboard, WebSocket terminal)
hero_init_pid1 PID 1 for containers
## Context hero_init was forked from geomind_code/zinit. Per Kristof: zinit splits into my_init (simplified, for zos) and hero_init (advanced, for Hero OS). The fork carries zinit history — we want a clean start. ## Plan ### Step 1: Merge TTY feature - Merge `development_tty2` into `development_home27` (which has the zinit→hero_init rename) - Resolve any conflicts from the rename - Verify TTY features work with hero_init naming ### Step 2: Polish - Ensure ALL references are hero_init (binary names, socket paths, env vars, docs) - Fix any broken tests - Update README.md for hero_init identity - Clean up ARCHITECTURE.md - Remove any zinit-specific artifacts - `cargo test` and `cargo clippy` clean ### Step 3: Verify integration - Confirm `hero_service` in hero_rpc works with polished hero_init_sdk - Test full lifecycle (run/start/stop/status/logs) ### Step 4: Squash history - Create orphan branch with single commit of entire polished codebase - Force-push as new `development` and `main` - Result: clean repo, no zinit history, single commit ## hero_init keeps advanced features (vs my_init which strips them) - Jobs (one-shot tasks with DAG dependencies) - TTY/PTY support (interactive processes, WebSocket attach, xterm.js) - OpenRPC API (no TOML format, all programmatic) - Scheduling (cron), secrets management - Web UI with terminal ## Crates | Crate | Purpose | |-------|--------| | hero_init | CLI binary (TUI, commands) | | hero_init_server | Server (process supervisor, RPC) | | hero_init_sdk | Rust SDK client | | hero_init_lib | Core library (DB, types) | | hero_init_ui | Web UI (dashboard, WebSocket terminal) | | hero_init_pid1 | PID 1 for containers |
Author
Owner

Detailed Implementation Plan

Prerequisites

  • hero_init repo: forge.ourworld.tf/lhumina_code/hero_init (forked from zinit)
  • Branch development_home27: has full zinit→hero_init rename (224 files, compiles clean)
  • Branch development_tty2: has TTY/PTY feature (from zinit)

Step 1: Merge TTY into renamed codebase

git checkout development_home27
git merge development_tty2
# Resolve conflicts — TTY branch has zinit names, development_home27 has hero_init names
# For each conflict: take the hero_init naming, keep the TTY code changes
# Then re-run the rename on any new files from TTY branch:
find . -type f \( -name "*.rs" -o -name "*.toml" \) ! -path "./target/*" | xargs sed -i s/zinit/hero_init/g etc.
cargo check --workspace

Key TTY files to merge:

  • crates/hero_init_server/src/supervisor/executor.rs — PTY spawning path
  • crates/hero_init_server/src/rpc/ — new PTY registry, attach endpoint
  • crates/hero_init_server/src/web.rs — WebSocket endpoint
  • crates/hero_init_ui/ — xterm.js terminal component
  • crates/hero_init/src/cli/attach subcommand
  • crates/hero_init_lib/tty: bool field on ActionSpec

Step 2: Polish

  1. README.md — rewrite for hero_init identity:

    • What it is (Hero OS process supervisor)
    • How it differs from my_init (advanced features)
    • Quick start
    • Crate overview
  2. ARCHITECTURE.md — clean overview:

    • Crate dependency graph
    • Server architecture (supervisor, executor, RPC, scheduler)
    • Socket convention (~/hero/var/sockets/hero_init_server.sock)
    • DB backend (SQLite, single source of truth)
    • OpenRPC API surface
  3. Cargo.toml — update:

    • Repository URL → lhumina_code/hero_init
    • Description → Hero OS process supervisor
    • Remove any geomind_code references
  4. Binary names — verify:

    • hero_init (CLI)
    • hero_init_server (server)
    • hero_init_ui (web UI)
    • hero_init_pid1 (container init)
  5. Tests — fix and verify:

    • cargo test --workspace
    • cargo clippy --workspace
    • Integration tests compile

Step 3: Verify hero_service integration

cd hero_rpc
# hero_service depends on hero_init_sdk
cargo check -p hero_service
# Test lifecycle commands work
cargo run -p hero_service -- status

Step 4: Squash to initial commit

git checkout --orphan fresh-start
git add -A
git commit -m "Initial commit: hero_init — Hero OS process supervisor

Forked from zinit, renamed, with TTY/PTY support.
All OpenRPC, no TOML format. Advanced features for Hero OS.

Crates: hero_init, hero_init_server, hero_init_sdk,
        hero_init_lib, hero_init_ui, hero_init_pid1"

# Replace branches
git branch -D development
git branch -D main
git branch -m development
git checkout -b main
git push --force origin development main

Verification Checklist

  • All crates compile (cargo check --workspace)
  • No zinit references remain (grep -r zinit --include="*.rs" --include="*.toml")
  • TTY feature works (attach to interactive process)
  • hero_service in hero_rpc compiles with hero_init_sdk
  • README.md is accurate and complete
  • ARCHITECTURE.md exists and is clear
  • Single commit on development and main branches
  • No zinit git history
## Detailed Implementation Plan ### Prerequisites - hero_init repo: `forge.ourworld.tf/lhumina_code/hero_init` (forked from zinit) - Branch `development_home27`: has full zinit→hero_init rename (224 files, compiles clean) - Branch `development_tty2`: has TTY/PTY feature (from zinit) ### Step 1: Merge TTY into renamed codebase ```bash git checkout development_home27 git merge development_tty2 # Resolve conflicts — TTY branch has zinit names, development_home27 has hero_init names # For each conflict: take the hero_init naming, keep the TTY code changes # Then re-run the rename on any new files from TTY branch: find . -type f \( -name "*.rs" -o -name "*.toml" \) ! -path "./target/*" | xargs sed -i s/zinit/hero_init/g etc. cargo check --workspace ``` Key TTY files to merge: - `crates/hero_init_server/src/supervisor/executor.rs` — PTY spawning path - `crates/hero_init_server/src/rpc/` — new PTY registry, attach endpoint - `crates/hero_init_server/src/web.rs` — WebSocket endpoint - `crates/hero_init_ui/` — xterm.js terminal component - `crates/hero_init/src/cli/` — `attach` subcommand - `crates/hero_init_lib/` — `tty: bool` field on ActionSpec ### Step 2: Polish 1. **README.md** — rewrite for hero_init identity: - What it is (Hero OS process supervisor) - How it differs from my_init (advanced features) - Quick start - Crate overview 2. **ARCHITECTURE.md** — clean overview: - Crate dependency graph - Server architecture (supervisor, executor, RPC, scheduler) - Socket convention (`~/hero/var/sockets/hero_init_server.sock`) - DB backend (SQLite, single source of truth) - OpenRPC API surface 3. **Cargo.toml** — update: - Repository URL → lhumina_code/hero_init - Description → Hero OS process supervisor - Remove any geomind_code references 4. **Binary names** — verify: - `hero_init` (CLI) - `hero_init_server` (server) - `hero_init_ui` (web UI) - `hero_init_pid1` (container init) 5. **Tests** — fix and verify: - `cargo test --workspace` - `cargo clippy --workspace` - Integration tests compile ### Step 3: Verify hero_service integration ```bash cd hero_rpc # hero_service depends on hero_init_sdk cargo check -p hero_service # Test lifecycle commands work cargo run -p hero_service -- status ``` ### Step 4: Squash to initial commit ```bash git checkout --orphan fresh-start git add -A git commit -m "Initial commit: hero_init — Hero OS process supervisor Forked from zinit, renamed, with TTY/PTY support. All OpenRPC, no TOML format. Advanced features for Hero OS. Crates: hero_init, hero_init_server, hero_init_sdk, hero_init_lib, hero_init_ui, hero_init_pid1" # Replace branches git branch -D development git branch -D main git branch -m development git checkout -b main git push --force origin development main ``` ### Verification Checklist - [ ] All crates compile (`cargo check --workspace`) - [ ] No zinit references remain (`grep -r zinit --include="*.rs" --include="*.toml"`) - [ ] TTY feature works (attach to interactive process) - [ ] hero_service in hero_rpc compiles with hero_init_sdk - [ ] README.md is accurate and complete - [ ] ARCHITECTURE.md exists and is clear - [ ] Single commit on development and main branches - [ ] No zinit git history
timur closed this issue 2026-03-18 08:49:43 +00:00
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_proc_archive#1
No description provided.