feat: derive service-projection metadata for the catalog#4
Open
estebanzimanyi wants to merge 1 commit into
Open
feat: derive service-projection metadata for the catalog#4estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
6d028b1 to
32315db
Compare
Adds parser/enrich.py: a clang-free pass that derives, for every function and opaque type, the metadata a service generator (OpenAPI/MCP/gRPC) needs but that C headers do not contain: - category (constructor/predicate/io/accessor/transformation/...) - typeEncodings: per opaque type, its text/MF-JSON/WKB in/out functions - network.exposable: whether the function maps to a stateless endpoint, with a precise reason when it does not (array/out-param, no encoder/ decoder, lifecycle, index) - wire: per-parameter and return request/response representation Matches the canonical C spellings libclang emits (struct-qualified names, unsigned char, int-returning predicates) and treats enums as scalars. Runs before merge_meta so every derived field is overridable from meta/meos-meta.json. Wired into run.py as step 2/3, documented in docs/enrichment.md, and tested on real signatures in tests/test_enrich.py (stdlib unittest, no libclang/pytest needed). Validated against the live MobilityDB master catalog: 2672 functions, 1790 (67%) stateless-exposable.
32315db to
1ad3228
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
parser/enrich.py— a libclang-free pass that derives, for everyfunction and opaque type in the catalog, the metadata a service generator
(OpenAPI / MCP / gRPC) needs but that C headers do not contain:
category— constructor / predicate / io / accessor / transformation / conversion / setop / aggregate / lifecycle / index.typeEncodings— per opaque C type, its text / MF-JSON / WKB in/out functions (the wire round-trip).network.exposable— whether the function maps onto a stateless endpoint, with a precise machine-readablereasonwhen it does not (array-or-out-param:…,no-encoder:…,no-decoder:…,lifecycle,index).wire— per-parameter and return request/response representation.enrichmentsummary (categoryCounts,exposableFunctions) for coverage tracking.Why
This is the foundation for projecting MEOS onto a network API. It turns
"what can be exposed over HTTP/MCP" from a manual judgement into a
per-function, machine-checkable verdict, while keeping the door open for
hand curation.
Design
merge_meta, so every derived field is overridable perfunction/type from
meta/meos-meta.json.run.pyas step 2/3.functions/structs/enumsentries areunchanged (new keys only), so existing consumers keep working.
docs/enrichment.md.tests/test_enrich.py: 13 tests on real MEOS signatures, stdlibunittestonly (no libclang/pytest needed) —python3 tests/test_enrich.py.Follow-up
The override surface enables incremental hand-curation of categories and
exposability in
meta/meos-meta.json, and a downstream generator(OpenAPI/MCP) that consumes
network/wire/typeEncodings.