Skip to content

fix(config): sweep every remaining stale description of the intraday gate - #82

Merged
StackOverFlow11 merged 2 commits into
mainfrom
fix/gate-description-configs
Jul 21, 2026
Merged

fix(config): sweep every remaining stale description of the intraday gate#82
StackOverFlow11 merged 2 commits into
mainfrom
fix/gate-description-configs

Conversation

@StackOverFlow11

Copy link
Copy Markdown
Owner

Why

Review of #78 asked whether its guard was too narrow. It was — and in a way worse than "a reworded sentence escapes the regex."

The guard scanned only the two report modules it had just fixed. Six live instances of the original defect were therefore unreachable by it even in principle:

file claim
qt/config.py:343 "comparing the selected execution-minute RAW close to raw stk_limit"
config/phase_i5b_...yaml:7 "execution-minute RAW 1min close to the raw stk_limit band"
config/phase_i5b_...yaml:46 "raw stk_limit vs the raw execution-minute close"
config/phase_i5c_...yaml:45 same sentence
config/phase_i5d_...yaml:46 same sentence
config/phase_i5e_...yaml:48 same sentence
config/phase_i5f_...yaml:51 same sentence

Five of these are in the config files an operator reads before enabling price_limit_check — a higher-stakes readership than a docstring, since they are exactly what someone edits when touching this feature.

A guard scoped to the files you already fixed can only ever confirm what you already know.

Widening it found six more

Extending the scan to the whole feature surface immediately surfaced a related staleness from the same PR #75 behaviour change — descriptions of the fill price, not the gate:

"execute at the first valid 1min close in [14:51, 14:56:59]"

in qt/intraday_tail_framework.py's module docstring and the I5a / I5b / I5f configs. PR #75 moved the fill to the bar VWAP too. Twelve sites total: seven describing the gate, five describing the fill.

The two restatements that survive by necessity

runtime/backtest/event_models.py and qt/config.py both sit upstream of qt.intraday_tail_framework in the import graph — it imports them — so neither can call limit_basis_phrase() without a cycle. Both now point at it rather than restating it, and the repo-wide scan is the net underneath them. The event_models.py docstring says so explicitly, so the next person does not try the import and discover the cycle themselves.

What was deliberately NOT swept

RUNBOOK.md and CLAUDE.md's 「涨跌停用未复权 raw close 比 stk_limit」 describe the daily universe tradability filter (universe/filters.py, data/clean/tradability.py) — a separate, older mechanism that genuinely does compare a raw daily close. Checked individually; sweeping them would have replaced a true statement with a false one.

Scope of the guard, stated honestly in its own docstring

It catches "close" written near "execution minute". It does not catch a reworded synonym — review demonstrated seven escapes ("its last print", "the final tick", "1-minute" for "1min"), and no lexical guard can close that gap. Composition is the real answer where the import graph allows it; this scan covers the two places it does not.

Gates

pytest 1776 passed · ruff clean · 31/31 configs validate · phase0 ic_mean=0.9600, annual_return=0.8408 · secret scan 0

…gate

Review of #78 asked whether its guard was too narrow. It was, in a way worse than
"a reworded sentence escapes the regex": the guard scanned only the two report
modules it had just fixed, so SIX live instances of the original defect were
structurally unreachable by it -- one in qt/config.py and five in the I5b/c/d/e/f
config YAMLs. Those YAML comments are what an operator reads before enabling
price_limit_check, a higher-stakes readership than a docstring.

A guard scoped to the files you already fixed can only ever confirm what you
already know. Widening it to the whole feature surface immediately found six MORE
stale sites of a related kind -- "execute at the first valid 1min CLOSE in
[14:51, 14:56:59]" in the I5a/I5b/I5f configs and the tail-framework module
docstring, describing the FILL price, which PR #75 also moved to the bar VWAP.

Twelve sites total: seven describing the gate, five describing the fill.

Two restatements survive by necessity and now say so. runtime/backtest/
event_models.py and qt/config.py both sit UPSTREAM of qt.intraday_tail_framework
in the import graph -- it imports them -- so neither can call limit_basis_phrase
without a cycle. Both now point at it instead of restating it, and the scan is
the net under them.

Deliberately NOT swept, and checked individually: RUNBOOK.md and CLAUDE.md's
"涨跌停用未复权 raw close 比 stk_limit" describe the DAILY universe tradability
filter (universe/filters.py, data/clean/tradability.py) -- a separate, older
mechanism that genuinely does compare a raw daily close. Sweeping those would
have replaced a true statement with a false one.

The test's docstring states its scope honestly: it catches "close" written near
"execution minute", not a reworded synonym. Review proved seven such escapes and
no lexical guard can close that. Composition is the answer where the import graph
allows it; this scan covers the two places it does not.

pytest 1776 passed, ruff clean, 31/31 configs validate, phase0 unchanged.
Review of #82 verified the sweep independently -- 12 pre-fix hits, 0 post-fix,
line numbers matching -- and noted that #79's qt/exec_basis_eval.py,
qt/exec_basis_sanity.py and qt/exec_forward_returns.py describe the same
execution anchor from the factor side and were not in the scan's target list.
They are accurate today; it read them.

Adding them anyway. The entire reason this guard had to be widened twice was that
its first version covered only the files already fixed, which meant it could
confirm nothing except what was already known. Waiting for these three to go
stale before listing them would repeat that exactly.

No behaviour change; the scan passes with them included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant