Skip to content

Commit 27c2d8e

Browse files
luisleo526claude
andcommitted
XAU-CAL: a C host's session day moves only on a 1D script, a run's begin reads no earlier run's day labels, a calendar that fails to install leaves none, and every doc anchor is re-anchored once
A second read-only review (opus, "approve with comments") of the day-label and calendar fixes found: - the C host read every bar's session day at max(script_interval_open_ms, script_interval_eligible_open_ms), which also moved 2D, W and M bars on a masked session whose period opens on a day that does not trade (February 2025 on 0930-1600:23456: nominal Sat 02-01 -> Mon 02-03), an ABI field outside the lane. It now does so only on a 1D script, where only a daily stamp moves a bar's label before its session's open (native_c_host.cpp; the pf_native_decision_v1 doc says so). Witness: tests/test_native_c_api.c check_decision_session_day_of_a_masked_month -- the February bar keeps its nominal open's day; against c7df82e6 (r5/xau-cal-7239^, this code before this commit) "a masked month's day moved to its first session". The check pins main's reading, so it passes on main 0411892, where no label moves. The dated-day check still holds. - a host reused across runs kept the previous run's day labels through the next begin until prepare_day_labels ran at its end; they are cleared where the begin clears its interval cache (prepare_public_begin). - deliver_tick read a print's input slot at its raw stamp while its script interval went through day_label_origin; both read the bar's own now. - a calendar announcement that fails to install (a day missing) left the earlier run's calendar installed for a later run that announces nothing; the announcement now replaces it, so none is left (install_symbol_calendar_metadata). Witness: tests/test_symbol_calendar_tapes.cpp, "96 checks, 0 failures"; against c7df82e6 "96 checks, 2 failures". Not changed, as reported: _infer_bar_interval_ms (pre-existing, 76482e6) reads a chart's first gap and parses stamps with int(); lanes pass script_tf, so the daily route never infers. A hand-written malformed calendar metadata makes the fingerprint's calendar digest raise, which main already turns into "fingerprint: skipped". Doc anchors, once, on the tree rebased onto main 0411892: of 1743, 275 did not resolve (main's digits moved by this lane's lines, and the lane's own); check_doc_anchors.py --fix took 75, reanchor_doc_citations.py --ref 0411892 --ref 12e3e507 (the lane's head before the rebase, r5/xau-cal-7239) carried 181 by line map, and 21 were set by hand from a main-to-this-tree line map: the four floor-constant citations (ci_verify.py :320, :587; CONTRIBUTING.md, docs/pages/contributing-llm.md), native_c_api.h :1485 (three pages) and :2137-2141, ADR-0001's pine_strategy_host.cpp citations (:1872, :1982, :1933, :1901), the lane's own ADR row (:1958, :2529, :2011), native-feature-parity.md's :3115 and :2005, and two native_c_host.cpp citations (:4048, :3232-3236). check_doc_anchors.py: all 1743 resolve; check_doc_lint.py clean. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 6f951cb commit 27c2d8e

13 files changed

Lines changed: 334 additions & 231 deletions

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ What each gate refuses:
152152
### The floors
153153

154154
`ci_verify.py` counts the CTest rows that actually **ran** and fails below a
155-
floor — `KERNEL_MIN_TESTS` ci_verify.py:313 and `RELEASE_MIN_TESTS`
156-
ci_verify.py:572.
155+
floor — `KERNEL_MIN_TESTS` ci_verify.py:320 and `RELEASE_MIN_TESTS`
156+
ci_verify.py:587.
157157
A deleted or silently skipped row is a failure, not a quieter run. If your
158158
change adds rows, raise the floor in the same commit and say by how much; if it
159159
legitimately removes one, lower it deliberately and say why. `--min-tests`

‎docs/adr/0001-kernel-adapter-boundary.md‎

Lines changed: 51 additions & 51 deletions
Large diffs are not rendered by default.

‎docs/design/native-feature-parity.md‎

Lines changed: 70 additions & 70 deletions
Large diffs are not rendered by default.

‎docs/native-refactor-progress.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ repository and were never pushed.
194194
K4, the batch log pre-size. Since V19-B's step 6 (`08e71bae`) a run under the
195195
default `NativeEventRetention::Window` keeps no driver point and retires its
196196
journal at every script-bar boundary, so K4 has nothing to size.
197-
`reserve_driver_log` (`src/native_execution_consumer.cpp:2601-2606`) returns
197+
`reserve_driver_log` (`src/native_execution_consumer.cpp:2707-2712`) returns
198198
unless the retention is Full, and `presize_logs`
199-
(`src/native_execution_consumer.cpp:9331-9342`) sizes no journal under Window.
199+
(`src/native_execution_consumer.cpp:9440-9451`) sizes no journal under Window.
200200
`NativeRunSpec::event_retention` (`include/pineforge/native_run_spec.hpp:714`)
201201
defaults to Window, and the Pine adapter declares
202202
`NativeEventRetention::Window` (`src/source/pine_adapter.cpp:2411`). K4 still

‎docs/pages/contributing-llm.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ finding to report, not a step to take.
117117
`scripts/check_doc_reverts.py`.
118118

119119
10. **A test row never silently disappears.** Each profile counts the rows that
120-
*ran* against a floor: `KERNEL_MIN_TESTS` ci_verify.py:313 and
121-
`RELEASE_MIN_TESTS` ci_verify.py:572. Adding rows means raising the floor
120+
*ran* against a floor: `KERNEL_MIN_TESTS` ci_verify.py:320 and
121+
`RELEASE_MIN_TESTS` ci_verify.py:587. Adding rows means raising the floor
122122
in the same commit.
123123

124124
## The recipe for a lane
@@ -252,7 +252,7 @@ policy layer that *uses* kernel features. Where every TradingView rule lives.
252252

253253
**front door** — one of the three ways in: PineScript through codegen, C++
254254
through `NativeStrategyHost` native_host.hpp:845, or C through the
255-
`strategy_native_*` surface (`strategy_native_host_create_v1` native_c_api.h:2677).
255+
`strategy_native_*` surface (`strategy_native_host_create_v1` native_c_api.h:2682).
256256

257257
**twin** — a test unit compiled twice, once against a frozen historical header
258258
closure and once against the current one, so a behaviour change has to be
@@ -264,7 +264,7 @@ measurement that produced it, so a later change to it is visible as a change to
264264
the record, not as an edit to a literal.
265265

266266
**floor** — the minimum number of CTest rows a profile must actually run
267-
(`KERNEL_MIN_TESTS` ci_verify.py:313, `RELEASE_MIN_TESTS` ci_verify.py:572). It
267+
(`KERNEL_MIN_TESTS` ci_verify.py:320, `RELEASE_MIN_TESTS` ci_verify.py:587). It
268268
counts rows that ran, so a skipped row does not pad it.
269269

270270
**receipt** — the recorded evidence an ABI-comparison row needs (a prepared

‎docs/pages/native-engine.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ spec fields.
470470
The rich `run(bars, n, input_tf, script_tf, inputs, syminfo, overrides, …)`
471471
overload (`engine.hpp:1623-1634`) is **not** refused as a source mutation: it
472472
reaches `NativeExecutionConsumer::run_rich`
473-
(`native_execution_consumer.cpp:9457-9497`), which admits the begin, checks the
473+
(`native_execution_consumer.cpp:9566-9606`), which admits the begin, checks the
474474
timeframe arguments against the spec, preflights and pumps the batch exactly
475475
like the plain overload. `inputs` / `syminfo` / `overrides` are carried only as
476476
`NativeBeginArgs` fields to `prepare_native_begin` — the overrides as the
@@ -638,11 +638,11 @@ a host reacts to its own execution and may submit again. A request born there,
638638
mid-bar on a continuous segment, is eligible on the **remaining path suffix** of
639639
that segment — the birth is admitted at the current cursor and the geometric
640640
search then sees only the unconsumed suffix (`born_on_remaining_path`,
641-
`native_execution_consumer.cpp:5657-5661`). Requests accepted before the
641+
`native_execution_consumer.cpp:5765-5769`). Requests accepted before the
642642
segment, and discrete points, keep the ordinary birth gate above.
643643

644644
`on_native_bar_open` fires at the modeled opening, before that point's matching
645-
pass (`native_execution_consumer.cpp:7112-7114`). **Lookahead warning:** the
645+
pass (`native_execution_consumer.cpp:7220-7222`). **Lookahead warning:** the
646646
`Bar` it receives is the *complete* script bar — the consumer has already set
647647
`engine.current_bar_ = open_view` (`native_execution_consumer.cpp:6983`), the
648648
complete bar unless the spec asks for `NativeOpenBarView::OpenOnly` — so its
@@ -1987,7 +1987,7 @@ bar instead, for a host whose last input is still forming; a D/W/M bar holds
19871987
whole days, so all four are true. Every callback of one script bar carries
19881988
the same four, fills and fill recalculations included, and a C host reads
19891989
the first three from `pf_native_decision_v1`'s session bytes
1990-
(`native_c_api.h:1484`). The kernel resolves each session day once through
1990+
(`native_c_api.h:1485`). The kernel resolves each session day once through
19911991
`native_calendar::session_day_at` (`native_calendar.hpp:455`), which a host
19921992
may call too. `tests/test_native_session_day_facts.cpp` replays the
19931993
TradingView session tapes through a bare host. It is a presentation snapshot
@@ -2108,7 +2108,7 @@ default, set while no run is active — because each row is a full
21082108
the live state, not the run's length: the closed rows enter through a running
21092109
digest). With the switch on,
21102110
one row follows each point, after the extremes that point just folded
2111-
(`record_script_report_point`, `native_execution_consumer.cpp:7993`), so
2111+
(`record_script_report_point`, `native_execution_consumer.cpp:8102`), so
21122112

21132113
```text
21142114
broker_state_hash_len == equity_curve_len == script_bars_processed
@@ -3078,7 +3078,7 @@ Only completed buckets are published, so this recipe has no lookahead by
30783078
construction. It is the same class the kernel's own subscription evaluator
30793079
aggregates with, and the one the kernel's `script_bucket_completions` query
30803080
feeds when the Pine scheduler asks how its input span buckets
3081-
(`TimeframeAggregator` `native_execution_consumer.cpp:8075`). What it does
3081+
(`TimeframeAggregator` `native_execution_consumer.cpp:8184`). What it does
30823082
**not** give you is what a
30833083
declared subscription does: an `authoritative_bars` feed, the `gaps` and
30843084
`lookahead` delivery rules, the lazy-seal chronology, a C spelling, and the
@@ -3164,7 +3164,7 @@ These are existing refusals, not implied future features:
31643164
A C host has the same stream and the same commands. Streaming needs no new
31653165
symbol — `strategy_stream_begin` and its family (`pineforge.h:739`) take
31663166
a `pf_strategy_t` from `strategy_native_host_create_v1` unchanged — and
3167-
`strategy_native_submit_v1` (`native_c_api.h:2718`) obeys the one legality
3167+
`strategy_native_submit_v1` (`native_c_api.h:2723`) obeys the one legality
31683168
rule its C++ spelling does.
31693169
31703170
Rebuild strategy libraries against this engine. An ABI-v4 module without the

0 commit comments

Comments
 (0)