Skip to content

Cut the Pine source layer out of BacktestEngine (R4-C, roadmap slice B; paired with codegen) - #253

Merged
luisleo526 merged 25 commits into
mainfrom
refactor/source-layer-20260914
Sep 14, 2026
Merged

luisleo526 merged 25 commits into
mainfrom
refactor/source-layer-20260914

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Roadmap slice B of the native-engine refactor: a relocation (no lowering, no behaviour change) that moves every Pine-policy owner out of BacktestEngine into an explicit pineforge::source::PineStrategyHost layer, so native_host.hpp → engine.hpp reaches zero compat/pine headers and native hosts construct nothing Pine. Contract, amendments, seam/reset/epoch ledgers and receipts live in the campaign evidence root (tasks/R4-C-SOURCE-LAYER-CONTRACT.md, tasks/R4-C-IMPLEMENTATION-PIN.json).

Landings on this branch

  • L0 (a8080a0): real v15 provider tests/fixtures/native_cpp_abi/host-e7cdf05/ frozen before any edit; six-provider settlement matrix; scripts/check_native_include_independence.py (fail-before recorded on e7cdf05).
  • L1 (51f6c4c, ecbcf55): the five include/pineforge/source/*.hpp headers with the empty intermediate source::PineStrategyHost : BacktestEngine, on_bar final → on_source_bar; 210 Pine test files, runner/examples/strategy.cpp and the tutorials ported by meaning; native/generic tests untouched.
  • L2 (next, atomic): the transfer — PendingOrder, strategy_*, the legacy scheduler/loops, fills/orders/risk/admission, language state, hash split, mirror split, C observer virtuals with native defaults, 45 pinned seams + 12 reset fragments, epoch engine_script_run v15→v16, fingerprint 16, pineforge-source-adapter/v1. Byte identity of the generated route is proved by a moved-only checker (every removed line reappears verbatim in src/source/ after the pinned rename table) and by the one composite sweep.
  • L3: source fingerprint tests, C-v1 canary, include/link-independence enforcement in CI, docs.

What this slice does NOT do (no R4 credit)

strategy_* still lowers through the moved legacy loop inside the source layer; LegacyCompatibilityConsumer remains bound for source hosts; the adapter→native lowering, deferred-ANY binding and ShortSeed deletion are slice C.

Evidence (attached as it lands)

Local ci_verify release/debug/native on the exact head; provider matrix; moved-only report; independence artifacts; ONE composite Cloud sweep (this head + codegen PR #129 head) with zero-diff readback, snapshot and the actual pr-gate (expected target.not-positive FAIL retained; baseline promotion deferred). Draft until then.

🤖 Generated with Claude Code

https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm

luisleo526 and others added 3 commits September 14, 2026 10:15
…ing (R4-C L0)

Freeze the e7cdf05 v15 host closure and extend the real provider matrix with same-epoch v15 pairing controls. Add the native include-independence fail-before checker, its tooling tests, and the relocation-proof handoff tooling.

Contract: §6.1, §6.5, §8.1, §8.9.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…step 1)

Add the five source-layer header placeholders and the empty PineStrategyHost hook/constructor implementation.

Register the source translation-unit group after the existing pineforge sources (R4-C §3.1, §4, §7 L1; amendment A8).

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…ine tests and the example (R4-C L1)

Port Pine-facing test fixtures and helper headers to source::PineStrategyHost, preserving direct engine.on_bar calls through the final forwarding hook.

Retarget the handwritten runner example and committed tutorial consumers; leave NativeStrategyHost and pure native request/settlement/position/account fixtures untouched.

Contract rules: R4-C §2 P1/P2, §3.1, §7 L1; amendments A5 and A8.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

L0+L1 head ecbcf55: local ci_verify release 342/342 passed, smoke consumer OK, settlement matrix six providers (v15-frozen host-e7cdf05 registered) zero pending rows, include-independence checker fail-before recorded. No epoch change yet (L2 carries v15→v16).

Add pre-transfer native-host witnesses for the S11, S19, S20-S24, and S35 defaults. (A28)

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Move ledger-classified source-route bodies to src/source and add initial native-default seam dispatch scaffolding. (A13, A16, A17, A23, A28)

Settlement coordinators remain on the base under the recorded A15 conflict.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Add data-only PineLanguageState and route F6 source-series reset through the source host while preserving native empty defaults. (A13, A17, F6)

Use source-qualified relocated definitions for moved-only normalization. (3.7)

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… L2 WIP)

Introduce source lifecycle hooks, F1-F5/F7-F12 position hooks, and source-owned pending observer routing. (A15, A17, A22)

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Move source PendingOrder compatibility interfaces, source lifecycle hooks, reset fragments, and C observer projections onto PineStrategyHost. (A5, A15, A17, A22)

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Remove source language fields from BacktestEngine and route metadata, reset, position-view, and C observation behavior through PineStrategyHost. (A13, A17, A20)

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Move the shared FNV sink into a source-free internal header and route relocated Pine state through S34. Keep the A31 settlement coordinator context generic and hash it there. Port the native physical-position test helper.\n\nContract rules: A24, S34, A31, A5.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Relocate PendingOrder ownership and public pending accessors into PineStrategyHost, re-key StrategyOverrides to the source adapter, and route stream entry comments through S33.\n\nContract rules: A5, A21, A22, S13-S18, S33.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Make base construction source-free, move remaining adapter-owned state into PineStrategyHost, split the PendingOrder descriptor and source projection TUs, and advance internal ownership/hash fingerprints to v16 with matching local guard parsing.\n\nContract rules: A21, A24, S10, S33, S34, §6.4, EPOCH-LEDGER.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…R4-C L2 WIP)

Move S37 auxiliary-feed storage behind source views, restore P10 generic security evaluation, and complete v15-to-v16 relocation-manifest tooling. Port affected source-host test accessors and split hash/mirror coverage checks.\n\nContract rules: A3, A5, A11, A15, A18, A19, A24, A30, A31.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Remove the v16 engine PendingOrder alias, re-key residual bridge signatures and test fixtures to source::PendingOrder, and keep the aggregate and settlement epoch checks fail-closed.\n\nContract rules: A3, A5, A11, A13, A19, A21, A24.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…WIP)

Relocate the PendingOrder-specific path helper cluster into the source layer and register its source translation unit.\n\nContract rules: A5, A11, A19.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Keep source lifecycle helpers behind S22-S24 host overrides and remove their duplicate generic implementation unit.\n\nContract rules: A15, A19.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Relocate tv-money and enum-string free helpers to source policy support, re-key their consumers, and complete the v15/v16 settlement matrix caller split.\n\nContract rules: A3, A11, A14, A18, A19.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…ding route, scheduler and hash; fence engine_script_run_v16 (R4-C L2)

Complete the L2 atomic source-layer relocation: language and policy storage, pending route, scheduler seams, adapter/configuration ownership, state-hash extension, mirror projection, and engine_script_run_v16 epoch fencing.\n\nContract rules: A2, A3, A5, A11, A13, A15, A17, A18, A20, A21, A22, A23, A24, A28, A30, A31; §3.7; §6.4.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…R4-C L2 WIP)

Ignore the native-version checker’s transient authenticated-fixture directory while the A24 source-hash mutation suite materializes its disposable repository copy. This is test-fixture isolation only; no product or moved-body behavior changes.\n\nContract rule: A24.\n\nCo-Authored-By: Claude Fable 5.1 <[email protected]>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

L2 (the atomic transfer) landed: head 0a4ed0e — 151 files, +17,041/−14,989 vs L1.

  • ci_verify release: 22/22 stages, CTest 343/343; provider matrix with the real v15 provider (host-e7cdf05) and the v15→v16 relocation manifest (114 moved storage names, 44 allowed vtable additions = the pinned seams S01–S37b, zero removed virtuals, mandatory v15↔v16 rejection pairs).
  • Moved-only proof: removed=12245 matched=12189 allowed=56 UNEXPLAINED=0 (allow-list rows only under rule ids A11/A15/A17/A24/A31: seam declarations, reset fragments, hash-sink header, settlement coordinators kept in the base).
  • Identifier-bound kernel guard (compat::pine|pine_*|_src_*|coof_*|pos_view_freeze*|process_pending_orders|tv_money*|market_admission_journal_|pending_orders_ over engine.hpp/native_host.hpp/native_*.cpp/engine_execution.cpp/c_abi.cpp/engine_state_hash.cpp): 0.
  • check_c_abi_runtime.py exit 0; PF_ABI_VERSION 4; pending_order_mirror.hpp byte-identical (sha 7921179f…); mirror generator split into descriptor TU + source projection TU.
  • Epochs: engine_script_run v15→v16 (one engine namespace; source::PendingOrder under pineforge-source-adapter/v1), broker/stream fingerprint 15→16; native_order v4 / consumer v6 / driver v4 unchanged.
  • Residual for L3: the five now-unused compat/pine includes in engine.hpp (no compat::pine type is referenced any more) are cut in L3 together with the include-independence enforcement.

…d enforce native include independence (R4-C L3)

Remove the residual source-only include closure from engine.hpp, make the generic and source includes explicit, and prove the installed native header boundary.

Add source-state fingerprint/reset/replay coverage and the frozen C-v1 PendingOrder canary; retain the L2 v16 mirror/hash split through direct runtime checks.

Wire the identifier guard into preflight and the installed include-independence proof into the release/native verifier profiles, with dependency and nm evidence output. Update the v16/source-adapter and O1-gap documentation.

Contract rules: §6.2, §6.3, §6.4, §6.5, §8.8; A11, A24, A25.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

L3 landed: head 7bbf93e (21 files, +598/−101).

  • engine.hpp no longer includes any compat/pine header; scripts/check_native_include_independence.py now passes and is enforced in the release and native ci_verify profiles (installed-tree -MMD deps of the six native roots + both native examples, demangled nm, standalone Series/TA/calendar consumer) — archive under the evidence root tasks/r4-c/independence/l3/. Fail-before recorded (the pre-cut closure failed at engine.hpp -> compat/pine/frozen_market_instruction.hpp).
  • New tests: test_source_fingerprint (mutation/reset/replay per relocated state group; native fixture folds exactly source:none and is unaffected by source-host construction) and test_pending_order_v1_canary (frozen c45 C-v1 reader vs the new runtime through the source projection).
  • Identifier-bound native source guard added to preflight/CTest.
  • ci_verify release: 24/24 stages, CTest 346/346; ci_verify native: 25/25 stages, 355/355. Mirror header sha unchanged; PF_ABI_VERSION 4; live-hash literals re-derived once for v16 and recorded.
  • Docs: v16/provider/source-adapter rows, the intermediate hierarchy, the O1 gap and "no R4 credit" wording.

luisleo526 and others added 3 commits September 14, 2026 15:53
Replace the ripgrep subprocess scan with equivalent standard-library regex scans.
Preserve the source/Pine include and C-ABI diagnostics, enforce the A18
identifier-bound scan with its comment and frozen-export exclusions, and
exercise a forbidden identifier in a temporary-tree self-test.

Contract rules: §6.5; A18.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
Add the public PineStrategyHost risk setter and route integer limits through adapter_.cap, preserving IntradayCap attachment and ledger semantics (R4-C A32). Add a focused source-host test and register it in the CTest suite.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
(cherry picked from commit 3d6035f1572bd1928a35b364103d38f43173b2c0)
@luisleo526

Copy link
Copy Markdown
Collaborator Author

Engine candidate 6e9b908 = L3 + merge of main (#252) + L3c (the native source guard scans with Python, no ripgrep dependency) + L3b (set_pine_risk_max_intraday_filled_orders(int), the declared setter for strategy.risk.max_intraday_filled_orders, body = the pre-slice integer-assignment attach).

Integration on the exact head:

  • ci_verify release 347/347, debug 347/347, native 356/356 (all stages green).
  • Whole-slice moved-only proof e7cdf05..6e9b908: removed=12245 matched=12189 allowed=56 UNEXPLAINED=0.
  • check_c_abi_runtime.py exit 0; pending_order_mirror.hpp sha 7921179f… unchanged.

Next: Fable final review of the exact pair (this head + codegen L4), then the ONE composite Cloud sweep and the actual pr-gate before this PR is marked ready.

@luisleo526

Copy link
Copy Markdown
Collaborator Author

Composite Cloud sweep on the pre-repair pair (engine 6e9b908 + codegen 6dbd0f7) — exp-native-r4-c-6e9b908-20260914 (execution pineforge-experiment-run-mmqxg), 72/72 cases, 4190/4190 probes vs exp-ci-preflight-0679210-20260913: 0 trade, 0 grade, 0 metadata, 0 coverage differences; configuration-identical (accepted_non_regression; the only verifier-document deltas are the identity paths /engineHead, /codegenHead, /verifiedAt, /verifySeconds). Candidate snapshot b16b5111… graded 4190 with 0 grade differences vs the active baseline; actual pr-gate FAIL target.not-positive as expected for a neutral relocation, baseline pointer stable, no promotion.

The Fable final review of this exact pair found the relocation bodies token-identical but flagged edge defects on the new codegen→host writer surface (a strategy.risk.allow_entry_in(strategy.direction.short) encoding mismatch through the new setter, sticky percent-flag semantics, dead Pine declarations left on the base, the native default of one C observer, a vacuous witness, carried hash waivers). Those repairs are landing next (L5); the repaired pair gets its own sweep + gate before this PR is marked ready, so this comment is interim evidence.

luisleo526 and others added 2 commits September 14, 2026 19:34
…text, drop the dead Pine declarations and add real native witnesses (R4-C L5)

Repair A33/A34 Pine risk writer semantics and cover direction plus sticky percent state.

Restore A37 generic trail/fold ownership and hash folds, update the v15→v16 relocation manifest, and remove F8/F10/S28.

Apply A35 waiver coverage enforcement, A36 source-only declaration cleanup and guard, and A38/A39 native and metadata witnesses/surface repairs.

Contract rules: A33, A34, A35, A36, A37, A38, A39, A40.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…-C L5b)

Value-initialise partial PendingOrder test fixtures before vector relocation and mirror use (A41).

Audit the five product construction paths; each assigns is_long before it can be read, so preserve the relocated member declaration verbatim and add no allow-list exception (A41).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

Final review repairs landed: L5 2c964db + L5b 1938fe0 (final engine head).

From the Fable final review of the previous head (relocation bodies token-identical; findings on the new writer surface):

  • set_pine_risk_direction(int) maps Pine's signed convention (+1 long-only, −1 short-only, 0 both) explicitly; percent flags on max_drawdown/max_intraday_loss are sticky exactly as before. Host unit tests for −1/0/+1 and percent-then-cash; codegen PR Keep matrix snapshot assertions active in Release #129 pins the emission and adds two compile-backed probes.
  • trail_best_price_ and the trail-restart reset are generic base state again (their three generic write/reset positions restored verbatim); the S18 C observer returns the member, so native handles behave as before the slice.
  • 127 declared-but-undefined Pine members and 14 dead stubs removed from BacktestEngine; the source::PendingOrder-typed path helpers left engine_internal.hpp; the native source guard now also flags declared-but-undefined base members.
  • 47 stale broker-hash waivers removed (the source hash extension covers those fields); the coverage checker rejects a waiver for any folded field.
  • Real native witnesses: a counting NativeStrategyHost subclass proves both source-close hooks are never invoked on the native route with equal settlements/position/hash; a C-metadata oracle test through the BacktestEngine* path.
  • L5b: the Linux UBSan finding — partial test pending orders are value-initialised in 7 test files; audit shows every product construction assigns is_long before use (no product change).

Verification on 1938fe0: ci_verify release 347/347, debug 347/347, native 356/356; strict per-function moved-only proof e7cdf05..1938fe0 MISMATCHES=0 (285 out-of-line bodies, 187 inline bodies, 432 header declarations); check_c_abi_runtime.py exit 0; pending_order_mirror.hpp sha 7921179f… unchanged; engine.hpp/native_host.hpp reference no source/ or compat/pine header.

Now running: CI on this head and the ONE counting composite Cloud sweep (engine 1938fe0 + codegen 763d2eb) with readback, snapshot and the actual pr-gate; ready + merge follow.

@luisleo526

Copy link
Copy Markdown
Collaborator Author

Counting composite sweep on the final pair (engine 1938fe0 + codegen 763d2eb) — exp-native-r4-c-1938fe0-20260914 (execution pineforge-experiment-run-b4hbc): 72/72 cases, 4190/4190 probes, 0 trade / 0 grade / 0 metadata / 0 coverage differences, configuration-identical vs exp-ci-preflight-0679210-20260913 (accepted_non_regression; only the identity paths /engineHead, /codegenHead, /verifiedAt, /verifySeconds differ). Candidate snapshot graded 4190 with 0 grade differences vs the active baseline; actual pr-gate FAIL target.not-positive as expected for a neutral relocation, baseline pointer stable, no promotion. CI on this head: 10/10 green including Linux sanitizers.

Evidence root: measurement/R4-C-1938FE0/ (readback/SUMMARY.json, GATE-EVIDENCE.json, FINAL-RECEIPT.json after merge). Marking ready; squash-merge engine first, then codegen PR #129.

@luisleo526
luisleo526 marked this pull request as ready for review September 14, 2026 12:24
@luisleo526
luisleo526 merged commit ab9714b into main Sep 14, 2026
10 checks passed
luisleo526 added a commit that referenced this pull request Sep 29, 2026
…GINE) (#300)

Audit of every README and doc page of pineforge-engine against engine main
35db01c and the live measurement; each change names its source.

What was wrong, and the source of the truth:

- Parity numbers were the retired 4,190-probe round-39 era (badges, hero,
  scoreboard, lane table, contributing-llm.md, design/progress pages). Now the
  active baseline pineforge-parity-baseline-20260929-engine-35db01c8 (snapshot
  sha256 47cec517..., population cf857209...): 8,006 probes, 7,989 graded =
  7,905 excellent + 84 strong, 17 TradingView-side anomalies excluded,
  18 lanes, 2,759,431 TradingView trades (population tvTradeRows / 2). The
  "2.8M matched" count has no source in the snapshot and is gone. Public
  corpus: 311 excellent + 1 declared anomaly (scripts/check_corpus_parity.sh
  pinned headline; parity step of the XAU-CAL lane job on this tree), and
  anomaly-equity-mirror-strategy-equity-01 is that anomaly (it does not
  match trade-for-trade on the pinned corpus).
- Versions: no 1.0.0, 0.14.0 or rc tag exists (git tag; gh release list).
  CHANGELOG's "## 1.0.0" becomes "## Unreleased" and lists #292-#298, which
  it lacked (squash messages 7f807b9..35db01c); "34 more" PF_API is 39.
  README Releases: v0.13.1 entry added, v0.13.0 line corrected, the merged
  live/abi-v4 "Unreleased" line and the 1.0.0 line replaced. Pages that
  framed 1.0 as shipped now say planned.
- Front door 1 could not run: pineforge-codegen has no CLI (0.10.4 or main),
  PyPI 0.10.4 output does not compile against main (cc log), a plain
  -lpineforge link drops the runtime C ABI (run_strategy.py refuses it), and
  run_strategy.py needs --ohlcv/--no-trim-output without the corpus. The new
  block ran end to end from a clean clone (14 trades on the tutorial feed).
- Prerequisites: floating-point std::to_chars (src/str_utils.cpp:55) needs
  GCC 11 / libc++ 14; ctest --test-dir needs CMake 3.20; examples need
  -DPINEFORGE_BUILD_EXAMPLES=ON; the install also ships libpineforge_kernel.a.
- MCP section: the image, hosted server and npm package run engine 0.13.1 +
  codegen 0.10.4 (pineforge-release v0.1.25 notes); hosted server and npm
  package descriptions corrected from their live/ published sources.
- Benchmarks: every number reproduces (check_provenance 163/163); framing
  fixed (commit and method named, PineTS has had strategy.* since 0.9.17),
  recipes state their prerequisites, two wrong failing-gate cells fixed,
  personal host name scrubbed from 14 Google Benchmark JSONs with the
  manifest sha256 values updated (origin_sha256 keeps the measured file).
- Reference pages: native-engine.md, pine-to-native.md, coverage.md,
  pine_v6_coverage_detail.md, the contract pages, ci.md and the design notes
  described removed members and pre-#253/#254 behaviour, stale counts
  (src 48 -> 53 .cpp, 66 -> 70 indicator classes, 43/33/10 -> 46/35/11
  NativeRunSpec fields, floors 786/298 -> 790/300), wrong anchors, drawings
  as absent, and transpiler status of an old codegen (now "on codegen main,
  not in a release yet" where it differs from v0.10.4).
- Hygiene: internal host names, personal paths, private-repo references and
  campaign tool names marked or removed; the banner image's stale
  "V0.8.0 / 245/246 / 0 engine bugs" strip removed; a dead
  pineforge-workflow-live link replaced by the public pineforge-live repo.
- Two orphan pages, docs/cheatsheet-runtime-and-execution.md and
  docs/tv-parity-probe-spec.md, were wrong in their load-bearing claims
  (17 removed engine members, pointvalue/FX/slippage claims) and nothing
  linked them: deleted.
- Sample outputs were stale: every page and the tutorial README printed the
  tutorial MACD as 49 trades / -190.85; since 650b0cb (in v0.13.1) the report
  counts the range-end close, and every harness prints 50 / +569.97 (runs on
  a clean clone of this branch). examples-python-sweep.md's 10000 capital
  could not pay for its 1-BTC order (every combo 0 trades): 100000, output
  re-measured. examples-multi.md output format matches multi.py; the
  magnifier A/B page shows today's run. The report fields script_tf_ratio
  and needs_aggregation print their contract values again on this base
  (FIX-E1E2, #299; tutorial/run_mtf.py Table A: ratio 1/1/4/16, agg
  0/0/1/1), so the pages state them as plain facts.
- Doxygen: `file:line` in four pages autolinked to a dead "file:line" URL;
  spelled `path:line` now. Build: 0 warnings.

Review fixes (REVIEW-DOCS-ENGINE-final.md, verdict MERGE-WITH-FIXES, of the
first version of this change, 79bd84c1 + 6cb01aa0): its five P2 findings with
the reviewer's fix text, and every P3 row but the last.

P2
1. docs/pages/metrics.md: a timestamped FX curve no longer fails closed for a
   leveraged position across a rate change; that position takes the
   broker-open margin checkpoint at the step bar's open
   (tests/test_affordability_fx.cpp:152-154, :781).
2. docs/pages/report-schema.md: the #254 caveat sat inside the table, so the
   bar_magnifier_enabled row rendered as text; it now follows the table.
3. CONTRIBUTING.md, docs/pages/getting-started.md: compiler minimums are the
   ones README.md states (floating-point std::to_chars, src/str_utils.cpp:55:
   libstdc++ from GCC 11, libc++ 14, macOS 13.3; g++-9 and g++-10 fail).
4. docker/README.md: the sample is the published image's run (50 trades,
   17/33, +569.97, trade 1 entering 1777488300000).
5. docs/pages/mtf.md: expected Table A says main prints 0 in ratio and agg?
   until the #254 regression is fixed.

P3
- configuration.md, CHANGELOG.md, coverage.md: v5 scripts do not "keep" host
  defaults (both codegens refuse //@Version=5); code from an earlier codegen
  and a hand-built PineStrategyConfig do.
- streaming.md: "Every strategy_stream_* call above" (create/free return no
  status).
- examples-multi.md: a module also exports std::piecewise_construct.
- integration-cmake.md: EXACT 0.13.1 also matches a git-checkout build of
  main; the ABI promise starts "From 1.0.0".
- ffi-python.md, tutorial-macd.md: the mirror covers the report structs, not
  every struct (ffi-python.md:15-17).
- configuration.md: tracing costs one branch per traced call when disabled
  (report-schema.md:180), not zero.
- benchmarks/results/raw/README.md: "Two edits were made" (host_name was
  rewritten in every Google Benchmark file); benchmarks/README.md: the
  maintainer fetch runs with the campaign environment sourced. Wording only.
- AGENTS.md: the configure line exports compile commands, which the receipt
  check needs; AGENTS.md and docs/ci.md: promote-baseline.yml is installed
  from the campaign copy, not unchanged (31 lines differ).
- docs/ci.md: the debug profile also skips the twin-parity guard
  (TWIN_PARITY_PROFILES).
- mtf.md, timeframes.md: "reported for an engine fix" dropped (no public
  issue).
- native-feature-parity.md: the C API "landed on main", not "shipped".
- tutorial/README.md: Table B's script_tf_ratio prints 0 on main until the
  #254 regression is fixed.

Not changed here: benchmarks/results/summary.md and trade_comparison.md keep
the first version's text (hand edits of generated output; fixing the generator,
benchmarks/compare.py:361 and scripts/verify_corpus.py:1403, is an
engine-lane follow-up). No benchmark number or results file changes beyond
the raw/README.md and benchmarks/README.md wording above: BENCH-REFRESH is
re-measuring the benchmark.

Rebased onto 4dc496d (FIX-E1E2, #299), squashed to one commit. docs/ci.md
states the new floors: PR registration 773 (debug, sanitizers) and 782
(native), full-run release 792 and kernel 300 (scripts/ci_verify.py:320,
:594, :638). The one rebase conflict, a native-refactor-progress.md row,
keeps main's re-anchored lines and this change's host-name removal.

Sentences this commit deletes or rewrites past recognition, named by the
commit that introduced them (scripts/check_doc_reverts.py):
- a4ab775 (docs: source-verified runtime-overrides + order-execution cheatsheet): cheatsheet-runtime-and-execution.md (142)
- 480fd19 (Production-readiness probes + engine state-reset / finite-fill fixes (): tv-parity-probe-spec.md (61)
- 28ad088 (docs: add Part 3 (cross-cutting behaviors) to engine cheatsheet): cheatsheet-runtime-and-execution.md (60)
- a8f84b9 (docs(api): OpenCV-style C ABI reference site + CF Pages deploy): abi-stability.md (21), tutorial-macd.md (3), examples-magnifier.md (2), examples-multi.md (2), getting-started.md (2), index.md (2), report-schema.md (2), examples-rust.md (1), ffi-python.md (1), install.md (1), lifecycle.md (1)
- cc4a56e (docs: add Pine v6 runtime coverage report (docs/coverage.md)): coverage.md (37)
- 24dcc53 (docs: reconcile Pine v6 audit + coverage docs with the 2026-06-10 audi): pine_v6_coverage_detail.md (29)
- d093560 (INT26: wave H, the late picks and the corpus re-pin to b40aa8e (1.0.0-): native-refactor-progress.md (13), install.md (3), pine-to-native.md (2), CONTRIBUTING.md (1)
- 73817c1 (Lower generated Pine execution onto the native kernel and retire the l): cheatsheet-runtime-and-execution.md (8), README.md (3), tv-parity-probe-spec.md (2), reservation-expansion-candidate.md (1)
- b1fbf0b (docs: detailed Pine v6 coverage report (per-identifier audit)): pine_v6_coverage_detail.md (14)
- 622d653 (docs(README): rewrite for the round-11 engine — brand-first, OSS-first): README.md (12)
- 46b2ced (docs: ABI v4 live surface; cheatsheet corrections (trail_price is read): cheatsheet-runtime-and-execution.md (7), README.md (3), live-surface.md (2)
- c45cf5a (refactor: move retained-parent priority into Pine compatibility): README.md (7), pine-order-priority-boundary.md (4)
- c1084ff (docs: record round 39 fractional price admission parity): README.md (10)
- f268342 (feat: add historical account FX lifecycle (#125)): cheatsheet-runtime-and-execution.md (10)
- af4c688 (Document realtime streaming lifecycle): cheatsheet-runtime-and-execution.md (5), coverage.md (3), examples-python-sweep.md (1), tutorial-macd.md (1)
- 9507d8f (refactor(corpus): pull equity-mirror into corpus/parity-anomalies/): coverage.md (10)
- 76482e6 (fix(runtime): align TA coverage and corpus replay): coverage.md (9)
- cc0b22d (Refactor reservation growth and Pine market instruction ownership): fill-model.md (7), frozen-market-instruction.md (2)
- d5a5eaf (Align lifecycle and admission documentation with final v11 model): market-admission.md (9)
- a6b0b70 (docs(audit): exhaustive Pine v6 coverage audit — 38 critical, ~62 mino): pine_v6_audit_master.md (7)
- 1e360bd (INT27: wave I -- magnifier on TradingView's intrabars, recalculation f): cheatsheet-runtime-and-execution.md (5), magnifier.md (1)
- 1dd5430 (Add the native feature-parity design: gaps, kernel-vs-adapter rulings,): design/native-feature-parity.md (6)
- 74491fa (INT28: wave-J engine integration (TVDEF-DROPS, W3/W3B/W4/W5/W6/W6B/W8,): cheatsheet-runtime-and-execution.md (4), README.md (1)
- 7ad5d38 (docs: refresh parity scoreboard through round 23): README.md (5)
- 7f807b9 (Another symbol's bars reach a run as a feed: kernel instrument feeds +): coverage.md (4), mtf.md (1)
- 3b13183 (Refactor order admission and trigger lifecycle into generic submodels): exit-leg-lifecycle-reflection.md (5)
- e244d65 (docs(coverage): update pine_v6_coverage_detail.md for post-sprint stat): pine_v6_coverage_detail.md (5)
- f864be5 (refactor: isolate Pine cap policy from native order state): cheatsheet-runtime-and-execution.md (2), pine-intraday-cap-boundary.md (2)
- e7cdf05 (Add native execution terms: host-resolved sizing, exact reversal, prec): abi-stability.md (2), native-engine.md (2)
- b4dd9a3 (docs(mtf): add multi-timeframe tutorial + Doxygen page): mtf.md (4)
- 5c2be9d (docs: record round 38 whole-lot budget parity results): README.md (3)
- 6bfe983 (docs: align round 39 lane table and diagnostic evidence): README.md (3)
- 471a113 (Docs: the README carries the 200-strategy refresh -- tiers per engine ): README.md (3)
- 8df08f2 (fix(engine): make dead strategy.close semantically inert (#143)): cheatsheet-runtime-and-execution.md (3)
- d3cca9e (Docs: correct migration semantics and harden publication guards): cheatsheet-runtime-and-execution.md (2), pine-to-native.md (1)
- 52f4dde (Preserve complete mirror context and earlier standalone ABI controls): fill-model.md (3)
- 4fb9db3 (Docs: CONTRIBUTING.md rewritten for someone who has never seen this re): CONTRIBUTING.md (2)
- 2ab2bfb (docs(README): round-11 closed-test results and a full factual refresh): README.md (2)
- 0501468 (docs: task-13 fix round 1 — v4 report mirrors (schema, Rust), probe-su): README.md (1), cheatsheet-runtime-and-execution.md (1)
- cfbe677 (Docs: the session flags end a session where TradingView ends it (R5 la): cheatsheet-runtime-and-execution.md (2)
- 6aa1d13 (runtime: wire syminfo.pointvalue through all money paths; hold ScopedT): coverage.md (2)
- 8b7965a (Docs: onboarding written for the contributor who is a language model (): contributing-llm.md (2)
- 16f3652 (Docs: the two site front doors re-derived against HEAD (R5 lane L14-B,): index.md (2)
- 04b0588 (Add native resolved execution settlement and preserve paid entry costs): metrics.md (2)
- 149f77c (Replace seven pending-order flags with quantity and event facts): quantity-intent.md (2)
- 962960b (Session flags match TradingView on multi-window and extended-hours cha): pine_v6_coverage_detail.md (2)
- 5215291 (Merge branch 'round5/bar-indexed-extremes-ring' into round5/candidate): pine_v6_coverage_detail.md (2)
- b1b27f0 (Initial commit: PineForge runtime v0.1.0): CONTRIBUTING.md (1)
- bfdbe96 (docs: refresh parity scoreboard through round 24): README.md (1)
- cda51d5 (Record the round 35 parity scoreboard and raw trade gains): README.md (1)
- 0d76a09 (Wave G: no ordinary quantity request stops a run, cancelled exits stay): adr/0001-kernel-adapter-boundary.md (1)
- 0983770 (Unify remaining fill paths under native settlement (#247)): ci.md (1)
- 50339d0 (Docs: the §1 inventory carries its closure markers, and a gate keeps t): design/native-feature-parity.md (1)
- 8b3b481 (docs+fix: org rename to pineforge-4pass; AI capability-gap note in REA): examples-multi.md (1)
- c28c2db (Derive placement state from original admission observations): fill-model.md (1)
- 208f00b (docs: refresh ctest count + run_strategy usage example): install.md (1)
- 0c174d9 (Docs: the arm options, the adoption table and the grid re-lowering wai): native-engine.md (1)
- 4b05b62 (Adapter re-lowering: the TradingView margin call runs through the kern): native-engine.md (1)
- 8e558eb (Say what the per-bar broker hash is for, where its API is documented (): native-engine.md (1)
- 5f3299d (Build the standalone native execution path (#243)): native-engine.md (1)
- b18f75e (Native sizing bases and fractional reduces (R5 lane L3)): native-engine.md (1)
- 0ef00da (The pages say a working row tells an absent arm from an arm at 0.0 (R5): native-engine.md (1)
- 7328f4d (Docs: the migration page is a complete map, and a gate holds it comple): pine-to-native.md (1)
- ce64f06 (docs(audit): update Pine v6 master audit — mark 20 resolved critical i): pine_v6_audit_master.md (1)
- a19f5a8 (docs: repoint codegen references to pineforge-codegen-oss; purge old f): pine_v6_audit_master.md (1)
- 2db58d9 (runtime: reconcile per-trade MFE/MAE with TV excursion semantics; gate): pine_v6_audit_master.md (1)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
@luisleo526
luisleo526 deleted the refactor/source-layer-20260914 branch October 5, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant