You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2fcbb52
Browse filesBrowse the repository at this point in the historyBrowse files
Docs: the migration page, the guide and the front doors say what the tree does (R5 lane F2, item 5)
Each statement below contradicted the tree; each now states the code's
behaviour, re-read in the tree (and probed where noted):
pine-to-native.md
* closedtrades.entry_comment(): no C accessor exists (strategy_closed_trade
_entry_id answers the id; pf_trade_t carries no strings) -> C column "--",
with the open-lot route.
* "Four members ... have no C spelling": the COVERAGE block excludes eleven
members and two seams; the four named are the ones a port meets first,
the rest are named by kind; the COVERAGE anchor is :48, not :45.
* `time`/`bar_index`/"session facts" -> pf_native_decision_v1: the C
decision carries no interval and no session fact; C++ adds
script_interval / input_interval; neither has session-day flags.
* close cause: BRACKET (2) is written only by the Pine adapter
(pine_strategy_host.cpp exit_from_bracket); a native bracket leg closes
as SCRIPT (1) (audit probe_bracket_cause), so the page says so.
native-engine.md
* native_continuation_hash(): portable since E23 (timezone by content),
not "local to this machine".
* subscription delivery: a session-clipped bucket completes Confirmed on
its own last bar; LazyComplete is a hole over its last slot (probe: NY
0930-1600 "60" and "D" buckets, batch and stream); `interval` is the
bucket's own period (deliver_timeframe_bar: interval_containing over the
subscription's timeframe).
* the OrderFill recalculation of a kernel liquidation runs after
on_native_margin_call (invoke_applied_callback: applied, margin call;
then the drain's recalculation), not "immediately after on_native_applied".
* presented-clock queries: native_open_lots(mark) and native_marked_equity
(mark) convert at active_account_currency_fx() too, beside
native_liquidation_price().
* pf_native_run_spec_ext_v1 has four published lengths (the stale "now has
three" / "now has two" sentences are history now), README likewise.
* sizing: the fill-time "own terms" branches of the adapter's
resolve_execution_terms restate the cash/percent quotient and fee reserve
inline (pine_adapter.cpp), so "the arithmetic exists once" is dropped.
docs/ci.md: six documentation guards -- four source-only preflight stages
(doc-anchors, doc-lint, design-inventory, doc-pine-coverage; it named
three), the executed-page CTest row, and the documentation build, which
runs after a merge only (docs.yml: push to main, v* tags, dispatch).
"0.1.1" literals (VERSION is 0.14.0): sample transcripts say
<version>/<sha>; version.h, the pinned find_package, the pkg-config
example and install.md name 0.14.0; integration-cmake.md states the
package's SameMajorVersion compatibility.
check_doc_anchors.py 1570/1570, check_doc_lint.py 0.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
(cherry picked from commit d9e972fc8005b553403048da8dfa62f687ba2825)
executions a callback drives through `execute_current` land at the same
1556
1558
cursor and spend the same budget, so a host that refills on its own fill
@@ -1754,7 +1756,7 @@ says otherwise, and the C spellings are in
1754
1756
|`native_recalculation_count()` / `native_recalculations_skipped()`| the calculations the cadence drove and the ones its per-point bound dropped |`strategy_native_recalculations_v1`|
1755
1757
|`native_decision_floor()` (`native_host.hpp:1267`) | the run's monotonic decision floor in epoch ms — the same value `NativeStateView::decision_floor_ms` carries, and the lower bound every request's birth is compared against |`pf_native_state_v1::decision_floor_ms`|
1756
1758
|`native_consumed_high_water()` (`native_host.hpp:1272`) | the highest `run_number` this host has consumed. It lives **outside** per-run reset, so the next configure on the same host needs a strictly larger number; a fresh host reads 0 |`pf_native_state_v1::consumed_high_water`|
1757
-
|`native_continuation_hash()`| the consumer's continuation identity, local to this machine|`strategy_native_continuation_hash_v1`|
1759
+
|`native_continuation_hash()`| the consumer's continuation identity: the timezone folded by its content, so the same spec over the same bars and zone rules answers the same value on every host|`strategy_native_continuation_hash_v1`|
1758
1760
|`native_sized_units(sized, price, equity, fx)`| the kernel's own `Sized` resolution as a pure query | none — see *Previewing a basis*|
1759
1761
|`inspect_current_execution(cmd)`|`NativeCurrentExecutionPreview`, with a `NativeCurrentRefusal``native_host.hpp:685` when the command cannot be consumed here | none — `strategy_native_execute_current_v1` answers the same verdicts |
1760
1762
@@ -2143,10 +2145,11 @@ and the input's `on_native_bar` follows it.
2143
2145
2144
2146
-`lookahead = false` (Pine's `barmerge.lookahead_off`): the bucket is
2145
2147
delivered on the input bar that completes it, never earlier — its **last**
2146
-
contributing input bar when that bar closes it (`Confirmed`), or, for a
2147
-
bucket only a later input reveals as complete (a session-clipped bucket, a
2148
-
hole over its last slot), the next period's **first** input bar
2149
-
(`LazyComplete`), which contributes nothing to it.
2148
+
contributing input bar when that bar closes it (`Confirmed`, a bucket the
2149
+
session close clips short of its nominal end included: the calendar knows
2150
+
that bar is the session's last), or, for a bucket only a later input reveals
2151
+
as complete (a hole over its last slot), the next period's **first** input
2152
+
bar (`LazyComplete`), which contributes nothing to it.
2150
2153
-`lookahead = true` (`barmerge.lookahead_on`): the completed bucket's final
2151
2154
OHLCV is delivered at its **first** contributing input bar, and
2152
2155
`native_series_bar` answers with it from then on.
@@ -2165,9 +2168,9 @@ and the input's `on_native_bar` follows it.
2165
2168
2166
2169
`NativeTimeframeBarContext::completion` is `Confirmed` when the bucket closed
2167
2170
on its own last contributing bar and `LazyComplete` when the next period's
2168
-
first input closed it. `interval` is the calendar span of the bucket's first
2169
-
contributing input bar; `delivered_at_ms` is the input bar the delivery rides
2170
-
on. A bucket still open at the end of the input is never delivered.
2171
+
first input closed it. `interval` is the bucket's own calendar interval — its
2172
+
period at the subscription's timeframe, located by its first contributing bar;
2173
+
`delivered_at_ms` is the input bar the delivery rides on. A bucket still open at the end of the input is never delivered.
2171
2174
2172
2175
**Chronology against the script interval.** The pump is ordered against the
2173
2176
*script* interval, not the raw input. With `script_tf` coarser than
@@ -2973,16 +2976,20 @@ and affordability gates, which consume a quantity before any request exists and
2973
2976
so cannot be a kernel decision. The percentage fee reserve is the kernel's
2974
2977
(`reserve_percent_fee`), and so is the conversion itself — including the
2975
2978
placement-time number those gates consume: the adapter reads it through
2976
-
`native_sized_units()` and floors it, so the arithmetic exists once
2977
-
(`tests/test_adapter_sizing_relower.cpp`, "the conversion exists once"). The two
2979
+
`native_sized_units()` and floors it (`tests/test_adapter_sizing_relower.cpp`,
2980
+
"the conversion exists once"). The two
2978
2981
lot floors stay the adapter's because neither is the kernel's `SnapToGrid` on
2979
2982
every input — the cash floor keeps a quotient a millionth of a lot under a
2980
2983
boundary raw, and the percent floor has no on-grid tolerance, so an exact lot
2981
2984
multiple such as `0.0392` on a `0.0001` grid comes out `0.0391` — both measured
2982
2985
in the same test ("the source lot floors are not the kernel floor"). Paths whose
2983
2986
sizing price is not the signal rule — a fill-time resize, a pure-stop entry
2984
-
sized at its trigger level — keep `HostSized{Open}` and their own terms branch
2985
-
(same test, "pure-stop default entry keeps its own branch"), and so do the
2987
+
sized at its trigger level, a typed percentage reversal sized from the
2988
+
hypothetical flatten's balance — keep `HostSized{Open}` and their own terms
2989
+
branch (same test, "pure-stop default entry keeps its own branch"), and that
2990
+
branch restates the same `cash / (price × point_value × fx)` quotient and
2991
+
percent fee reserve inline in the adapter's `resolve_execution_terms` override
2992
+
rather than calling `native_sized_units()`; so do the
2986
2993
percentage exits: the kernel resolves a `ScopeFraction` as `scope * fraction`,
2987
2994
which is not `scope * percent / 100`, and no field reconciles the association.
2988
2995
@@ -3463,11 +3470,11 @@ has no call that marks one, so its integer, 2, is refused like any other.
3463
3470
base-spec words: the kernel's validation judges them, and a bad one answers
3464
3471
-1 and leaves the host failed.
3465
3472
3466
-
`pf_native_run_spec_ext_v1` now has **three** published lengths and the
3467
-
runtime accepts any of them: the layout this header first shipped
3468
-
(`PF_NATIVE_RUN_SPEC_EXT_V1_BASE_SIZE`), that plus the risk tail
3469
-
(`PF_NATIVE_RUN_SPEC_EXT_V1_RISK_SIZE`), and the current one, which appends
3470
-
what the header used to list as unrepresentable — the retained intrabar path
3473
+
`pf_native_run_spec_ext_v1`'s third published length,
3474
+
`PF_NATIVE_RUN_SPEC_EXT_V1_POLICY_SIZE`, ends the tail after the base layout
3475
+
(`PF_NATIVE_RUN_SPEC_EXT_V1_BASE_SIZE`) and the risk tail
3476
+
(`PF_NATIVE_RUN_SPEC_EXT_V1_RISK_SIZE`); the runtime accepts it and the other
3477
+
three. That tail appends what the header used to list as unrepresentable — the retained intrabar path
3471
3478
(`PF_NATIVE_SPEC_EXT_INTRABAR`), the four feed-shape and presentation
3472
3479
policies (`PF_NATIVE_SPEC_EXT_FEED_POLICY`: slot labels, feed tolerance, the
3473
3480
forced path order, abort reporting), and the margin model's remaining knobs
@@ -3501,11 +3508,11 @@ past it, and any other length is `PF_NATIVE_E_STRUCT`.
3501
3508
The risk block (`PF_NATIVE_SPEC_EXT_RISK`) was the first **additive tail** in
3502
3509
this header. It appends `risk_*` fields — the two loss limits as a value plus
3503
3510
a percent flag, the two counts, the day basis and the breach action, each
3504
-
limit opt-in through its own `has_` flag — past `reserved0`, so
3505
-
`pf_native_run_spec_ext_v1` now has two published lengths and the runtime
3506
-
accepts either: `PF_NATIVE_RUN_SPEC_EXT_V1_BASE_SIZE` (the layout this header
3507
-
first shipped, defined as the offset of the first appended field rather than
3508
-
as a literal, so it stays right on every target) and the current `sizeof`.
3511
+
limit opt-in through its own `has_` flag — past `reserved0`, which gave
3512
+
`pf_native_run_spec_ext_v1` its second published length — beside
3513
+
`PF_NATIVE_RUN_SPEC_EXT_V1_BASE_SIZE` (the layout this header first shipped,
3514
+
defined as the offset of the first appended field rather than as a literal, so
3515
+
it stays right on every target) — ending at `PF_NATIVE_RUN_SPEC_EXT_V1_RISK_SIZE`.
3509
3516
Each subscription row (`pf_native_subscription_v1`) carries `lookahead` and
3510
3517
`gaps` as `uint32_t` words holding a `pf_native_lookahead_e`
3511
3518
(`PF_NATIVE_LOOKAHEAD_AT_COMPLETION` / `_AT_FIRST_INPUT`) and a
0 commit comments