Fix OServer::run_cli to honor service.toml socket paths (#69) #79

Merged
timur merged 3 commits from issue-69-oserver-socket-paths into development 2026-05-20 05:55:08 +00:00
Owner

Closes #69. OServer now reads the service.toml socket entry first, falls back to default only if absent. Test fixture verifies non-default path binding; default-case behaviour unchanged.

Closes #69. OServer now reads the service.toml socket entry first, falls back to default only if absent. Test fixture verifies non-default path binding; default-case behaviour unchanged.
fix(server): honour service.toml rpc socket path in OServer::run_cli (#69)
Some checks failed
Test / test (push) Failing after 2m12s
86171183a0
OServer::run_cli always bound the unified rpc socket at
`$HERO_SOCKET_DIR/<service_name>/rpc.sock`, ignoring any custom
`[[binaries.sockets]].path` declared in service.toml. Services that
legitimately needed a non-default socket layout (e.g.
`hero_petstore/rpc.sock` while the binary is named `petstore_server`)
couldn't get it.

- Add HeroLifecycle::service_toml(toml_str) — attach the embedded
  service.toml so downstream consumers can read it.
- Add OServerConfig::rpc_socket_relative(path) — override the default
  `<name>/rpc.sock` layout with a service.toml-declared path.
- OServer::run_cli now parses the attached service.toml, finds the rpc
  socket entry, and applies it as the override. print_info_json uses
  the same resolution so --info reports the actual bind path.

Default behaviour is unchanged: when no service.toml is attached or no
rpc socket is declared, the per-service `<name>/rpc.sock` layout still
applies.

Unit tests cover all four resolution paths in
`crates/server/src/server/server.rs`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
test(server): cover service.toml rpc socket override end-to-end (#69)
Some checks failed
Test / test (push) Failing after 2m45s
17687b6fc5
Adds `crates/server/tests/run_cli_socket_path.rs` — boots `OServer` with
and without `OServerConfig::rpc_socket_relative`, asserts the listener
binds at the declared path (e.g. `hero_petstore/rpc.sock`) rather than
the default `<name>/rpc.sock`, and verifies the default-case behaviour
is unchanged. A live `rpc.health` request over the socket confirms a
real listener — not a stale file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore(example): opt recipe_server into service.toml rpc path resolution (#69)
Some checks failed
Test / test (push) Failing after 2m13s
Test / test (pull_request) Failing after 2m36s
564c4de7e3
Attach the embedded service.toml via the new
`HeroLifecycle::service_toml()` builder so the unified rpc socket is
bound at the path declared in `[[binaries.sockets]]` rather than the
default `<service_name>/rpc.sock`. For the recipe_server example the
two happen to coincide today, but this wires up the contract so future
manifests with non-matching paths Just Work.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
timur merged commit fd061e3fa2 into development 2026-05-20 05:55:08 +00:00
Sign in to join this conversation.
No reviewers
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_blueprint!79
No description provided.