Bug Protocol — "Loudly Declare"
The compute + engine stack is new and moves. Every failure gets this protocol. Never paper over an error to keep a campaign moving — a swallowed bug is worse than a blocked stage. A confabulated mechanism (inventing why the engine did something) is the worst failure mode: the campaign's worst moments have been confabulated reconcile events, pricing behavior, and budget behavior. Verify, don't assert.
Precedent: a totalBudget over-deployment bug (a book with a 40% budget deployed ~96% of NAV at cold
start) was caught exactly this way and invalidated weeks of results. The general lesson is to
quarantine every result affected by an engine defect and rerun only after the behavior is corrected.
The five steps (apply on every failure)
- Stop and characterize — is it config (my fault), data (source-side), or engine (NexusTrade)? Reproduce minimally — the smallest job/backtest that still shows it.
- Log it immediately in the run's
CAMPAIGN_LOG.mdunder a⚠️ BUG/ISSUEheading: symptom, repro IDs, expected-vs-observed, current hypothesis (labeled hypothesis), what it blocks. - If it's a real engine/data bug, write a hand-off doc
<NAME>_BUG.mdin the run directory, modeled on the template inreferences/BUG_TEMPLATE.md(one-line summary, expected vs observed, reproduction with IDs, leading hypothesis, alternatives to rule out, where to look, impact on results). - Quarantine affected results — mark every backtest/study that ran before the fix as suspect/invalid. Re-run after the fix. If the bug inflated leverage, both returns AND drawdowns are inflated and any sweep gene it touched may be non-differentiating — re-validate all of it.
- Tell the human, prominently, in the chat. Bugs are a co-equal deliverable of the episode with the trading result — not an embarrassment to route around.
What is NOT a bug (honest-signal failures — don't file these)
- A fold returning
NoEligibleCandidate= an honest signal, not a bug. Widen validation; don't drop the certification floors. - A dead / not-yet-listed name (e.g. SNDK in 2022) being absent or in a reject list with no fabricated values = correct behavior. The engine fabricating a price/indicator value for a name that didn't trade IS a bug (see engine-sanity).
- A single-tick reconcile target = the live strategy accretes the rest over daily rebalances — say so, don't re-diagnose it as a bug (see deploy-gate).
Verify-don't-assert checklist
Before writing any claim about engine behavior into a deliverable, back it with one of:
query_backtest_events / query_portfolio_events, a conditionFieldAudit, or a minimal
reproduction. "The engine probably…" is not evidence.