Skip to content

Report-only native intraday terminal quote - #321

Merged
luisleo526 merged 5 commits into
mainfrom
px/h34-native-quote
Oct 3, 2026
Merged

luisleo526 merged 5 commits into
mainfrom
px/h34-native-quote

Conversation

@luisleo526

@luisleo526 luisleo526 commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Report-only native intraday terminal quote

Summary

Use the explicitly declared native chart terminal quote through the existing
report hook, without feeding another bar into execution. The inclusive chart
range end can be one chart interval after the last completed magnified bucket.
No kernel, settlement implementation, runtime C export or codegen change is
part of this PR. The branch is rebased onto 288f189c; the final head is
7ec2f15f0a6bed976a2bb5f3d6117733b6cb6925.

Derived report metrics recomputed from the corrected terminal mark are presentation, provided trades, fills, book and state remain byte-identical.

  • The report-only declaration pins quote time, close and native-feed SHA-256
    in runtime provenance; ON/OFF and any changed component have different
    fingerprints, while undeclared runs retain the old fingerprint shape.
  • Apply only on the last mark's chart grid: the completed mark or exactly one
    chart interval later. Stale, off-grid, future, daily, nonmagnified and
    incomplete runs are inert. An applied/inert observable and harness detail
    distinguish application from declaration.
  • Re-sum displayed trade rows for report.net_profit and last equity, matching
    the metrics calculator's accumulation order without a one-ulp discrepancy.
  • Repeated report reads are pure and idempotent; stored report rows, fills,
    position, pending orders and broker-state hashes do not change. No new
    !stream_mode_ gate is introduced.

Review Field Table

Surface Presentation changes allowed Unchanged contract
open_at_end rows exit_time, tick-rounded exit_price, pnl, pnl_pct, commission Entry identity, quantity, excursions, bar indexes, all real closed trades
Report and equity curve net_profit; final point time_ms and equity Earlier curve points, open_pl, diagnostics, counters, traces and hashes
metrics.all and the open side net_profit(_pct), gross_profit/loss(_pct), profit_factor, avg_trade/win/loss(_pct), ratio_avg_win_avg_loss, largest_win/loss(_pct), commission_paid, expectancy; win/loss counts, percent_profitable and streaks only if the projected row changes sign num_trades, avg_bars_in_*, the other side and actual trade facts
metrics.equity Terminal extreme max_equity_drawdown/runup(_pct), sharpe_monthly, sortino_monthly, sharpe_bar, sortino_bar, cagr, calmar, recovery_factor Execution equity history/prefix, buy_hold_return(_pct), time_in_market_pct
Execution None Stored trades, fills, live position, pending-order book and state

The projected row deliberately retains its old max_runup, max_drawdown
and exit_bar_index; it is not a synthetic execution bar. Buy-and-hold still
uses the last executed close. The last equity point is relabelled, not
appended, so the preceding gap can span two chart intervals. At a month
boundary the corrected point enters a one-point trailing month for monthly
Sharpe/Sortino, and the preceding point supplies the closing month's final
sample. The trade-only parity grader does not validate these derived metrics
against TradingView. The harness line infers APPLIED from the terminal
timestamps, which is exact for a quote one interval after the mark but not for
a quote stamped at the mark itself. See docs/report-terminal-quote.md.

Review

An independent review returned merge-with-fixes; every fix was applied. A
focused re-review of the fix round returned merge, with no blocking finding.
It re-proved execution identity on real probes with per-bar hash recording on:
the NQ 15-minute range-end probe has 63,086 of 63,086 per-bar broker-state
hashes identical with the quote off and on, and an ETH magnifier probe
37,999 of 37,999. Trade rows and the pending-order book are identical in both.
The rebase onto 288f189c conflicted only in documentation citation digits;
both code commits are patch-identical.

Gate

  • Full-population measurement of head 7ec2f15 with the current codegen:
    7,989 probes, no grade change, none missing, none erroring.
  • Gate verdict: PASS (no improvement, no regression), verdict schema v3.
    Hard lane (1,009 probes): 0 moves, tier-rank sum 4027 → 4027. Target lanes
    (6,980 probes): 0 up, 0 down.
  • This is the expected result: the quote is inert until the companion
    workflow PR's input pin is applied after its declared-case gate. The paired
    measurement with the quote declared (below) is where NQ and EURUSD lift.

Validation

  • Focused final-head quote test: 1476 checks, zero failures; four related
    CTest rows pass. Magnifier/range-end Python suites: 23 + 38 pass.
  • Runtime fingerprint self-test: 291 pass; documentation anchors: 1744/1744.
  • Refreshed measurement uses the rebased engine and checked-settings codegen:
    19 probes/87 pairs plus an independent two-probe/19-pair OFF ladder. All
    actual trade-row and pending-order-book/live-position digests are identical.
    Only NQ and EURUSD in the ruled range-end pair lift strong to excellent.
  • The five probes without per-bar hash tapes have explicit raw actual-row
    and book/position identity witnesses; empty hash arrays are not evidence.
    Unit tests also compare complete per-bar and final state hashes.
  • Full C report comparisons normalize the terminal presentation fields and
    derived metric blocks, serializing floats as binary64 bits; the unit test
    validates the metrics against the existing pure report calculators.
  • Full verification profiles on the exact final head (x86-64 Linux, GCC 13):
    preflight 44 stages; release 807 CTest rows; sanitizers 788; debug 788;
    kernel 303 with zero residual findings; documentation with zero Doxygen
    warnings. Full corpus trade identity is 312/312 and the 54-probe subset
    54/54, with zero moved, unrecorded, missing or schema-violating rows. The
    macOS build and native-live profiles do not run on these hosts.

Apply Gate

Merge does not enable the input. The companion workflow PR
(pineforge-4pass/pineforge-workflow#93) must first pass
one declared case end to end on its candidate immutable runner image before
the input pin is applied. Its receipt, APPLIED detail, new runtime quote
fingerprint and fresh OFF control must agree. Disable probe reuse and verifier
cache seeding, use fresh science/output keys, and reject an OFF cached result.
Only the supervisor applies compatible image/input pins in a paused window
and measures the reference pair under the new science identity. No production
migration, deployment, push or gate recording is performed by this PR's lane.

🤖 Generated with Claude Code

luisleo526 and others added 5 commits October 4, 2026 03:48
…d check reads timestamps only

The rebase onto 288f189 moved cited lines in the adapter boundary ADR and the
native feature parity page; the citations are carried across by line map.
The report quote page now says the harness APPLIED line is inferred from the
terminal timestamps, which is exact for a quote one interval after the mark
and not for a quote stamped at the mark itself.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@luisleo526
luisleo526 marked this pull request as ready for review October 3, 2026 20:40
@luisleo526
luisleo526 merged commit f6fdc03 into main Oct 3, 2026
19 checks passed
@luisleo526
luisleo526 deleted the px/h34-native-quote branch October 3, 2026 20:42
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