Skip to content

grader: resolve distinct-entry identity against every TradingView entry key - #313

Merged
luisleo526 merged 3 commits into
mainfrom
px/w7-identity-grader
Oct 3, 2026
Merged

luisleo526 merged 3 commits into
mainfrom
px/w7-identity-grader

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

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:

  • An exact price belongs only to its own key.
  • A non-exact price counts at a proven key only if that key is the sole TradingView key within the tolerance.
  • A price inside the tolerance of a proven key and of any other TradingView key is ambiguous and refuses 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:

  • non-empty engine entry-incarnation identities;
  • a distinct identity count equal to that Signal count. Raw fragment-row count cannot certify separate entries.

To assign engine rows to those proven multi-Signal keys, the check considers only the proven keys with the same timestamp and direction:

  • exact price equality with a proven key wins;
  • otherwise, a price is assigned if exactly one proven key is within the strict relative entry tolerance (less than 0.01 %);
  • overlap between proven keys, missing identities or unequal identity counts refuse 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:

  • An exact price equality belongs only to its own TradingView key. It contributes to a proven multi-Signal key only if that is the exact key.
  • Without an exact match, a row contributes only when a proven multi-Signal key is the sole TradingView key within the unchanged strict relative entry tolerance (less than 0.01 %).
  • A non-exact price within tolerance of a proven key and of any other TradingView key is ambiguous, and refuses excellent at each affected proven key.
  • Missing identities or unequal identity counts also refuse 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

  • Tests: scripts/test_verify_corpus_metrics.py has 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.
    • The nearby-extra-entry guard (it must still fail the count gate) and the ambiguity guard are pinned.
  • Full verification profiles on this exact tree: preflight, release (792 rows), debug and sanitizers (773 each), kernel (301), docs (0 Doxygen warnings), corpus parity (312 of 312 unchanged: 311 excellent, 1 anomaly) and subset (54).
  • Full-population parity sweep of this head: 7,989 probes, with the same engine library, so every trade set is identical. Exactly 7 probes change grade: the seven refill-cascade probes, from strong to excellent (1 hard-lane, 6 target). Every grade field of the other 7,982 probes is identical to the baseline. Gate verdict: PASS (improved), 0 worsened, hard rank sum 4022 → 4023.

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

@luisleo526
luisleo526 marked this pull request as ready for review October 3, 2026 01:13
@luisleo526
luisleo526 merged commit 227c223 into main Oct 3, 2026
18 checks passed
@luisleo526
luisleo526 deleted the px/w7-identity-grader branch October 3, 2026 01:16
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