pineforge-codegen 1.5.0__py3-none-any.whl → 1.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -511,9 +511,9 @@ class CallHandlers:
511
511
  if func_name == "vwap" and not all_args:
512
512
  # The bare ``ta.vwap`` property is the VWAP of hlc3 (Pine v6
513
513
  # reference: "It uses hlc3 as its source series"); TradingView's
514
- # own read equals hlc3 on a daily bar (lab tv
515
- # notrade-session-vwap-f1d, NYSE:F 1D 2025-07-01..08-31, 42/42,
516
- # 2026-09-05), where the engine used to read the bar's close.
514
+ # own read equals hlc3 on a daily bar (a daily US-stock probe,
515
+ # tapes kept outside this repository), where the engine used to
516
+ # read the bar's close.
517
517
  default_src = Identifier(name="hlc3")
518
518
  self._visit(default_src)
519
519
  for field in ("high", "low", "close"):
@@ -2,7 +2,7 @@
2
2
  timeframe.
3
3
 
4
4
  TradingView flags a bar by its own open time: on an extended-hours
5
- NASDAQ:AAPL 60 chart the 09:00 bar, which holds the 09:30 open, is
5
+ US-listed stock's 60-minute chart the 09:00 bar, which holds the 09:30 open, is
6
6
  pre-market and the 16:00 bar post-market. It reads a session's day mask per
7
7
  session day, so an overnight session's Sunday-evening open belongs to
8
8
  Monday's, and a ``0000-2400`` day is in market throughout; a D/W/M bar holds
@@ -407,34 +407,36 @@ class TaSiteHelper:
407
407
  # TradingView's per-family clocks below a top-level lazy edge
408
408
  # ------------------------------------------------------------------
409
409
  #
410
- # Pinned 2026-09-03 with ``lab tv`` on NYSE:F 1D (range 2025-04-01 ..
411
- # 2026-05-01; cadence-7 ternary probes ``v = bar_index % 7 == 3 ? <call> :
410
+ # Pinned on a daily US-stock probe (tapes kept outside this repository;
411
+ # cadence-7 ternary probes ``v = bar_index % 7 == 3 ? <call> :
412
412
  # na`` exposing the value through the entry size, plus lazy-``and``
413
413
  # probes), each scored per call against three models:
414
414
  #
415
- # every-bar natives highest 9/9, sma 25/25, ema 23/23 -- the runtime
415
+ # every-bar natives highest, sma, ema (every trade matched) -- the runtime
416
416
  # advances the built-in on every chart bar; only the
417
417
  # value is gated (``_lazy_edge_ta_hoist_plan``).
418
- # hold-last source roc 38/38 (+39/39 entries), change 39/39, mom
419
- # 39/39 -- TradingView computes these from the CALL'S
418
+ # hold-last source roc, change, mom (every trade matched) --
419
+ # TradingView computes these from the CALL'S
420
420
  # OWN ``source[length]`` history: the source is
421
421
  # written only on bars where the call executes, the
422
422
  # last executed value is held on skipped bars, and
423
423
  # the history is na before the first execution
424
424
  # (call 1 of every value probe has no TV entry).
425
- # every-bar 0/38..0/39, ring-of-executions 0..1/39.
426
- # per-execution cum, barssince, valuewhen, cross, crossover 39/39,
427
- # rising 39/39 (strictly monotonic over its executed
428
- # samples) and math.sum 39/39 (na until three
429
- # executed samples) -- the native only ever sees the
430
- # samples of bars where the call executes, which is
431
- # exactly the reached-only inline ``compute`` lowering
432
- # (every-bar 0..31/39).
425
+ # the every-bar clock matched almost no trade and the
426
+ # ring-of-executions clock at most one.
427
+ # per-execution cum, barssince, valuewhen, cross, crossover,
428
+ # rising (strictly monotonic over its executed
429
+ # samples) and math.sum (na until three
430
+ # executed samples), every trade matched -- the native
431
+ # only ever sees the samples of bars where the call
432
+ # executes, which is exactly the reached-only inline
433
+ # ``compute`` lowering (the every-bar clock matched
434
+ # fewer than all of them).
433
435
  #
434
436
  # The hoist is an ALLOW-LIST and requires a direct ``[k]`` read. A broad
435
437
  # every-bar hoist of every stateful family measured on Cloud Run against
436
- # the full population (2026-09-04, like-for-like vs the same lab bundle)
437
- # fixed the pinned shapes but cost 170 tiers / 30 hard-lane regressions,
438
+ # the full population (like-for-like vs the same lab bundle)
439
+ # fixed the pinned shapes but cost many tiers and hard-lane regressions,
438
440
  # and hoisting allow-listed families WITHOUT a history read still broke
439
441
  # four ETH hard-lane probes that main matched at 100%: ``adxVal > 30 and
440
442
  # adxVal > ta.sma(adxVal, 7)`` (louislapis9), ``volume < ta.sma(volume,
@@ -444,12 +446,12 @@ class TaSiteHelper:
444
446
  # ``ta.highest(high, n) / entry > 1.05`` under ``and`` (miemomo3). Every
445
447
  # every-bar tape (highest/sma/ema ``[1]`` under ``and``, the ternary
446
448
  # ``ta.highest(high, 5)[1]``, robmagnaye) reads ``[k]`` on the call, and
447
- # the bare twins of those tapes (2026-09-04, same cadence-7 probes) are
448
- # per-execution: ``close > ta.sma(close, 5)`` ring 39/39 (every-bar 23),
449
- # ``close > ta.ema(close, 5)`` ring 39/39 (26), ``? ta.sma(close, 5) : na``
450
- # ring 39/39 (2, na until five executed samples), ``? ta.highest(high, 5)
451
- # : na`` ring 38/39 (11; TV is na with one executed sample, then the
452
- # partial maximum). So: TradingView keeps a lazily executed call on the
449
+ # the bare twins of those tapes (same cadence-7 probes) are
450
+ # per-execution: ``close > ta.sma(close, 5)`` ring matched every trade
451
+ # (every-bar did not), likewise ``close > ta.ema(close, 5)``,
452
+ # ``? ta.sma(close, 5) : na`` (na until five executed samples) and
453
+ # ``? ta.highest(high, 5) : na`` (ring matched all but one trade; TV is na
454
+ # with one executed sample, then the partial maximum). So: TradingView keeps a lazily executed call on the
453
455
  # reached-only clock unless the call's own history is referenced (``[k]``),
454
456
  # in which case it materialises a continuous series and the call is
455
457
  # evaluated on every bar. Only ``LAZY_EVERY_BAR_TA`` families
@@ -670,12 +672,13 @@ class TaSiteHelper:
670
672
  per-execution inline compute (cum/barssince/valuewhen/cross*/rising/...)
671
673
  must never precalc.
672
674
 
673
- Re-pinned 2026-09-03: the old opt-out for a chart ``ta.sma`` under an
675
+ Re-pinned: the old opt-out for a chart ``ta.sma`` under an
674
676
  ``and`` RHS (pf-probe-oliver-dual-vol-sma, "eager precalc is
675
677
  TV-incorrect") and the matching recursive ``ta.ema`` rule encoded a
676
- per-call clock that ``lab tv`` refuted for top-level shapes (NYSE:F 1D,
677
- ``... and close > ta.sma(close,5)[1]``: every-bar 25/25 vs per-call 28;
678
- ``ta.ema``: 23/23 vs 27). The analyzer never marks a site inside an
678
+ per-call clock that TradingView refuted for top-level shapes (a daily
679
+ US-stock probe, ``... and close > ta.sma(close,5)[1]``: the every-bar
680
+ clock matched every trade and the per-call clock did not; ``ta.ema``
681
+ likewise). The analyzer never marks a site inside an
679
682
  ``if``/loop/function scope static, so after hoisting the opt-outs
680
683
  only reach a static lazy-edge ``ta.sma``/``ta.ema`` that is not a
681
684
  top-level statement operand -- in practice a UDT field default
@@ -717,21 +720,21 @@ class TaSiteHelper:
717
720
  # Every-bar hoisting of stateful ``ta.*`` sites below top-level lazy edges
718
721
  # ------------------------------------------------------------------
719
722
  #
720
- # TradingView rule, pinned 2026-09-03 with ``lab tv`` on NYSE:F 1D (tapes
721
- # out-pin-ring-lazyand / lazyand-sma / lazyand-ema / ring-ternary): a
723
+ # TradingView rule, pinned on a daily US-stock probe (tapes kept outside
724
+ # this repository; out-pin-ring-lazyand / lazyand-sma / lazyand-ema / ring-ternary): a
722
725
  # stateful ``ta.*`` call inside ANY expression operand of a top-level
723
726
  # statement -- the RHS of a Pine-v6 lazy ``and``/``or``, either branch of a
724
727
  # ternary, nested comparisons -- is evaluated on EVERY bar. Short-circuiting
725
728
  # and branch selection gate only the *value*, never the built-in's state,
726
729
  # and ``[1]`` on such a call is the previous BAR's value:
727
730
  #
728
- # c = bar_index % 7 == 3 and close > ta.highest(high,5)[1] 9/9 entries
729
- # c = bar_index % 7 == 3 and close > ta.sma(close,5)[1] 25/25
730
- # c = bar_index % 7 == 3 and close > ta.ema(close,5)[1] 23/23
731
- # v = bar_index % 7 == 3 ? ta.highest(high,5)[1] : na 38/39
731
+ # c = bar_index % 7 == 3 and close > ta.highest(high,5)[1]
732
+ # c = bar_index % 7 == 3 and close > ta.sma(close,5)[1]
733
+ # c = bar_index % 7 == 3 and close > ta.ema(close,5)[1]
734
+ # v = bar_index % 7 == 3 ? ta.highest(high,5)[1] : na
732
735
  #
733
- # (the per-call / "previous evaluation" model predicts 8/9, 28, 27 and
734
- # 2/39). Production instance: robmagnaye14 ``bullMSS = setupAlive and
736
+ # (the per-call / "previous evaluation" model mispredicts these).
737
+ # Production instance: robmagnaye14 ``bullMSS = setupAlive and
735
738
  # dir == 1 and close > ta.highest(high, 10)[1]``.
736
739
  #
737
740
  # A stateful call INSIDE an ``if``/local-block/function body that does not
@@ -563,8 +563,8 @@ class TypeInferer:
563
563
  milliseconds) is 7 776 000 000 on TradingView. Emitted as C++ ``int``
564
564
  literal arithmetic the same product overflows (wraps to -813 934 592),
565
565
  so a ``(time - t0) > threeMonths`` expiry fires on every bar (round 8
566
- family U: latibonit15 execution-signals-confluence, six lanes; lab tv
567
- u-lati-levels-nq15 vs the engine, 2026-09-05). ``400 * MS`` over
566
+ family U: latibonit15 execution-signals-confluence, six lanes; a recorded
567
+ probe tape vs the engine). ``400 * MS`` over
568
568
  ``const int MS = 7200000`` is 2 880 000 000 too (lab tv
569
569
  pf-cgs-int64-const, 2026-09-28): the constant is emitted as its
570
570
  literal, so the product was the same C++ ``int`` overflow. Folding
@@ -865,8 +865,8 @@ class ExprVisitor:
865
865
  # Same implicit tail as TA_IMPLICIT_APPEND["vwap"]:
866
866
  # the symbol clock keys the Daily anchor reset.
867
867
  # The bare property is the VWAP of hlc3 (Pine
868
- # v6 reference; lab tv notrade-session-vwap-f1d,
869
- # 2026-09-05: TradingView's read equals hlc3 on
868
+ # v6 reference; a recorded daily US-stock probe:
869
+ # TradingView's read equals hlc3 on
870
870
  # a daily bar), never of the close.
871
871
  _hlc3 = "((current_bar_.high + current_bar_.low + current_bar_.close) / 3.0)"
872
872
  return (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pineforge-codegen
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary: PineScript v6 to C++ transpiler that targets the pineforge-engine runtime.
5
5
  Project-URL: Homepage, https://github.com/pineforge-4pass/pineforge-codegen-oss
6
6
  Project-URL: Issues, https://github.com/pineforge-4pass/pineforge-codegen-oss/issues
@@ -327,7 +327,7 @@ for the changes in each release from 1.0.0 on and the release-note policy.
327
327
  ## Releases and this README
328
328
 
329
329
  <!-- Release lane: before a release is tagged, add it to the Engine pairing
330
- table and update every line that names `1.5.0` or `v1.5.0` as the current
330
+ table and update every line that names `1.6.0` or `v1.6.0` as the current
331
331
  release or pair (this section's version and date, the baseline paragraph at
332
332
  the top, the engine `src/source/` link, the `@pf-trace` note, the clone
333
333
  command and its example output, "This section describes …", the timing note)
@@ -337,7 +337,7 @@ hosted-server line name no version. -->
337
337
 
338
338
  This README ships with each release as its package description on PyPI
339
339
  (`pineforge-codegen`); releases from 0.7.0 on are also on npm as
340
- `@pineforge/codegen-pyodide`. It describes 1.5.0 (2026-10-12)
340
+ `@pineforge/codegen-pyodide`. It describes 1.6.0 (2026-10-17)
341
341
  and what changed since 0.10.4. The 1.4.0 release's behavior was validated
342
342
  before tagging on codegen `bfc4ddce` with engine `b3192bfc`, excluding engine
343
343
  request #356; those validation builds reported `1.3.0`. Historical measurements
@@ -410,8 +410,8 @@ It does **not** own execution semantics. Order lifecycle, bracket legs,
410
410
  fill-price and slippage rules, `process_orders_on_close` / `calc_on_order_fills`,
411
411
  margin revival and trail/stop behaviour — everything TradingView parity depends
412
412
  on at run time — live in the engine's source-adapter runtime
413
- ([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.5.0/src/source)
414
- in engine `v1.5.0`), which maps them onto the engine's Pine-agnostic kernel.
413
+ ([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.6.0/src/source)
414
+ in engine `v1.6.0`), which maps them onto the engine's Pine-agnostic kernel.
415
415
  See
416
416
  the engine's [architecture notes](https://github.com/pineforge-4pass/pineforge-engine#architecture-kernel-vs-parity).
417
417
 
@@ -825,6 +825,7 @@ Generated C++ compiles only against the engine it was generated for:
825
825
  | 1.3.0 (PyPI, 2026-10-06) | `v1.3.0` | The pair the `pineforge-release` image `1.3.0` ships. Its C++ adds the confirmed-bar receipt, which engine `v1.3.0`'s live runner reads, and the order-shapes receipt; engine `v1.3.0`'s `<pineforge/pineforge.h>` is `v1.2.0`'s. Regenerate and relink. |
826
826
  | 1.4.0 (PyPI, 2026-10-08) | `v1.4.0` | Adds paired coded failures, corrected input manifests and collection lowering. C ABI 4 does not authorize a mixed pair. Regenerate and relink. |
827
827
  | 1.5.0 (PyPI, 2026-10-12) | `v1.5.0` | Adds the nonfatal `note` diagnostic severity and diagnostic `user_message` templates. Regenerate and relink. |
828
+ | 1.6.0 (PyPI, 2026-10-17) | `v1.6.0` | Emitted C++ and the Python, JSON and diagnostic contract are unchanged since 1.5.0; test and comment cleanup only (#200, #201, #202). Regenerate and relink. |
828
829
  | Later `X.Y.Z` releases | `vX.Y.Z` of the same version | See below. |
829
830
 
830
831
  On the 0.x line the engine and codegen versions are independent, and the
@@ -850,8 +851,8 @@ Pine as `strategy.pine`, write `strategy.generated.cpp` with the
850
851
  [file example](#transpile-a-file-to-a-cpp) above, then from the same directory:
851
852
 
852
853
  ```bash
853
- # 1.5.0 pairs with engine v1.5.0. For 0.10.4 use v0.13.1.
854
- git clone --branch v1.5.0 https://github.com/pineforge-4pass/pineforge-engine.git
854
+ # 1.6.0 pairs with engine v1.6.0. For 0.10.4 use v0.13.1.
855
+ git clone --branch v1.6.0 https://github.com/pineforge-4pass/pineforge-engine.git
855
856
  cd pineforge-engine
856
857
  cp ../strategy.generated.cpp tutorial/macd/generated.cpp # the tutorial's strategy slot
857
858
  bash tutorial/run.sh # needs cmake, a C++17 compiler and python3
@@ -977,7 +978,7 @@ quote. The commercial-license store (coming soon) will take orders online.
977
978
 
978
979
  ## Explicit Pine execution attachment
979
980
 
980
- This section describes the 1.5.0 and engine `v1.5.0` pair. The Pine execution adapter is
981
+ This section describes the 1.6.0 and engine `v1.6.0` pair. The Pine execution adapter is
981
982
  the engine's full Pine execution runtime (`PineExecutionAdapter` and
982
983
  `PineStrategyHost` in the engine's `src/source/`): order lifecycle, bracket
983
984
  legs, fill-price and slippage rules, POOC / `calc_on_order_fills`, margin
@@ -1000,9 +1001,9 @@ Regenerate old generated C++ before using a new engine for Pine execution. C++
1000
1001
  generated before the source-layer cut
1001
1002
  ([#129](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/129)),
1002
1003
  0.10.4's included, derives from `BacktestEngine` and does not compile against
1003
- engine `v1.5.0`; old cap-only C++ does not attach the priority rule, and
1004
+ engine `v1.6.0`; old cap-only C++ does not attach the priority rule, and
1004
1005
  metadata cannot silently restore it. Rebuild all modules against the
1005
- new matching C++ layout (`engine_script_run_v19` in engine `v1.5.0`). Retaining
1006
+ new matching C++ layout (`engine_script_run_v19` in engine `v1.6.0`). Retaining
1006
1007
  that epoch does not promise equal fingerprints, state hashes or trades across
1007
1008
  releases. The extraction preserves Pine policy
1008
1009
  under explicit attachment; it does not implement the generic native
@@ -31,7 +31,7 @@ pineforge_codegen/tokens.py,sha256=SODOOSXKiTW0GMOz41D_IykuAVsUbbSFYS11pqON2rY,1
31
31
  pineforge_codegen/tv_input_choices.py,sha256=4t5q-49hwWquoOMVMbx_WgvFzsZ2Xll24imI7Evsk8I,2508
32
32
  pineforge_codegen/analyzer/__init__.py,sha256=VfohuIe92Ym5cCY8P7EIRYRaRJVoU1t-RBokRzDMPPI,1936
33
33
  pineforge_codegen/analyzer/base.py,sha256=gWF4PUeMUjxEoDd0meaNKsZrI-Bz49l9obxkbpaBuvM,329017
34
- pineforge_codegen/analyzer/call_handlers.py,sha256=OIigquyMrs5w6lZkJnplf9f6ujPu1uBekV91Wg0KNLU,94310
34
+ pineforge_codegen/analyzer/call_handlers.py,sha256=tkAlIWvuIIWyPX7crFpI_ch2UQe1QVJrHgVj8WyNCi8,94289
35
35
  pineforge_codegen/analyzer/contracts.py,sha256=L0-bpMAp7685mW4L03IN8a3T13_JskpMHAetUZf1-6E,23547
36
36
  pineforge_codegen/analyzer/diagnostics.py,sha256=5tJZCEeqPbWbYh658iCK5AK43KhBWJUTWYQapH6U_FU,7183
37
37
  pineforge_codegen/analyzer/tables.py,sha256=zBhk2bw1UhR_eHTWqgs-ojY5bKCTcaieMsQer4oJKW8,10023
@@ -51,15 +51,15 @@ pineforge_codegen/codegen/input.py,sha256=KlitUiphXryWKiPjfUqhk2VLyTVliyiEt_JqkL
51
51
  pineforge_codegen/codegen/order_shapes.py,sha256=H20ElOyewRdXXY7e8LMdkdj7pxf36H0Q5Jsg3yVPPRY,14848
52
52
  pineforge_codegen/codegen/run_stops.py,sha256=4gkHBySR_sd5AgXXv3R-7Z83zGmoCWLXZFcPxKPngY8,3541
53
53
  pineforge_codegen/codegen/security.py,sha256=PvMODMxk3p3Ff8jT-3tOiEtZ5yPVZF2TgVB0C77x0Yo,385527
54
- pineforge_codegen/codegen/session_market.py,sha256=_oymYTSLeYqDbGBW5jB40gvCkidZ8fWwKV9g8ljwO2M,3425
55
- pineforge_codegen/codegen/ta.py,sha256=COS-ZFDpbqlopiBHK2f9yKWLiNn6kKpLQoZ4nmtBDik,106661
54
+ pineforge_codegen/codegen/session_market.py,sha256=-urGaWozZ0k4uNzZ5lPB2fqftpJrftcZiw4eWWMnJKM,3438
55
+ pineforge_codegen/codegen/ta.py,sha256=w9nvIqbbLCOL8jLnW7z9vMlu8RqYyF8nTtrQoRKnwcA,106771
56
56
  pineforge_codegen/codegen/tables.py,sha256=KiGrUc_j8HHEwb8kUbczl9KHFnyRS3B6PRTmlN6mc1w,65492
57
57
  pineforge_codegen/codegen/tv_number_format.py,sha256=SZ70zOmMD9vC1ko0WQnt6X0q7PJ_-jT93N7ZtquwPLE,11637
58
- pineforge_codegen/codegen/types.py,sha256=TRKflL13aNjcPHU4tNlHKPMjvXmAi2oeLxs_SucumtU,210064
58
+ pineforge_codegen/codegen/types.py,sha256=6jqFekrLxahAyhQ6rFuzQKhzarKArsDISJDuBsJWwVc,210048
59
59
  pineforge_codegen/codegen/visit_call.py,sha256=xP_pBkFU8EPytG0Fi94-lbackJSSC3wOQ_H00n9nzlE,194990
60
- pineforge_codegen/codegen/visit_expr.py,sha256=Nrz3fPYp6TIxiXTFTdup-6oc7gmnMiODYc-hrosybx8,111370
60
+ pineforge_codegen/codegen/visit_expr.py,sha256=nLFf4ErbvEAKJZYjeQUiDyh_H3_8ICEsk_h6VholoG4,111358
61
61
  pineforge_codegen/codegen/visit_stmt.py,sha256=czS0z7QuskBeCjpy9i2srg2Z8nR0VdXqho3-AVIeZ1U,118214
62
- pineforge_codegen-1.5.0.dist-info/METADATA,sha256=twgHN2mFQ1MR9ZDpxAKAH4fBmWx5K-d8hpwfCMEdygQ,54041
63
- pineforge_codegen-1.5.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
64
- pineforge_codegen-1.5.0.dist-info/licenses/LICENSE,sha256=jOb1NwvEgyuqWgdxUE6jTtQGRZqCz261Ws0d_LRztvw,11164
65
- pineforge_codegen-1.5.0.dist-info/RECORD,,
62
+ pineforge_codegen-1.6.0.dist-info/METADATA,sha256=3IMQ-aJAYXK3sEQe3qwDGGLVIZMgWsIm9EPQrelCB7A,54240
63
+ pineforge_codegen-1.6.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
64
+ pineforge_codegen-1.6.0.dist-info/licenses/LICENSE,sha256=jOb1NwvEgyuqWgdxUE6jTtQGRZqCz261Ws0d_LRztvw,11164
65
+ pineforge_codegen-1.6.0.dist-info/RECORD,,