Skip to content

ops(backtests): read runtime_type/decision_source in prod to settle the LLM-vs-rule-based mix #514

Description

@FlyM1ss

From §12 of docs/superpowers/specs/2026-09-21-backtest-bar-cache-design.md (#506).
Companion to #502 — same trip to prod, different data source (the run history DB, not the
Render deploy log).

Both #501 and #506 shorten the dark window before the first bar: schema-init skipping, and
now an on-disk bar cache that removes loading_bars (~86% of that window, measured locally)
on a warm key. Neither touches the decision loop.

So the ceiling on every further change of this kind is the mix of what prod actually runs.
Read it, once, rather than guessing:

SELECT runtime_type, decision_source, COUNT(*), AVG(...)
FROM agent_runs
WHERE created_at > now() - interval '30 days'
GROUP BY 1, 2;

against AGENT_RUNS_DATABASE_URL (the ATL-runs-main Neon project — run history has its own
database, see CLAUDE.md).

Why it decides something: if most runs are decision_source='llm', wall-clock is
dominated by model latency the cache cannot touch, and further start-up work has a small
ceiling — spend the effort on the LLM lane instead. If most are rule-based, the start-up
window is a real share of total runtime and the next cache (aggregated output, the
loading_bars residual that #506 split out as fetch_seconds vs aggregate+verify) is worth
building.

Entry point: §1-C of the speed-and-trust design. Record the numbers on this issue; that
is the deliverable.

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