Collapse catalog to meta-service — ServiceDefinition = name+description+interfaces (#1) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-1-meta-service"
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?
Closes #1. Catalog domain now has just
ServiceDefinition = { name, description, interfaces: [Interface] }— no ServiceToml mirroring, no auto-field declarations (sid/created_at/updated_at are injected by the generator per hero_rpc#85 + hero_skills#275).ServiceCatalogexposes real list/get_by_name/list_by_interface queries plus mocked bootstrap/refactor/check/verify ops; each mock returns a canned OpReport + TODO markers naming the production wiring. Cargo deps flipped back todevelopment(was issue-85 feature branch + a stray herolib_otomlmainpin).cargo build --workspace+cargo test --workspaceclean.`hero_service` is the canonical template *and* the seed of the meta-service that bootstraps, refactors, checks and verifies other Hero services. This commit rewrites the catalog domain so it actually looks like that service — its OSchema, its RPC surface, and its handler stubs all line up with the "manage hero services" framing. ## Schema (schemas/catalog/catalog.oschema) `ServiceDefinition` collapses from a parallel `ServiceToml` (binaries, sockets, category, status, version, …) to the minimum the catalog needs: ServiceDefinition = { name: str @index description: str interfaces: [Interface] } `sid` / `created_at` / `updated_at` are no longer declared in the schema — they are auto-injected by the generator (hero_rpc#85). All redeclared ServiceToml types (Kind / Category / Protocol / SockType / Binary / Socket / ServiceMeta) are gone; live service metadata is read from each service's own `service.toml` via `herolib_core::base::ServiceToml`. Closes hero_rpc#72. `Interface` (server | admin | cli | web | rhai), `OpStatus`, `Diagnostic` and `OpReport` are added — owned by the catalog, used by the meta-ops below. `service ServiceCatalog` now exposes: - list / get_by_name / list_by_interface — queries - bootstrap(name, description, interfaces) → OpReport - refactor(name, prompt) → OpReport - check(name) → OpReport - verify(name) → OpReport ## Handlers (crates/hero_service_server/src/catalog/rpc.rs) The four meta-ops are **mocked** — each returns a realistic canned `OpReport` and a single `TODO[<op>]` comment naming the exact crate / skill that the production implementation will pull: | op | production wiring | |-----------|----------------------------------------------------------------| | bootstrap | `hero_rpc_osis::build::{OschemaBuildConfig, OschemaBuilder}` + canonical service template from hero_skills | | refactor | `herolib_ai::AiClient::from_env()` with skill bodies as system prompt | | check | rule packs from hero_skills (service.toml, sockets, branching, naming, layout) | | verify | cargo build + `<binary> --info --json` + socket connect + tests_smoketest | Queries (`list`, `get_by_name`, `list_by_interface`) are real — they hit the OSIS-backed `OsisCatalog` domain. ## Build / deps - `crates/hero_service/build.rs`: drop the removed `.docs_dir(...)` builder call (the new generator emits canonical `docs/openrpc.json`). - `crates/hero_service/src/services/`: removed — was an empty placeholder module; meta-op handlers live in `hero_service_server` where handlers belong. ## TEMPORARY — branch override `hero_rpc` deps point at branch `issue-85-rootobj-sid-validation`. Without that fix, the generator rejects `ServiceDefinition` because it has no explicit `sid` field, even though the Rust struct emitter auto-injects it. Switch the three Cargo.toml files back to `branch = "development"` once hero_rpc#85 is merged. ## Refs - Closes hero_rpc#72 (no service redeclares `herolib_core::base` types). - Blocks on hero_rpc#85 (`fix(generator): drop redundant sid-field requirement on root objects`). - Drives hero_skills#275 (skill change to stop telling authors to declare `sid` / `created_at` / `updated_at`). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>259e46f04ftod3f48c7b57hero_rpc#85TEMPORARY comments + regen against current hero_rpc #4