Repository navigation
fix(concepts): reject LLM refusal definitions + blank concept name (#2440) - #2468
Merged
Merged
Conversation
…2440) The batch definition backfill (#2440) shipped ~9.3k degenerate definitions to prod: fluent LLM refusals ('the concept name was not provided...', 'sources do not contain sufficient information') that passed the length + terminology guardrails and were bulk-approved. applyPostValidation now rejects known refusal signatures (reason='refusal'), and generateConceptDefinition refuses to call the model with a blank/undefined concept.name (reason='no-name') so a bad name fails loud instead of producing 'CONCEPT: undefined' and a refusal. Prod rollback of the already-shipped degenerate rows is a separate data op.
Live batch-2440 rows use phrasings the first pass missed: 'the concept provided is undefined', 'concept name provided is undefined', 'not enough information to write a grounded definition', 'cannot be documented', 'please supply a valid concept name'. Widened REFUSAL_PATTERNS to cover them; verified two genuine definitions (Data Product Catalog, webhook) still pass.
The #2426 bulk-run (originally assumed clean) also approved ~23 'valid name, thin grounding' refusals ('The provided sources do not contain any/sufficient information about X...'). Broadened the pattern to enough|any|sufficient + does-not-contain. Verified genuine definitions still pass.
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.
Problem (#2440)
The concept-definition batch backfill approved ~9,290 degenerate definitions to prod — fluent LLM refusals ("the concept name was not provided…", "the concept provided is undefined", "sources do not contain sufficient information about X") that passed the length + terminology guardrails and were bulk-approved. On-page they render as refusal text instead of definitions; one even rendered the literal string
"undefined".Post-incident investigation also found the original #2426 500-run was NOT clean — it contained 26 "valid name, thin grounding" refusals too.
Root cause
Two gaps, both needed:
applyPostValidationonly checked length + stale terminology. A fluent refusal is non-null, in-range, clean-termed → counted asgeneratedand bulk-approved. The "9,290 generated / 0 errors" metrics were false positives.CONCEPT: undefinedinto the prompt, so the model correctly refused. (The shipped CQL job passes a correct lowercaseconcept.name— verified viakg-concept-loader.js's dual-branch pattern — so this was not the shipped job, but the guardrail catches the output regardless of source.)Fix
applyPostValidationrejects refusal signatures →reason:'refusal'(never written, never approved). Patterns cover every phrasing observed live on prod.generateConceptDefinitionrefuses a blank/undefinedconcept.name→reason:'no-name', failing loud instead of emittingCONCEPT: undefined.Prod data remediation (done separately, out-of-band)
batch-2440rows (marker-based) → NULL. 0 remain.Tests
test/unit/concept-definition-extract.test.js— 12 pass. New cases cover refusal signatures (incl. real prod phrasings), the no-name guard, and no-false-positive checks.