catalog domain is over-modelled — collapse ServiceDefinition to name + description + interfaces #1
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?
Problem
crates/hero_service/schemas/catalog/catalog.oschemamodels aServiceDefinitionthat re-implementsservice.tomlinstead of just referencing it. Today's shape:Plus five supporting enums and two embedded structs (
SocketDef,BinaryDef) that redeclare the closed-set enums and structs that already live inherolib_core::base—Kind,Category,Protocol,SockType,Binary,Socket,ServiceMeta,ServiceToml. The local enums have already drifted from canon (e.g.BinaryKindaddsapp;ServiceCategoryis a different set thanCategory).Why it's wrong
The
hero_servicecatalog isn't supposed to be a parallel registry of binaries and sockets —service.tomlalready is that, and it ships with every service binary. The catalog only needs enough to locate a service; everything else can be read from itsservice.tomlon demand.Proposed shape
A minimal
ServiceDefinition:That's it.
sid/created_at/updated_atauto-injected by the generator. Everything else (repo,binaries,sockets,version,category, …) lives in the service's ownservice.tomland is read at query time.With this collapse:
use-import language feature here (though that feature is still valuable for other consumers).ServiceCategoryandherolib_core::base::Category.service.tomlstays the single source of truth.What to do
crates/hero_service/schemas/catalog/catalog.oschemawith the minimal shape above (plus whateverservice ServiceCatalog { … }methods the admin UI needs —get_by_interface(...),get_by_name(...), etc.).crates/hero_service/src/catalog/types_generated.rs— should be ~20 lines: oneServiceDefinitionstruct and oneInterfaceenum.repo/binaries/categoryto either read fromservice.tomlat request time or drop the columns.Acceptance
catalog.oschemadeclares no types that overlap withherolib_core::base.ServiceDefinitionis ≤4 user-visible fields (name,description,interfaces, optionaltags).crates/hero_servicebuilds clean.hero_service_adminlists services correctly (readingservice.tomlfor live metadata).Refs
sid/created_at/updated_atlines in currentcatalog.oschema).ed0a1e1in this repo, refshero_skills#261.herolib_core::baseServiceToml types per-service #72Expanded scope — make
hero_servicethe meta-service that manages hero servicesOriginal framing of this issue was "collapse the over-modelled catalog schema." That stands, but the bigger picture from chat:
So the catalog isn't just a data store; it's the public surface of an operational meta-service. Implementations will be mocked for this issue (canned responses + clearly-marked TODO stubs at every integration point), but the schema, RPC surface, and module wiring will be real.
Updated
catalog.oschema(proposed)Notes against the schema:
sid/created_at/updated_atdeclared — those are auto-injected per hero_skills#275.herolib_core::base— closes the original hero_rpc#72 symptom.OpReport/Diagnostic/OpStatusare owned by the catalog (op-specific), not service-catalog-of-services concepts; they belong here.Integration points (mocked here, real later)
bootstraphero_rpc_osis::build::OschemaBuilder+hero_skills/skills/*for the templaterefactorherolib_ai::AiClient::from_env()+ matching skill body as system promptcheckhero_skills(service.toml shape, socket conventions, hero_branching, hero_crates_best_practices_check)verifycargo build,--info --jsonparse, socket connect, smoke testsFor this issue, each handler returns a clearly canned
OpReportand a TODO comment naming the exact integration it would call. That gives the admin UI + SDK something to drive, without committing to a 2-week AI-orchestrator build right now.Plan
schemas/catalog/catalog.oschemawith the schema above.crates/hero_service/src/catalog/types_generated.rs(should be small now —ServiceDefinition+Interface+OpStatus+Diagnostic+OpReport).crates/hero_service_server/src/catalog/rpc.rswith mocked impls returning canned reports.cargo build --workspaceclean.issue-1-meta-service, push, open PR.sidfield, contradicting Rust struct emitter (which auto-injects it) #85sidfield, contradicting Rust struct emitter (which auto-injects it) #85Branch pushed:
issue-1-meta-service.Diff: 20 files, +1342 −1400.
ServiceDefinitionis now{ name, description, interfaces: [Interface] }— auto-injectedsid/created_at/updated_at, noServiceTomlmirroring. Closes hero_rpc#72 at the schema level.RPC surface (catalog.oschema):
list/get_by_name/list_by_interface— real, backed byOsisCatalog.bootstrap(name, description, interfaces) → OpReport— mocked. Real:hero_rpc_osis::build::OschemaBuilder+ skills templates.refactor(name, prompt) → OpReport— mocked. Real:herolib_ai::AiClientwith skill bodies as system prompt.check(name) → OpReport— mocked. Real: rule packs fromhero_skills/skills/*.verify(name) → OpReport— mocked. Real:cargo build+--info --jsonparse + socket connect.Each handler returns a canned
OpReportwith a clearTODO[<op>]block incrates/hero_service_server/src/catalog/rpc.rsnaming the exact crate / skill the production version will use.Blocks on: hero_rpc#85 — generator rejects
[rootobject]types without an explicitsidfield.Cargo.tomls in this branch temporarily pinhero_rpctoissue-85-rootobj-sid-validation; revert todevelopmentafter that lands.Tests:
cargo test --workspaceclean (2 catalog CRUD tests pass).sid-field requirement on root objects (#85) #88