fix repo #58
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_services_archive#58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
check & fix where needed this repo based on
skills
/hero_crates_best_practices_check
/hero_sockets
/hero_proc_service_selfstart
Implementation Spec for Issue #58 — fix repo (v2)
Objective
Audit and fix the
hero_servicesrepository against three skill requirements:hero_crates_best_practices_checkhero_socketshero_proc_service_selfstartIssues Found & Fix Plan
Step 1 — Fix
openrpc.jsonduplicate entryFile:
crates/hero_services_server/openrpc.jsonRemove the duplicate
rpc.discovermethod entry (appears twice in the methods array).Dependencies: none
Step 2 — Remove stale per-crate Makefiles
Files:
crates/hero_services_server/Makefile,crates/hero_services_ui/MakefileThe root
Makefile(at repo root) already handles all build targets. The per-crate Makefiles reference wrong package names that don't exist (hero_services_openrpc,hero_services_http) — delete them.Dependencies: none
Step 3 — Migrate
hero_services_serversocket to HTTP/axum over UDSFiles:
crates/hero_services_server/src/rpc.rs,crates/hero_services_server/Cargo.tomlCurrently the server speaks raw newline-delimited JSON-RPC over its UDS. Per
hero_sockets, it must serve HTTP so GET/health,/manifest,/openrpccan be routed alongside JSON-RPC viaPOST /rpc.axum,tower,hyper,hyper-utilto[dependencies]UnixListenerloop with axum router over UDSGET /health→{"status":"ok"},GET /manifest→ service info,GET /openrpc→ spec,POST /rpc→ existing dispatchDependencies: none
Step 4 — Update
hero_services_sdkclient to HTTP POSTFile:
crates/hero_services_sdk/src/client.rsAfter Step 3, the server expects HTTP. Update the client from raw UDS newline-JSON to HTTP POST over UDS using hyper with Unix connector.
Dependencies: Step 3
Step 5 — Add
--start/--stop/servesubcommands tohero_services_serverFile:
crates/hero_services_server/src/main.rsAdd
Serve,Start,Stopsubcommands.Start/Stopusehero_proc_sdkto register/unregister with hero_proc.serve: long-running daemon (current no-args behavior)start: register service with hero_proc + start itstop: stop service via hero_procDependencies: Step 3
Step 6 — Fix
hero_services_ui: remove TCP, fix endpoints, add subcommandsFiles:
crates/hero_services_ui/src/main.rs— remove TCP port 8800; addserve/start/stopsubcommandscrates/hero_services_ui/src/routes.rs— fix/health→{"status":"ok"}JSON; addGET /manifest; addGET /openrpccrates/hero_services_ui/Cargo.toml— addhero_proc_sdkcrates/hero_services_ui/openrpc.json— create minimal OpenRPC specDependencies: none (parallel with Steps 3–5)
Files to Modify/Create
crates/hero_services_server/openrpc.jsoncrates/hero_services_server/Makefilecrates/hero_services_ui/Makefilecrates/hero_services_server/Cargo.tomlcrates/hero_services_server/src/rpc.rscrates/hero_services_server/src/main.rscrates/hero_services_sdk/src/client.rscrates/hero_services_ui/Cargo.tomlcrates/hero_services_ui/src/main.rscrates/hero_services_ui/src/routes.rscrates/hero_services_ui/openrpc.jsonAcceptance Criteria
hero_services_uidoes not bind any TCP portGET /healthon both sockets returns{"status":"ok"}JSONGET /manifeston both sockets returns service info JSONGET /openrpcon both sockets returns OpenRPC spechero_services_server --startregisters with hero_proc and exits 0hero_services_server --stopunregisters from hero_proc and exits 0hero_services_ui --startregisters with hero_proc and exits 0hero_services_ui --stopunregisters from hero_proc and exits 0hero_services_server servestarts the daemonhero_services_ui servestarts the UI serveropenrpc.jsonhas no duplicate method entriescargo checkpasses for all workspace membersNotes
Test Results
Full output
Implementation committed:
2ea4e4fBrowse:
lhumina_code/hero_services@2ea4e4fChanges summary:
hero_services_server: migrated UDS transport to HTTP/axum; addedGET /health,/manifest,/openrpc; addedserve/start/stopsubcommandshero_services_ui: removed TCP listener (port 8800); fixed/healthJSON; added/manifest,/openrpc; addedserve/start/stopsubcommands; createdopenrpc.jsonhero_services_sdk: switched client from raw newline-JSON to HTTP POST over UDSopenrpc.json: removed duplicaterpc.discoverentryTests: 23/23 unit tests pass.
cargo checkclean across all workspace members.