WIP: fix: use std::sync::RwLock in UnifiedServerBuilder to avoid panic #19

Closed
despiegk wants to merge 0 commits from development_13 into development
Owner

Summary

  • Replaced tokio::sync::RwLock with std::sync::RwLock for UnifiedServerBuilder.entries
  • blocking_write() panics when called inside a tokio runtime; write().unwrap() on std RwLock works correctly
  • serve() now accepts Arc<AsyncRwLock<ContextRegistry>> (aliased to avoid ambiguity)

Test plan

  • cargo build -p hero_rpc_server compiles clean
  • make example (recipe_server) no longer panics on startup
## Summary - Replaced `tokio::sync::RwLock` with `std::sync::RwLock` for `UnifiedServerBuilder.entries` - `blocking_write()` panics when called inside a tokio runtime; `write().unwrap()` on std RwLock works correctly - `serve()` now accepts `Arc<AsyncRwLock<ContextRegistry>>` (aliased to avoid ambiguity) ## Test plan - `cargo build -p hero_rpc_server` compiles clean - `make example` (recipe_server) no longer panics on startup
feat: align socket strategy with hero_sockets/hero_context skills (#13)
Some checks failed
Test / test (push) Failing after 53s
a0f4a08ce5
Implements the updated architecture from hero_skills:

- Single rpc.sock per service via UnifiedServer (replaces per-domain sockets)
- Context via X-Hero-Context header (integer, 0=admin, >=1=user)
- Claims via X-Hero-Claims header (missing = full trust)
- X-Forwarded-Prefix header for URL generation
- RequestContext extended with hero_context, hero_claims, forwarded_prefix
- Authorization helpers: is_trusted(), has_claim(), context_name()
- OServerConfig uses $HERO_SOCKET_DIR/<service>/rpc.sock convention
- HeroLifecycle uses restart_service() with kill_other and health_checks
- Legacy OServer socket paths deprecated (not removed)
- All 171 tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Calling blocking_write() on a tokio RwLock from within an async runtime
panics. Switched entries to std::sync::RwLock since all builder mutations
happen before the async server starts serving requests.
Merge remote-tracking branch 'origin/development' into development_13
Some checks failed
Test / test (push) Failing after 53s
Test / test (pull_request) Failing after 55s
f4ab4bc7d0
fix: hero_skills compliance — discovery manifest, interpreter, recipe_server lifecycle
Some checks failed
Test / test (pull_request) Failing after 38s
Test / test (push) Failing after 1m1s
17478db57b
- Fix discovery manifest field name: socket_type → socket (per hero_sockets spec)
- Add .interpreter("exec") to lifecycle action builder (per hero_proc_sdk spec)
- Update recipe_server examples to use OServer::run_cli() with HeroLifecycle
  for hero_proc integration (start/stop/status/logs/serve subcommands)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
docs: align all docs and example with hero_skills conventions
Some checks failed
Test / test (push) Failing after 40s
Test / test (pull_request) Failing after 54s
b8963386a6
- Fix recipe_server main.rs comment: accurately describes CLI subcommands
  (start/stop/serve) instead of incorrectly saying --start/--stop flags
- Update recipe_server Makefile: use hero_proc integration (start/stop
  subcommands), correct socket path ($HERO_SOCKET_DIR/recipe-server/rpc.sock),
  remove manual PID/kill-server logic
- Update recipe_server README.md: correct socket paths, curl examples,
  add CLI subcommand reference table, document X-Hero-Context header
- Update curl test script: use $HERO_SOCKET_DIR with proper default
- Rewrite GETTING_STARTED.md: unified socket model, HeroLifecycle/run_cli
  pattern, correct main.rs example, hero_proc integration section,
  context headers, management methods, fix Rust version to 1.93+
- Update README.md: fix socket paths, architecture description, runtime
  flow, Rust version 1.93+, add hero_skills and hero_proc references

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
refactor: standardize CLI to hero_skills singlebin pattern (--start/--stop flags)
Some checks failed
Test / test (push) Failing after 1m1s
Test / test (pull_request) Failing after 1m1s
eb53a1da13
Replace subcommand-based CLI (start/stop/serve) with hero_skills singlebin
pattern: --start flag for hero_proc registration, --stop flag for shutdown,
bare binary for foreground mode. Applied across OServer::run_cli(),
HeroRpcServer, HeroUiServer, HeroServer, lifecycle exec_command, recipe
server example, and all documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
refactor: align scaffolder with hero_skills conventions
Some checks failed
Test / test (pull_request) Failing after 38s
Test / test (push) Failing after 55s
17cc9618df
- Rename generated crates: _openrpc → _server, _http → _ui
- Generated server main.rs uses --start/--stop singlebin pattern
- Generated UI main.rs uses HeroUiServer (no raw TCP)
- Add Makefile generation (three-layer build_lib pattern)
- Add buildenv.sh generation
- Update rust-version to 1.93.0
- Update CLI binary (--no-ui flag, _server references)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: service method routing + implement recipe_server custom methods
Some checks failed
Test / test (pull_request) Failing after 1m1s
Test / test (push) Failing after 39s
c405c8cecd
- Include service name prefixes in type_names() so unified server routes
  custom service methods (e.g. recipeservice.get_by_category) correctly
- Implement get_by_category, get_by_difficulty, add_to_collection in
  recipe_server example (replace todo!() stubs with working code)
- Fix GETTING_STARTED.md set example to use OTOML data format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
timur closed this pull request 2026-04-07 17:56:36 +00:00
Owner

Merged via git push to development branch. Closing PR.

Merged via git push to development branch. Closing PR.
Some checks failed
Test / test (pull_request) Failing after 1m1s
Test / test (push) Failing after 39s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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_rpc!19
No description provided.