The semantic layer gets measured, and exploration learns to align - #567
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Contributor
Author
|
Review before merge. Two ledger gaps fixed, one bench guard, one renumber:
Not changed: migrations here use plain |
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.
Three measuring benches for the semantic layer, the coverage cut of #503, and decision record 0036.
Benches (
scripts/bench/)mappings.mjs(A mapping proposal has never been scored #501) scores what exploration proposes. Judgement is by number: a truth entry is a definition plus one gold SQL, the proposal is run against the same rows, same number means same definition whatever the model named it. Four columns —covered,right,wrong,broken— andwrong(runs, matches nothing) is the one that decides whether automatic confirmation could ever be default-on. Two corpora: TPC-H (schema and definitions from the specification's 22 queries, rows fromgenerate_series, comments as a separate file so their value is measurable) andwide, a flattened e-commerce order table whose every definition carries a convention the columns do not state.ask.mjs(A chat answer is never checked against the data #520) scores chat end to end: it asks each question, re-runs the SQL the model actually ran, and compares with the gold — two columns,sql_rightandanswer_right, because they come apart.--replayre-scores from the conversations already in the base (seconds, not forty minutes);--seedwrites the truth as confirmed definitions (the upper bound);--confirmconfirms what exploration proposed (the product path);--parallel Nasks several at once.lib.mjsholds the onesame()both benches use, so their numbers are on one scale.Numbers, recorded on #501 and #520:
#503 — an exploration says what it covered
proposal_capscales with the schema instead of a fixed 12 (TPC-H coverage 25% → 33%); the schema-text cap is now a real cross-source bound; a run writes a row inmapping_exploration_runs(tables and columns scanned, truncation, cap, returned, accepted, drops with an example each, tables covered, error);last_runonGET /kbs/{id}/mappings. Single-source bases accept whateversourcethe model echoes — the first bench run lost all twelve proposals to a source name with a timestamp in it. Migration0044.0036 — Exploration aligns a schema to the ontology
Exploration today inserts two classes and makes concepts entities of them; the wide base had 93 concept entities, most of them column names. The record moves the concept: an attribute of a real class, or a rule over such attributes; exploration proposes an alignment per table through
ontology_proposals; conversions are 0032's expression tree;concept_mappingsbecomes rendered. Revision notes on 0009 and 0011. Decision 7 is implemented in #561; the written-definition door is #563; the conventions-as-prose dead end was measured at 14/18 and revised in place. Follow-ups: #554, #555, #556.Also renumbers the exploration-ledger migration to
0044(dev took0041) and merges dev.🤖 Generated with Claude Code