#959·openui

Add dataInvention flag to PromptOptions to disable the 'generate realistic/plausible data' rule

Author: adam-boatman-skyCreated Aug 11, 2026Updated Aug 11, 2026

Context

buildImportantRules() in lang-core unconditionally appends the line:

- When asked about data, generate realistic/plausible data

This is correct for generative UI (the default consumer), but harmful for description-mode consumers that describe existing UI rather than generating new UI. In that context it instructs the model to invent data — image URLs, prices, copy — that is not in the source, producing artefacts that are locally well-formed but materially false.

Current workaround

We post-process the generated prompt to excise the line:

typescript
const prompt = library.prompt(options);
return prompt.split("\n").filter(line => !line.includes("When asked about data, generate realistic/plausible data")).join("\n");

This works but is coupled to the exact wording — if lang-core rewords the rule, the excision silently stops matching.

Proposal

Add a dataInvention?: boolean flag to PromptOptions, defaulting to true (preserving current behaviour). When false, skip the line in buildImportantRules().

This mirrors the existing pattern of editMode, inlineMode, bindings, and toolCalls — feature flags that control which sections of the prompt are emitted.

Use case

backpack-openui has two consumers:

  1. Runtime (generative UI) — dataInvention: true (default)
  2. Description (describing existing prototypes) — dataInvention: false

The description consumer is the one that needs this flag. Evidence: https://github.com/Skyscanner/backpack-openui/blob/main/docs/spike-findings.md