rename & some refactor #14
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
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_router#14
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?
rename to use hero_router
change all references to it, check everywhere
also go over /Users/despiegk/hero/code/hero_skills/claude
to make sure all renames done
changes
$servicename/rpc endpoint
should be implemented in hero_router and goes to right rpc socket see /hero_sockets
so basically we no longer use an implemented proxy we have the router to automatically connect this
$servicename/admin endpoint
this only works if context = 0
a new endpoint which is for admin UI, which is the $name_ui component normally but not relevant here
see /hero_sockets where its mapped
$HERO_SOCKET_DIR/<service_name>/ui.sock
this means we have automatic mapping between admin
don't forget to set X-Forwarded-Prefix to $servicename/admin
because otherwise the UI won't work
set X-Hero-Context = 0 because is always the admin
because this is for admin interface
make sure X-Hero-Claims is not set, because we are admin
$servicename/$webname endpoint
$HERO_SOCKET_DIR/<service_name>/web_$webname.sock
don't forget to set X-Forwarded-Prefix
context awareness
see skill /hero_context
a hero_router is always started in a context --context 8
when starting it
this context is available and set X-Hero-Context for every request to backend
Implementation Spec for Issue #14: Rename hero_inspector to hero_router
Objective
Rename the
hero_inspectorproject/crate hierarchy tohero_router, update all internal references, and refactor the routing logic to implement automatic socket-based routing for three endpoint types:$servicename/rpc,$servicename/admin, and$servicename/$webname. Add context awareness sohero_routerinjectsX-Hero-Contexton every proxied request.Requirements
herolib_inspector→herolib_router,hero_inspector_server→hero_router_server,hero_inspector_ui→hero_router_ui,hero_inspector_sdk→hero_router_sdk,hero_inspector_examples→hero_router_examples/$servicename/rpc→$HERO_SOCKET_DIR/<service_name>/rpc.sock/$servicename/admin→$HERO_SOCKET_DIR/<service_name>/ui.sock(context==0 only, setX-Forwarded-Prefix,X-Hero-Context=0, noX-Hero-Claims)/$servicename/$webname→$HERO_SOCKET_DIR/<service_name>/web_$webname.sock(setX-Forwarded-Prefix)--context <N>CLI arg; injectX-Hero-Contexton every requesthero_inspectorImplementation Plan (11 Steps)
crates/hero_inspector*tocrates/hero_router*InspectorConfig→RouterConfig,InspectorCache→RouterCache, etc./$svc/rpc,/$svc/admin,/$svc/$webnamewith proper header injection--contextCLI argument — pass through config, injectX-Hero-Context/Users/despiegk/hero/code/hero_skills/claudecargo build/test/clippyAcceptance Criteria
cargo build --workspacecompilescargo test --workspacepasses/rpc,/admin,/$webname) route correctly with proper headers--contextCLI arg works and injectsX-Hero-ContextNotes
inspector.*torouter.*(breaking change)INSPECTOR_*toROUTER_*Implementation Complete
Build & Test Results
cargo build --workspace— PASSEDcargo test --workspace— PASSED (0 test failures)cargo clippy --workspace -- -D warnings— PASSEDChanges Summary
Rename (hero_inspector → hero_router):
hero_inspector*→hero_router*InspectorConfig→RouterConfig,InspectorCache→RouterCache, etc.inspector.*→router.*(15 methods)HeroInspectorClient→HeroRouterClientINSPECTOR_*→ROUTER_*New Routing Endpoints:
/$servicename/rpc→$HERO_SOCKET_DIR/<service>/rpc.sock(with X-Hero-Context)/$servicename/admin→$HERO_SOCKET_DIR/<service>/ui.sock(context==0 only, X-Hero-Context=0, no X-Hero-Claims)/$servicename/$webname→$HERO_SOCKET_DIR/<service>/web_$webname.sock(with X-Forwarded-Prefix)Context Awareness:
--context <N>CLI argument to all binariesScanner Update:
<service>/rpc.sock,ui.sock,web_*.sock)*_server.sock,*_ui.sock)Skill Files Updated (6 files):
Implementation committed:
6c93792Browse:
lhumina_code/hero_inspector@6c93792