Repository navigation
fix(engine): supports_lower_tf_emulation accepts seconds-suffix TFs - #20
Merged
Merged
Conversation
is_fixed_intraday_minute_tf previously only accepted digit-only
strings, so Pine seconds literals "30S" / "45S" / "15S" all returned
false. supports_lower_tf_emulation then short-circuited to false, and
the downstream code path in engine_security.cpp threw an internal
error for the "30S" case (60 / 30 = 2 is a valid divisor that should
emulate, not raise "passed integer-ratio check but emulation support
returned false").
Two fixes:
* is_fixed_intraday_minute_tf — accept "<digits>S" in addition to
bare digits.
* tf_to_seconds — handle a trailing 'S' as seconds rather than
falling through to stoi() which silently parses "30S" as 30 and
multiplies by 60 (yielding 1800 seconds = 30 minutes, not 30s).
After this change, "30S" on 1m input correctly emulates with ratio=2,
and "45S" on 1m input is correctly rejected by the existing modulo
check (60 % 45 != 0).
Adds tests/test_lower_tf_seconds_suffix.cpp as the regression guard;
no corpus probe exercises sub-minute LTF today.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Summary
is_fixed_intraday_minute_tfto accept<digits>S(seconds-suffix) TFsrequest.security_lower_tf("30S", ...)on 1m input threw an internal error despite being a valid divisor (60/30=2)tf_to_secondsupdated to parse trailing 'S' as secondsTest plan
test_lower_tf_seconds_suffix(new): 30S/45S/15S on 1m + "5"/"15" minute baselinePlan:
docs/superpowers/plans/2026-05-28-phase-a-engine-parity.md(subset — A1/A2/A3 were already fixed upstream)🤖 Generated with Claude Code