Repository navigation
Commit 770f7b2
Adapter: quiet-bar gates on every per-bar policy hook, and a commandless receipt read only moves its cursor (R5 lane PERF-L4, step 2)
Every TradingView policy hook the adapter runs at a bar boundary -- the
opening's release, ranking, admission, deferral, re-acceptance, two-stop
arbitration, fill-recalculation tail, declined-reversal and cap, margin and
intraday-loss checkpoints; the publication's bracket, close, entry and
relative-exit drains; the close's fill passes, admissions, re-arms, terminal
policy and short checkpoints -- is now first asked whether its body has
anything to act on, and is not run when it has not
(src/source/pine_quiet_bar.hpp, 29 gates). Each condition is the hook's own
no-op precondition: no live row of the family it acts on, an empty queue, a
flat book, a run configuration its body refuses before reading the book, no
loss rule, no due cap close. The gate sits at the hook's per-bar call site,
before the hook builds its frame, or at the top of a hook that is also
reached elsewhere; on an unbound adapter no gate fires, so require_host()
refuses exactly as before.
observe_terminal_receipts, read three times a bar, returns early when no
command event lies above its cursor, moving the cursor to the high water as
the full read would. It leaves the hashed terminal watermark alone, as the
read would: a terminal receipt is a command, every command's ordinal exceeds
the high water of the read before it, so the first read after one takes the
full path.
No value moves and no layout changes. tests/test_adapter_quiet_bar.cpp runs
a battery of 272 runs (21 fixture scenarios aimed at the gated hooks,
including a margin-call regime the corpus lacks -- 62 margin-call rows --
and 48 seeded random strategies, each magnifier off/on and hash recording
on/off):
* test_adapter_quiet_bar: every run's source folds, recorded broker-state
hashes, final hash and trade rows equal the values pinned on f71cd82;
and a bar with nothing to act on allocates only what the kernel does
(a held bracket and a flat stop pair allocated 268 and 488 per 44 quiet
bars on f71cd82, against the kernel's 4) -- the fail-before;
* test_adapter_quiet_bar_differential: the shipped library's transcript
(continuation included) equals the ungated build's
(PINEFORGE_PINE_QUIET_BAR_GATES=0), line for line;
* test_adapter_quiet_bar_probe: a quiet bar asks 30 gates and runs no hook
body, and every gate is taken both ways across the battery.
Mutating any of four gates (the entry drain's reset, the margin block, the
receipt cursor, the admission's side) fails both the pinned and the
differential rows.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
(cherry picked from commit 0cc0905208988ede88bcf4a786629bf01072eee9)1 parent b301cb3 commit 770f7b2
7 files changed
Lines changed: 1870 additions & 28 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
1822 | 1823 | | |
1823 | 1824 | | |
1824 | 1825 | | |
1825 | | - | |
1826 | | - | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
1827 | 1834 | | |
1828 | 1835 | | |
1829 | 1836 | | |
| |||
1846 | 1853 | | |
1847 | 1854 | | |
1848 | 1855 | | |
1849 | | - | |
| 1856 | + | |
| 1857 | + | |
1850 | 1858 | | |
1851 | | - | |
| 1859 | + | |
| 1860 | + | |
1852 | 1861 | | |
1853 | 1862 | | |
1854 | 1863 | | |
1855 | | - | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
1856 | 1868 | | |
1857 | 1869 | | |
1858 | 1870 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
905 | 910 | | |
906 | 911 | | |
907 | 912 | | |
| |||
1414 | 1419 | | |
1415 | 1420 | | |
1416 | 1421 | | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1417 | 1469 | | |
1418 | 1470 | | |
1419 | 1471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments