pineforge-codegen 1.12.0__tar.gz → 1.14.0__tar.gz

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.
Files changed (117) hide show
  1. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/CHANGELOG.md +151 -40
  2. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/PKG-INFO +1 -1
  3. pineforge_codegen-1.14.0/VERSION +1 -0
  4. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/ci.md +6 -0
  5. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/codegen-coverage-gaps.md +1 -1
  6. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/reference/file-map.md +3 -0
  7. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/reference/support-contracts.md +42 -1
  8. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/base.py +577 -50
  9. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/call_handlers.py +83 -56
  10. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/contracts.py +6 -0
  11. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/operators.py +3 -1
  12. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/types.py +271 -14
  13. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/value_bindings.py +6 -0
  14. pineforge_codegen-1.14.0/pineforge_codegen/builtin_constants.py +85 -0
  15. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/base.py +260 -44
  16. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/checked_settings.py +9 -8
  17. pineforge_codegen-1.14.0/pineforge_codegen/codegen/color_constants.py +14 -0
  18. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/constant_values.py +12 -4
  19. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/drawing.py +113 -26
  20. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/emit_top.py +168 -75
  21. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/helpers.py +62 -8
  22. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/host_members.py +1 -0
  23. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/input.py +33 -51
  24. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/order_shapes.py +2 -1
  25. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/run_stops.py +10 -0
  26. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/security.py +283 -48
  27. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/strategy_declaration.py +6 -2
  28. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/ta.py +204 -11
  29. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/tables.py +104 -61
  30. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/tv_string_units.py +81 -1
  31. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/types.py +73 -9
  32. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/visit_call.py +205 -55
  33. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/visit_expr.py +18 -14
  34. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/visit_stmt.py +22 -10
  35. pineforge_codegen-1.14.0/pineforge_codegen/color_constants.py +126 -0
  36. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/diagnostic_codes.py +31 -3
  37. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/diagnostics_catalog.json +4 -1
  38. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/function_overloads.py +1 -0
  39. pineforge_codegen-1.14.0/pineforge_codegen/input_defaults.py +32 -0
  40. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/lexer.py +14 -2
  41. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/parser.py +12 -1
  42. pineforge_codegen-1.14.0/pineforge_codegen/reference_casts.py +38 -0
  43. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/signatures.py +106 -23
  44. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/support_checker.py +2 -0
  45. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/symbols.py +26 -0
  46. pineforge_codegen-1.12.0/VERSION +0 -1
  47. pineforge_codegen-1.12.0/pineforge_codegen/codegen/color_constants.py +0 -89
  48. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/.gitignore +0 -0
  49. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/CONTRIBUTING.md +0 -0
  50. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/LEGAL.md +0 -0
  51. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/LICENSE +0 -0
  52. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/README.md +0 -0
  53. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/PUBLIC_CONTRACT.md +0 -0
  54. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/engine-main-ci.md +0 -0
  55. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/pine-cap-activation.md +0 -0
  56. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/reference/adding-a-pine-function.md +0 -0
  57. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/reference/conventions.md +0 -0
  58. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/reference/known-codegen-quirks.md +0 -0
  59. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/docs/reference/pipeline.md +0 -0
  60. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/__init__.py +0 -0
  61. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/__init__.py +0 -0
  62. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/callable_history_names.py +0 -0
  63. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/diagnostics.py +0 -0
  64. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/qualifiers.py +0 -0
  65. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/tables.py +0 -0
  66. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/analyzer/v6_forms.py +0 -0
  67. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/array_binding.py +0 -0
  68. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/ast_nodes.py +0 -0
  69. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/block_locals.py +0 -0
  70. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/builtin_keywords.py +0 -0
  71. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/__init__.py +0 -0
  72. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/array_field_width.py +0 -0
  73. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/array_slice.py +0 -0
  74. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/ascii.py +0 -0
  75. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/bool_text.py +0 -0
  76. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/capabilities.py +0 -0
  77. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/capacities.py +0 -0
  78. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/closed_trade_fold.py +0 -0
  79. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/collection_history.py +0 -0
  80. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/constant_fold.py +0 -0
  81. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/endless_for.py +0 -0
  82. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/for_loops.py +0 -0
  83. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/graph_journal.py +0 -0
  84. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/helpers_syminfo.py +0 -0
  85. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/history_sharing.py +0 -0
  86. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/id_sites.py +0 -0
  87. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/retained_alias.py +0 -0
  88. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/session_market.py +0 -0
  89. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/timeframe_values.py +0 -0
  90. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/codegen/tv_number_format.py +0 -0
  91. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/collection_history.py +0 -0
  92. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/cpp_allowlist.py +0 -0
  93. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/cpp_names.py +0 -0
  94. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/drawing_all.py +0 -0
  95. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/errors.py +0 -0
  96. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/external_requests.py +0 -0
  97. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/finite_ta_length.py +0 -0
  98. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/input_keys.py +0 -0
  99. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/intrinsic_binding.py +0 -0
  100. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/library_inline.py +0 -0
  101. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/library_modules.py +0 -0
  102. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/library_v5.py +0 -0
  103. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/limits.py +0 -0
  104. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/loop_types.py +0 -0
  105. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/matrix_overloads.py +0 -0
  106. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/method_binding.py +0 -0
  107. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/pine_libraries.py +0 -0
  108. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/pine_spelling.py +0 -0
  109. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/pragmas.py +0 -0
  110. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/request_discovery.py +0 -0
  111. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/request_feed_inventory.py +0 -0
  112. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/security_contexts.py +0 -0
  113. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/session_reads.py +0 -0
  114. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/timeframe_token_cli.py +0 -0
  115. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/tokens.py +0 -0
  116. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pineforge_codegen/tv_input_choices.py +0 -0
  117. {pineforge_codegen-1.12.0 → pineforge_codegen-1.14.0}/pyproject.toml +0 -0
@@ -22,6 +22,107 @@ supported as exact pairs; on the 0.x line they are independent. See the
22
22
 
23
23
  ## Unreleased (next release)
24
24
 
25
+ - Generated EMA, TSI, KC, KCW and MACD calls use the paired engine's checked
26
+ source adapters for fixed, input and simple lengths, including helper and
27
+ requested-context copies and precalculation. Invalid lengths are checked
28
+ when the call executes, including with an unavailable source. Keltner calls
29
+ restore their existing seeding context if validation throws. Requires the
30
+ `PineEma`, `PineTsi`, `PineKc`, `PineKcw` and `PineMacd` APIs in
31
+ `pineforge/source/pine_ta_length.hpp`; regenerate C++ and relink.
32
+
33
+ - `ta.sma` accepts supported lengths that vary by bar, including lengths from inline inputs, local variables, and loop counters. Unsupported lengths that depend on `var` or `varip` still report an error, and tuple declarations that reuse a parameter name in the same function body are rejected before C++ is generated. This also fixes Unicode handling in `str.match` and `na` separators in `str.split`.
34
+ - `strategy.convert_to_account` and `strategy.convert_to_symbol` now warn in the run report and return the input unchanged, still in its original currency, when no conversion rate is available ([#376](https://github.com/pineforge-4pass/pineforge-codegen-oss/issues/376)).
35
+ - Strategy sizing constants retain their string values in expressions, aliases
36
+ and helper calls. Host order and risk settings convert these values to their
37
+ numeric representation only at the setting boundary.
38
+
39
+ - `timeframe.in_seconds` and `timeframe.change` resolve an evaluated empty
40
+ string to the chart period, including input, variable, function-return and
41
+ named arguments. The argument is evaluated once, and nonempty strings keep
42
+ their explicit period. Bare `na` remains accepted; the value returned by
43
+ `timeframe.change(na)` is still awaiting verification against TradingView.
44
+ Non-string timeframe arguments are refused before C++ emission with the
45
+ stable `PF-E2095` type diagnostic and a source location, including input
46
+ values, reassignments, indicator results and helper parameters. Equally
47
+ specific diagnostic templates distinguish primitive types from qualifiers
48
+ using their catalog argument kinds. Dotted builtin signatures retain supplied
49
+ arguments, including escaped string literals and VWAP anchors. (#394)
50
+ - Script identifiers spelled like integer-to-float conversion temporaries,
51
+ including the underscore suffixes of nested conversions, now use the
52
+ generator's reserved-name escaping.
53
+ - Reference-typed UDT fields keep their type when initialized or reassigned
54
+ with `na`, including array defaults. Drawing handles cross user-function
55
+ and tuple boundaries by value, and `label(na)` produces a missing label
56
+ handle. Polyline locals, arrays, fields and delete methods retain opaque
57
+ handles and argument evaluation while rendering remains a visual no-op.
58
+ - Generated function variants and persistent local copies avoid authored and
59
+ generated member names, including names ending in `_cs1` and composed names
60
+ that overlap collection-history or requested-context storage. Persistent
61
+ declarations in sibling blocks also retain distinct storage when a script
62
+ uses their generated spelling. Declarations, calls and history storage use
63
+ the same allocated identities, including when selecting reachable variants
64
+ for emission. Regenerate C++ and relink affected strategies.
65
+ - Persistent declarations accept a type qualifier after `var` or `varip`.
66
+ Lower-timeframe requests return independently typed arrays for inline and
67
+ helper-returned tuple payloads.
68
+ - Complete nested indentation levels can combine tabs and spaces. Requested
69
+ `na`/`nz` helper parameters retain their bindings beside time operations;
70
+ global tuple declarations and their member histories share one requested
71
+ sample. Uncalled forwarding helpers no longer allocate unresolved TA buffers
72
+ for their unreachable call variants (#372). Bare tuple-element history
73
+ payloads retain their located refusal. Tuple histories rendered through the
74
+ expression visitor, including reads through globals, retain their chart
75
+ series and warning. Resolvable variants of a reachable helper retain their
76
+ TA state even when registered through an uncalled caller. Requested builtin
77
+ tuples reuse their existing sampled results, and mixed-clock tuple history
78
+ uses the registered history diagnostic.
79
+
80
+ - Built-in size, position, line/label style and shape constants retain their
81
+ string values in variables, selections, function arguments and returns, and
82
+ string input defaults/options. This fixes ambiguous C++ assignments, NUL
83
+ strings, unsupported size inputs and null-pointer string construction (#389).
84
+ Sort-order constants retain their distinct `sort_order` identity through
85
+ defaults and comparisons; invalid string conversions are diagnosed at their
86
+ Pine location, including individual elements of string input options.
87
+ `array.sort_indices` honors a supplied sort direction.
88
+ Scalar function overloads no longer crash during type checking.
89
+ Regenerate C++ and relink affected strategies.
90
+ - A zone name the engine rejects now makes calendar-form `timestamp()` stop the
91
+ run at its first evaluation, instead of silently calculating a UTC value.
92
+ The paired engine reports a typed timezone error identifying the failed bar.
93
+ An engine without the typed helper prints the text without the bar prefix, an
94
+ arm that paired releases do not meet. Accepted zones and UTC are unchanged;
95
+ the single `TIMESTAMP_REJECTED_ZONE_STOPS_RUN` switch restores the old behavior
96
+ (the compatibility macros stay in the output of a script that calls
97
+ `timestamp()` with a calendar). Not covered: the unchecked
98
+ `setenv("TZ", ...)` of the sealed branch and the restoring `setenv` or `unsetenv`
99
+ in the same lambda; on ENOMEM the environment stays unchanged and the conversion
100
+ silently uses the previous zone.
101
+ Setting the switch to `False` restores behavior, not the original emitted
102
+ bytes: the timezone macro block and newly reserved names remain.
103
+ Regenerate C++ and relink affected strategies.
104
+
105
+ - User functions retain array, object and string result types through branch
106
+ returns and history clones. Untyped arguments retain collection element
107
+ types through nested calls and tuple bindings, and reassigned matrix locals
108
+ keep their initializer's matrix type. (#391)
109
+ - Deeply nested user-function calls share type-inference work within each
110
+ expression query, including when a return type remains unresolved.
111
+ - `array.sort_indices` returns integer indices, accepts typed `array<int>`
112
+ results and honors ascending/default or descending order in namespace and
113
+ method calls, including named arguments. Numeric `na` values sort last in
114
+ ascending order and first in descending order; string arrays use lexical
115
+ ordering. The source array is unchanged. (#392)
116
+ - `request.security` keeps the requested-bar history and declaration-time
117
+ value of top-level scalar copies of persistent or reassigned globals,
118
+ including copy chains. A declared float copy preserves an integer source's
119
+ missing value, and replayed updates use the requested `bar_index`.
120
+ Compound assignments in requested selections retain the lexical binding
121
+ of their target and its request-owned `var` or `varip` storage.
122
+ See [#393](https://github.com/pineforge-4pass/pineforge-codegen-oss/issues/393).
123
+
124
+ ## 1.12.0 — 2026-11-12
125
+
25
126
  - Pine v6 reports located errors for a missing `color.new` transparency,
26
127
  `fill(transp=...)`, calendar-number timestamp defaults in `input.time` with
27
128
  a time zone string as the first timestamp argument or a `timezone` keyword,
@@ -64,11 +165,6 @@ supported as exact pairs; on the 0.x line they are independent. See the
64
165
  keeps its existing compile error. Requested evaluations, collection
65
166
  history, nested records and intrabar recalculations keep their previous
66
167
  lowering. Regenerate C++ and relink affected strategies.
67
- - `str.format_time` now uses TradingView's documented defaults when arguments
68
- are omitted: `"yyyy-MM-dd'T'HH:mm:ssZ"` for the format and the exchange time
69
- zone (`syminfo.timezone`) for the timezone. Pass `"yyyy-MM-dd"` and `"UTC"`
70
- explicitly to restore the previous output. Regenerate C++ and relink
71
- affected strategies.
72
168
  - `str.split(source, "")` with an empty separator now returns one part per
73
169
  UTF-16 unit, as TradingView does: "axb" gives three parts, an accent or a CJK
74
170
  character between two letters three, an emoji between two letters four (an
@@ -76,16 +172,51 @@ supported as exact pairs; on the 0.x line they are independent. See the
76
172
  It returned the whole string as one part, even for plain ASCII. The empty
77
173
  text still has one part, as in TradingView. A separator that is not empty
78
174
  splits as before, through the engine.
79
- - A `when` argument on a strategy order call in Pine v6 now reports `PF-E2081`,
80
- explaining that v6 removed the argument and recommending an `if` statement
81
- around the call. Other unknown keywords keep `PF-E2027`.
82
- - Pine identifiers spelled like generated state members or helpers use the C++ name allocator, including history-bearing locals in requested helpers.
83
175
  - A script variable spelled like one of the generator's tuple element bindings (`_tuple_result_0_elem_0`) now gets a private name instead of redeclaring the binding.
84
176
  - A local declared in a function or method and spelled like a built-in variable now keeps its own type, history storage and reads. Exceptions: a string local spelled like a price field (`open`, `high`, `low`, `close`, `hl2`, `hlc3`, `hlcc4`, `ohlc4`, `volume`) that is read with history in a function requested through `request.security` is still refused, as before; the support check still warns that `bar_index`, `last_bar_index` and `timenow` diverge from TradingView at every read of a local with that name; a script that declares the same built-in name in several callable shapes is accepted where an ordinary name is refused by the shared-Series check; and the confirmed-bar request receipt of a request inside the declaring function names the local by its internal storage spelling.
85
177
  - A function-local string read with history now keeps its string type in concatenations, so the emitted C++ joins the current and previous values without applying `std::to_string` to a string (#354).
86
178
  - A function or method parameter spelled like a built-in variable (`close`,
87
179
  `high`, ...) now keeps its `[n]` history operator and gives the same values
88
180
  as when the parameter has another name (#360).
181
+ - A `var` declared in one block no longer shares storage with a plain variable
182
+ of the same name in a sibling block, so it keeps its value across runs (#359).
183
+ - A float setting of a built-in indicator computed from an input now keeps
184
+ its fraction, as on TradingView: the multiplier of `ta.bb`, `ta.bbw`,
185
+ `ta.kc`, `ta.kcw` and the `ta.vwap` bands, the factor of `ta.supertrend`,
186
+ the arguments of `ta.sar`, and the offset and sigma of `ta.alma` (#362).
187
+ Regenerate C++ and relink affected strategies.
188
+ - `str.length`, `str.pos` and `str.substring` now count and cut text in UTF-16
189
+ code units, as TradingView does: an emoji is two units and every other
190
+ character one. They counted UTF-8 bytes, so an accent counted 2, a CJK
191
+ character 3 and an emoji 4, and a position or a cut after such a character
192
+ was off by the extra bytes. The helpers are emitted into the generated file
193
+ only when its code calls one of the three functions (a call that is only a
194
+ plot argument emits nothing), so every other script keeps the text it had;
195
+ the engine is not involved. A cut between the two units of an emoji keeps
196
+ each half as its own three-byte sequence (the length of a half is one unit),
197
+ the form `str.split` gives its parts. Such a half never occurs inside a text
198
+ that holds the whole character, so three things differ from TradingView:
199
+ joining the two halves again, with `+` or `array.join`, does not give back
200
+ the original four bytes, so the joined text does not equal the original text;
201
+ a search for a half in the text it was cut from finds nothing (`str.pos`
202
+ returns -1, where the one byte the old cut gave was found at the same
203
+ position, and `str.contains` returns false); and a half is not equal to, or
204
+ at the start or end of, a part of that text that holds the whole character.
205
+ A begin position that lies inside the bytes of a text but past its units
206
+ (5 on "a", an emoji, "b") now stops the run; before, it returned the bytes
207
+ after that position.
208
+
209
+ ## 1.11.0 — 2026-11-09
210
+
211
+ - `str.format_time` now uses TradingView's documented defaults when arguments
212
+ are omitted: `"yyyy-MM-dd'T'HH:mm:ssZ"` for the format and the exchange time
213
+ zone (`syminfo.timezone`) for the timezone. Pass `"yyyy-MM-dd"` and `"UTC"`
214
+ explicitly to restore the previous output. Regenerate C++ and relink
215
+ affected strategies.
216
+ - A `when` argument on a strategy order call in Pine v6 now reports `PF-E2081`,
217
+ explaining that v6 removed the argument and recommending an `if` statement
218
+ around the call. Other unknown keywords keep `PF-E2027`.
219
+ - Pine identifiers spelled like generated state members or helpers use the C++ name allocator, including history-bearing locals in requested helpers.
89
220
  - History retention can be selected with keyword-only `history_capacity`
90
221
  in `transpile()`, `transpile_full()`, `transpile_with_request_inventory()`
91
222
  and `gate/glue.py::transpile_json()`. The JavaScript worker template does
@@ -112,8 +243,6 @@ supported as exact pairs; on the 0.x line they are independent. See the
112
243
  option. Capacities outside the native int64 domain are refused even for
113
244
  scripts without drawings. Regenerate C++ and relink affected strategies.
114
245
  - Typed `array.from()` initializers now match their declared element type, including function-local `var` and `varip` arrays of timestamps.
115
- - A `var` declared in one block no longer shares storage with a plain variable
116
- of the same name in a sibling block, so it keeps its value across runs (#359).
117
246
  - Variables initialized from `backadjustment.*`, `settlement_as_close.*` and
118
247
  `adjustment.*` constants now use integer storage in emitted C++.
119
248
  - `int(x)` of a floating value, and a stored `math.floor(x)`, `math.ceil(x)`
@@ -133,11 +262,6 @@ supported as exact pairs; on the 0.x line they are independent. See the
133
262
  (`int(strategy.equity)`) and a float field of a record (`int(b.v)`) count as
134
263
  floating values too. This changes generated C++ for scripts that use these
135
264
  forms: regenerate and relink affected strategies.
136
- - A float setting of a built-in indicator computed from an input now keeps
137
- its fraction, as on TradingView: the multiplier of `ta.bb`, `ta.bbw`,
138
- `ta.kc`, `ta.kcw` and the `ta.vwap` bands, the factor of `ta.supertrend`,
139
- the arguments of `ta.sar`, and the offset and sigma of `ta.alma` (#362).
140
- Regenerate C++ and relink affected strategies.
141
265
  - Repeated explicit input titles now have separate override keys: the first
142
266
  keeps the bare title, and later inputs use `<title>#<n>`, starting at 2 and
143
267
  skipping authored titles and keys already assigned. The manifest, effective
@@ -252,6 +376,17 @@ supported as exact pairs; on the 0.x line they are independent. See the
252
376
  seeds. Migration: none; undeclared runs are unchanged. The diagnostic stays
253
377
  an unconditional note at each `ta.ema` call; this text change leaves generated
254
378
  C++ unchanged.
379
+ - Missing integer values remain `na` in float writes, numeric selections,
380
+ float arguments and arithmetic. Explicit float declarations keep fractional
381
+ values after integer initialization. Regenerate C++ and relink strategies.
382
+
383
+ ## 1.10.0 — 2026-11-03
384
+
385
+ - Since 1.10.0, identifiers and import paths in Pine v6 scripts must be ASCII:
386
+ a non-ASCII character in a name is refused at that character (`no viable
387
+ alternative at character ...`); 1.9.1 encoded such names. Strings and
388
+ comments keep non-ASCII text, spelled as octal escapes in the generated C++
389
+ (#290).
255
390
  - An affine chart loop proved endless is stopped with the loop-time error when
256
391
  its result reaches an effect. Omission is limited to an unused loop statement
257
392
  with no calls, whose writes have no readers except self-updates, a break
@@ -260,10 +395,6 @@ supported as exact pairs; on the 0.x line they are independent. See the
260
395
  may drop them. Endless loops in functions, methods and `request.security`
261
396
  still never end here while TradingView stops them; data-dependent endless
262
397
  loops still hang.
263
- - Missing integer values remain `na` in float writes, numeric selections,
264
- float arguments and arithmetic. Explicit float declarations keep fractional
265
- values after integer initialization. Regenerate C++ and relink strategies.
266
-
267
398
  - Pine v6 calls refuse a positional argument after a named argument with
268
399
  `PF-E2074` at that positional expression. The check also covers strategy
269
400
  declarations, unused functions and v6 library bodies before lowering.
@@ -326,26 +457,6 @@ supported as exact pairs; on the 0.x line they are independent. See the
326
457
  TradingView accepts a namespace call after an expired block local with the
327
458
  same name; PineForge's analysis no longer refuses it, but code generation
328
459
  still rejects some such calls (a known gap).
329
- - `str.length`, `str.pos` and `str.substring` now count and cut text in UTF-16
330
- code units, as TradingView does: an emoji is two units and every other
331
- character one. They counted UTF-8 bytes, so an accent counted 2, a CJK
332
- character 3 and an emoji 4, and a position or a cut after such a character
333
- was off by the extra bytes. The helpers are emitted into the generated file
334
- only when its code calls one of the three functions (a call that is only a
335
- plot argument emits nothing), so every other script keeps the text it had;
336
- the engine is not involved. A cut between the two units of an emoji keeps
337
- each half as its own three-byte sequence (the length of a half is one unit),
338
- the form `str.split` gives its parts. Such a half never occurs inside a text
339
- that holds the whole character, so three things differ from TradingView:
340
- joining the two halves again, with `+` or `array.join`, does not give back
341
- the original four bytes, so the joined text does not equal the original text;
342
- a search for a half in the text it was cut from finds nothing (`str.pos`
343
- returns -1, where the one byte the old cut gave was found at the same
344
- position, and `str.contains` returns false); and a half is not equal to, or
345
- at the start or end of, a part of that text that holds the whole character.
346
- A begin position that lies inside the bytes of a text but past its units
347
- (5 on "a", an emoji, "b") now stops the run; before, it returned the bytes
348
- after that position.
349
460
 
350
461
  ## 1.9.1 — 2026-10-31
351
462
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pineforge-codegen
3
- Version: 1.12.0
3
+ Version: 1.14.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
@@ -0,0 +1 @@
1
+ 1.14.0
@@ -74,6 +74,12 @@ publication failure also fails the job.
74
74
  | Native tests absent from the matrix | GKE PR / engine-main calls shared changes/native jobs; consumed by the same `gate` writer |
75
75
 
76
76
  The shared pytest matrix runs the same command as both former PR matrices.
77
+ Each Python version runs the suite as four jobs, one per part. Each job sets
78
+ `PF_TEST_SHARD` to its part, for example `2/4`, and `tests/conftest.py` keeps
79
+ the tests whose id hashes to that part, so the four jobs of a Python version
80
+ together run every test exactly once. The pytest job of the push and dispatch
81
+ workflow, `test.yml`, is cut the same way, and a test holds the matrix,
82
+ environment and commands of the two jobs equal.
77
83
  The differential leg retains Python 3.14, Node 22, the Pyodide selftest,
78
84
  dependency audit and full gate. Package metadata and entity checks run on every
79
85
  admitted diff, as does the workflow/App-environment guard.
@@ -70,7 +70,7 @@ tables (`HARD_REJECT_FUNC`, `HARD_REJECT_NAMESPACE`, `NOT_YET_FUNC`,
70
70
  | `visit_expr.py:443` | `session.<unknown>` → `"false"` | Known members being enumerated does not justify a value for an unknown member. The catch-all is a placeholder defect. |
71
71
  | `visit_expr.py:448` | `syminfo.<unknown>` → `"0"` | The historical whitelist blocked unknown members upstream; the emitter placeholder is still a defect. |
72
72
  | `visit_expr.py:459` | `color.<unknown>` → `"0"` | The historical whitelist covered known constants; an unknown-member placeholder is still a defect. |
73
- | `visit_expr.py:461` | `SKIP_NAMESPACES` (table/label/line/box/polyline/chart/linefill/display/size/position) → `"0"` | The audit treated these as visual omissions. Substituting zero for a missing value lowering is a defect; each supported member needs its semantics. |
73
+ | `visit_expr.py:461` (historical audit) | Legacy visual namespace fallbacks → `"0"` | Inventoried size, position, line/label style and shape constants now use typed string values from `builtin_constants.py` before these fallbacks. Remaining missing value lowerings are defects; rendering omissions do not justify substituting zero for a value. |
74
74
  | `visit_expr.py:484-507` | `strategy.oca.<unknown>`, `strategy.direction.<unknown>`, `strategy.commission.<unknown>`, `strategy.closedtrades.<unknown>`, `strategy.opentrades.<unknown>` catch-alls | Known enum values do not define unknown members. The catch-all defaults are placeholder defects. |
75
75
  | `visit_call.py:357` | `map.<unknown>(...)` → `"0"` | The historical whitelist rejected unknown functions upstream; the emitter placeholder is still a defect. |
76
76
  | `visit_call.py:404` | `array.<unknown>(...)` → `"0"` | The historical whitelist rejected unknown functions upstream; the emitter placeholder is still a defect. |
@@ -52,6 +52,9 @@ pineforge_codegen/
52
52
  │ (after generation; the C++ unchanged).
53
53
  ├── session_reads.py The session.<flag>[k] reads the generated
54
54
  │ C++ holds (analyzer and codegen share it).
55
+ ├── builtin_constants.py Typed scalar constant values shared by
56
+ │ analysis, emission and input proofs;
57
+ │ nominal builtin enums retain TypeSpec identity.
55
58
  ├── signatures.py Pine v6 builtin signature registry
56
59
  │ (TA / math / str / strategy / input /
57
60
  │ map / built-ins) — single source of
@@ -1,5 +1,29 @@
1
1
  ## Support contracts
2
2
 
3
+ Persistent typed declarations parse their storage prefix separately from their
4
+ qualifier: `var const float`, `varip const int`, and the corresponding `simple`
5
+ and `series` forms retain both annotations and their existing initialization.
6
+
7
+ `request.security_lower_tf` tuple payloads, written inline or returned by a
8
+ helper, produce one array per element. Each intrabar evaluates the tuple once
9
+ before distributing values to the independently typed arrays; clearing the
10
+ request clears every array together. Tuple-bound arrays retain collection
11
+ metadata in global and callable scopes.
12
+
13
+ A global tuple declaration read by `request.security` is sampled once in the
14
+ requested evaluator, in declaration order. Scalar and history reads share that
15
+ sample, including stateful helper results. Member history commits on completed
16
+ requested bars even when a lazy payload does not read the member on that bar.
17
+ Helper parameter bindings remain active through `na`/`nz` builtin emission in
18
+ both evaluator modes. These rules supersede the older tuple refusal limitations
19
+ described in the historical helper row below.
20
+
21
+ Complete mixed tab/space nested block prefixes use four columns per tab plus
22
+ the spaces. Previously accepted incomplete mixed prefixes, skipped first-body
23
+ widths and pending logical-line continuations retain their earlier handling
24
+ pending additional TradingView observations; they are not newly refused as part
25
+ of the nested-block correction.
26
+
3
27
  Builtin `array.slice` on a resolved typed array in the script, a function or
4
28
  method parameter, or a callable-local array opens the view gate and lowers the
5
29
  script's array storage to typed handles:
@@ -20,6 +44,12 @@ lowering. Structural mutation, collection reassignment/escape, history and
20
44
  pair-binder iteration retain PF-E5086 pending TV evidence/provenance support;
21
45
  declaration tails yielding collections as callable/selection values are refused.
22
46
  `polyline.all` retains PF-E5085 until the engine has a Polyline handle/arena.
47
+ Polyline locals, array elements and UDT fields retain opaque typed handles;
48
+ default construction and bare `na` use a missing handle, and copies retain
49
+ its identity. `polyline.new` and functional or method-form `delete` keep the
50
+ existing visual-only rendering contract, while evaluating their arguments
51
+ once in parameter order. Opaque ID allocation joins script reset and rollback
52
+ state. This does not supply the live arena required by `polyline.all`.
23
53
  `var`/`varip` aliases retain PF-E5086 until a TradingView capture establishes
24
54
  their lifetime semantics. Whether a later creation in the same bar is visible
25
55
  through the alias is not yet measured against TradingView.
@@ -193,7 +223,7 @@ persistence against paired script controls.
193
223
 
194
224
  Numeric `matrix.sum(id1, id2)` returns a detached matrix for either a matrix or numeric scalar RHS; its existing one-argument aggregate lowering is unchanged. Scalar `matrix.diff`/`matrix.mult` also return detached matrices. Typed matrix/vector multiplication and a variable initialized from namespace `array.concat` are refused with the existing unsupported-function diagnostic. Default/index-only matrix row/column insertion fills with element na; omitted submatrix bounds, sort column and array-fill end use the collection dimensions. `tests/test_matrix_arithmetic_overloads.py` compiles and runs these overloads against the paired runtime.
195
225
 
196
- Keyword arguments of the matrix methods and of the checked array methods (`get`, `set`, `insert`, `remove`, `fill`, `slice`, `percentrank`, `first`, `last`, `pop`, `shift`, `sort`, `indexof`, `unshift`) bind to their own parameter slot (`CallVisitor._collection_arg_nodes`; the slots are `MATRIX_METHOD_KWARGS` and `CHECKED_ARRAY_METHOD_KWARGS`, and `row_index` / `col_index` of `add_row` / `add_col` keep binding to `row` / `column`), never shifted left over a gap: a gap before a later argument takes the omitted optional parameter's default in place (`matrix.sort(m, order = order.descending)` sorts column 0 descending, `m.submatrix(to_column = 1)` keeps every row, `a.fill(7.0, index_to = 1)` fills from 0). A keyword that names no parameter, a parameter given twice (by position and by keyword) and a gap before a required parameter are refused with the diagnostics the namespace already reports for a call that does not bind (`matrix.<method>: wrong number of arguments`; for an array method its `unknown keyword argument`, `passed both positionally and by keyword` and `missing required argument`, the typed-method templates). A call without keywords, and an array method outside the checked table, keep their arguments as written. `matrix.fill` binds its range keywords (`from_row`, `to_row`, `from_column`, `to_column`) as it binds a positional range, which the lowering does not apply: both fill the whole matrix, as before (an approximation TradingView does not make, unverified (hold)). `tests/test_arrseg_review_fixes.py` pins each keyword form against its positional twin and runs the defaulted ones. A defaulted `submatrix` evaluates its receiver once. An index-only `add_row` / `add_col` takes any numeric index (an input, a function's result, `math.min(...)`); an argument whose type the analysis cannot resolve is told from an array by its C++ type. A bound result of `array.concat` -- `c = array.concat(a, b)`, `c = a.concat(b)` on a variable declared an array and bound once, and the `:=` reassignments of both -- keeps the unsupported-function refusal; the statement form, `matrix.concat` and a user method named `concat` are unchanged. A matrix bound to a missing history (`b = m[20]`, then `b.get(0, 0)`) raises the recorded na-matrix text (RE10053), as the history itself does; one passed on to a function still raises the engine's text. Follow-ups, unverified (hold): matrix diff/mult dimension checks, a `for ... in` over a bound na array ID, keywords on an array method outside the checked table, on `matrix.new` and on a UDT field's matrix, and the `matrix.fill` range.
226
+ Keyword arguments of the matrix methods and of the checked array methods (`get`, `set`, `insert`, `remove`, `fill`, `slice`, `percentrank`, `first`, `last`, `pop`, `shift`, `sort`, `sort_indices`, `indexof`, `unshift`) bind to their own parameter slot (`CallVisitor._collection_arg_nodes`; the slots are `MATRIX_METHOD_KWARGS` and `CHECKED_ARRAY_METHOD_KWARGS`, and `row_index` / `col_index` of `add_row` / `add_col` keep binding to `row` / `column`), never shifted left over a gap: a gap before a later argument takes the omitted optional parameter's default in place (`matrix.sort(m, order = order.descending)` sorts column 0 descending, `m.submatrix(to_column = 1)` keeps every row, `a.fill(7.0, index_to = 1)` fills from 0). A keyword that names no parameter, a parameter given twice (by position and by keyword) and a gap before a required parameter are refused with the diagnostics the namespace already reports for a call that does not bind (`matrix.<method>: wrong number of arguments`; for an array method its `unknown keyword argument`, `passed both positionally and by keyword` and `missing required argument`, the typed-method templates). A call without keywords, and an array method outside the checked table, keep their arguments as written. `matrix.fill` binds its range keywords (`from_row`, `to_row`, `from_column`, `to_column`) as it binds a positional range, which the lowering does not apply: both fill the whole matrix, as before (an approximation TradingView does not make, unverified (hold)). `tests/test_arrseg_review_fixes.py` pins each keyword form against its positional twin and runs the defaulted ones. A defaulted `submatrix` evaluates its receiver once. An index-only `add_row` / `add_col` takes any numeric index (an input, a function's result, `math.min(...)`); an argument whose type the analysis cannot resolve is told from an array by its C++ type. A bound result of `array.concat` -- `c = array.concat(a, b)`, `c = a.concat(b)` on a variable declared an array and bound once, and the `:=` reassignments of both -- keeps the unsupported-function refusal; the statement form, `matrix.concat` and a user method named `concat` are unchanged. A matrix bound to a missing history (`b = m[20]`, then `b.get(0, 0)`) raises the recorded na-matrix text (RE10053), as the history itself does; one passed on to a function still raises the engine's text. Follow-ups, unverified (hold): matrix diff/mult dimension checks, a `for ... in` over a bound na array ID, keywords on an array method outside the checked table, on `matrix.new` and on a UDT field's matrix, and the `matrix.fill` range.
197
227
 
198
228
  `pineforge_codegen.support_checker` is the gate. Its job is to fail
199
229
  loudly **before** codegen so users never get a silently miscompiled
@@ -271,6 +301,17 @@ This exception covers only constructs PineForge refuses today. A form that compi
271
301
  The emission invariant (`AGENTS.md#emission-invariant`) states this rule for every emission path. The notes in this file describe existing behavior: a documented approximation or unsupported fallback is an implementation gap, not an exception to the invariant.
272
302
 
273
303
  Input defaults use the input family's Pine type and qualifier contract.
304
+ Inventoried `size.*`, `position.*`, `line.style_*`, `label.style_*` and
305
+ `shape.*` members have string values independently of a visual call's
306
+ rendering support. `builtin_constants.py` supplies their value and semantic
307
+ type to analysis, emission and string-input proofs. Line styles also supply
308
+ box border styles. Assignments, selections and callable variants preserve
309
+ those types. `order.ascending` and `order.descending` instead retain nominal
310
+ `sort_order` TypeSpecs; their runtime storage does not permit a Pine string
311
+ conversion. Typed slots and operator contracts check that identity.
312
+ `tests/test_builtin_style_values.py` covers the value paths, named bindings
313
+ and nominal restrictions, including order arguments of collection sorting.
314
+
274
315
  An explicit `const color` carrier with a proven initializer supplies its
275
316
  packed value to the getter and settings descriptor before `on_bar`; the
276
317
  manifest reads that descriptor. `codegen/constant_values.py` resolves lexical