Skip to content

Commit 8988faf

Browse files
luisleo526claude
andcommitted
INT29: the docs state the picked rules, and every doc anchor is re-anchored once, on the integrated tree
The picked rule commits kept main's doc pages (their doc hunks renumbered anchors on their own lanes' trees), and the lanes' docs-and-anchors commits were not picked. This commit does both once, on the integrated tree. Doc text, from lane W12-ENG-TIME's docs commit d761f56d (not picked), word for word: - docs/coverage.md's "Time / Session / Timezone" says what pine_time / pine_time_close return under a session argument (the session's own D / W / M and intraday bars, in its timezone), that the chart's own intraday time_close is that grid on syminfo.session, that a close is the boundary itself, and that a 24-hour session's day in a DST zone runs wall clock to wall clock, citing tests/fixtures/session_period, time_close_function and dst_day_close. Where it said both return na "when the bar is outside the requested session", it now says "when no bar of tf built on the requested session holds the bar". - docs/pages/pine-to-native.md's session.ismarket row said the payload predicate pine_session_ismarket "misses every Sunday open under a weekday mask ... and every bar of 0000-2400, which it cannot parse as a whole day"; the picked W11-ENG-TIME-COLOR commits 1 and 1c made it read every HHMM as minutes and a day mask by each window's session day, and moved the tests/test_session_ismarket_tape.cpp pins to 0 misses. The row now says so. Anchors. Every page's digits were main's (74491fa), except W11 4b's plus_dm anchor (renumbered for the ta_volatility_trend.cpp it carries) and the seven W12 renumbered with the text above (lane W13-ENG-MARGIN-OPP's docs commit cb5d0d99, not picked either, renumbers digits only). The picks, INT29's composition and comment commits and the floors moved lines in pine_adapter.cpp, pine_adapter.hpp, pine_strategy_host.cpp, pine_state_hash.cpp, intraday_cap.hpp, session_time.hpp, session_time.cpp and ci_verify.py: - an exact difflib line map from the copy of each cited file that the digits were written against to this tree's, every claimed anchor verified by check_doc_anchors' own judge -- main first and alone where it carries the digits, then d761f56d's copy for W12's seven (its session files equal this tree's), then this tree's own for the plus_dm anchor: 243 anchors moved, 1,479 kept; - by hand, where the line itself changed: KERNEL_MIN_TESTS ci_verify.py:301 -> :306 and RELEASE_MIN_TESTS :511 -> :527 (CONTRIBUTING.md, docs/pages/contributing-llm.md twice each); - two ADR-0001 sha256 anchors into include/pineforge/ta.hpp (:333-340, :420-429) the map could not judge stay as they are: their lines are unchanged and the gate resolves them. check_doc_anchors.py: 1,730 of 1,730 resolve. check_doc_lint, check_design_inventory, check_kernel_seam_rows, check_dangling_comment_names, check_c_abi_runtime and check_twin_parity: 0 findings. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 3cccc26 commit 8988faf

8 files changed

Lines changed: 153 additions & 142 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:301 and `RELEASE_MIN_TESTS`
156-
ci_verify.py:511.
155+
floor — `KERNEL_MIN_TESTS` ci_verify.py:306 and `RELEASE_MIN_TESTS`
156+
ci_verify.py:527.
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: 29 additions & 29 deletions
Large diffs are not rendered by default.

‎docs/coverage.md‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,9 +743,20 @@ irregular data.
743743

744744
`pine_time(bar_ms, tf, session, tz, chart_tf)` and
745745
`pine_time_close(...)` return Unix milliseconds, or `na<int64_t>()` when
746-
the bar is outside the requested session (TradingView semantics for
747-
filtered sessions). They handle session string parsing and timezone
748-
conversion internally.
746+
no bar of `tf` built on the requested session holds the bar (TradingView
747+
semantics for filtered sessions). They handle session string parsing and
748+
timezone conversion internally. A session argument builds its own bars, in
749+
its timezone (the explicit one, else `syminfo.timezone`): a D bar runs
750+
from a session day's first window open to its last close, a W or M bar
751+
from the first session day of its week or month to the next one's, and an
752+
intraday bar opens at each window's open
753+
(`tests/fixtures/session_period`); the chart's own `time_close` on an
754+
intraday chart is that grid on `syminfo.session`. A close is the boundary
755+
itself: on an intraday chart a W or M closes where the next one opens, on
756+
a daily chart at its last traded close (`tests/fixtures/time_close_function`).
757+
A 24-hour session's day in a zone with daylight saving runs from one
758+
wall-clock open to the next, 23 or 25 hours across a switch
759+
(`tests/fixtures/dst_day_close`).
749760

750761
`tz_util::ScopedTimezone(tz)` is RAII — it grabs a process-wide mutex,
751762
swaps `TZ` (lazily: a same-zone request skips the `setenv` / `tzset`

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

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

‎docs/native-refactor-progress.md‎

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

‎docs/pages/contributing-llm.md‎

Lines changed: 3 additions & 3 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:301 and
121-
`RELEASE_MIN_TESTS` ci_verify.py:511. Adding rows means raising the floor
120+
*ran* against a floor: `KERNEL_MIN_TESTS` ci_verify.py:306 and
121+
`RELEASE_MIN_TESTS` ci_verify.py:527. Adding rows means raising the floor
122122
in the same commit.
123123

124124
## The recipe for a lane
@@ -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:301, `RELEASE_MIN_TESTS` ci_verify.py:511). It
267+
(`KERNEL_MIN_TESTS` ci_verify.py:306, `RELEASE_MIN_TESTS` ci_verify.py:527). 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ adapter answers `margin_check_allowed` with TradingView's scheduling — which
14921492
includes the post-exit re-size: when a priced bracket leg of the script bar
14931493
fills, the slice resting at that bar's adverse extreme was sized on the
14941494
pre-exit book, and the legacy broker cancelled and re-scheduled it there
1495-
(`margin_check_allowed` `pine_adapter.cpp:14615-14648`), so the adapter admits
1495+
(`margin_check_allowed` `pine_adapter.cpp:14792-14825`), so the adapter admits
14961496
the kernel's own point for that driver point while (and only while) a slice
14971497
rests —
14981498
`resolve_margin_requirement` with its ten-significant-digit money and
@@ -4442,7 +4442,7 @@ constructor/member cut has since landed: `engine.hpp` has **zero** references to
44424442
`CapAttachment`, `OrderPriority` or `IntradayCap`. `NativeStrategyHost` is
44434443
zero-argument (`native_host.hpp:845`); the `CapAttachment` constructor belongs
44444444
to `source::PineStrategyHost` (`pine_strategy_host.hpp:286-289`), and the cap
4445-
type itself lives in the adapter (`IntradayCap` `intraday_cap.hpp:83`).
4445+
type itself lives in the adapter (`IntradayCap` `intraday_cap.hpp:84`).
44464446
44474447
Nor is there a build-level one. The two source sets are disjoint:
44484448
`PINEFORGE_SOURCE_LAYER_SOURCES` (`CMakeLists.txt:91`) holds all six

‎docs/pages/pine-to-native.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ part both ways (`tests/test_adapter_margin_schedule_differential.cpp`, M11).
467467
| raw input before aggregation | `on_native_input` native_host.hpp:875 | `on_input` native_c_api.h:2499 | `native_auxiliary_feed_strategy.cpp` | Every accepted confirmed input bar, before aggregation or matching. |
468468
| a lower-timeframe sub-bar | `on_native_sub_bar` native_host.hpp:928 | `on_sub_bar` native_c_api.h:2540 | `tests/test_native_calc_timing.cpp` | `NativeCalculationReason::SubBar` is reserved and never delivered to the recalculate hook — a sub-bar has its own callback. |
469469
| `time`, `bar_index`, the bar's calendar interval, session facts | `NativeDecisionContext` market_driver.hpp:120 with `NativeCoordinate` market_driver.hpp:72 | `pf_native_decision_v1` native_c_api.h:1484 | `hello_kernel.cpp` | `NativeCoordinate::interval_index` is the sequential SCRIPT-bar index on every run, including aggregation; `input_interval_index` names the input slot for a host that needs input cadence. Both are copied onto the callback stack, and mutating them changes nothing. In C++ `script_interval` market_driver.hpp:124 and `input_interval` market_driver.hpp:123 add the calendar facts (eligible open, last traded close, next period and next input opens); the C decision carries the script interval's five instants and the session days of its open and of the next input in its tail, presented to a callback table at `PF_NATIVE_CALLBACKS_V1_POLICY_SIZE` or later, and no input interval. The C `on_input` callback receives the input index separately. The session-day facts are the three rows below. |
470-
| `session.ismarket` | `in_session` market_driver.hpp:161 | `in_session` native_c_api.h:1502 | `tests/test_native_session_day_facts.cpp` | The script bar is in session on the run's own calendar (`NativeRunSpec::session` / `timezone`), read at its label, or at its interval's first eligible instant when that is later (a bar opening inside a break); a D/W/M bar holds whole session days, so it is always true there. The calendar applies a session's day mask to the session day's trading date: Sunday 17:00 CT of a CME-style `1700-1600:23456` is Monday's session, in session. Pine's own chart `session.ismarket` is generated as the session calendar asked at the bar's open (the transpiler's helper), which holds those Sunday opens and a `0000-2400` day in market, as TradingView does. Inside a `request.security` payload it is still the time-of-day predicate `pine_session_ismarket` session_time.hpp:247, whose mask reads each instant's weekday: on six `lab tv` tapes it misses every Sunday open under a weekday mask (`1700-1600:23456`) and every bar of `0000-2400`, which it cannot parse as a whole day (`tests/test_session_ismarket_tape.cpp`); unmasked sessions (`1700-1600`, `1700-1700`, `24x7`, `0930-1600`) agree. Any reading at the bar's open puts a bar that opens inside a break out of market, which TradingView and this fact hold in market (`tests/test_session_break_open_bar_tape.cpp`). In C, read the three session bytes only when `session_facts` native_c_api.h:1501 is 1. |
470+
| `session.ismarket` | `in_session` market_driver.hpp:161 | `in_session` native_c_api.h:1502 | `tests/test_native_session_day_facts.cpp` | The script bar is in session on the run's own calendar (`NativeRunSpec::session` / `timezone`), read at its label, or at its interval's first eligible instant when that is later (a bar opening inside a break); a D/W/M bar holds whole session days, so it is always true there. The calendar applies a session's day mask to the session day's trading date: Sunday 17:00 CT of a CME-style `1700-1600:23456` is Monday's session, in session. Pine's own chart `session.ismarket` is generated as the session calendar asked at the bar's open (the transpiler's helper), which holds those Sunday opens and a `0000-2400` day in market, as TradingView does. Inside a `request.security` payload it is still the time-of-day predicate `pine_session_ismarket` session_time.hpp:256, which reads every `HHMM` as minutes and a day mask by each window's session day: on six `lab tv` tapes it now holds every Sunday open under a weekday mask (`1700-1600:23456`) and every bar of `0000-2400` in market, as TradingView does (`tests/test_session_ismarket_tape.cpp`, lane W11-ENG-TIME-COLOR), and unmasked sessions (`1700-1600`, `1700-1700`, `24x7`, `0930-1600`) agree. Any reading at the bar's open puts a bar that opens inside a break out of market, which TradingView and this fact hold in market (`tests/test_session_break_open_bar_tape.cpp`). In C, read the three session bytes only when `session_facts` native_c_api.h:1501 is 1. |
471471
| `session.isfirstbar` | `opens_session_day` market_driver.hpp:162 | `opens_session_day` native_c_api.h:1503 | `tests/test_native_session_day_facts.cpp` | In session, and the bar before it is not, or is on another session day. The session day rolls at the session's first window start and is keyed to its trading date, so an overnight session is one day across local midnight (Tokyo `2230-0500`: its days open at 22:30). "The bar before" is the one the run holds — the batch input, the stream warmup — else the calendar's previous eligible input slot across declared breaks; a run's first bar opens its day. |
472472
| `session.islastbar` | `closes_session_day` market_driver.hpp:163, `closes_session_day_open_ended` market_driver.hpp:164 | `closes_session_day` native_c_api.h:1504 | `tests/test_native_session_day_facts.cpp` | In session, and the bar after it is not, or is on another session day, "the bar after" read the same way. A batch's final bar closes its day (a batch is complete input); `closes_session_day_open_ended` reads the calendar there instead, for a host recomputing a batch whose last input is still forming (C++ only: a C host's live edge is a stream). A stream's bars read the calendar, so a stream cannot see an early close its session string does not declare: the NYSE half day's 12:45 closes the day in a batch (the next bar held is the next day's) but not in a stream (ADR-0001, ruling "Session-day facts at a bar with nothing held after it"). |
473473
| the price at the current point | `current_execution_point` native_host.hpp:1087 | `price` native_c_api.h:1563 | `native_selected_strategy.cpp` | The readiness preview `inspect_current_execution` native_host.hpp:1099 is an observation, never an apply token; `execute_current` native_host.hpp:1104 is the apply. |

0 commit comments

Comments
 (0)