fix repo #13

Open
opened 2026-03-20 06:58:27 +00:00 by despiegk · 4 comments
Owner

check & fix where needed this repo based on

skills

/hero_crates_best_practices_check
/hero_sockets
/hero_proc_service_selfstart

check & fix where needed this repo based on skills /hero_crates_best_practices_check /hero_sockets /hero_proc_service_selfstart
Author
Owner

Implementation Spec — Issue #13: Fix Repo

Objective

Audit and fix the hero_embedder workspace to conform to three skill standards:

  1. hero_crates_best_practices_check — multi-crate architecture, Makefile conventions, binary naming
  2. hero_sockets — Unix Domain Socket, mandatory /health, /.well-known/heroservice.json, /rpc, /openrpc.json endpoints
  3. hero_proc_service_selfstartstart/stop/serve subcommands via HeroLifecycle

Gaps Found

Category 1: Crate Structure

  • buildenv.sh BINARIES missing hero_embedder_proxy
  • crates/hero_embedder_proxy/ has no Makefile

Category 2: Sockets

  • hero_embedder_ui socket missing /.well-known/heroservice.json endpoint
  • hero_embedder_ui socket missing /openrpc.json endpoint

Category 3: hero_proc_service_selfstart

  • hero_embedder_proxy has no start/stop/serve subcommands (bare binary, no HeroLifecycle)
  • hero_embedder_proxy/Cargo.toml missing hero_rpc_server dependency

Category 4: Compile Issues

  • hero_embedder_server/src/main.rs missing use std::path::Path; import (bare Path::new at line ~294)

Files to Modify / Create

File Change
crates/hero_embedder_server/src/main.rs Add Path to import
crates/hero_embedder_ui/src/main.rs Add /.well-known/heroservice.json and /openrpc.json routes
crates/hero_embedder_ui/heroservice.json Create UI socket discovery manifest
crates/hero_embedder_ui/openrpc.json Create minimal OpenRPC stub
crates/hero_embedder_proxy/Cargo.toml Add hero_rpc_server dependency
crates/hero_embedder_proxy/src/main.rs Add HeroLifecycle + LifecycleCommand + Serve subcommand
crates/hero_embedder_proxy/Makefile Create standard crate Makefile
buildenv.sh Add hero_embedder_proxy to BINARIES

Implementation Plan

Step 1 — Fix compile error: Path import in server

Files: crates/hero_embedder_server/src/main.rs

  • Change use std::path::PathBuf;use std::path::{Path, PathBuf};
  • Dependencies: none

Step 2 — Add heroservice.json + openrpc.json to UI socket

Files: crates/hero_embedder_ui/heroservice.json (create), crates/hero_embedder_ui/openrpc.json (create), crates/hero_embedder_ui/src/main.rs (modify)

  • Create static JSON files
  • Add HEROSERVICE_JSON and OPENRPC_JSON static string includes
  • Add heroservice_handler() and openrpc_handler() functions
  • Register /.well-known/heroservice.json and /openrpc.json routes
  • Dependencies: none

Step 3 — Add lifecycle management to hero_embedder_proxy

Files: crates/hero_embedder_proxy/Cargo.toml, crates/hero_embedder_proxy/src/main.rs

  • Add hero_rpc_server git dependency
  • Replace bare Args struct with Cli having Lifecycle(LifecycleCommand) and Serve subcommands
  • Move run logic into run_proxy() async function
  • Add HeroLifecycle::new("hero_embedder_proxy", ...) + dispatch in main()
  • Dependencies: none (parallel with Step 2)

Step 4 — Create Makefile for hero_embedder_proxy

Files: crates/hero_embedder_proxy/Makefile (create)

  • Standard build, check, test, clippy, fmt targets
  • Dependencies: none (parallel with Steps 2 & 3)

Step 5 — Add hero_embedder_proxy to buildenv.sh BINARIES

Files: buildenv.sh

  • Add hero_embedder_proxy to BINARIES export
  • Dependencies: none

Acceptance Criteria

  • cargo check --workspace passes with zero errors
  • hero_embedder_server exposes all 4 mandatory endpoints
  • hero_embedder_ui exposes all 4 mandatory endpoints (including new heroservice + openrpc)
  • hero_embedder_proxy start/stop work via hero_proc
  • hero_embedder_proxy is installed by make install
  • crates/hero_embedder_proxy/Makefile exists with standard targets

Post this as a comment using:

curl -s -X POST \
  -H "Authorization: token $FORGEJO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"body": "<spec_content>"}' \
  "https://forge.ourworld.tf/api/v1/repos/lhumina_code/hero_embedder/issues/13/comments"
## Implementation Spec — Issue #13: Fix Repo ### Objective Audit and fix the `hero_embedder` workspace to conform to three skill standards: 1. **hero_crates_best_practices_check** — multi-crate architecture, Makefile conventions, binary naming 2. **hero_sockets** — Unix Domain Socket, mandatory `/health`, `/.well-known/heroservice.json`, `/rpc`, `/openrpc.json` endpoints 3. **hero_proc_service_selfstart** — `start`/`stop`/`serve` subcommands via `HeroLifecycle` --- ### Gaps Found #### Category 1: Crate Structure - ❌ `buildenv.sh` BINARIES missing `hero_embedder_proxy` - ❌ `crates/hero_embedder_proxy/` has no Makefile #### Category 2: Sockets - ❌ `hero_embedder_ui` socket missing `/.well-known/heroservice.json` endpoint - ❌ `hero_embedder_ui` socket missing `/openrpc.json` endpoint #### Category 3: hero_proc_service_selfstart - ❌ `hero_embedder_proxy` has no `start`/`stop`/`serve` subcommands (bare binary, no HeroLifecycle) - ❌ `hero_embedder_proxy/Cargo.toml` missing `hero_rpc_server` dependency #### Category 4: Compile Issues - ❌ `hero_embedder_server/src/main.rs` missing `use std::path::Path;` import (bare `Path::new` at line ~294) --- ### Files to Modify / Create | File | Change | |---|---| | `crates/hero_embedder_server/src/main.rs` | Add `Path` to import | | `crates/hero_embedder_ui/src/main.rs` | Add `/.well-known/heroservice.json` and `/openrpc.json` routes | | `crates/hero_embedder_ui/heroservice.json` | Create UI socket discovery manifest | | `crates/hero_embedder_ui/openrpc.json` | Create minimal OpenRPC stub | | `crates/hero_embedder_proxy/Cargo.toml` | Add `hero_rpc_server` dependency | | `crates/hero_embedder_proxy/src/main.rs` | Add `HeroLifecycle` + `LifecycleCommand` + `Serve` subcommand | | `crates/hero_embedder_proxy/Makefile` | Create standard crate Makefile | | `buildenv.sh` | Add `hero_embedder_proxy` to `BINARIES` | --- ### Implementation Plan #### Step 1 — Fix compile error: `Path` import in server **Files:** `crates/hero_embedder_server/src/main.rs` - Change `use std::path::PathBuf;` → `use std::path::{Path, PathBuf};` - **Dependencies:** none #### Step 2 — Add heroservice.json + openrpc.json to UI socket **Files:** `crates/hero_embedder_ui/heroservice.json` (create), `crates/hero_embedder_ui/openrpc.json` (create), `crates/hero_embedder_ui/src/main.rs` (modify) - Create static JSON files - Add `HEROSERVICE_JSON` and `OPENRPC_JSON` static string includes - Add `heroservice_handler()` and `openrpc_handler()` functions - Register `/.well-known/heroservice.json` and `/openrpc.json` routes - **Dependencies:** none #### Step 3 — Add lifecycle management to hero_embedder_proxy **Files:** `crates/hero_embedder_proxy/Cargo.toml`, `crates/hero_embedder_proxy/src/main.rs` - Add `hero_rpc_server` git dependency - Replace bare `Args` struct with `Cli` having `Lifecycle(LifecycleCommand)` and `Serve` subcommands - Move run logic into `run_proxy()` async function - Add `HeroLifecycle::new("hero_embedder_proxy", ...)` + dispatch in `main()` - **Dependencies:** none (parallel with Step 2) #### Step 4 — Create Makefile for hero_embedder_proxy **Files:** `crates/hero_embedder_proxy/Makefile` (create) - Standard `build`, `check`, `test`, `clippy`, `fmt` targets - **Dependencies:** none (parallel with Steps 2 & 3) #### Step 5 — Add hero_embedder_proxy to buildenv.sh BINARIES **Files:** `buildenv.sh` - Add `hero_embedder_proxy` to `BINARIES` export - **Dependencies:** none --- ### Acceptance Criteria - [ ] `cargo check --workspace` passes with zero errors - [ ] `hero_embedder_server` exposes all 4 mandatory endpoints - [ ] `hero_embedder_ui` exposes all 4 mandatory endpoints (including new heroservice + openrpc) - [ ] `hero_embedder_proxy start/stop` work via `hero_proc` - [ ] `hero_embedder_proxy` is installed by `make install` - [ ] `crates/hero_embedder_proxy/Makefile` exists with standard targets --- Post this as a comment using: ```bash curl -s -X POST \ -H "Authorization: token $FORGEJO_TOKEN" \ -H "Content-Type: application/json" \ -d '{"body": "<spec_content>"}' \ "https://forge.ourworld.tf/api/v1/repos/lhumina_code/hero_embedder/issues/13/comments" ```
Author
Owner

Implementation Spec (Revised) — Issue #13: Fix Repo

Objective

Audit and fix the hero_embedder workspace to conform to three skill standards:

  1. hero_crates_best_practices_check — multi-crate architecture, build conventions, binary naming
  2. hero_sockets — Unix Domain Socket, mandatory /health, /.well-known/heroservice.json, /rpc, /openrpc.json endpoints
  3. hero_proc_service_selfstartstart/stop/serve subcommands via HeroLifecycle

Note: The Makefile lives at the repo root only (no per-crate Makefiles). Step 4 from the previous spec is dropped.


Gaps Found

Category 1: Crate Structure

  • buildenv.sh BINARIES missing hero_embedder_proxy

Category 2: Sockets

  • hero_embedder_ui socket missing /.well-known/heroservice.json endpoint
  • hero_embedder_ui socket missing /openrpc.json endpoint

Category 3: hero_proc_service_selfstart

  • hero_embedder_proxy has no start/stop/serve subcommands (bare binary, no HeroLifecycle)
  • hero_embedder_proxy/Cargo.toml missing hero_rpc_server dependency

Category 4: Compile Issues

  • hero_embedder_server/src/main.rs missing use std::path::Path; import

Files to Modify / Create

File Change
crates/hero_embedder_server/src/main.rs Add Path to import
crates/hero_embedder_ui/src/main.rs Add /.well-known/heroservice.json and /openrpc.json routes
crates/hero_embedder_ui/heroservice.json Create UI socket discovery manifest
crates/hero_embedder_ui/openrpc.json Create minimal OpenRPC stub
crates/hero_embedder_proxy/Cargo.toml Add hero_rpc_server dependency
crates/hero_embedder_proxy/src/main.rs Add HeroLifecycle + LifecycleCommand + Serve subcommand
buildenv.sh Add hero_embedder_proxy to BINARIES

Implementation Plan (4 steps)

Step 1 — Fix compile error: Path import in server

Files: crates/hero_embedder_server/src/main.rs

  • Change use std::path::PathBuf;use std::path::{Path, PathBuf};
  • Dependencies: none

Step 2 — Add heroservice.json + openrpc.json to UI socket

Files: crates/hero_embedder_ui/heroservice.json (create), crates/hero_embedder_ui/openrpc.json (create), crates/hero_embedder_ui/src/main.rs (modify)

  • Create static JSON files
  • Add static string includes + route handlers
  • Register /.well-known/heroservice.json and /openrpc.json routes
  • Dependencies: none (parallel with Step 3)

Step 3 — Add lifecycle management to hero_embedder_proxy

Files: crates/hero_embedder_proxy/Cargo.toml, crates/hero_embedder_proxy/src/main.rs

  • Add hero_rpc_server git dependency
  • Replace bare Args with Cli having Lifecycle(LifecycleCommand) and Serve subcommands
  • Move run logic into run_proxy() async fn
  • Dependencies: none (parallel with Step 2)

Step 4 — Add hero_embedder_proxy to buildenv.sh BINARIES

Files: buildenv.sh

  • Add hero_embedder_proxy to BINARIES export
  • Dependencies: none

Acceptance Criteria

  • cargo check --workspace passes with zero errors
  • hero_embedder_ui exposes /.well-known/heroservice.json and /openrpc.json
  • hero_embedder_proxy start/stop work via hero_proc
  • hero_embedder_proxy is installed by make install (in BINARIES)
## Implementation Spec (Revised) — Issue #13: Fix Repo ### Objective Audit and fix the `hero_embedder` workspace to conform to three skill standards: 1. **hero_crates_best_practices_check** — multi-crate architecture, build conventions, binary naming 2. **hero_sockets** — Unix Domain Socket, mandatory `/health`, `/.well-known/heroservice.json`, `/rpc`, `/openrpc.json` endpoints 3. **hero_proc_service_selfstart** — `start`/`stop`/`serve` subcommands via `HeroLifecycle` > Note: The Makefile lives at the repo root only (no per-crate Makefiles). Step 4 from the previous spec is dropped. --- ### Gaps Found #### Category 1: Crate Structure - ❌ `buildenv.sh` BINARIES missing `hero_embedder_proxy` #### Category 2: Sockets - ❌ `hero_embedder_ui` socket missing `/.well-known/heroservice.json` endpoint - ❌ `hero_embedder_ui` socket missing `/openrpc.json` endpoint #### Category 3: hero_proc_service_selfstart - ❌ `hero_embedder_proxy` has no `start`/`stop`/`serve` subcommands (bare binary, no HeroLifecycle) - ❌ `hero_embedder_proxy/Cargo.toml` missing `hero_rpc_server` dependency #### Category 4: Compile Issues - ❌ `hero_embedder_server/src/main.rs` missing `use std::path::Path;` import --- ### Files to Modify / Create | File | Change | |---|---| | `crates/hero_embedder_server/src/main.rs` | Add `Path` to import | | `crates/hero_embedder_ui/src/main.rs` | Add `/.well-known/heroservice.json` and `/openrpc.json` routes | | `crates/hero_embedder_ui/heroservice.json` | Create UI socket discovery manifest | | `crates/hero_embedder_ui/openrpc.json` | Create minimal OpenRPC stub | | `crates/hero_embedder_proxy/Cargo.toml` | Add `hero_rpc_server` dependency | | `crates/hero_embedder_proxy/src/main.rs` | Add `HeroLifecycle` + `LifecycleCommand` + `Serve` subcommand | | `buildenv.sh` | Add `hero_embedder_proxy` to `BINARIES` | --- ### Implementation Plan (4 steps) #### Step 1 — Fix compile error: `Path` import in server **Files:** `crates/hero_embedder_server/src/main.rs` - Change `use std::path::PathBuf;` → `use std::path::{Path, PathBuf};` - **Dependencies:** none #### Step 2 — Add heroservice.json + openrpc.json to UI socket **Files:** `crates/hero_embedder_ui/heroservice.json` (create), `crates/hero_embedder_ui/openrpc.json` (create), `crates/hero_embedder_ui/src/main.rs` (modify) - Create static JSON files - Add static string includes + route handlers - Register `/.well-known/heroservice.json` and `/openrpc.json` routes - **Dependencies:** none (parallel with Step 3) #### Step 3 — Add lifecycle management to hero_embedder_proxy **Files:** `crates/hero_embedder_proxy/Cargo.toml`, `crates/hero_embedder_proxy/src/main.rs` - Add `hero_rpc_server` git dependency - Replace bare `Args` with `Cli` having `Lifecycle(LifecycleCommand)` and `Serve` subcommands - Move run logic into `run_proxy()` async fn - **Dependencies:** none (parallel with Step 2) #### Step 4 — Add hero_embedder_proxy to buildenv.sh BINARIES **Files:** `buildenv.sh` - Add `hero_embedder_proxy` to `BINARIES` export - **Dependencies:** none --- ### Acceptance Criteria - [ ] `cargo check --workspace` passes with zero errors - [ ] `hero_embedder_ui` exposes `/.well-known/heroservice.json` and `/openrpc.json` - [ ] `hero_embedder_proxy start/stop` work via `hero_proc` - [ ] `hero_embedder_proxy` is installed by `make install` (in BINARIES)
Author
Owner

Cargo Check Results

Status: PASS

Output:

Finished `dev` profile [unoptimized + debuginfo] target(s) in 46.19s

All workspace crates checked successfully:
- hero_embedder_lib
- hero_embedder_sdk
- hero_embedder_examples
- hero_embedder
- hero_embedder_proxy
- hero_embedder_ui
- hero_embedder_server
## Cargo Check Results **Status:** PASS **Output:** ``` Finished `dev` profile [unoptimized + debuginfo] target(s) in 46.19s All workspace crates checked successfully: - hero_embedder_lib - hero_embedder_sdk - hero_embedder_examples - hero_embedder - hero_embedder_proxy - hero_embedder_ui - hero_embedder_server ```
Author
Owner

Implementation committed: 2564163

Browse: 2564163

Implementation committed: `2564163` Browse: https://forge.ourworld.tf/lhumina_code/hero_embedder/commit/2564163
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
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_embedder#13
No description provided.