Skip to content

fix(engine): supports_lower_tf_emulation accepts seconds-suffix TFs - #20

Merged
luisleo526 merged 2 commits into
mainfrom
fix/phase-a-engine-parity
May 28, 2026
Merged

luisleo526 merged 2 commits into
mainfrom
fix/phase-a-engine-parity

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Summary

  • Phase A engine parity work — extends is_fixed_intraday_minute_tf to accept <digits>S (seconds-suffix) TFs
  • Without this, request.security_lower_tf("30S", ...) on 1m input threw an internal error despite being a valid divisor (60/30=2)
  • tf_to_seconds updated to parse trailing 'S' as seconds

Test plan

  • test_lower_tf_seconds_suffix (new): 30S/45S/15S on 1m + "5"/"15" minute baseline
  • Full ctest (41/41 pass)
  • Full corpus sweep: 234/234 ok, excellent=233 + anomaly=1 (no regression)

Plan: docs/superpowers/plans/2026-05-28-phase-a-engine-parity.md (subset — A1/A2/A3 were already fixed upstream)

🤖 Generated with Claude Code

luisleo526 and others added 2 commits May 28, 2026 22:47
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]>
@luisleo526
luisleo526 merged commit ee81d98 into main May 28, 2026
4 checks passed
@luisleo526
luisleo526 deleted the fix/phase-a-engine-parity branch May 28, 2026 16:32
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