Strategy application context — when each strategy applies, and when it must not fire - #7
Merged
Conversation
Each library strategy carried a two- or three-line header restating the condition its IR already encodes. That is zero selection value: it says what the strategy does, never when it applies or when it must not fire. ATS reads this block verbatim (llmre/nano_catalog.py reads the leading // comment block and renders it beside the compiled intent) and it is the only place a rejection can be expressed, because the proposal engine retargets a published rule to the live instrument but carries its thresholds unchanged. Each header now states the regime it belongs to and the regimes where it must NOT fire, the conditions that must hold first, what invalidates it, its shape on the chart, the near-neighbour it gets confused with, and the instrument class its thresholds were calibrated on. That last field is the one that prevents silent damage. Several thresholds do not travel: ROC > 5 is an ordinary hour for BTC and a limit move for an index future, and BB_WIDTH < 4 is an absolute percentage that stops discriminating on a quieter instrument. ATR_PCT > 5 is the worst case — carried across unchanged it does not misfire, it never fires, and the volatility brake silently disappears. Comments only. No IR changes, so the source/IR conformance guard is unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gives every library strategy the context needed to decide when it applies and when it must not fire.
One commit, 15 files, comments only — no IR, no source, no packaging changes.
The problem
Every library strategy carried two or three lines restating its own entry condition:
That has zero selection value. It says what the strategy does, never when it applies — and a consumer reading this corpus already has the condition from the compiled IR. So the header was spending tokens to repeat something the reader already knew, while the thing it actually needed to decide was absent.
The change
Each header now states:
That last field is not documentation. A consumer retargets a published rule to whatever instrument is live but carries its thresholds across unchanged, so the hazard is wrong-regime numbers transplanted between instrument classes — and this header is the only place a rejection can be expressed.
Concrete cases the headers now name:
roc_momentum— ROC > 5 is an ordinary hour for BTC and a limit-move event for an index future.bb_squeeze_breakout—BB_WIDTH < 4is an absolute percentage; on a quieter instrument it is permanently satisfied and stops discriminating at all.atr_volatility_halt— the worst case, and counterintuitive. Carried across unchanged this breaker does not misfire, it never fires, and the volatility brake silently disappears.golden_cross— marked a regime filter, not an entry. It is true for months, so firing it as a trigger fires on every bar of a bull market.volume_spike_confirmationis a strict subset ofrsi_oversold_reversal, andwilliams_r_reversalis the invertedstochastic_oversold. Both pairs agreeing is one idea counted twice, not confirmation — now stated where the selection is made.Verification
Comments cannot change compiled output, so the source/IR conformance guard was never at risk — but it was verified rather than assumed:
REGIME:andCALIBRATED ON:Cost
The rendered catalog grows to roughly 4.9k tokens for a consumer that loads the whole library each cycle. That is the price of a selection filter and is the intended trade, but it is a real per-cycle cost worth watching.
🤖 Generated with Claude Code