Instrument + HTF parity: engine fixes, runtime syminfo ABI, and TV-graded probes#29
Merged
Merged
Conversation
…quest.security
Weekly: crosses_boundary forced a spurious week boundary at every Jan 1
(tm_year change), splitting the ISO week that straddles Dec/Jan into two
partial weeks. A weekly request.security SMA then updated a bar early —
visible as ~30 flipped close-vs-weekly-SMA crosses in a chop-at-level
month (2026-01). Fix: compare the absolute Monday date (continuous across
years). Surfaced by a TV-parity weekly probe (weak->excellent).
Monthly: validate_security_timeframes rejected 'M' because tf_to_seconds
returns -1 (calendar marker) tripping the <=0 guard, though the CALENDAR
month aggregator is wired. Admit the month marker as a coarser HTF
(security_lower_tf('M') stays invalid). test_calendar_aggregation_wm gains
a year-boundary regression (the Dec29-Jan4 week is one 7-day week).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ue into PnL Adds strategy_set_syminfo_mintick / strategy_set_syminfo_pointvalue C-ABI setters (append-only; MINOR bump due), mirroring the existing runtime syminfo timezone/session/metadata setters — the engine stores no instrument metadata of its own; the harness injects it per run, by design. pointvalue ($/point/contract) now multiplies realized PnL + MFE/MAE in emit_close_trade (crypto/equity pointvalue=1 -> unchanged; futures e.g. ES=50 -> correct). Kills the dead-field finding. ABI whitelist updated. Validated: ES futures TV-parity excellent (550/550) once injected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Engine-only invariant oracles for the remaining TV-oracle-less TA family: TSI/RCI bounded [-100,100]; NVI frozen on non-down-volume bars, PVI frozen on non-up-volume bars (origin-formula-independent structural invariants). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ection verify_corpus.py + run_strategy.py resolved the TV export tz to a fixed integer offset, so an IANA zone with DST (e.g. America/New_York, UTC-4 summer / UTC-5 winter) mis-aligned trades across the Nov DST flip. Both now accept IANA zone names via zoneinfo (DST-aware) alongside the legacy fixed aliases — enables US-equity / FX parity. run_strategy also injects runtime_overrides.mintick / .pointvalue through the new C-ABI setters. Validated: AAPL US-equity (RTH+gaps+DST) TV-parity excellent (82/82). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Points the corpus gitlink at the commit adding the 12 ETH TA/HTF validation probes (headline 233 -> 245 excellent) + the 5 categorized special-validation probes (AAPL/ES/EURUSD/monthly/leverage). The local probe staging area (proposed-probes/) is removed — probes now live in the corpus submodule only, keeping the engine repo clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…/us-equity) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
corpus PR merged; update the gitlink from the feature-branch commit to the corpus main commit so the submodule reference resolves on a clone of corpus main. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Closes the corpus's instrument-monoculture + HTF gaps with TV-graded probes and the engine fixes they surfaced. Adds runtime syminfo injection (mintick/pointvalue) so non-crypto instruments validate, makes the verifier DST-aware, and grows the headline corpus 233 → 245 excellent.
Probes live in the
corpussubmodule (PR: pineforge-corpus#probes/instrument-and-htf-parity); this branch's gitlink points at them. Merge the corpus PR first.Engine / ABI
fix(engine)weekly HTF year-boundary —crosses_boundaryforced a spurious week split at every Jan 1 (tm_yearchange), so a weeklyrequest.securitySMA updated a bar early → ~30 flipped crosses in a chop-at-level month. Now compares the absolute Monday date (continuous across years). Surfaced by a TV weekly probe (weak→excellent).feat(engine)accept monthlyrequest.security("M")—validate_security_timeframesrejected the calendar marker (tf_to_seconds("M")==-1) though the MONTH aggregator is wired; now admitted as a coarser HTF (security_lower_tf("M")stays invalid). Year-boundary regression added totest_calendar_aggregation_wm.feat(abi)runtime syminfo mintick/pointvalue setters —strategy_set_syminfo_mintick/strategy_set_syminfo_pointvalue(append-only → MINOR version bump due), mirroring the existing runtime syminfo setters; the engine stores no instrument metadata of its own (harness injects per run).pointvaluenow multiplies realized PnL + MFE/MAE (crypto/equity pointvalue=1 → unchanged; ES=50 → correct), killing the dead-field finding. ABI whitelist updated.Scripts
verify_corpus.py+run_strategy.py(IANA zones viazoneinfo) — a fixed offset mis-aligned US-equity/FX across the Nov DST flip.run_strategyalso injectsruntime_overrides.mintick/.pointvalue.Tests
test_ta_volume_state_oracle: TSI/RCI value bounds + NVI/PVI structural update-rule (engine-only invariants).TV-parity results (via the corpus submodule)
validation/(headline sweep): +12 ETH probes, allexcellent—ta.{tsi,rci,cog,cmo,mfi,wpr,obv,accdist,pvt,nvi,pvi,pivot_point_levels}+ weekly HTF. The TA volume/state family had zero TV coverage before.special-validation/<category>/<probe>/(excluded from the sweep): AAPLexcellent(RTH+gaps+DST), ESexcellent(point value 50, 0.25 tick), EURUSDstrong(TV-exact fills; sub-cent FX PnL artifact), monthly + leverage documented (warmup-depth / missing forced liquidation). Licensed OHLCV/TV/engine data git-ignored.Verification
ctest53/53 (incl. ASan/UBSan lane) ·scripts/run_corpus.sh245 excellent + 1 anomaly, 0 fail, 0 churn.🤖 Generated with Claude Code