pineforge-codegen 1.4.0__tar.gz → 1.5.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 (74) hide show
  1. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/CHANGELOG.md +91 -0
  2. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/PKG-INFO +65 -30
  3. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/README.md +64 -29
  4. pineforge_codegen-1.5.0/VERSION +1 -0
  5. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/docs/PUBLIC_CONTRACT.md +210 -25
  6. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/__init__.py +60 -4
  7. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/diagnostic_codes.py +18 -8
  8. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/diagnostics_catalog.json +629 -629
  9. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/errors.py +12 -1
  10. pineforge_codegen-1.5.0/pineforge_codegen/request_feed_inventory.py +311 -0
  11. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/support_checker.py +15 -6
  12. pineforge_codegen-1.5.0/pineforge_codegen/timeframe_token_cli.py +133 -0
  13. pineforge_codegen-1.4.0/VERSION +0 -1
  14. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/.gitignore +0 -0
  15. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/CONTRIBUTING.md +0 -0
  16. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/LEGAL.md +0 -0
  17. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/LICENSE +0 -0
  18. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/docs/codegen-coverage-gaps.md +0 -0
  19. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/docs/pine-cap-activation.md +0 -0
  20. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/analyzer/__init__.py +0 -0
  21. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/analyzer/base.py +0 -0
  22. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/analyzer/call_handlers.py +0 -0
  23. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/analyzer/contracts.py +0 -0
  24. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/analyzer/diagnostics.py +0 -0
  25. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/analyzer/tables.py +0 -0
  26. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/analyzer/types.py +0 -0
  27. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/ast_nodes.py +0 -0
  28. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/block_locals.py +0 -0
  29. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/builtin_keywords.py +0 -0
  30. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/__init__.py +0 -0
  31. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/base.py +0 -0
  32. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/capabilities.py +0 -0
  33. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/checked_settings.py +0 -0
  34. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/collection_history.py +0 -0
  35. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/constant_fold.py +0 -0
  36. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/drawing.py +0 -0
  37. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/emit_top.py +0 -0
  38. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/helpers.py +0 -0
  39. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/helpers_syminfo.py +0 -0
  40. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/host_members.py +0 -0
  41. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/input.py +0 -0
  42. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/order_shapes.py +0 -0
  43. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/run_stops.py +0 -0
  44. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/security.py +0 -0
  45. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/session_market.py +0 -0
  46. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/ta.py +0 -0
  47. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/tables.py +0 -0
  48. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/tv_number_format.py +0 -0
  49. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/types.py +0 -0
  50. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/visit_call.py +0 -0
  51. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/visit_expr.py +0 -0
  52. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/codegen/visit_stmt.py +0 -0
  53. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/collection_history.py +0 -0
  54. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/external_requests.py +0 -0
  55. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/finite_ta_length.py +0 -0
  56. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/lexer.py +0 -0
  57. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/library_inline.py +0 -0
  58. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/library_modules.py +0 -0
  59. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/library_v5.py +0 -0
  60. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/limits.py +0 -0
  61. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/matrix_overloads.py +0 -0
  62. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/method_binding.py +0 -0
  63. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/parser.py +0 -0
  64. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/pine_libraries.py +0 -0
  65. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/pine_spelling.py +0 -0
  66. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/pragmas.py +0 -0
  67. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/request_discovery.py +0 -0
  68. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/security_contexts.py +0 -0
  69. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/session_reads.py +0 -0
  70. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/signatures.py +0 -0
  71. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/symbols.py +0 -0
  72. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/tokens.py +0 -0
  73. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pineforge_codegen/tv_input_choices.py +0 -0
  74. {pineforge_codegen-1.4.0 → pineforge_codegen-1.5.0}/pyproject.toml +0 -0
@@ -20,6 +20,97 @@ 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.5.0 — 2026-10-12
24
+
25
+ A minor release of the exact engine/codegen pair, paired with engine `v1.5.0`
26
+ and dated 2026-10-12. This entry records the diagnostic additions below and the
27
+ report-contract documentation for the paired engine fix, and nothing else: the
28
+ codegen change is diagnostics only; the report documentation adds no Python,
29
+ JSON, diagnostic or emitted-C++ change of its own, and no analyzer or
30
+ code-generation file differs.
31
+
32
+ ### Compatibility and migration
33
+
34
+ - **`note` is a third diagnostic severity, and it is nonfatal.** A diagnostic
35
+ is now an `error`, a `warning` or a `note`: `Level.NOTE` in Python and `"note"`
36
+ as the `severity` of a catalog entry and of a JSON diagnostic. A note is
37
+ nonfatal like a warning. `transpile_full()["diagnostics"]` and the success
38
+ envelope's `diagnostics` list warnings and notes, a script with only notes
39
+ still returns `ok: true` and its C++, and a `CompileError` can carry notes
40
+ beside its errors. `transpile()` still returns no nonfatal diagnostics.
41
+ `CompileError.format()` prints `note[...]` where it printed `warning[...]` for
42
+ the codes below. Code written for two severities must handle `note`: read an
43
+ unknown severity as a warning, never as an error. A note does not mean that
44
+ results are unaffected; PF-W1505 describes a warmup approximation.
45
+ - **Exactly eleven codes change from warning to note:** PF-W1505, PF-W1508,
46
+ PF-W1509, PF-W1525, PF-W1526, PF-W1527, PF-W1528, PF-W1529, PF-W1530,
47
+ PF-W1531 and PF-W1532. They describe calls PineForge skips as visual only
48
+ (`plot(...)`, `table.new(...)`), earnings, dividends, splits, financial,
49
+ footprint and other-symbol requests whose value reaches only display and alert
50
+ sinks and is lowered to `na`, and the `ta.ema` warmup approximation. Every
51
+ other code keeps its severity. PF-W1502 (`color(...)` cast), PF-W1506
52
+ (`color.from_gradient`), PF-W1507 (drawing setters that drop color, style or
53
+ size), PF-W1078 (visual or style constants) and PF-W1552 (a
54
+ `request.security_lower_tf` whose value reaches only display and alert sinks)
55
+ also speak of visual-only or display-only handling and remain warnings: a
56
+ message's wording does not classify it. A consumer that tallied these eleven
57
+ codes as warnings, to gate a run, count warnings or color a banner, now
58
+ receives notes. PF-W1509 still classifies as PF-W1508 where the two templates
59
+ tie, so no new emitted code appears.
60
+ - **`user_message` is a raw ICU template over `args`.** Every catalog entry,
61
+ every `Diagnostic` (`Diagnostic.user_message`) and every JSON diagnostic gains
62
+ `user_message`: a short English ICU template that uses only that diagnostic's
63
+ existing `args` names and may be constant (`{name}() does nothing in a backtest.`
64
+ with `args.name = "plot"`). It is not pre-rendered English. Render it with
65
+ `args` as plain text, never as template syntax or markup, or translate by
66
+ `code`; do not display the unrendered template. It does not replace `message`
67
+ and `hint`. The templates of the eleven migrated codes are fixed string for
68
+ string by a delta fixture. Every template is checked for form (short,
69
+ parseable, over that code's own `args` names). Each of the 97 warning twins
70
+ of an error (`PF-W1nnn` for `PF-E1nnn`) has a sentence of its own that says
71
+ PineForge warns, and the 91 that warn only inside a `switch` arm also say it
72
+ keeps the arm's lowering. No warning or note template says that PineForge
73
+ refuses or rejects something, though one may say what TradingView refuses or
74
+ rejects. Beyond these checks a template's exact wording is not pinned.
75
+ - **Legacy fields are stable.** `code`, `args`, `message`, `hint`, `line`,
76
+ `col`, `endCol`, `ok`, `error` and the envelope keys keep their meaning and
77
+ values: no key is renamed or removed, and no code is renumbered or reused (the
78
+ notes keep their `PF-W` codes, and the prefix is not the severity).
79
+ `render_diagnostic()` still returns the unchanged English `message` and
80
+ `hint`. The catalog schema id stays `pineforge-diagnostics-catalog/v1`, so a
81
+ reader that checks `severity` against two values or rejects unknown entry
82
+ fields must accept `note` and `user_message`. The receiver examples in
83
+ `tests/fixtures/diagnostic_notes/receiver.json` specify the compatibility
84
+ rule; they are not evidence of any application's behavior.
85
+ - **The warmup sidecar is later work.** No compile-time or runtime sidecar
86
+ exists in this entry. PF-W1505 stays the static `ta.ema` note it was, with
87
+ only its severity changed: the support checker emits it at each `ta.ema` call
88
+ it visits, with no per-call condition or suppression and no call-site
89
+ identifier. The startup inventory and extraction that would bind a versioned
90
+ sidecar to a diagnostic by `call_site_id` and source range, so that a consumer
91
+ can show a startup sentence only for a known finite shortfall, are not part of
92
+ this entry, and no diagnostic carries a call-site identifier or a startup
93
+ length.
94
+
95
+ ### Documentation
96
+
97
+ The engine side of the report-ownership text below is a report fix, in
98
+ preparation, that engine `v1.4.0` does not carry.
99
+
100
+ - The [public contract](docs/PUBLIC_CONTRACT.md#a-report-belongs-to-the-call-that-returned-it)
101
+ states that a report belongs to the call that returned it. A call the engine
102
+ refuses without beginning gets the empty report, never an earlier run's rows;
103
+ a run that began and then failed keeps its partial rows; the explicit stream
104
+ snapshot keeps the owner's rows; recorded outputs keep their own record of
105
+ the last run that began.
106
+ - Read the error text, the error code **and** the run status after every run.
107
+ A refusal the engine makes before it admits the begin leaves the status at its
108
+ earlier value (0 after a completed run), so the status alone misses it. The
109
+ README's "Compile & run against the engine" section says the same.
110
+ - Pairing is unchanged in kind: regenerate the strategy C++ and relink against
111
+ the engine release's headers and `libpineforge.a` on a pair change (README
112
+ [Engine pairing](README.md#engine-pairing)).
113
+
23
114
  ## 1.4.0 — 2026-10-08
24
115
 
25
116
  A minor release of the exact engine/codegen pair. Its behavior was validated
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pineforge-codegen
3
- Version: 1.4.0
3
+ Version: 1.5.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
@@ -321,13 +321,13 @@ for the changes in each release from 1.0.0 on and the release-note policy.
321
321
  `transpile_full()` are the supported Python entry points.
322
322
  - **Located diagnostics** — the support checker rejects unsupported Pine with
323
323
  a `file:line:col` location before any C++ is emitted, and
324
- `transpile_full()` returns warnings for supported scripts with documented
325
- approximations.
324
+ `transpile_full()` returns nonfatal warnings and, since 1.5.0, notes for supported scripts,
325
+ including those with documented approximations.
326
326
 
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.4.0` or `v1.4.0` as the current
330
+ table and update every line that names `1.5.0` or `v1.5.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,10 +337,10 @@ 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.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
340
+ `@pineforge/codegen-pyodide`. It describes 1.5.0 (2026-10-12)
341
+ and what changed since 0.10.4. The 1.4.0 release's behavior was validated
342
+ before tagging on codegen `bfc4ddce` with engine `b3192bfc`, excluding engine
343
+ request #356; those validation builds reported `1.3.0`. Historical measurements
344
344
  below retain the versions on which they were run. The
345
345
  [PyPI release history](https://pypi.org/project/pineforge-codegen/#history)
346
346
  lists every release; the
@@ -349,6 +349,9 @@ covers 1.0.0 on and links the notes of earlier releases. A source install
349
349
  reports the version in `VERSION`, which the release workflow sets when it tags
350
350
  a release.
351
351
 
352
+ Text that says "since 1.5.0" describes the 1.5.0 release and later versions;
353
+ the statements about 1.4.0 keep their historical meaning.
354
+
352
355
  ### Upgrading from 1.3.0
353
356
 
354
357
  For the 1.4.0 pair, regenerate C++ and relink against engine
@@ -407,8 +410,8 @@ It does **not** own execution semantics. Order lifecycle, bracket legs,
407
410
  fill-price and slippage rules, `process_orders_on_close` / `calc_on_order_fills`,
408
411
  margin revival and trail/stop behaviour — everything TradingView parity depends
409
412
  on at run time — live in the engine's source-adapter runtime
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.
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.
412
415
  See
413
416
  the engine's [architecture notes](https://github.com/pineforge-4pass/pineforge-engine#architecture-kernel-vs-parity).
414
417
 
@@ -475,8 +478,8 @@ transpile(
475
478
  Returns the generated C++ source as a string. Raises
476
479
  `pineforge_codegen.errors.CompileError` on a rejected construct and, since 1.0.0,
477
480
  on a syntax error or an input limit (0.10.4 recovers from some syntax errors
478
- and has no input limits). It does not return nonfatal warnings; use
479
- `transpile_full()` to inspect them.
481
+ and has no input limits). It does not return nonfatal diagnostics (warnings and,
482
+ since 1.5.0, notes); use `transpile_full()` to inspect them.
480
483
 
481
484
  `libraries` is new in 1.0.0. It maps an import path to the library's
482
485
  source (`{"user/name/version": source_text}`), and each import the script uses
@@ -503,8 +506,8 @@ It returns `{"cpp": str, "inputs": list[dict], "strategyParams": dict,
503
506
  "diagnostics": list[Diagnostic], "requests": list[dict]}` on success (0.10.4
504
507
  returns the first three keys; `requests` is new in 1.1.0). `inputs` is the input
505
508
  manifest; its `title` is the actual override key, and an `input.symbol` entry
506
- also has `"kind": "symbol"` (since 1.1.0). `diagnostics` contains nonfatal
507
- warnings. Since 1.4.0, each input also has `supported`, the checked-settings receipt's
509
+ also has `"kind": "symbol"` (since 1.1.0). `diagnostics` contains the nonfatal
510
+ warnings and, since 1.5.0, notes. Since 1.4.0, each input also has `supported`, the checked-settings receipt's
508
511
  flag. Hide inputs with a false flag, exclude them from sweeps and optimization,
509
512
  and do not send a value: the compiled default is used, and the paired engine
510
513
  refuses a supplied value with `setting_unsupported`. A true flag is not a full
@@ -535,17 +538,29 @@ renamed or removed, and the changelog lists the values that changed.
535
538
  A rejected script raises `CompileError` with its diagnostics. The Pyodide
536
539
  package ships `gate/glue.py`'s `transpile_json(source) -> str`, whose JSON
537
540
  success and error envelopes carry the same manifest and, since 1.0.0, the same
538
- warnings; since 1.1.0 the success envelope also carries `requests`. See the
541
+ warnings; since 1.1.0 the success envelope also carries `requests`. Since 1.5.0, notes, the
542
+ informational level described under [Diagnostic codes](#diagnostic-codes),
543
+ travel in the same `diagnostics` lists with `"severity": "note"`. See the
539
544
  [1.0 public contract](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/docs/PUBLIC_CONTRACT.md)
540
545
  for the exact fields, severity values, and input key rules. There is no
541
546
  installed CLI or exit-code contract.
542
547
 
543
548
  ### Diagnostic codes
544
549
 
545
- Every diagnostic carries a stable `code` and named `args` (since 1.2.0):
546
- `PF-E1203` for an error, `PF-W0412` for a warning, and the data its English
547
- `message` and `hint` were built from — identifiers, types, keywords and
548
- numbers, raw.
550
+ Every diagnostic carries a stable `code` (of the form `PF-E1203` or `PF-W0412`)
551
+ and named `args` (since 1.2.0): the data its English `message` and `hint` were
552
+ built from — identifiers, types, keywords and numbers, raw.
553
+
554
+ An `E` code is an error. A `W` code can be a warning or, since 1.5.0, a note:
555
+ read its declared `level` (`severity` in JSON entries and the catalog).
556
+ A note is a nonfatal, informational diagnostic, and it keeps
557
+ the `PF-W` code it had as a warning. Eleven codes are notes: PF-W1505 (the
558
+ `ta.ema` initial-warmup approximation, reported at every `ta.ema` call as a
559
+ general caveat, not a measured shortfall), PF-W1508 and PF-W1509 (a call such as
560
+ `plot` or `alert` that has no effect in a backtest) and PF-W1525 to PF-W1532 (a
561
+ request for outside data whose value reaches only display and alert sinks,
562
+ lowered to `na`). Every other diagnostic keeps its severity, the other
563
+ visual-only and display-only ones included; the catalog is authoritative.
549
564
 
550
565
  ```python
551
566
  from pineforge_codegen import diagnostics_catalog, transpile_full
@@ -557,15 +572,21 @@ for d in transpile_full(source)["diagnostics"]:
557
572
  entry = diagnostics_catalog()["codes"]["PF-W1067"]
558
573
  # {'severity': 'warning', 'area': 'support',
559
574
  # 'message': '{name} diverges from TradingView semantics in PineForge.',
560
- # 'hint': '...', 'explanation': '...', 'args': {'name': {'kind': 'identifier'}}}
575
+ # 'hint': '...', 'explanation': '...', 'args': {'name': {'kind': 'identifier'}},
576
+ # 'user_message': '...'}
561
577
  ```
562
578
 
563
579
  The catalog (`pineforge_codegen/diagnostics_catalog.json`, also attached to
564
580
  each GitHub release) gives each code its severity, English ICU MessageFormat
565
- templates and a one-line explanation; rendering the templates with `args`
566
- gives the `message` and `hint` byte for byte, so an application can translate
567
- a diagnostic by its code. Codes are never reused. See
568
- [Diagnostic codes](docs/PUBLIC_CONTRACT.md#diagnostic-codes).
581
+ `message` and `hint` templates, a one-line explanation and a short
582
+ `user_message` template; rendering the `message` and `hint` templates with
583
+ `args` gives the diagnostic's `message` and `hint` byte for byte, so an
584
+ application can translate a diagnostic by its code. `user_message` is a
585
+ separate short English ICU template (since 1.5.0) over the same `args` (it may be constant):
586
+ the translation source and the fallback for a code an application does not
587
+ know. It is a template, not pre-rendered English, and each `Diagnostic` and
588
+ JSON diagnostic entry carries it as `user_message` too. Codes are never reused.
589
+ See [Diagnostic codes](docs/PUBLIC_CONTRACT.md#diagnostic-codes).
569
590
 
570
591
  ### List the other symbols a script requests
571
592
 
@@ -656,7 +677,8 @@ transpile(src, filename="my_strategy.pine")
656
677
 
657
678
  Not every request for outside data is refused. A
658
679
  `request.financial()` whose value reaches only plots, alerts, tables or logs
659
- transpiles with a warning and reads `na`; 0.10.4 refuses it. The
680
+ transpiles with a note since 1.5.0 (a warning in earlier releases) and reads `na`; 0.10.4
681
+ refuses it. The
660
682
  [changelog](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/CHANGELOG.md)
661
683
  lists what 1.0.0 reads, warns about or refuses for such requests.
662
684
 
@@ -802,6 +824,7 @@ Generated C++ compiles only against the engine it was generated for:
802
824
  | 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. |
803
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. |
804
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
+ | 1.5.0 (PyPI, 2026-10-12) | `v1.5.0` | Adds the nonfatal `note` diagnostic severity and diagnostic `user_message` templates. Regenerate and relink. |
805
828
  | Later `X.Y.Z` releases | `vX.Y.Z` of the same version | See below. |
806
829
 
807
830
  On the 0.x line the engine and codegen versions are independent, and the
@@ -827,8 +850,8 @@ Pine as `strategy.pine`, write `strategy.generated.cpp` with the
827
850
  [file example](#transpile-a-file-to-a-cpp) above, then from the same directory:
828
851
 
829
852
  ```bash
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
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
832
855
  cd pineforge-engine
833
856
  cp ../strategy.generated.cpp tutorial/macd/generated.cpp # the tutorial's strategy slot
834
857
  bash tutorial/run.sh # needs cmake, a C++17 compiler and python3
@@ -871,6 +894,18 @@ presence of `strategy.close` or `strategy.close_all` in the source. Older C++
871
894
  has removed; regenerate it before compiling there. Reachable close commands
872
895
  keep their ordinary runtime lowering.
873
896
 
897
+ Check how a run ended before you use its report. Read the error text
898
+ (`strategy_get_last_error`), the error code (`strategy_get_last_error_code`)
899
+ **and** the run status (`strategy_last_run_status`): the run failed when the
900
+ text or the code is non-empty or the status is 1. A refusal the engine makes
901
+ before it admits the begin, such as a bar array with a non-finite price, leaves
902
+ the status at its earlier value, so a rerun on a handle whose last run completed
903
+ can read status 0 beside a non-empty error. An engine without the report gate
904
+ (`v1.4.0` and earlier) can also hand a refused rerun on a reused handle the
905
+ previous run's rows. The
906
+ [public contract](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/docs/PUBLIC_CONTRACT.md#a-report-belongs-to-the-call-that-returned-it)
907
+ states the report rule and the engine release that carries it.
908
+
874
909
  Prefer no local build? [pineforge.dev](https://www.pineforge.dev) runs a free
875
910
  hosted MCP server, with a weekly backtest quota, whose `backtest_pine` tool
876
911
  transpiles and backtests a strategy for an AI agent. The
@@ -942,7 +977,7 @@ quote. The commercial-license store (coming soon) will take orders online.
942
977
 
943
978
  ## Explicit Pine execution attachment
944
979
 
945
- This section describes the 1.4.0 and engine `v1.4.0` pair. The Pine execution adapter is
980
+ This section describes the 1.5.0 and engine `v1.5.0` pair. The Pine execution adapter is
946
981
  the engine's full Pine execution runtime (`PineExecutionAdapter` and
947
982
  `PineStrategyHost` in the engine's `src/source/`): order lifecycle, bracket
948
983
  legs, fill-price and slippage rules, POOC / `calc_on_order_fills`, margin
@@ -965,9 +1000,9 @@ Regenerate old generated C++ before using a new engine for Pine execution. C++
965
1000
  generated before the source-layer cut
966
1001
  ([#129](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/129)),
967
1002
  0.10.4's included, derives from `BacktestEngine` and does not compile against
968
- engine `v1.4.0`; old cap-only C++ does not attach the priority rule, and
1003
+ engine `v1.5.0`; old cap-only C++ does not attach the priority rule, and
969
1004
  metadata cannot silently restore it. Rebuild all modules against the
970
- new matching C++ layout (`engine_script_run_v19` in engine `v1.4.0`). Retaining
1005
+ new matching C++ layout (`engine_script_run_v19` in engine `v1.5.0`). Retaining
971
1006
  that epoch does not promise equal fingerprints, state hashes or trades across
972
1007
  releases. The extraction preserves Pine policy
973
1008
  under explicit attachment; it does not implement the generic native
@@ -36,13 +36,13 @@ for the changes in each release from 1.0.0 on and the release-note policy.
36
36
  `transpile_full()` are the supported Python entry points.
37
37
  - **Located diagnostics** — the support checker rejects unsupported Pine with
38
38
  a `file:line:col` location before any C++ is emitted, and
39
- `transpile_full()` returns warnings for supported scripts with documented
40
- approximations.
39
+ `transpile_full()` returns nonfatal warnings and, since 1.5.0, notes for supported scripts,
40
+ including those with documented approximations.
41
41
 
42
42
  ## Releases and this README
43
43
 
44
44
  <!-- Release lane: before a release is tagged, add it to the Engine pairing
45
- table and update every line that names `1.4.0` or `v1.4.0` as the current
45
+ table and update every line that names `1.5.0` or `v1.5.0` as the current
46
46
  release or pair (this section's version and date, the baseline paragraph at
47
47
  the top, the engine `src/source/` link, the `@pf-trace` note, the clone
48
48
  command and its example output, "This section describes …", the timing note)
@@ -52,10 +52,10 @@ hosted-server line name no version. -->
52
52
 
53
53
  This README ships with each release as its package description on PyPI
54
54
  (`pineforge-codegen`); releases from 0.7.0 on are also on npm as
55
- `@pineforge/codegen-pyodide`. It describes 1.4.0 (2026-10-08)
56
- and what changed since 0.10.4. The release's behavior was validated before
57
- tagging on codegen `bfc4ddce` with engine `b3192bfc`, excluding engine
58
- request #356. Those validation builds reported `1.3.0`; historical measurements
55
+ `@pineforge/codegen-pyodide`. It describes 1.5.0 (2026-10-12)
56
+ and what changed since 0.10.4. The 1.4.0 release's behavior was validated
57
+ before tagging on codegen `bfc4ddce` with engine `b3192bfc`, excluding engine
58
+ request #356; those validation builds reported `1.3.0`. Historical measurements
59
59
  below retain the versions on which they were run. The
60
60
  [PyPI release history](https://pypi.org/project/pineforge-codegen/#history)
61
61
  lists every release; the
@@ -64,6 +64,9 @@ covers 1.0.0 on and links the notes of earlier releases. A source install
64
64
  reports the version in `VERSION`, which the release workflow sets when it tags
65
65
  a release.
66
66
 
67
+ Text that says "since 1.5.0" describes the 1.5.0 release and later versions;
68
+ the statements about 1.4.0 keep their historical meaning.
69
+
67
70
  ### Upgrading from 1.3.0
68
71
 
69
72
  For the 1.4.0 pair, regenerate C++ and relink against engine
@@ -122,8 +125,8 @@ It does **not** own execution semantics. Order lifecycle, bracket legs,
122
125
  fill-price and slippage rules, `process_orders_on_close` / `calc_on_order_fills`,
123
126
  margin revival and trail/stop behaviour — everything TradingView parity depends
124
127
  on at run time — live in the engine's source-adapter runtime
125
- ([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.4.0/src/source)
126
- in engine `v1.4.0`), which maps them onto the engine's Pine-agnostic kernel.
128
+ ([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.5.0/src/source)
129
+ in engine `v1.5.0`), which maps them onto the engine's Pine-agnostic kernel.
127
130
  See
128
131
  the engine's [architecture notes](https://github.com/pineforge-4pass/pineforge-engine#architecture-kernel-vs-parity).
129
132
 
@@ -190,8 +193,8 @@ transpile(
190
193
  Returns the generated C++ source as a string. Raises
191
194
  `pineforge_codegen.errors.CompileError` on a rejected construct and, since 1.0.0,
192
195
  on a syntax error or an input limit (0.10.4 recovers from some syntax errors
193
- and has no input limits). It does not return nonfatal warnings; use
194
- `transpile_full()` to inspect them.
196
+ and has no input limits). It does not return nonfatal diagnostics (warnings and,
197
+ since 1.5.0, notes); use `transpile_full()` to inspect them.
195
198
 
196
199
  `libraries` is new in 1.0.0. It maps an import path to the library's
197
200
  source (`{"user/name/version": source_text}`), and each import the script uses
@@ -218,8 +221,8 @@ It returns `{"cpp": str, "inputs": list[dict], "strategyParams": dict,
218
221
  "diagnostics": list[Diagnostic], "requests": list[dict]}` on success (0.10.4
219
222
  returns the first three keys; `requests` is new in 1.1.0). `inputs` is the input
220
223
  manifest; its `title` is the actual override key, and an `input.symbol` entry
221
- also has `"kind": "symbol"` (since 1.1.0). `diagnostics` contains nonfatal
222
- warnings. Since 1.4.0, each input also has `supported`, the checked-settings receipt's
224
+ also has `"kind": "symbol"` (since 1.1.0). `diagnostics` contains the nonfatal
225
+ warnings and, since 1.5.0, notes. Since 1.4.0, each input also has `supported`, the checked-settings receipt's
223
226
  flag. Hide inputs with a false flag, exclude them from sweeps and optimization,
224
227
  and do not send a value: the compiled default is used, and the paired engine
225
228
  refuses a supplied value with `setting_unsupported`. A true flag is not a full
@@ -250,17 +253,29 @@ renamed or removed, and the changelog lists the values that changed.
250
253
  A rejected script raises `CompileError` with its diagnostics. The Pyodide
251
254
  package ships `gate/glue.py`'s `transpile_json(source) -> str`, whose JSON
252
255
  success and error envelopes carry the same manifest and, since 1.0.0, the same
253
- warnings; since 1.1.0 the success envelope also carries `requests`. See the
256
+ warnings; since 1.1.0 the success envelope also carries `requests`. Since 1.5.0, notes, the
257
+ informational level described under [Diagnostic codes](#diagnostic-codes),
258
+ travel in the same `diagnostics` lists with `"severity": "note"`. See the
254
259
  [1.0 public contract](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/docs/PUBLIC_CONTRACT.md)
255
260
  for the exact fields, severity values, and input key rules. There is no
256
261
  installed CLI or exit-code contract.
257
262
 
258
263
  ### Diagnostic codes
259
264
 
260
- Every diagnostic carries a stable `code` and named `args` (since 1.2.0):
261
- `PF-E1203` for an error, `PF-W0412` for a warning, and the data its English
262
- `message` and `hint` were built from — identifiers, types, keywords and
263
- numbers, raw.
265
+ Every diagnostic carries a stable `code` (of the form `PF-E1203` or `PF-W0412`)
266
+ and named `args` (since 1.2.0): the data its English `message` and `hint` were
267
+ built from — identifiers, types, keywords and numbers, raw.
268
+
269
+ An `E` code is an error. A `W` code can be a warning or, since 1.5.0, a note:
270
+ read its declared `level` (`severity` in JSON entries and the catalog).
271
+ A note is a nonfatal, informational diagnostic, and it keeps
272
+ the `PF-W` code it had as a warning. Eleven codes are notes: PF-W1505 (the
273
+ `ta.ema` initial-warmup approximation, reported at every `ta.ema` call as a
274
+ general caveat, not a measured shortfall), PF-W1508 and PF-W1509 (a call such as
275
+ `plot` or `alert` that has no effect in a backtest) and PF-W1525 to PF-W1532 (a
276
+ request for outside data whose value reaches only display and alert sinks,
277
+ lowered to `na`). Every other diagnostic keeps its severity, the other
278
+ visual-only and display-only ones included; the catalog is authoritative.
264
279
 
265
280
  ```python
266
281
  from pineforge_codegen import diagnostics_catalog, transpile_full
@@ -272,15 +287,21 @@ for d in transpile_full(source)["diagnostics"]:
272
287
  entry = diagnostics_catalog()["codes"]["PF-W1067"]
273
288
  # {'severity': 'warning', 'area': 'support',
274
289
  # 'message': '{name} diverges from TradingView semantics in PineForge.',
275
- # 'hint': '...', 'explanation': '...', 'args': {'name': {'kind': 'identifier'}}}
290
+ # 'hint': '...', 'explanation': '...', 'args': {'name': {'kind': 'identifier'}},
291
+ # 'user_message': '...'}
276
292
  ```
277
293
 
278
294
  The catalog (`pineforge_codegen/diagnostics_catalog.json`, also attached to
279
295
  each GitHub release) gives each code its severity, English ICU MessageFormat
280
- templates and a one-line explanation; rendering the templates with `args`
281
- gives the `message` and `hint` byte for byte, so an application can translate
282
- a diagnostic by its code. Codes are never reused. See
283
- [Diagnostic codes](docs/PUBLIC_CONTRACT.md#diagnostic-codes).
296
+ `message` and `hint` templates, a one-line explanation and a short
297
+ `user_message` template; rendering the `message` and `hint` templates with
298
+ `args` gives the diagnostic's `message` and `hint` byte for byte, so an
299
+ application can translate a diagnostic by its code. `user_message` is a
300
+ separate short English ICU template (since 1.5.0) over the same `args` (it may be constant):
301
+ the translation source and the fallback for a code an application does not
302
+ know. It is a template, not pre-rendered English, and each `Diagnostic` and
303
+ JSON diagnostic entry carries it as `user_message` too. Codes are never reused.
304
+ See [Diagnostic codes](docs/PUBLIC_CONTRACT.md#diagnostic-codes).
284
305
 
285
306
  ### List the other symbols a script requests
286
307
 
@@ -371,7 +392,8 @@ transpile(src, filename="my_strategy.pine")
371
392
 
372
393
  Not every request for outside data is refused. A
373
394
  `request.financial()` whose value reaches only plots, alerts, tables or logs
374
- transpiles with a warning and reads `na`; 0.10.4 refuses it. The
395
+ transpiles with a note since 1.5.0 (a warning in earlier releases) and reads `na`; 0.10.4
396
+ refuses it. The
375
397
  [changelog](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/CHANGELOG.md)
376
398
  lists what 1.0.0 reads, warns about or refuses for such requests.
377
399
 
@@ -517,6 +539,7 @@ Generated C++ compiles only against the engine it was generated for:
517
539
  | 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. |
518
540
  | 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. |
519
541
  | 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. |
542
+ | 1.5.0 (PyPI, 2026-10-12) | `v1.5.0` | Adds the nonfatal `note` diagnostic severity and diagnostic `user_message` templates. Regenerate and relink. |
520
543
  | Later `X.Y.Z` releases | `vX.Y.Z` of the same version | See below. |
521
544
 
522
545
  On the 0.x line the engine and codegen versions are independent, and the
@@ -542,8 +565,8 @@ Pine as `strategy.pine`, write `strategy.generated.cpp` with the
542
565
  [file example](#transpile-a-file-to-a-cpp) above, then from the same directory:
543
566
 
544
567
  ```bash
545
- # 1.4.0 pairs with engine v1.4.0. For 0.10.4 use v0.13.1.
546
- git clone --branch v1.4.0 https://github.com/pineforge-4pass/pineforge-engine.git
568
+ # 1.5.0 pairs with engine v1.5.0. For 0.10.4 use v0.13.1.
569
+ git clone --branch v1.5.0 https://github.com/pineforge-4pass/pineforge-engine.git
547
570
  cd pineforge-engine
548
571
  cp ../strategy.generated.cpp tutorial/macd/generated.cpp # the tutorial's strategy slot
549
572
  bash tutorial/run.sh # needs cmake, a C++17 compiler and python3
@@ -586,6 +609,18 @@ presence of `strategy.close` or `strategy.close_all` in the source. Older C++
586
609
  has removed; regenerate it before compiling there. Reachable close commands
587
610
  keep their ordinary runtime lowering.
588
611
 
612
+ Check how a run ended before you use its report. Read the error text
613
+ (`strategy_get_last_error`), the error code (`strategy_get_last_error_code`)
614
+ **and** the run status (`strategy_last_run_status`): the run failed when the
615
+ text or the code is non-empty or the status is 1. A refusal the engine makes
616
+ before it admits the begin, such as a bar array with a non-finite price, leaves
617
+ the status at its earlier value, so a rerun on a handle whose last run completed
618
+ can read status 0 beside a non-empty error. An engine without the report gate
619
+ (`v1.4.0` and earlier) can also hand a refused rerun on a reused handle the
620
+ previous run's rows. The
621
+ [public contract](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/docs/PUBLIC_CONTRACT.md#a-report-belongs-to-the-call-that-returned-it)
622
+ states the report rule and the engine release that carries it.
623
+
589
624
  Prefer no local build? [pineforge.dev](https://www.pineforge.dev) runs a free
590
625
  hosted MCP server, with a weekly backtest quota, whose `backtest_pine` tool
591
626
  transpiles and backtests a strategy for an AI agent. The
@@ -657,7 +692,7 @@ quote. The commercial-license store (coming soon) will take orders online.
657
692
 
658
693
  ## Explicit Pine execution attachment
659
694
 
660
- This section describes the 1.4.0 and engine `v1.4.0` pair. The Pine execution adapter is
695
+ This section describes the 1.5.0 and engine `v1.5.0` pair. The Pine execution adapter is
661
696
  the engine's full Pine execution runtime (`PineExecutionAdapter` and
662
697
  `PineStrategyHost` in the engine's `src/source/`): order lifecycle, bracket
663
698
  legs, fill-price and slippage rules, POOC / `calc_on_order_fills`, margin
@@ -680,9 +715,9 @@ Regenerate old generated C++ before using a new engine for Pine execution. C++
680
715
  generated before the source-layer cut
681
716
  ([#129](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/129)),
682
717
  0.10.4's included, derives from `BacktestEngine` and does not compile against
683
- engine `v1.4.0`; old cap-only C++ does not attach the priority rule, and
718
+ engine `v1.5.0`; old cap-only C++ does not attach the priority rule, and
684
719
  metadata cannot silently restore it. Rebuild all modules against the
685
- new matching C++ layout (`engine_script_run_v19` in engine `v1.4.0`). Retaining
720
+ new matching C++ layout (`engine_script_run_v19` in engine `v1.5.0`). Retaining
686
721
  that epoch does not promise equal fingerprints, state hashes or trades across
687
722
  releases. The extraction preserves Pine policy
688
723
  under explicit attachment; it does not implement the generic native
@@ -0,0 +1 @@
1
+ 1.5.0