Skip to content

feat: derive service-projection metadata for the catalog#4

Open
estebanzimanyi wants to merge 1 commit into
masterfrom
feat/service-enrichment
Open

feat: derive service-projection metadata for the catalog#4
estebanzimanyi wants to merge 1 commit into
masterfrom
feat/service-enrichment

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

What

Adds parser/enrich.py — a libclang-free pass that derives, for every
function 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-readable reason when it does not (array-or-out-param:…, no-encoder:…, no-decoder:…, lifecycle, index).
  • wire — per-parameter and return request/response representation.
  • A top-level enrichment summary (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

  • Runs before merge_meta, so every derived field is overridable per
    function/type from meta/meos-meta.json.
  • Wired into run.py as step 2/3.
  • Purely additive: the existing functions / structs / enums entries are
    unchanged (new keys only), so existing consumers keep working.
  • Contract documented in docs/enrichment.md.
  • tests/test_enrich.py: 13 tests on real MEOS signatures, stdlib
    unittest only (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.

@estebanzimanyi estebanzimanyi force-pushed the feat/service-enrichment branch 12 times, most recently from 6d028b1 to 32315db Compare May 18, 2026 10:46
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant