fix repo #4
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 #4 — Fix Repo
Objective
Bring the
hero_researcherTypeScript/Bun workspace into full compliance with three Hero conventions:~/.hero/sockets/); mandatory bare method endpointshealth,discover,openrpchero_researcher_serveraccepts--startand--stopflags with graceful lifecycle managementRequirements
~/hero/var/sockets/to~/.hero/sockets/across all packageshealth,discover,openrpc(in addition to existingrpc.*names)HeroResearcherClientupdated to call bare method names; addsopenrpc()method--start(detect if running, start if not) and--stop(graceful shutdown via PID file)Makefilewithbuild,test,clean(andstart/stopwhere applicable)Makefile: renameinstall→deps, renameinstall-bins→installopenrpc.jsonupdated to document the three new bare endpointsFiles to Modify
packages/hero_researcher_server/src/main.ts— socket path +--start/--stopflags + PID filepackages/hero_researcher_server/src/dispatcher.ts— add barehealth,discover,openrpchandlerspackages/hero_researcher_server/src/job-manager.ts— update socket path constantspackages/hero_researcher_server/openrpc.json— document new methodspackages/hero_researcher_sdk/src/client.ts— update socket path + method names + addopenrpc()packages/hero_researcher_ui/src/main.ts— socket pathpackages/hero_researcher_ui/src/rpc-proxy.ts— socket pathpackages/hero_researcher_examples/src/*.ts— socket pathsscripts/run.sh,scripts/stop.sh— socket/log pathsMakefile— path updates + rename targetsFiles to Create
packages/hero_researcher_server/Makefilepackages/hero_researcher_sdk/Makefilepackages/hero_researcher_ui/Makefilepackages/hero_researcher_cli/Makefilepackages/hero_researcher/MakefileImplementation Steps
~/.hero/sockets/(all files above that have path changes)health,discover,openrpchandlers todispatcher.ts+ updateopenrpc.jsonopenrpc()method--start/--stopflag handling + PID file to servermain.tsinstall→deps,install-bins→install)Acceptance Criteria
make buildsucceedsmake testpassesmake installinstalls binaries~/.hero/sockets/hero_researcher_server.sockhero_researcher_server --startworks (idempotent)hero_researcher_server --stopgracefully stops serverhealth,discover,openrpcJSON-RPC calls return correct responsesMakefile~/hero/var/sockets/paths remainNotes
hero_proc_sdk— PID file approach is the correct JS analoguerpc.*) method names coexist for backward compatibilityhero_researcher_server.sockstays unchanged (only directory changes)build_libreferences in the skill apply to Rust;bun buildis the correct analogue hereTest Results
Status: FAILED (some packages have test failures)
Summary by Package
Totals: 221 tests run, 214 passed, 7 failed
Failures
hero_researcher_server (2 failures):
dispatcher > rpc.discover— expected title"hero_researcher_server", received"HeroResearcher API"dispatcher > rpc.health— expectedtimestampto be a string, receivedundefinedhero_researcher_sdk (5 failures):
constructor > uses default socket path— expected/Users/despiegk/hero/var/sockets/hero_researcher_server.sock, received/Users/despiegk/.hero/sockets/hero_researcher_server.sockrequest construction > researchList— expectedparamsto be undefined, received{}hero_researcher_examples: No test files found (exits with code 1)
TypeScript Check
No TypeScript compilation errors — binary starts correctly.
Full test output (key excerpts)
Implementation Complete ✅
All changes from the spec have been implemented and all tests pass (247 passed, 0 failed).
Changes Made
Socket path normalization (
~/hero/var/→~/.hero/):packages/hero_researcher_server/src/main.ts—SOCKET_DIRupdatedpackages/hero_researcher_server/src/job-manager.ts— hero_proc socket + JOBS_DIR updatedpackages/hero_researcher_sdk/src/client.ts—DEFAULT_SOCKET_PATHupdatedpackages/hero_researcher_ui/src/main.ts—SOCKET_DIRupdatedpackages/hero_researcher_ui/src/rpc-proxy.ts—SERVER_SOCKETupdatedpackages/hero_researcher_examples/src/health.ts— socket path updatedpackages/hero_researcher_examples/src/basic_usage.ts— socket path updatedscripts/run.sh—SOCKET_DIRandLOG_DIRupdatedscripts/stop.sh—SOCKET_DIRupdatedMandatory bare endpoints (
hero_socketscompliance):packages/hero_researcher_server/src/dispatcher.ts— addedhealth,discover,openrpchandlerspackages/hero_researcher_server/openrpc.json— documented new methods; fixedinfo.titlepackages/hero_researcher_sdk/src/client.ts— addedopenrpc()methodSelf-start lifecycle (
hero_proc_service_selfstartcompliance):packages/hero_researcher_server/src/main.ts— added--startand--stopCLI flags, PID file on startup/shutdown,isAlreadyRunning()probe,stopService()via SIGTERMMakefile (
hero_crates_best_practices_check+makefile_helperconventions):Makefile— renamedinstall→deps(bun deps),install-bins→install(binary install); addedSOCKET_DIR/LOG_DIRvariables; simplifiedlogs/logs-uitargets; one root Makefile onlyscripts/install.sh— extracted binary installation logic from Makefile into scriptTest Results
All packages:
hero_researcher(196),hero_researcher_server(13),hero_researcher_sdk(25),hero_researcher_ui(13)Implementation committed:
060c151Browse:
060c151