{# Reusable cockpit presentation macros. The Overview is the TEMPLATE for a consistency pass across the cockpit (Paper / Replay / Backtest roll to these next), so the headline card, the provisional-Sharpe span, and the compact track row all live here. Pure presentation — no data is computed in templates. #} {# ---- provisional_num: a number that DIMS + marks itself when its window is still pre-gate ------------- Keep short-window forward stats visible ("fun to watch") but visibly NOT authoritative. `warming=True` renders muted with a "· pre-gate" marker; once the window clears it renders bright/normal. `cls` is the bright (cleared) sign-class (e.g. "pos"/"neg"); pre-gate always overrides to muted. #} {% macro provisional_num(text, warming, cls="") %} {%- if warming -%} {{ text }} · pre-gate {%- else -%} {{ text }} {%- endif -%} {% endmacro %} {# ---- headline_card: the fund headline — the CONNECTED backfill record + a small live-readiness chip --- `h` is the backfill view: final_equity, total_return_pct, sharpe, max_dd_pct, since (year), title, and `gate` {days, min_days, status} for the secondary chip. `curve` is the pre-rendered multi-year SVG. #} {% macro headline_card(h, curve) %}

Fund status — {{ h.title }}

{% if h.has_record %}
${{ h.final_equity|money }} {{ '%+.0f'|format(h.total_return_pct) }}% · Sharpe {{ '%.2f'|format(h.sharpe) }} · maxDD {{ '%.0f'|format(h.max_dd_pct) }}% · since {{ h.since }} live: gate {{ h.gate.days }}/{{ h.gate.min_days }} · {{ h.gate.status }}
{% if curve %}
{{ curve|safe }}
{% endif %}
{% else %}

no backfilled record yet · live: gate {{ h.gate.days }}/{{ h.gate.min_days }} · {{ h.gate.status }}

{% endif %}
{% endmacro %} {# ---- exec_badge: the PAPER/LIVE execution-mode badge driven by the registry `execution` field. On every track so the operating console is unmissably consistent (all "paper" today; "live" flips green). #} {% macro exec_badge(execution) %}{{ execution|upper }}{% endmacro %} {# ---- track_row: one compact edge row. `record` is the meaningful number (backfill/backtest ref, else "—"); the forward column shows the gate days/min · STATUS plus the dimmed provisional forward Sharpe. Carries the PAPER/LIVE badge (registry `execution`) beside the name. #} {% macro track_row(f, spark) %} {{ f.display_name }} {{ exec_badge(f.execution) }} {% if f.status %}{{ f.status }}{% endif %} {%- if f.bt_status -%} Sh {{ '%.2f'|format(f.bt_sharpe) if f.bt_sharpe is not none else '—' }} / {{ '%+.0f'|format(f.bt_cagr*100) if f.bt_cagr is not none else '—' }}% {%- else -%} {%- endif -%} {{ f.days }}/{{ f.gate_min_days }} · {{ f.gate_status }} {{ provisional_num('Sh %.2f'|format(f.sharpe), f.warming, 'pos' if f.sharpe >= 0 else 'neg') }} {{ spark(f.strategy_id)|safe }} {% endmacro %} {# ---- deploy_constituent_row: one constituent edge of a DEPLOY book — its standalone (vol-targeted) venue metric. `e` = {strategy_id, display_name, sleeve, sharpe, ann_return_pct, max_dd_pct}. Always PAPER. #} {% macro deploy_constituent_row(e) %} {{ e.display_name }} {{ exec_badge('paper') }} Sh {{ '%.2f'|format(e.sharpe) }} / {{ '%+.0f'|format(e.ann_return_pct) }}% {{ '%.0f'|format(e.max_dd_pct) }}% {% endmacro %} {# ---- research_section: the dimmed, registry-driven RESEARCH block ("not the fund") — every research-tier tracker grouped by venue, each PAPER/LIVE-badged via track_row. REUSABLE so the same deploy/research structure can roll to the Paper page next. `groups` = [(venue, [FleetRow, ...]), ...]. #} {% macro research_section(groups, spark) %}
{# It's literally "not the fund" — collapsed by default so the main fund overview isn't a long wall; the summary is styled to match the section

skin (font-size/border-bottom). #}
Research — not the fund (experimental edges)
{% for venue, rows in groups %} {% for f in rows %}{{ track_row(f, spark) }}{% endfor %} {% endfor %}
edgerecordforwardnav
{{ venue }}

dimmed = pre-gate, statistically provisional

{% endmacro %}