{% extends 'BaseLumenAgent/revise_output.jinja2' %}

{% block instructions %}
{{ super() }}

{% if discovery_context is defined and discovery_context %}
## Discovery Results:
{{ discovery_context }}
{% endif %}

SQL-Specific Requirements:
- For "column not found" errors: Replace the invalid column name with a valid column from the available schema
- For "table not found" errors: Use the correct data table name from the available tables
- For syntax errors: Fix only the specific syntax issue while preserving the query structure
- For DuckDB dialect: Use double quotes for column names, single quotes for string literals
- Preserve the original query intent - don't completely rewrite unless the structure is fundamentally broken
- Use exact column names from the schema (case-sensitive)
{% endblock %}
