Skip to content

fix(codegen): parse 'YYYY-MM-DD HH:MM UTC' timestamps + accept ignore_invalid_symbol#44

Merged
luisleo526 merged 1 commit into
mainfrom
fix/transpile-timestamp-utcword-and-ignore-invalid-symbol
Jul 7, 2026
Merged

fix(codegen): parse 'YYYY-MM-DD HH:MM UTC' timestamps + accept ignore_invalid_symbol#44
luisleo526 merged 1 commit into
mainfrom
fix/transpile-timestamp-utcword-and-ignore-invalid-symbol

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

Two additive transpile fixes that unblock valid community Pine. Each recovered a data/ strategy from transpile-error → excellent (100% match, cntAbs 0).

Fixes

  1. timestamp(dateString): _parse_pine_datestring_ms couldn't read a trailing tz word ("2024-01-01 00:00 UTC", "1 Jan 2020 09:30 GMT+2") or the space-separated YYYY-MM-DD HH:MM[:SS] form. Peel the UTC/GMT[±H[:MM]] word into an explicit offset + add the Y-M-D strptime formats. Purely additive — strings that already parsed are unchanged. → recovers yukozb-gold-ny-orb.
  2. request.security ignore_invalid_symbol: was hard-rejected, but it's a guaranteed no-op — codegen forces request.security onto the current chart symbol (always valid), so the flag can never change the result. Moved into SECURITY_ALLOWED_PARAMS (accept + drop). currency stays rejected (FX-changing). → recovers officialjack-helios.

Also fixes a pre-existing stale KI-35 assertion in test_compile_smoke.py (year() now lowers to pine_* helpers, not the old gmtime_r lambda — a #42/#43 leftover).

Verification (fresh-context R7 = GO)

  • Corpus emission-diff (authoritative): transpiled all 265 corpus strategies at HEAD vs parent → byte-identical, 0 changed, 0 regressed (corpus uses 0 ignore_invalid_symbol, 0 timestamp(, so the new paths are untouched).
  • pytest: 1446 passed.
  • Recovered: yukozb + officialjack-helios → excellent (fail at parent for exactly the 2 fixed reasons, succeed at HEAD).
  • Sentinels: 3commas-pol-grid + lukeborgerding excellent, byte-identical transpile.
  • Full data re-sweep: exc+strong 324→326/400, 0 tier regressions.

🤖 Generated with Claude Code

…_invalid_symbol

Two additive transpile fixes that unblock valid community Pine (each recovered a
data/ strategy from transpile-error to EXCELLENT, 100% match / cntAbs 0):

1. timestamp(dateString): _parse_pine_datestring_ms couldn't read a trailing tz
   WORD ("2024-01-01 00:00 UTC", "1 Jan 2020 09:30 GMT+2") or the space-separated
   "YYYY-MM-DD HH:MM[:SS]" form. Peel the UTC/GMT[±H[:MM]] word into an explicit
   offset and add the Y-M-D strptime formats. Purely additive — strings that
   already parsed are unchanged (the regex is a no-op without a trailing tz word).
   Recovers yukozb-gold-ny-orb.

2. request.security ignore_invalid_symbol: was hard-rejected ("reject loudly"),
   but it is a GUARANTEED no-op here — codegen forces request.security onto the
   current chart symbol (the "symbol must reference current chart symbol" check),
   which is always valid, so the flag can never change the result. Move it into
   SECURITY_ALLOWED_PARAMS (accept + drop), alongside backadjustment/adjustment.
   `currency` stays hard-rejected (it changes values via FX conversion). Recovers
   officialjack-helios.

Also fixes a pre-existing stale KI-35 assertion in test_compile_smoke.py
(test_regression_year_function_call_form_compiles asserted the old gmtime_r inline
lambda; year()/hour() now lower to pine_<field>() engine helpers — PR #42 leftover
that PR #43 missed).

Tests: new timestamp UTC/GMT-word cases; ignore_invalid_symbol now asserted
accepted; locked-params snapshot updated. Full suite green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@luisleo526 luisleo526 merged commit bdc1191 into main Jul 7, 2026
9 checks passed
@luisleo526 luisleo526 deleted the fix/transpile-timestamp-utcword-and-ignore-invalid-symbol branch July 7, 2026 10:19
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