Collapse catalog to meta-service — ServiceDefinition = name+description+interfaces (#1) #2

Merged
timur merged 2 commits from issue-1-meta-service into development 2026-05-20 08:18:18 +00:00
Owner

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). ServiceCatalog exposes 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 to development (was issue-85 feature branch + a stray herolib_otoml main pin). cargo build --workspace + cargo test --workspace clean.

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). `ServiceCatalog` exposes 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 to `development` (was issue-85 feature branch + a stray herolib_otoml `main` pin). `cargo build --workspace` + `cargo test --workspace` clean.
`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>
timur force-pushed issue-1-meta-service from 259e46f04f to d3f48c7b57 2026-05-20 08:18:05 +00:00 Compare
timur merged commit 8c0df0f01e into development 2026-05-20 08:18:18 +00:00
Sign in to join this conversation.
No reviewers
No labels
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_service!2
No description provided.