pineforge-codegen 1.3.0__tar.gz → 1.4.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.
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/CHANGELOG.md +226 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/PKG-INFO +94 -18
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/README.md +93 -17
- pineforge_codegen-1.4.0/VERSION +1 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/docs/PUBLIC_CONTRACT.md +147 -9
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/docs/pine-cap-activation.md +11 -6
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/__init__.py +6 -5
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/analyzer/base.py +3 -3
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/analyzer/types.py +7 -3
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/base.py +26 -16
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/checked_settings.py +113 -2
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/collection_history.py +163 -12
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/emit_top.py +24 -8
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/helpers.py +19 -1
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/host_members.py +1 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/input.py +23 -8
- pineforge_codegen-1.4.0/pineforge_codegen/codegen/run_stops.py +52 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/security.py +12 -5
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/tables.py +132 -28
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/tv_number_format.py +9 -2
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/types.py +85 -4
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/visit_call.py +174 -55
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/visit_expr.py +32 -6
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/visit_stmt.py +3 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/collection_history.py +122 -20
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/diagnostics_catalog.json +1 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/external_requests.py +30 -9
- pineforge_codegen-1.4.0/pineforge_codegen/matrix_overloads.py +7 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/parser.py +7 -2
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/signatures.py +2 -2
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/support_checker.py +82 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pyproject.toml +1 -1
- pineforge_codegen-1.3.0/VERSION +0 -1
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/.gitignore +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/CONTRIBUTING.md +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/LEGAL.md +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/LICENSE +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/docs/codegen-coverage-gaps.md +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/analyzer/__init__.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/analyzer/call_handlers.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/analyzer/contracts.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/analyzer/diagnostics.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/analyzer/tables.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/ast_nodes.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/block_locals.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/builtin_keywords.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/__init__.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/capabilities.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/constant_fold.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/drawing.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/helpers_syminfo.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/order_shapes.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/session_market.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/codegen/ta.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/diagnostic_codes.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/errors.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/finite_ta_length.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/lexer.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/library_inline.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/library_modules.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/library_v5.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/limits.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/method_binding.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/pine_libraries.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/pine_spelling.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/pragmas.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/request_discovery.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/security_contexts.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/session_reads.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/symbols.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/tokens.py +0 -0
- {pineforge_codegen-1.3.0 → pineforge_codegen-1.4.0}/pineforge_codegen/tv_input_choices.py +0 -0
|
@@ -20,6 +20,232 @@ supported as exact pairs; on the 0.x line they are independent. See the
|
|
|
20
20
|
the release commit. A prerelease note describes changes since the preceding
|
|
21
21
|
prerelease or stable tag; the final stable note consolidates the series.
|
|
22
22
|
|
|
23
|
+
## 1.4.0 — 2026-10-08
|
|
24
|
+
|
|
25
|
+
A minor release of the exact engine/codegen pair. Its behavior was validated
|
|
26
|
+
before tagging on codegen `bfc4ddce` and engine `b3192bfc`.
|
|
27
|
+
It consolidates the seven requests landed
|
|
28
|
+
since `v1.3.0`: [#183](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/183)
|
|
29
|
+
(emission ordering), [#184](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/184)
|
|
30
|
+
(coded run stops), [#185](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/185)
|
|
31
|
+
(input manifests), [#186](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/186)
|
|
32
|
+
(collection history and binding), [#188](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/188)
|
|
33
|
+
(CI history), [#189](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/189)
|
|
34
|
+
(reference tests), and [#190](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/190)
|
|
35
|
+
(emitted-string regressions and edge cases). Recorded-output support from
|
|
36
|
+
engine request #356 is excluded. The pre-tag validation used these commits
|
|
37
|
+
with `VERSION` equal to `1.3.0`; those results are not post-tag measurements.
|
|
38
|
+
|
|
39
|
+
### Compatibility and migration
|
|
40
|
+
|
|
41
|
+
- Codegen 1.4.0 supports only engine `v1.4.0`. Regenerate every strategy's C++
|
|
42
|
+
and relink with that release's generated headers and `libpineforge.a`.
|
|
43
|
+
The pair retains C ABI version 4, settings/capability API version 1 and the
|
|
44
|
+
`engine_script_run_v19` epoch; equal version numbers for those interfaces
|
|
45
|
+
do not make mixed engine/codegen releases supported.
|
|
46
|
+
A report's fingerprint records engine/codegen versions, generated C++'s
|
|
47
|
+
hash and the paired engine's corrected provenance values. The retained
|
|
48
|
+
epoch and hash domain tags do not promise equal fingerprints, state-hash
|
|
49
|
+
values or trades across 1.3.0 and 1.4.0.
|
|
50
|
+
- Emitted C++ changes, including common run-stop shims and collection history
|
|
51
|
+
wrappers. Do not reuse a 1.3.0 strategy library or assume source identity.
|
|
52
|
+
The public Python call signatures and override keys stay the same, but
|
|
53
|
+
`inputs` values and the Python/Pyodide success envelopes change as described
|
|
54
|
+
below. These are not blanket byte-identity promises for emission or envelopes.
|
|
55
|
+
- Every manifest row now carries `supported`. When it is `false`, hide the
|
|
56
|
+
input, exclude it from sweeps and optimization, and do not send a value:
|
|
57
|
+
the strategy uses its compiled default, and the paired engine refuses a
|
|
58
|
+
supplied value with `setting_unsupported`. `supported: true` alone does
|
|
59
|
+
not validate the value's type, bounds or options, or make a shared key safe.
|
|
60
|
+
A supported empty dropdown and an unsupported string input can both have
|
|
61
|
+
`options: []`; that list does not determine support.
|
|
62
|
+
- Give each input a unique title before upgrading. Calls with the same title
|
|
63
|
+
or fallback declaration key still produce separate manifest rows with the
|
|
64
|
+
same `title`; their `supported` flags do not detect the collision. Different
|
|
65
|
+
`group=` labels do not separate keys. On the paired 1.4.0 engine's normal
|
|
66
|
+
checked path, a completed run of such a script has `fingerprint: null` even
|
|
67
|
+
without an override. Supplying the shared key fails before execution with
|
|
68
|
+
`setting_rejected`, reason `ambiguous_key`. For example,
|
|
69
|
+
`Period="7"` returned a success report on 1.3.0, whose legacy setter applied
|
|
70
|
+
a shared key to all matching inputs. Legacy-path unresolved provenance rows
|
|
71
|
+
may still appear inside a fingerprint; that differs from the whole
|
|
72
|
+
fingerprint being null on the checked path.
|
|
73
|
+
- The paired engine's run harness now uses the checked settings API. Stored
|
|
74
|
+
presets and sweep values must satisfy the compiled input's type, bounds and
|
|
75
|
+
options. Two other examples that succeeded on 1.3.0 now fail with
|
|
76
|
+
`setting_rejected`: `Color="color.blue"` (`expected_integer`) and
|
|
77
|
+
`Choice="15"` for options `[10, 20, 30]` (`invalid_input_option`). A color's
|
|
78
|
+
manifest still has `type: "string"` and a Pine spelling such as `"color.red"`
|
|
79
|
+
as its default, but the checked native input requires the packed integer;
|
|
80
|
+
do not forward that manifest string as a native color value. The checked
|
|
81
|
+
API also validates parseable numbers, booleans, enum members and known keys.
|
|
82
|
+
This does not mean all invalid settings previously succeeded:
|
|
83
|
+
`initial_capital="abc"` and `initial_capital="-1"` already failed on 1.3.0;
|
|
84
|
+
they now report `expected_finite_decimal` and `value_below_minimum` reasons.
|
|
85
|
+
Legacy C setters retain their existing behavior.
|
|
86
|
+
- The paired engine adds `strategy_get_last_error_code` and
|
|
87
|
+
`strategy_get_last_error_args` beside the existing English error getter,
|
|
88
|
+
under `PINEFORGE_HAS_RUN_FAILURE_CODES_V1`. Its run harness exposes `code`
|
|
89
|
+
and typed `args` beside `error` on failures. Check the failure channel even
|
|
90
|
+
when the English message is empty; do not accept a stopped run's partial
|
|
91
|
+
output as success or parse the English to recover a code. These run failures
|
|
92
|
+
are distinct from transpile-time `CompileError` diagnostics.
|
|
93
|
+
`setting_rejected` is catalog class `input`; `setting_unsupported` is class
|
|
94
|
+
`unsupported`. A deliberate `runtime.error` is `strategy_runtime_error`,
|
|
95
|
+
class `strategy`. The installed engine entrypoint returns exit 4 for all
|
|
96
|
+
three codes: exit 4 alone does not select a billing or refund decision.
|
|
97
|
+
- The paired engine certifies scalar input/override types in fingerprint
|
|
98
|
+
provenance; unresolved values remain explicit rather than being treated as
|
|
99
|
+
certified native values. This is an engine report change, not another field
|
|
100
|
+
added to the transpile-time input manifest. See the paired engine's release
|
|
101
|
+
notes for report resolution reasons and counts.
|
|
102
|
+
|
|
103
|
+
### Emission and run failures
|
|
104
|
+
|
|
105
|
+
- Requested-context history resets and TA variant position ties no longer
|
|
106
|
+
use address or set order; they preserve traversal order. Refusal
|
|
107
|
+
diagnostics for conflicting scalar history and map locals are hash-seed
|
|
108
|
+
independent.
|
|
109
|
+
- Generated run stops use stable engine failure codes when the paired engine
|
|
110
|
+
advertises `PINEFORGE_HAS_RUN_FAILURE_CODES_V1`. No-data and other-symbol
|
|
111
|
+
stops carry compile-time request provenance; copying their English into
|
|
112
|
+
`runtime.error` cannot select their codes. Older engines keep the legacy
|
|
113
|
+
throws and English messages.
|
|
114
|
+
- `runtime.error(message = "...")` now passes the named message. With the
|
|
115
|
+
coded engine and run harness, a run stopped by `runtime.error()` with an
|
|
116
|
+
empty or named message no longer reports success or exposes partial results.
|
|
117
|
+
- `str.tonumber` no longer hides a stop raised while evaluating its argument;
|
|
118
|
+
only numeric parse failures become `na`. Invalid array sizes, substring
|
|
119
|
+
positions and overflowing format-placeholder indices have checked stops.
|
|
120
|
+
String parsing and checked substring calls do not capture authored helper-like
|
|
121
|
+
names; substring arguments retain source order without copying the source text.
|
|
122
|
+
- Generated run wrappers preserve the inner failure code, and latched setter
|
|
123
|
+
failures and checked strategy construction retain their failure identity.
|
|
124
|
+
|
|
125
|
+
### Python and Pyodide input metadata
|
|
126
|
+
|
|
127
|
+
- The transpile-time input manifest (`transpile_full()["inputs"]` and the JSON
|
|
128
|
+
envelope of the Pyodide package) gains `supported`, the checked-settings
|
|
129
|
+
receipt's flag, on every input, and reads its defaults, choices and bounds
|
|
130
|
+
from the descriptor that generates the receipt, with the retained limitations
|
|
131
|
+
below. No manifest key is renamed or removed, but these values of existing
|
|
132
|
+
keys change:
|
|
133
|
+
- Source inputs (`input.source`, a plain `input(close)`): `default` is the
|
|
134
|
+
series name, where it was `null`, and `options` lists the nine native
|
|
135
|
+
sources, where it was absent.
|
|
136
|
+
- Enum inputs: `options` lists the `Enum.member` choices, where it was
|
|
137
|
+
absent; `default` keeps its `Enum.member` spelling. The compiled receipt
|
|
138
|
+
encodes that default as its integer member value.
|
|
139
|
+
- String inputs: a built-in constant publishes its runtime value
|
|
140
|
+
(`alert.freq_all` is `"all"`, `currency.USD` is `"USD"`; the manifest held
|
|
141
|
+
the Pine names), a named string constant its value, and the choices of
|
|
142
|
+
`input.timeframe` and `input.session` are listed. What the receipt cannot
|
|
143
|
+
represent (`size.small`, `position.top_right`, `na`) has `supported: false`
|
|
144
|
+
and `options: []`; an unavailable default is `""`, but a representable
|
|
145
|
+
default survives an unsupported choice. String decoding uses the emitter
|
|
146
|
+
escape grammar, keeps literal Unicode and escaped backslashes, and stops
|
|
147
|
+
at the first NUL like the receipt's `std::string(const char*)` constructor.
|
|
148
|
+
NUL is emitted as a fixed three-digit octal escape even before digits;
|
|
149
|
+
this is consistency with current native truncation, not lossless NUL storage.
|
|
150
|
+
- Typed `int`, `float`, `price` and `time` inputs: a signed or
|
|
151
|
+
named-constant `default` is a number, where it was `null`; `min`, `max` and
|
|
152
|
+
`step` appear for signed and named-constant bounds (`minval=-80` was left
|
|
153
|
+
out); an `options=[...]` dropdown lists its numbers. A literal or inlined
|
|
154
|
+
`bool` default publishes a boolean, not a number.
|
|
155
|
+
- A plain `input(-5)` or `input(-2.5)` is typed `int` or `float` with its
|
|
156
|
+
number as `default`, where it was `string` with `null`. The compiled
|
|
157
|
+
getter and checked receipt keep their existing float type for these
|
|
158
|
+
signed plain inputs; this manifest correction does not change that lowering.
|
|
159
|
+
|
|
160
|
+
Values the receipt computes at run time (`LEN * 2`, `not true`,
|
|
161
|
+
`timestamp(year, month, ...)`) stay unpublished: the default remains
|
|
162
|
+
`None`/JSON `null`, an unfoldable bound is omitted, and the whole `options`
|
|
163
|
+
field is omitted when any numeric choice is unfoldable. An `input.color`
|
|
164
|
+
retains its Pine spelling as a string default, not the receipt's packed
|
|
165
|
+
integer; other nonliteral plain `input()` calls remain `string` with no
|
|
166
|
+
published default (the source case above is the exception). A folded
|
|
167
|
+
`timestamp("...")` is a publishable literal. These gaps
|
|
168
|
+
are explicit in `tests/test_input_metadata_receipt.py::KNOWN_LIMITS`, not a
|
|
169
|
+
claim of arbitrary expression evaluation or language soundness.
|
|
170
|
+
- Documents the timeframe spellings of two surfaces, both stable: a capability
|
|
171
|
+
receipt records a request's timeframe as the script wrote it (`"D"`), and
|
|
172
|
+
request discovery and feed keys use the engine's spelling (`"1D"`).
|
|
173
|
+
|
|
174
|
+
### Collection lowering and refusals
|
|
175
|
+
|
|
176
|
+
- Bind keyword arguments of the matrix methods and the checked array methods to their own parameter slot, with the omitted optional parameters taking their defaults in place (`matrix.sort(m, order = order.descending)`, `m.submatrix(to_column = 1)`, `a.fill(7.0, index_to = 1)` no longer drop or shift a keyword), and refuse a keyword that names no parameter, or a parameter given twice, with the existing argument diagnostics. A defaulted `submatrix` evaluates its receiver once, an index-only `add_row` / `add_col` takes any numeric index, and a bound `array.concat` result (`c = a.concat(b)`, `c := array.concat(a, b)`) keeps the unsupported-function refusal. An array history that reaches a user function's or method's parameter keeps its earlier copy lowering and the earlier refusal of a callee that checks it with `na()`; a bound missing-history matrix reports the recorded na-ID runtime error.
|
|
177
|
+
- Compile matrix/matrix and matrix/scalar `matrix.sum` overloads with matrix-valued results, including helpers and history. Support scalar `matrix.diff`/`matrix.mult` and omitted optional arguments to matrix row/column insertion, submatrix, sort and array fill; unsupported matrix/vector multiplication and bound `array.concat` results report an existing unsupported-function diagnostic instead of failing C++ compilation.
|
|
178
|
+
- Preserve na array IDs when a history offset has no value, including aliases and `na()`-only bindings; array methods on those IDs report the existing runtime error instead of crashing. Bounds-check legacy collection-element reads and writes to prevent unchecked access.
|
|
179
|
+
|
|
180
|
+
The inherited follow-ups remain: keywords on UDT matrix fields, `matrix.new`
|
|
181
|
+
and array methods outside the checked table; `matrix.fill` range handling
|
|
182
|
+
(both spellings still fill the whole matrix); matrix diff/mult dimension
|
|
183
|
+
checks; and nullable history across callable/iteration shapes not covered by
|
|
184
|
+
the documented lowering. This release does not claim those cases resolved.
|
|
185
|
+
|
|
186
|
+
### Emitted-string edge cases and maintenance
|
|
187
|
+
|
|
188
|
+
- Return the prefix or ticker of the supplied symbol in `syminfo.prefix(symbol)`
|
|
189
|
+
and `syminfo.ticker(symbol)` instead of always reading the chart symbol; the
|
|
190
|
+
variable forms, no-argument calls and direct chart-ID calls keep their
|
|
191
|
+
chart lowering. Supplied-symbol calls split at the first colon; a prefix
|
|
192
|
+
is empty without a colon or with no ticker after it, and a ticker without
|
|
193
|
+
a colon is the full string. Non-string arguments still compile and yield
|
|
194
|
+
an empty string, including the retained string-`na` typing gap.
|
|
195
|
+
- Refuse malformed library versions with the existing import diagnostic instead
|
|
196
|
+
of allowing them to raise outside the JSON gate, including non-ASCII decimal
|
|
197
|
+
digits and ASCII versions exceeding Python's integer-conversion limit.
|
|
198
|
+
- Reserve generated receipt exports and version macros against script names.
|
|
199
|
+
- Escape embedded NUL values in generated C++ string literals, and strengthen
|
|
200
|
+
emitted-string regression tests with explicit emitter reach and round trips.
|
|
201
|
+
- CI fetches full branch history for historical reference tests (#188); two
|
|
202
|
+
whole-C++ comparisons use the accepted immutable scaffold (#189). These
|
|
203
|
+
changes affect verification only, not the compiler or execution semantics.
|
|
204
|
+
|
|
205
|
+
The hardening wording remains scoped to the previously documented emitted-string
|
|
206
|
+
validation and escaping; these edge-case repairs and regression checks are not
|
|
207
|
+
a new arbitrary-source security guarantee. No exploit payloads are included.
|
|
208
|
+
|
|
209
|
+
### Known issues with consumers
|
|
210
|
+
|
|
211
|
+
The new numeric options expose an exact-type comparison in
|
|
212
|
+
`pineforge-hpo` 0.11.0: a JSON integer `20` is refused with
|
|
213
|
+
`invalid_input_option` for an `input.float` choice `20.0`, although the
|
|
214
|
+
numbers are equal. For HPO 0.11.0, send each selected value with the number
|
|
215
|
+
type the original manifest publishes for that option: `20.0` when it lists
|
|
216
|
+
`20.0` (explicit JSON `20.0` or a Python float), and integer `20` when it lists
|
|
217
|
+
`20`. A float input written with whole-number-literal options such as
|
|
218
|
+
`options=[10, 20, 30]` publishes integer options; mixed lists retain mixed
|
|
219
|
+
number types. The input's `float` type alone does not choose the workaround.
|
|
220
|
+
|
|
221
|
+
This can affect a caller that reads a float-spelled manifest default and
|
|
222
|
+
sends it back through JavaScript's ordinary JSON serialization, which writes
|
|
223
|
+
a whole-number value as `20`, losing its float spelling. Writing `20.0` in
|
|
224
|
+
JavaScript before ordinary serialization does not preserve that distinction;
|
|
225
|
+
preserve each option's original number type at the HPO boundary. Upgrade to
|
|
226
|
+
HPO 0.11.1 or a later release containing the fix when available. This fix is
|
|
227
|
+
separate from the engine/codegen release; HPO 0.11.1 has not been released at
|
|
228
|
+
the time of writing.
|
|
229
|
+
|
|
230
|
+
### Recorded validation and grades
|
|
231
|
+
|
|
232
|
+
The landed #190 candidate recorded 9,254 engine-enabled pytest passes with
|
|
233
|
+
12 audited skips, 2,164 focused passes each under GCC and Clang without skips,
|
|
234
|
+
314 public corpus compilation passes, and 279 fixtures in each of the JSON
|
|
235
|
+
and Pyodide fixture-parity checks. Those
|
|
236
|
+
are the request's retained native measurements, not a new native suite run
|
|
237
|
+
for this documentation change. The release-pair baseline records
|
|
238
|
+
excellent: <!-- pf:releases[1.4.0].scoreboard.excellent|int -->7,983<!-- /pf -->;
|
|
239
|
+
strong: <!-- pf:releases[1.4.0].scoreboard.strong|int -->6<!-- /pf -->;
|
|
240
|
+
graded: <!-- pf:releases[1.4.0].scoreboard.graded|int -->7,989<!-- /pf --> probes,
|
|
241
|
+
with <!-- pf:releases[1.4.0].scoreboard.belowStrong|int -->0<!-- /pf --> below strong
|
|
242
|
+
and <!-- pf:releases[1.4.0].scoreboard.engineErrors|int -->0<!-- /pf --> engine errors.
|
|
243
|
+
These are recorded grading outcomes, not a statement that no internal attempt
|
|
244
|
+
ever failed. Baseline <!-- pf:releases[1.4.0].scoreboard.id|code -->`pineforge-parity-baseline-20261007-engine-b3192bfc`<!-- /pf -->
|
|
245
|
+
measures engine <!-- pf:releases[1.4.0].scoreboard.engineCommit|short-code -->`b3192bfc`<!-- /pf -->
|
|
246
|
+
and codegen <!-- pf:releases[1.4.0].scoreboard.codegenCommit|short-code -->`bfc4ddce`<!-- /pf -->;
|
|
247
|
+
these quantities render from the public release facts, not numeric overrides.
|
|
248
|
+
|
|
23
249
|
## 1.3.0 — 2026-10-06
|
|
24
250
|
|
|
25
251
|
A minor release: generated strategy libraries gain two receipts beside 1.2.0's
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pineforge-codegen
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.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
|
|
@@ -296,12 +296,14 @@ A pure-Python library that turns a PineScript v6 strategy into a complete C++
|
|
|
296
296
|
source file you can compile against the [`pineforge-engine`](https://github.com/pineforge-4pass/pineforge-engine)
|
|
297
297
|
runtime.
|
|
298
298
|
|
|
299
|
-
**Measured <!-- pf:scoreboard.date -->2026-10-
|
|
300
|
-
graded excellent and <!-- pf:scoreboard.strong|int -->
|
|
299
|
+
**Measured <!-- pf:scoreboard.date -->2026-10-07<!-- /pf -->** on main engine <!-- pf:scoreboard.engineCommit|short-code -->`b3192bfc`<!-- /pf --> with codegen-oss <!-- pf:scoreboard.codegenCommit|short-code -->`bfc4ddce`<!-- /pf --> (baseline <!-- pf:scoreboard.id|code -->`pineforge-parity-baseline-20261007-engine-b3192bfc`<!-- /pf -->, snapshot <!-- pf:scoreboard.snapshotSha256|short-code -->`28ba8dbd`<!-- /pf -->): <!-- pf:scoreboard.excellent|int -->7,983<!-- /pf --> of <!-- pf:scoreboard.graded|int -->7,989<!-- /pf --> TradingView probes
|
|
300
|
+
graded excellent and <!-- pf:scoreboard.strong|int -->6<!-- /pf --> strong, with <!-- pf:scoreboard.belowStrong|int -->0<!-- /pf --> below strong; <!-- pf:scoreboard.anomaliesExcluded|int -->17<!-- /pf --> more probes are held out as TradingView-side anomalies.
|
|
301
301
|
A probe is a strategy exported from TradingView with its trade list and replayed
|
|
302
302
|
trade for trade on the same bars.
|
|
303
303
|
|
|
304
|
-
Release **1.
|
|
304
|
+
Release **1.4.0 grades <!-- pf:releases[1.4.0].scoreboard.excellent|int -->7,983<!-- /pf --> excellent / <!-- pf:releases[1.4.0].scoreboard.strong|int -->6<!-- /pf --> strong**, on <!-- pf:releases[1.4.0].scoreboard.graded|int -->7,989<!-- /pf --> probes (baseline <!-- pf:releases[1.4.0].scoreboard.id|code -->`pineforge-parity-baseline-20261007-engine-b3192bfc`<!-- /pf -->, <!-- pf:releases[1.4.0].scoreboard.date -->2026-10-07<!-- /pf -->). These are the pair's recorded grading outcomes, not a promise about arbitrary scripts. A main scoreboard advance does not change release results.
|
|
305
|
+
|
|
306
|
+
Release 1.3.0 recorded <!-- pf:releases[1.3.0].scoreboard.excellent|int -->7,982<!-- /pf --> excellent / <!-- pf:releases[1.3.0].scoreboard.strong|int -->7<!-- /pf --> strong on <!-- pf:releases[1.3.0].scoreboard.graded|int -->7,989<!-- /pf --> probes; its historical result remains scoped to that pair.
|
|
305
307
|
|
|
306
308
|
The quantities above render from the public [facts tokens](https://github.com/pineforge-4pass/pineforge-release/blob/main/facts/facts.json). Maintain them with `lab facts render --repo . --facts <local facts file or pinned raw URL>`; `lab facts check` with the same inputs reports drift. Grades are registry-derived; the authored-script and closed-trade inventory is explicitly sourced to a historical public README for the identical population, not to registry row or slug totals.
|
|
307
309
|
|
|
@@ -325,7 +327,7 @@ for the changes in each release from 1.0.0 on and the release-note policy.
|
|
|
325
327
|
## Releases and this README
|
|
326
328
|
|
|
327
329
|
<!-- Release lane: before a release is tagged, add it to the Engine pairing
|
|
328
|
-
table and update every line that names `1.
|
|
330
|
+
table and update every line that names `1.4.0` or `v1.4.0` as the current
|
|
329
331
|
release or pair (this section's version and date, the baseline paragraph at
|
|
330
332
|
the top, the engine `src/source/` link, the `@pf-trace` note, the clone
|
|
331
333
|
command and its example output, "This section describes …", the timing note)
|
|
@@ -335,8 +337,11 @@ hosted-server line name no version. -->
|
|
|
335
337
|
|
|
336
338
|
This README ships with each release as its package description on PyPI
|
|
337
339
|
(`pineforge-codegen`); releases from 0.7.0 on are also on npm as
|
|
338
|
-
`@pineforge/codegen-pyodide`. It describes 1.
|
|
339
|
-
since 0.10.4. The
|
|
340
|
+
`@pineforge/codegen-pyodide`. It describes 1.4.0 (2026-10-08)
|
|
341
|
+
and what changed since 0.10.4. The release's behavior was validated before
|
|
342
|
+
tagging on codegen `bfc4ddce` with engine `b3192bfc`, excluding engine
|
|
343
|
+
request #356. Those validation builds reported `1.3.0`; historical measurements
|
|
344
|
+
below retain the versions on which they were run. The
|
|
340
345
|
[PyPI release history](https://pypi.org/project/pineforge-codegen/#history)
|
|
341
346
|
lists every release; the
|
|
342
347
|
[changelog](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/CHANGELOG.md)
|
|
@@ -344,6 +349,33 @@ covers 1.0.0 on and links the notes of earlier releases. A source install
|
|
|
344
349
|
reports the version in `VERSION`, which the release workflow sets when it tags
|
|
345
350
|
a release.
|
|
346
351
|
|
|
352
|
+
### Upgrading from 1.3.0
|
|
353
|
+
|
|
354
|
+
For the 1.4.0 pair, regenerate C++ and relink against engine
|
|
355
|
+
`v1.4.0`'s generated headers and runtime, even though C ABI version 4 and the
|
|
356
|
+
script ABI epoch are retained. Emission and input manifests change; neither
|
|
357
|
+
generated C++ nor Python/Pyodide envelopes are promised byte-identical. Every
|
|
358
|
+
input row now has `supported`: when false, hide it, exclude it from sweeps and
|
|
359
|
+
optimization, and do not send a value. Its compiled default is used; a supplied
|
|
360
|
+
value is refused with `setting_unsupported`. A true flag still requires type,
|
|
361
|
+
bounds and options validation, and does not detect duplicate keys. Account for
|
|
362
|
+
corrected source/enum choices, string values, signed bounds and plain-input types.
|
|
363
|
+
|
|
364
|
+
Give each input a unique title; different `group=` labels do not separate
|
|
365
|
+
override keys. The paired checked path refuses a shared key and returns a null
|
|
366
|
+
fingerprint for a completed run of such a script even without an override.
|
|
367
|
+
The [1.4.0 migration notes](CHANGELOG.md#140--2026-10-08) cover this change,
|
|
368
|
+
new refusals of some previously accepted settings, and color's string manifest
|
|
369
|
+
versus packed-integer native value. Check stored presets before submitting them.
|
|
370
|
+
Users of `pineforge-hpo` 0.11.0 must preserve the manifest's number type for
|
|
371
|
+
each option at its input boundary; see the [known issue](CHANGELOG.md#known-issues-with-consumers).
|
|
372
|
+
|
|
373
|
+
The paired engine adds coded run failures and typed fingerprint provenance.
|
|
374
|
+
Its run harness returns failure `code` and typed `args` beside `error`; an
|
|
375
|
+
empty message still means failure. Transpile-time diagnostics remain a separate
|
|
376
|
+
Python/JSON surface. Read the [1.4.0 changelog](CHANGELOG.md#140--2026-10-08)
|
|
377
|
+
for migration details and inherited collection/metadata limitations.
|
|
378
|
+
|
|
347
379
|
### Upgrading from 0.10.4
|
|
348
380
|
|
|
349
381
|
0.10.4 (2026-09-06) was the last 0.x release. Its README is at the
|
|
@@ -375,8 +407,9 @@ It does **not** own execution semantics. Order lifecycle, bracket legs,
|
|
|
375
407
|
fill-price and slippage rules, `process_orders_on_close` / `calc_on_order_fills`,
|
|
376
408
|
margin revival and trail/stop behaviour — everything TradingView parity depends
|
|
377
409
|
on at run time — live in the engine's source-adapter runtime
|
|
378
|
-
([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.
|
|
379
|
-
in engine `v1.
|
|
410
|
+
([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.4.0/src/source)
|
|
411
|
+
in engine `v1.4.0`), which maps them onto the engine's Pine-agnostic kernel.
|
|
412
|
+
See
|
|
380
413
|
the engine's [architecture notes](https://github.com/pineforge-4pass/pineforge-engine#architecture-kernel-vs-parity).
|
|
381
414
|
|
|
382
415
|
---
|
|
@@ -471,7 +504,33 @@ It returns `{"cpp": str, "inputs": list[dict], "strategyParams": dict,
|
|
|
471
504
|
returns the first three keys; `requests` is new in 1.1.0). `inputs` is the input
|
|
472
505
|
manifest; its `title` is the actual override key, and an `input.symbol` entry
|
|
473
506
|
also has `"kind": "symbol"` (since 1.1.0). `diagnostics` contains nonfatal
|
|
474
|
-
warnings.
|
|
507
|
+
warnings. Since 1.4.0, each input also has `supported`, the checked-settings receipt's
|
|
508
|
+
flag. Hide inputs with a false flag, exclude them from sweeps and optimization,
|
|
509
|
+
and do not send a value: the compiled default is used, and the paired engine
|
|
510
|
+
refuses a supplied value with `setting_unsupported`. A true flag is not a full
|
|
511
|
+
validation or duplicate-key check. Defaults, bounds and choices are the
|
|
512
|
+
receipt's values where it holds a literal: string inputs spell a built-in constant by its runtime
|
|
513
|
+
value (`alert.freq_all` is `"all"`, not the Pine name), a source or enum input
|
|
514
|
+
lists its choices, and a typed number input publishes a signed or named-constant
|
|
515
|
+
default and bound and the numbers of an `options=[...]` dropdown. An
|
|
516
|
+
unrepresentable string default is `""`, and every unsupported string input has
|
|
517
|
+
`options: []` (a representable default is kept), so key on `supported`, not on
|
|
518
|
+
`options`. Plain `input(-5)` and `input(-2.5)` now publish `int` and `float`
|
|
519
|
+
manifest types and numeric defaults; their compiled getters and checked
|
|
520
|
+
receipts retain the existing float type. A plain `input(close)` publishes
|
|
521
|
+
source choices but retains its `string` manifest type. String metadata
|
|
522
|
+
follows native C-string construction: an
|
|
523
|
+
embedded NUL truncates the published default/choice at the first NUL; it is
|
|
524
|
+
not a lossless-string promise. Literal Unicode and escaped backslashes are
|
|
525
|
+
retained. Run-time arithmetic, `not true` and calendar-part `timestamp` values
|
|
526
|
+
still have no published default or unfoldable bounds; a folded
|
|
527
|
+
`timestamp("...")` is a literal. The whole numeric `options` field is omitted
|
|
528
|
+
if any choice is unfoldable. Colors retain their Pine spelling and `string`
|
|
529
|
+
manifest type, while the checked native setter requires a packed integer.
|
|
530
|
+
The [contract](docs/PUBLIC_CONTRACT.md#input-manifest-and-override-keys) lists
|
|
531
|
+
these retained limits. The PyPI and Pyodide manifests carry the same fields; no key is
|
|
532
|
+
renamed or removed, and the changelog lists the values that changed.
|
|
533
|
+
`requests` lists the other symbols' feeds the script reads (see
|
|
475
534
|
[List the other symbols a script requests](#list-the-other-symbols-a-script-requests)).
|
|
476
535
|
A rejected script raises `CompileError` with its diagnostics. The Pyodide
|
|
477
536
|
package ships `gate/glue.py`'s `transpile_json(source) -> str`, whose JSON
|
|
@@ -536,7 +595,21 @@ timeframe is a `literal` in the engine's spelling (whole minutes such as
|
|
|
536
595
|
`"240"`, `<n>D|W|M|S` such as `"1D"`, Pine's bare `"D"` as `"1D"`), the
|
|
537
596
|
`chart`'s, an `input` or `computed` (an empty `value` is the chart's). A
|
|
538
597
|
request whose value reaches only plots and alerts is lowered to `na` and
|
|
539
|
-
reads no feed, so it is not listed.
|
|
598
|
+
reads no feed, so it is not listed.
|
|
599
|
+
|
|
600
|
+
Timeframe spellings differ by surface, and both are stable. A capability
|
|
601
|
+
receipt records a request's `timeframe` as the script wrote it: a literal
|
|
602
|
+
verbatim (`"D"` stays `"D"`, `"1D"` stays `"1D"`), anything else as its Pine
|
|
603
|
+
expression (`timeframe.period`, a variable's name). Request discovery and feed
|
|
604
|
+
keys use the engine's spelling, in which Pine's bare `"D"` / `"W"` / `"M"` /
|
|
605
|
+
`"S"` are `"1D"` / `"1W"` / `"1M"` / `"1S"` and any other text is kept.
|
|
606
|
+
Discovery folds `literal` and `computed` values
|
|
607
|
+
(`pineforge_codegen.request_discovery.canonical_timeframe`); the engine folds
|
|
608
|
+
the requested timeframe when it looks a feed up, so a script's `"D"` and
|
|
609
|
+
`"1D"` read the same feed, keyed `"1D"`. An `input` timeframe's `default` and
|
|
610
|
+
its override are raw: fold them the same way. To match a receipt's request to a
|
|
611
|
+
feed, fold the receipt's literal timeframe with that rule (folding twice
|
|
612
|
+
changes nothing); never map a feed key back to `"D"`. The
|
|
540
613
|
[public contract](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/docs/PUBLIC_CONTRACT.md)
|
|
541
614
|
gives every field.
|
|
542
615
|
|
|
@@ -728,6 +801,7 @@ Generated C++ compiles only against the engine it was generated for:
|
|
|
728
801
|
| 1.1.0 (PyPI, 2026-10-04) | `v1.1.0` | The pair the `pineforge-release` image `1.1.0` ships. Its C++ defines the checked settings functions that engine `v1.1.0` adds to `<pineforge/pineforge.h>`; regenerate and relink. |
|
|
729
802
|
| 1.2.0 (PyPI, 2026-10-05) | `v1.2.0` | The pair the `pineforge-release` image `1.2.0` ships. Its C++ defines the compiled execution capability functions that engine `v1.2.0` adds to `<pineforge/pineforge.h>`; regenerate and relink. |
|
|
730
803
|
| 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. |
|
|
804
|
+
| 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. |
|
|
731
805
|
| Later `X.Y.Z` releases | `vX.Y.Z` of the same version | See below. |
|
|
732
806
|
|
|
733
807
|
On the 0.x line the engine and codegen versions are independent, and the
|
|
@@ -753,8 +827,8 @@ Pine as `strategy.pine`, write `strategy.generated.cpp` with the
|
|
|
753
827
|
[file example](#transpile-a-file-to-a-cpp) above, then from the same directory:
|
|
754
828
|
|
|
755
829
|
```bash
|
|
756
|
-
# 1.
|
|
757
|
-
git clone --branch v1.
|
|
830
|
+
# 1.4.0 pairs with engine v1.4.0. For 0.10.4 use v0.13.1.
|
|
831
|
+
git clone --branch v1.4.0 https://github.com/pineforge-4pass/pineforge-engine.git
|
|
758
832
|
cd pineforge-engine
|
|
759
833
|
cp ../strategy.generated.cpp tutorial/macd/generated.cpp # the tutorial's strategy slot
|
|
760
834
|
bash tutorial/run.sh # needs cmake, a C++17 compiler and python3
|
|
@@ -763,7 +837,8 @@ bash tutorial/run.sh # needs cmake, a C++17 compiler and python3
|
|
|
763
837
|
`run.sh` configures CMake once, builds `libpineforge.a` and
|
|
764
838
|
`tutorial/macd/strategy.so`, and runs `tutorial/run.py`, which loads the `.so`,
|
|
765
839
|
feeds it the bars and reads back the closed trades. For the quick-start SMA
|
|
766
|
-
cross, 1.3.0 with engine `v1.3.0
|
|
840
|
+
cross, the following output was measured on 1.3.0 with engine `v1.3.0`; it
|
|
841
|
+
was not re-measured for the 1.4.0 release notes:
|
|
767
842
|
|
|
768
843
|
```
|
|
769
844
|
MACD(12,26,9) on BTCUSDT 15m — 672 bars, 2026-04-29 18:15 → 2026-05-06 18:00 UTC
|
|
@@ -867,7 +942,7 @@ quote. The commercial-license store (coming soon) will take orders online.
|
|
|
867
942
|
|
|
868
943
|
## Explicit Pine execution attachment
|
|
869
944
|
|
|
870
|
-
This section describes 1.
|
|
945
|
+
This section describes the 1.4.0 and engine `v1.4.0` pair. The Pine execution adapter is
|
|
871
946
|
the engine's full Pine execution runtime (`PineExecutionAdapter` and
|
|
872
947
|
`PineStrategyHost` in the engine's `src/source/`): order lifecycle, bracket
|
|
873
948
|
legs, fill-price and slippage rules, POOC / `calc_on_order_fills`, margin
|
|
@@ -890,10 +965,11 @@ Regenerate old generated C++ before using a new engine for Pine execution. C++
|
|
|
890
965
|
generated before the source-layer cut
|
|
891
966
|
([#129](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/129)),
|
|
892
967
|
0.10.4's included, derives from `BacktestEngine` and does not compile against
|
|
893
|
-
engine `v1.
|
|
968
|
+
engine `v1.4.0`; old cap-only C++ does not attach the priority rule, and
|
|
894
969
|
metadata cannot silently restore it. Rebuild all modules against the
|
|
895
|
-
new matching C++ layout (`engine_script_run_v19` in engine `v1.
|
|
896
|
-
|
|
970
|
+
new matching C++ layout (`engine_script_run_v19` in engine `v1.4.0`). Retaining
|
|
971
|
+
that epoch does not promise equal fingerprints, state hashes or trades across
|
|
972
|
+
releases. The extraction preserves Pine policy
|
|
897
973
|
under explicit attachment; it does not implement the generic native
|
|
898
974
|
child-activation scheduler or prove campaign neutrality. Compile-only corpus
|
|
899
975
|
checks do not run Pine backtests.
|