A definition can be written by hand - #563
Open
WaylandYang wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
This was referenced Sep 9, 2026
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.
Closes #562. The capability cut; the page follows once #552 has landed (both touch
Mappings.tsx).A row in
concept_mappingshad exactly one way in: exploration proposes, a person confirms. A data team that already has its definitions — a metrics doc, the SQL behind last quarter's report — had nowhere to put them, and #520 measured what they are worth once they are in the prompt: 1 of 18 right answers without, 17 of 18 with, on the wide corpus. Exploration cannot fill that gap (0 of 18 there; it cannot see a convention that is not in the schema). This is the door.What changes
POST /kbs/{id}/mappings(Editor): concept name, kind (metric/dimension, default metric), a mounted source by name, and the sametable_name / expr / sql / unit / summary / derivedthe revise form takes. The row landsconfirmedwith the author in a newwritten_bycolumn (migration0046), so a written row and an exploration-proposed one stay distinguishable —decided_bycannot tell them apart, since a confirmed proposal has one too. Auditmapping.written.POST /kbs/{id}/mappings/preview(Editor): render the definition (sqlverbatim, elseSELECT expr FROM table— the same rendering the bench scores with), run it through the read-only gate on its source, return the first row. The person sees the number before saving; the engine's error comes back verbatim when it does not run.revise(definition_shape): at least one of table, expression, SQL. The source must be mounted (source_not_mounted). One definition per (concept, source): a second is a 409, since the existing row may be a confirmed proposal and overwriting it would erase a decision — revise instead. Exploration cannot clobber a written row either:proposeonly refreshesproposedrows, the same rule that protects a rejection.ConceptMappinggainswritten_by; the three list queries return it.The concept still becomes an entity of the builtin
Metric/Dimensionclass, because that is the table's current shape. 0035 retires that shape (#556) and keeps the table, rendering into it, so a written SQL survives.Verified
definition_shape,render_sql(sql wins and drops a trailing;; table alone is not runnable).a_definition_can_be_written_by_hand: written row is confirmed withwritten_by; same key again isConflict; a laterproposeon that key leaves it untouched; exploration's own rows havewritten_by = NULL.previewof the GMV definition returns 32931921.08, the bench truth; a broken expression returns 422 withcolumn "no_such_col" does not exist; create → 200 and the list shows the rowconfirmed/ written; same key → 409; unmounted source → 422source_not_mounted; no definition → 422empty_mapping.Does not touch
Mappings.tsx(#552) orchat.rs(#548).🤖 Generated with Claude Code