From 9f200c15b74f7787eb4412845ab6890663ef2870 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 10 Jul 2026 12:11:23 +0200 Subject: [PATCH] Make the streaming-relevance baseline reproducible in-repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generator codegen_facades.py projects the JMEOS FFI surface against tools/baseline/streaming-relevance-baseline.json, but that baseline was a frozen snapshot produced by an out-of-repo classifier and recorded a dangling absolute source_catalog path, so it could not be regenerated here — the last non-reproducible input in the generation chain. Vendor the deterministic classifier as tools/classify_streaming_relevance.py (the tier of a function is decided purely by its name, object-model role, and temporal-parameter count) plus a tools/regen_baseline.sh wrapper, and document the full input chain in GENERATION.md: MobilityDB @ tools/meos-source-commit.txt -> MEOS-API/run.py -> meos-idl.json -> classify_streaming_relevance.py -> streaming-relevance-baseline.json -> codegen_facades.py -> org.mobilitydb.meos.MeosOps* facades Regenerate the committed baseline through the vendored classifier so its provenance is portable. The function classification is byte-identical to the previous baseline, so the 57 generated facade classes are unchanged; only the metadata (source_catalog, generated_at) differs. --- GENERATION.md | 29 ++ .../streaming-relevance-baseline.json | 5 +- tools/classify_streaming_relevance.py | 321 ++++++++++++++++++ tools/regen_baseline.sh | 30 ++ 4 files changed, 382 insertions(+), 3 deletions(-) create mode 100755 tools/classify_streaming_relevance.py create mode 100755 tools/regen_baseline.sh diff --git a/GENERATION.md b/GENERATION.md index 2c9131c..2beb3d7 100644 --- a/GENERATION.md +++ b/GENERATION.md @@ -25,6 +25,35 @@ emits the `org.mobilitydb.meos.MeosOps*` 1:1 forwarder facades the Flink process The facades are a *consumer* projection (they live here, not in JMEOS, so the JMEOS FFI line and the facade line do not diverge). +## The streaming-relevance baseline (generator input) + +`tools/codegen_facades.py` emits a facade only for functions in the +**streaming-relevant** tiers, read from `tools/baseline/streaming-relevance-baseline.json`. +That baseline is itself **generated and reproducible** — it is not a hand-maintained +list. It is produced by **`tools/classify_streaming_relevance.py`**, a deterministic +classifier: the tier of a function is decided purely by its name, its object-model role, +and its number of temporal parameters (zero per-function judgement), so the same MEOS +catalog always yields the same baseline. + +The full input chain, from the tracked MobilityDB commit: + +``` +MobilityDB @ tools/meos-source-commit.txt + → MEOS-API/run.py over the MEOS headers → meos-idl.json (the catalog) + → tools/classify_streaming_relevance.py → tools/baseline/streaming-relevance-baseline.json + → tools/codegen_facades.py (jar-surface ∩ baseline) → org.mobilitydb.meos.MeosOps* facades +``` + +To refresh the baseline (e.g. after bumping `tools/meos-source-commit.txt`): rebuild the +catalog at the tracked commit with MEOS-API, then + +``` +tools/regen_baseline.sh +``` + +and commit the diff. Because the classifier is deterministic, an unchanged catalog +regenerates the baseline byte-for-byte. + ## Generate-then-retire — the green-CI version is the probe Hand-written facades/glue are replaced by the generated forwarders **family by family, diff --git a/tools/baseline/streaming-relevance-baseline.json b/tools/baseline/streaming-relevance-baseline.json index 4055e12..fd5342d 100644 --- a/tools/baseline/streaming-relevance-baseline.json +++ b/tools/baseline/streaming-relevance-baseline.json @@ -1,7 +1,6 @@ { "schema_version": "0.1.0-draft", - "generated_at": "2026-05-21T07:46:14.181946Z", - "source_catalog": "/home/esteban/src/_streaming_relevance/meos-api/output/meos-idl.json", + "source_catalog": "meos-idl.json (MobilityDB master, MEOS-API run.py)", "source_catalog_function_count": 3548, "classifier": "v4", "vocabulary": [ @@ -41647,4 +41646,4 @@ "n_params": 3 } ] -} \ No newline at end of file +} diff --git a/tools/classify_streaming_relevance.py b/tools/classify_streaming_relevance.py new file mode 100755 index 0000000..3690fff --- /dev/null +++ b/tools/classify_streaming_relevance.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python3 +"""Classify the MEOS public API into streaming tiers — the reproducible +producer of ``tools/baseline/streaming-relevance-baseline.json``. + +The baseline is the generator input consumed by ``codegen_facades.py`` +(which emits a facade only for the streaming-relevant tiers). This script +is deterministic: the tier of a function is decided purely by its name, +its object-model role, and the number of temporal parameters — there is +zero per-function judgement, so the same MEOS catalog always yields the +same baseline. + +Usage: + classify_streaming_relevance.py [-o ] + [--source-ref