{# 06 / STARTER CODE — synthesised runnable snippet. The starter_code prompt produces a Python (default) script that hits the recommended endpoint(s) with the recommended library; the renderer dumps it verbatim inside a
so users can copy-paste it.
T42.3 — wrap the snippet in a styled scrollable container with a Copy
button. The starter snippet for a real scan is typically 200+ lines
(full auth flow + retry harness); on a typical viewport it used to
push the rest of the report (07 / 08) below the fold. The 600px cap
+ ``overflow-y:auto`` keeps it self-contained. The Markdown fallback
report stays unchanged — Markdown handles its own layout.
T47.2 — when the synthesis prompt ran but ``starter_code.code`` came
back empty / whitespace-only (the combined ``scan_synthesis`` call
sometimes returns ``""`` for this field while populating the others),
render the retry banner in slot 06 instead of leaving the section
blank. Skipping the section entirely was the v0.1.x behaviour and led
to T47.2's "06 is missing" complaint: users couldn't tell whether the
section was suppressed deliberately or whether the prompt had failed.
The retry path mirrors T18's per-section retry (rerun_orchestrator
``prompt_name='synthesis'``) so the user pays no credits to recover.
The section is suppressed entirely only when synthesis_result is None
(legacy / pre-T16 scans where no synthesis ever ran -- there's
nothing to retry).
T52 — dropped the hardcoded Tailwind ``bg-gray-900`` / ``text-gray-100``
classes in favour of theme-aware CSS variables (``--bg-deep``,
``--ink-2``, ``--accent``) so the code block respects the user's
light/dark toggle. Matches the snippet-pane style used by
scraping_plan.html for curl/httpx snippets. #}
{% set sc = (report.synthesis_result.starter_code if report.synthesis_result else None) %}
{% set sc_code = (sc.code | default('') if sc else '') %}
{% set sc_has_code = sc_code and sc_code.strip() %}
{% if report.synthesis_result %}
06 / STARTER CODE
{% if sc_has_code %}
Runnable starter snippet
A {{ sc.language | default('python') }} script using the recommended library and headers from this scan. Treat it as a starting point — add your own error handling, retries, and proxy config before production use.
{{ sc.code|e }}
{% if sc.notes %}
{% for note in sc.notes %}
- {{ note }}
{% endfor %}
{% endif %}
{% else %}
Runnable starter snippet
Starter code couldn’t be generated for this scan. The other sections (recommendation, verdict, scraping plan) are still trustworthy — this is an isolated failure of the starter_code field on the combined synthesis call.
{% with section_name='synthesis', section_label='starter code' %}
{% include 'partials/retry_section.html' %}
{% endwith %}
{% endif %}
{% endif %}