Skip to content

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

Description

@adam-boatman-sky

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:

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions