Fold indexer-backed find into the openrpc_server! macro #159
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_lib#159
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?
On the macro path, generated
*_findmethods are hand-written stubs that ignore their filter params and full-scan the store withlist()(for examplecompany_findin hero_biz, and the same in cm50_app), so the OSIS indexer is never used. The machinery already exists in hero_blueprint (theOsisIndexerclient, the typedFindParamsfilters, and ato_indexer_querylowering), but nothing wires it end to end. The goal is that every service migrated ontoopenrpc_server!gets real indexed queries with no per-service code, before the wider rollout.Proposed approach, reusing the existing
Hooksseam rather than adding new codegen: when a domain has@indexfields,serve_domainsauto-registers a generic hook set built from the spec's index metadata. A before-hook on find lowers the request'sFindParamsto an indexer query, runsOsisIndexer::search, and returns the sids, short-circuiting the stub body. After-hooks on set and delete do the index write-through (index_documentanddelete_document). Theto_indexer_querylowering moves to a runtime helper in the osis crate so there is one source and no per-type emission.OsisIndexerchanges from log-and-swallow to a hard error when the indexer is down, both per call and with a startup probe. Once the macro owns find, the generator under hero_blueprint/crates/generator is moved to an archive directory and the hand-written*_findstubs in hero_biz and cm50_app are dropped, since they inherit the macro behavior. This spans hero_lib (the macro andserve_domains) and hero_blueprint (the osis helper, the hard-error change, the generator archive).@timur, before I start, please confirm the four design calls:
to_indexer_queryas a runtime helper in the osis crate, versus emitted per type.index_documentmust be idempotent), index-before-commit, or a reconcile path.Context: lhumina_code/home#309
Signed-by: mik-tf mik-tf@noreply.invalid