Skip to content

fix(concepts): reject LLM refusal definitions + blank concept name (#2440) - #2468

Merged
jung-thomas merged 3 commits into
DEVfrom
worktree-fix-2440-concept-def-guardrail
Sep 22, 2026
Merged

jung-thomas merged 3 commits into
DEVfrom
worktree-fix-2440-concept-def-guardrail

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

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:

  1. No semantic guardrail. applyPostValidation only checked length + stale terminology. A fluent refusal is non-null, in-range, clean-termed → counted as generated and bulk-approved. The "9,290 generated / 0 errors" metrics were false positives.
  2. Blank concept name reached the model. Some generation path fed CONCEPT: undefined into the prompt, so the model correctly refused. (The shipped CQL job passes a correct lowercase concept.name — verified via kg-concept-loader.js's dual-branch pattern — so this was not the shipped job, but the guardrail catches the output regardless of source.)

Fix

  • applyPostValidation rejects refusal signatures → reason:'refusal' (never written, never approved). Patterns cover every phrasing observed live on prod.
  • generateConceptDefinition refuses a blank/undefined concept.name → reason:'no-name', failing loud instead of emitting CONCEPT: undefined.
  • Verified genuine definitions (Data Product Catalog, webhook, sap.m.StandardListItem, UI5 Value State) still pass — no false positives.

Prod data remediation (done separately, out-of-band)

  • Rolled back all 9,290 batch-2440 rows (marker-based) → NULL. 0 remain.
  • Rolled back the 26 degenerate refusals in the Topics and Concepts #2426 set (by exact ID) → NULL. 474 good Topics and Concepts #2426 rows intact, 0 refusals left.
  • Pending: PROD content rebuild so pages stop rendering the garbage and fall back to tiles.

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.

…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.
@jung-thomas
jung-thomas merged commit 5e73bf2 into DEV Sep 22, 2026
4 of 5 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-2440-concept-def-guardrail branch September 22, 2026 15:24
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