Skip to content

Adapter re-lowering R1: the kernel owns equity recording; the Pine host selects the policy and marks its cadence - #263

Merged
luisleo526 merged 1 commit into
mainfrom
r5/R1-adapter-report
Sep 20, 2026
Merged

luisleo526 merged 1 commit into
mainfrom
r5/R1-adapter-report

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

What

First lane of the adapter re-lowering wave (the Pine adapter uses the kernel's new native features instead of keeping parallel code): the equity curve is now recorded by the kernel under NativeReportPolicy::KernelRecordedAtHostMarks; the Pine host selects that policy in project() and marks its two cadence points through mark_script_report_point(); src/source/** no longer touches the engine's protected recording members.

Why a third policy value: the adapter's cadence (per published source slot, inside the callback, before the after-close fills; suppressed probe tails; COOF double publishes) cannot be reproduced by the kernel's per-calculation KernelRecorded cadence, so the recording moved to the kernel and the cadence stayed with the host. The value folds nothing into the continuation hash, so every adapter per-bar broker hash is unchanged.

Evidence

  • Whole-corpus byte-identity vs main: 312/312 engine_trades.csv identical, validation_report.md identical, 24 cases' full equity curves (5,138,348 points, 105 metric fields) identical.
  • tests/test_adapter_report_relower.cpp: 421 checks (ordinary / calc_on_order_fills / suppressed-tail cadences vs values harvested from the pre-change library).
  • Supervisor fresh ci_verify release PASS (504).
  • Campaign sweep exp-r5-r1-adapter-report-20260920 on this tree: 4190 graded, coverage-lost 0, hard 0, band leavers 0, score 0 — no regression, net 0 (accepted).

🤖 Generated with Claude Code

https://claude.ai/code/session_01CSmYixVAp4NqWpBZxkrLPT

…only selects the policy and marks its cadence (R5 lane R1)

NativeReportPolicy gains KernelRecordedAtHostMarks: the kernel performs the
recording (update_equity_extremes + record_equity_point, the L2 code path)
when the host marks a report point through the consumer's
mark_script_report_point(engine, ts). The Pine host selects that policy in
project() and marks its two cadence points (after the pending flushes on a
published bar, and on a suppressed probe tail) instead of calling the
engine's protected recording members itself; src/source/** no longer
references update_equity_extremes / record_equity_point. The adapter's
cadence (per published source slot, inside the callback, before the
after-close fills), its bar.timestamp label and its own range-end producer
and per-bar broker hash stay as they are — the kernel's KernelRecorded
cadence cannot reproduce them, so the recording moved and the cadence did
not. KernelRecordedAtHostMarks folds nothing into the continuation hash so
every adapter per-bar hash is unchanged.

Byte-identity: 312 corpus engine_trades.csv identical to main 06ef483 with
the regenerated corpus, validation report identical, 24 cases' full equity
curves (5,138,348 points, 105 metric fields) identical.
tests/test_adapter_report_relower.cpp (421 checks: ordinary, COOF and
suppressed-tail cadences against values harvested from the 06ef483 library).
ci_verify release PASS (501).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSmYixVAp4NqWpBZxkrLPT
@luisleo526
luisleo526 merged commit 04330d4 into main Sep 20, 2026
11 checks passed
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