Repository navigation
grader: resolve distinct-entry identity against every TradingView entry key - #313
Merged
Merged
Conversation
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.
What
This fixes a defect in the grader's distinct-entry identity check (
scripts/verify_corpus.py). No other gate, threshold, tier rule, matcher or fragment-consolidation step changes.The check needs the engine to show as many distinct entry incarnations as TradingView shows distinct entry Signals, wherever TradingView proves several separate entries at one exact time, price and direction. To decide which TradingView entry an engine row belongs to, the old code compared engine prices only against the proven multi-Signal keys. An engine row sitting exactly on a nearby one-Signal entry, one tick away and inside the 0.01 % entry tolerance, was counted against the proven key next to it. That can wrongly reject a correct engine. It can also hide an engine that merged two entries.
The fixed check resolves prices against every TradingView entry key at that time and direction:
excellent.Rule text
Before. At each exact entry timestamp, price and direction where TradingView exports at least two distinct, non-empty entry Signals, the distinct-entry identity check requires:
To assign engine rows to those proven multi-Signal keys, the check considers only the proven keys with the same timestamp and direction:
excellent.Other TradingView entry keys are invisible to this assignment. A row exactly at a nearby one-Signal or empty-Signal key can therefore be borrowed by a multi-Signal key, which falsely rejects a correct engine or conceals a merged entry.
After. At each exact entry timestamp, price and direction where TradingView exports at least two distinct, non-empty entry Signals, the check still requires non-empty engine entry-incarnation identities and a distinct identity count equal to that Signal count. Raw fragment-row count still cannot certify separate entries.
Assignment now considers every TradingView entry key with that exact timestamp and direction, including keys with only one Signal or none:
excellentat each affected proven key.excellent.No nearest-price choice is permitted. Fragment consolidation, trade matching, tier criteria and all thresholds are unchanged, so an extra nearby entry still fails the count gate. This fixes which entry a row represents; it does not loosen the standard.
Evidence
scripts/test_verify_corpus_metrics.pyhas new unit tests and a synthetic refill-cascade tape (tests/fixtures/coof_cascade_identity/). Against the old grader, 6 of 43 fail; with the fix, all 43 pass.Docs
README (the grade definitions and a new "Distinct-entry identity" section), CONTRIBUTING and the LLM contributor page now describe the rule as written above.
🤖 Generated with Claude Code