Skip to content

Commit 91d65ad

Browse files
luisleo526claude
andcommitted
integration: the doc facts the code lanes handed on are on the pages, re-verified on this tree; B-DOCS' hash pins name what they cite again
Doc facts, each number and symbol read on this tree: - B-C-SURFACE (report (f) and its fix-up's list): README's symbol tables gain strategy_configure_native_fx_curve_ext_v1, strategy_configure_native_ext_result_v1 and strategy_native_timeframe_bar_interval_v1 (and V19-B's strategy_native_acknowledge_events_v1 / _event_window_v1, which no table listed); the counts are 66 / 58 / 43 / 109 wherever a page states them (README's "Yours to embed", index.md's inventory sentence); pf_native_callbacks_v1 has four published lengths (README, native-engine.md -- which still said two -- and native_c_api.h's BASE_SIZE / HOOKS_SIZE comments, comment-only, strip_comments identical); native-engine.md states the base configure's refusals, the typed configure's phase rules and reuse refusals (words 55-57, 55 unreachable), the typed FX-curve refusal and index, the interval query inside on_timeframe_bar, and the excursion fee tail; magnifier.md says the kernel counts the magnifier for every host and no hash folds it. - B-ADAPTER (finding 4): native-engine.md adds current executions to "the kernel converts at the cursor", states the preview / apply rate difference and the run-end rows' presented-clock rate; ADR-0001 section B rows for script_bucket_completions, the producer's account_fx and the current-execution rate; design OL14 records V19D-P1 (the tapes), SZ4 and pine-to-native's default_qty_type row record that a per-call qty_type is not Pine. - B-ENGINE (f): coverage.md's mintick mode states the 0.25-tick one-decimal rendering it keeps and the non-positive-tick default. - K-ULP2 / K-ULP3: native-settlement.md says which full exits reach the kernel as a Book-scope Reduce, not a Flatten, and that the Pine host's 1e-10 lot sweep (on_native_applied, kQtyEpsilon) is source-layer policy. - design row SZ10a (B-ADAPTER) was invisible to the two design-inventory guards (their ID patterns had no room for a suffix): both now read `[A-Z]..[0-9][a-z]?` IDs (91 rows), the crosswalk has SZ10a's row, and test_check_pine_to_native_coverage.py pins a suffixed ID must-fail. B-DOCS' content-hash pins. Its comment-only header edits deleted blank lines in native_c_api.h, engine.hpp, pineforge.h, ta.hpp and engine_internal.hpp, moving lines under citations that were right on db98990, and the H10 gate's refusals were then answered with a `sha256:` hash of whatever line the old digits hit -- a comment, a blank line (the hash of the empty string), other code -- instead of the line the sentence names. Of 214 hashed citations: - 87 are restored to db98990's citation, carried through the exact line map of the cited file, their symbol claim judged by check_doc_anchors without the hash (exec/INT24-scratch/tools/dehash.py); 5 legitimate comment / range pins are moved to db98990's window with the hash of that window; 63 stay as they were (the window db98990 meant); - about 25 on lines B-DOCS rewrote are re-cited by hand to the symbol they name (the C submit / replace / cancel family, size_basis, arm_scope, p1, on_precommit, max_contracts_held_short, sortino_monthly, the FX-curve call, the subscription words, the risk rows' update_risk_state / intraday_loss_orders_blocked / cap_placement_denied / chart_day_key sites, the Pine host's trade-row writes -- which no longer include exit_id); two that pinned blank lines for claims the tree no longer has are removed; - 17 citations wrapped as ``sha256:H` path:line` (a doubled backtick, which Doxygen reads as an unclosed code span) are written `sha256:H` path:line. check_doc_anchors: 1678/1678 resolve; doc lint 0; coverage offered 131 / covered 131, inventory 91 / 91; design inventory 0 findings; the H10 self-tests (45), the coverage self-test (2), reanchor --self-test, the detached census 0/0; docs/build.sh (Doxygen 1.18 here) 0 warnings; check_kernel_residuals' ruled entries 202 / 25 as on db98990. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 925f1c9 commit 91d65ad

14 files changed

Lines changed: 254 additions & 154 deletions

‎README.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The separate PineForge compiler, [`pineforge-codegen`](https://github.com/pinefo
3535
- **Open runtime.** The engine and native live runner are Apache-2.0. The separately distributed [PineForge compiler](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/LICENSE) uses PolyForm Noncommercial terms with additional personal-trading permission; commercial use requires a separate license. Public reference strategies, benchmarks and validation tooling are available in their respective repositories; the community-script test set is not redistributed.
3636
- **Fast.** In-process, no interpreter: median **15× faster than PyneCore** on 196 timed strategies (a median 603k bars/s per strategy with the bar magnifier on). Parameter sweeps re-run a loaded `.so` with new inputs — no recompile, no fork.
3737
- **Deterministic to the bit.** Two runs with the same inputs produce identical trade lists. Same on Linux and macOS.
38-
- **Yours to embed.** 106 `extern "C"` functions across two headers — 65 compiled-strategy declarations and 41 native-host declarations — append-only ABI. Call it from C, Python, Rust, Go, Node, Julia — or let an AI agent drive it over MCP.
38+
- **Yours to embed.** 109 `extern "C"` functions across two headers — 66 compiled-strategy declarations and 43 native-host declarations — append-only ABI. Call it from C, Python, Rust, Go, Node, Julia — or let an AI agent drive it over MCP.
3939

4040
---
4141

@@ -449,7 +449,7 @@ inventories are pinned by `scripts/check_c_abi_runtime.py`:
449449
| `strategy_set_account_currency_fx_series` | Effective-time quote-to-account FX |
450450
| `strategy_get_last_error` | The latest runtime error |
451451
| `pf_version_get` / `pf_version_string` / `pf_abi_version` | Runtime version, version string, struct-layout version (`PF_ABI_VERSION == 4`) |
452-
| `strategy_execution_contract` / `strategy_configure_native_v1` / `strategy_configure_native_fx_curve_v1` | Query Legacy vs NativeMarketV1; apply the versioned native run specification; stage or clear an immutable native FX curve |
452+
| `strategy_execution_contract` / `strategy_configure_native_v1` / `strategy_configure_native_fx_curve_v1` / `_fx_curve_ext_v1` | Query Legacy vs NativeMarketV1; apply the versioned native run specification (a refused one returns `-1` and leaves the handle Failed); stage or clear an immutable native FX curve, `_fx_curve_ext_v1` also writing the typed refusal (`pf_native_fx_curve_error_e`) and the offending point's index |
453453
| `strategy_request_abort` / `strategy_last_run_status` | Cooperative abort of a run in progress; `0`=completed, `1`=aborted |
454454
| `strategy_set_realtime_tail` | Live-runtime surface (ABI v4): the array's last bar is a still-forming tail — `barstate.islast=false`, `last_bar_index`/`last_bar_time` frozen at the horizon bar, no range-end row |
455455
| `strategy_set_probe_suppress_tail_logic` | ABI v4: the last bar runs only the broker's pre-`on_bar` steps (pending-order settlement, intraday-cap/loss checks) and returns — no `on_bar`, no margin-call / POOC second pass / bracket-reissue processing (the range-end row is `strategy_set_realtime_tail`'s to skip; the flags are independent) |
@@ -479,14 +479,16 @@ strategy. They are additive; no symbol, struct or behaviour above changes, and
479479
| `strategy_native_position_v1` / `_working_len_v1` / `_working_get_v1` | The physical position, and a copy-out snapshot of the live working book (`pf_native_working_v1`: its appended `trail_has_arm_price` tells a trail with no arm price from one armed at 0.0, and a caller sending `PF_NATIVE_WORKING_V1_BASE_SIZE` is filled exactly that far) |
480480
| `strategy_native_open_lot_count_v1` / `_open_lot_get_v1` | The physical book lot by lot (`pf_native_open_lot_v1`: identity, entry facts, signed units, entry fee, fee-net P&L and excursions at a mark) — `strategy.opentrades.*` for a C host |
481481
| `strategy_native_events_v1` / `_state_v1` | Poll the recorded event history by ordinal; read the lifecycle and its typed failure |
482+
| `strategy_native_acknowledge_events_v1` / `strategy_native_event_window_v1` | Under the `WINDOW` event retention: say which events the host has read, so the kernel drops those command events at the next script-bar boundary; read the oldest ordinal a poll can still return |
483+
| `strategy_native_timeframe_bar_interval_v1` | From inside `on_timeframe_bar`, the delivered bucket's own calendar interval (`pf_native_timeframe_interval_v1`: the C++ `NativeTimeframeBarContext::interval`); `PF_NATIVE_E_STATE` anywhere else |
482484
| `strategy_native_partial_bar_v1` / `_series_bar_v1` / `_trail_state_v1` / `_liquidation_price_v1` | The four optional reads — the bar so far at the cursor, a declared higher-timeframe series' latest bucket, a live trail's projection, the solved liquidation level. Each answers `PF_NATIVE_ABSENT` where the C++ `std::optional` is empty |
483485
| `strategy_native_risk_state_v1` / `_marked_equity_v1` / `_recalculations_v1` / `_continuation_hash_v1` | The generic risk ledger, marked equity at a mark, the driven/suppressed recalculation counters, and the run's continuation identity |
484486
| `strategy_native_margin_call_v1` | One margin call's whole economics by its event ordinal (`pf_native_margin_call_v1`: mark, units, the position before and after, the surviving book's equity and requirement, the re-solved liquidation price) |
485487
| `strategy_native_sized_units_v1` | The units a `PF_NATIVE_INTENT_SIZED` request resolves to under the run's spec — the kernel's own sizing function, as a pure query before submitting |
486488
| `strategy_native_cohort_open_v1` / `_add_v1` / `_remove_v1` | Cohort rosters: a cohort close is `PF_NATIVE_INTENT_HOST_SIZED` owned by `PF_NATIVE_OWNER_BIND_COHORT`, sized by the `on_close_units` hook |
487489
| `strategy_native_declare_subscriptions_v1` / `_ext_v1` | Declare the run's higher-timeframe series from inside `on_run_begin`, replacing the staged list; `_ext_v1` adds a series source per row and writes the kernel's typed refusal (`pf_native_spec_error_e` and its field) |
488490
| `strategy_native_declare_auxiliary_feed_v1` | Declare, replace or withdraw the run's auxiliary finer feed from inside `on_run_begin`, with the same typed refusal |
489-
| `strategy_configure_native_ext_v1` | Configure from `pf_native_run_spec_v1` **plus** `pf_native_run_spec_ext_v1` (report policy, price grid, calculation timing, open-bar view, margin model, higher-timeframe subscriptions, generic risk limits, the auxiliary finer feed, the retained intrabar path, and the slot-label / feed-tolerance / path-order / abort-reporting policies). The two specs' nine enum-valued words stay `uint32_t` and each has a C enumeration: `pf_native_fee_kind_e`, `pf_native_close_execution_e`, `pf_native_open_directions_e`, `pf_native_report_policy_e`, `pf_native_price_grid_e`, `pf_native_grid_rounding_e`, `pf_native_calc_trigger_e`, `pf_native_open_bar_view_e`, `pf_native_liquidation_sizing_e` |
491+
| `strategy_configure_native_ext_v1` / `strategy_configure_native_ext_result_v1` | Configure from `pf_native_run_spec_v1` **plus** `pf_native_run_spec_ext_v1` (report policy, price grid, calculation timing, open-bar view, margin model, higher-timeframe subscriptions, generic risk limits, the auxiliary finer feed, the retained intrabar path, and the slot-label / feed-tolerance / path-order / abort-reporting policies). The two specs' nine enum-valued words stay `uint32_t` and each has a C enumeration: `pf_native_fee_kind_e`, `pf_native_close_execution_e`, `pf_native_open_directions_e`, `pf_native_report_policy_e`, `pf_native_price_grid_e`, `pf_native_grid_rounding_e`, `pf_native_calc_trigger_e`, `pf_native_open_bar_view_e`, `pf_native_liquidation_sizing_e`. `_ext_result_v1` writes the kernel's typed refusal (`pf_native_spec_error_e` and its field) and, with either out-parameter set, also configures the next run of a Completed handle or one an abort failed |
490492
| `strategy_native_append_auxiliary_bars_v1` / `_ext_v1` | Append a realtime stream's later bars to the run's declared auxiliary finer feed; `_ext_v1` writes the typed append refusal (`pf_native_append_error_e`) and the bar it stopped on |
491493
| `strategy_native_declare_opened_lot_entry_bar_mask_v1` | From inside `on_applied`, say where the fill that opened a lot sat on its entry bar (`pf_native_opened_lot_fill_point_e`: on the bar's path, or after it); the kernel derives the lot's entry-bar mask that `on_lot_excursion`'s facts carry back |
492494
| `strategy_native_api_version` | This surface's layout version (`PF_NATIVE_API_VERSION`) |
@@ -506,9 +508,11 @@ struct with L9's appended risk tail (`PF_NATIVE_RUN_SPEC_EXT_V1_RISK_SIZE`), tha
506508
plus N8's intrabar / policy tail (`PF_NATIVE_RUN_SPEC_EXT_V1_POLICY_SIZE`), the
507509
auxiliary-feed tail (`PF_NATIVE_RUN_SPEC_EXT_V1_AUXILIARY_SIZE`), the event-retention
508510
tail, and the current layout; `pf_native_callbacks_v1`
509-
has three — the layout the lane first shipped (`PF_NATIVE_CALLBACKS_V1_BASE_SIZE`),
510-
that plus its six-hook tail (`PF_NATIVE_CALLBACKS_V1_HOOKS_SIZE`) and the
511-
current one with the policy-hook tail behind it. The runtime accepts each, so a host
511+
has four — the layout the lane first shipped (`PF_NATIVE_CALLBACKS_V1_BASE_SIZE`),
512+
that plus its six-hook tail (`PF_NATIVE_CALLBACKS_V1_HOOKS_SIZE`), that plus the
513+
policy-hook tail (`PF_NATIVE_CALLBACKS_V1_POLICY_SIZE`), and the current one,
514+
whose trailing `reserved1` marker says the host reads the lot-excursion facts'
515+
`entry_commission` tail. The runtime accepts each, so a host
512516
compiled against an earlier one keeps working unchanged. An **observation**
513517
callback that returns non-zero latches
514518
`NativeFailureCode::CallbackException` and ends the run `Failed`; the

0 commit comments

Comments
 (0)