Skip to content

Lower generated Pine execution onto the native kernel and retire the legacy loop (R4 slice C) - #254

Draft
luisleo526 wants to merge 184 commits into
mainfrom
refactor/adapter-lowering-20260914
Draft

luisleo526 wants to merge 184 commits into
mainfrom
refactor/adapter-lowering-20260914

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Roadmap slice C: the switch. After this PR every generated strategy executes through NativeExecutionConsumer via source::PineExecutionAdapter (PineStrategyHost : NativeStrategyHost); the executable PendingOrder, process_pending_orders, LegacyCompatibilityConsumer, the base legacy seams and the executable ShortSeed role are deleted. Contract, binding pin, amendments and anchors live in the campaign evidence root (tasks/R4-D-ADAPTER-LOWERING-CONTRACT.md rev 2, tasks/R4-DEFERRED-ANY-BINDING-PIN.md rev 2, tasks/R4-D-IMPLEMENTATION-PIN.json).

Landings on this branch

  • L0 (5928e32): real v16 providers frozen (host-ab9714b, seven-archive matrix); 23 legacy-route oracle test TUs (1,184 literal checks) capturing deferred-ANY/cohort/birth/FIFO, all reversal families, ShortSeed books, FX rollover cases, COOF first-open vs cascade, >64 fills, POOC freeze, magnifier cadence, day keys, frozen sizing/stop snapshots — these must keep passing on the native route; deletion ledger; PendingIntentView schema (65 members, 98 prefix fields, 5 probes, zero open).
  • L1 (next): generic kernel additions — host-maintained request cohorts (BindCohort/CohortClose, NoTarget deferral), intrabar (magnifier) path in NativeRunSpec/driver, pre-open hook, pre-begin configuration provider, staged configuration ingress; epochs native_order v5 / run_spec v2 / driver v5 / consumer v7 / engine_script_run v17.
  • L2: adapter + scheduler as dead code on a fixture host. L3a: the switch (paired codegen). L3b: deletions.

Acceptance

Fixed-4190 composite readback byte-identical on the switched route (one sweep on the final pair), the oracle tests, native witnesses, purity guards, deletion evidence. This slice claims the R4 phase credit; the N01–N13 audit note follows for R5.

🤖 Generated with Claude Code

https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm

…r the native lowering switch (R4-D L0)

Freeze the authentic ab9714b engine_script_run_v16/native_order_v4/native_run_spec_v1/native_driver_v4 provider and register frozen/live same-epoch ABI pairings.

Capture literal legacy-route oracle translation units, the Appendix-C PendingIntentView schema, and its coverage validator.

Contract rules: §0, P3, P6, P9, P10, P11, P12, P13, P15, §§3.3-3.6, and deferred-ANY P-DA1-P-DA7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…gin configuration provider to the native kernel (R4-D L1)

Implement the fenced generic lowering prerequisites:
- native v5 cohort ownership/authority, live NoTarget deferral, deterministic roster resolution, receipts, and continuation hashing;
- native v2 owned lower-timeframe intrabar paths and v5 driver decision context/delivery;
- native host v17 pre-open and pre-begin provider hooks plus staged ingress;
- v7 native-consumer matching, validation, lifecycle, hash/ABI fences, relocation matrix, and native witnesses.

Contract rules: §3.1; P7a; P8a/P8b; P11; P15; P-DA1/P-DA3; amendments A1/A3/A5/A7/A8.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

L1 landed: head e5f5e20 (45 files, +2,194/−519) — the generic kernel additions the switch needs, all source-free:

  • native_order_v5: host-maintained request cohorts (CohortHandle, BindCohort owner / CohortClose authority, exhaustive hash visitors) resolved at every match candidate to the live openings of the members' predecessor chains; NoTarget as a durable live deferral (no event).
  • native_run_spec_v2::IntrabarPath (owned lower-TF bar copy, tf, samples, distribution, volume-weighting; FNV content digest in the spec/continuation domain); native_driver_v5 sub-bar decision context; the consumer evaluates resting requests over each lower-bar OHLC path with parent-OHLC fallback — the former magnifier refusal is now path validation.
  • NativeStrategyHost::on_native_bar_open (before matching at the script-bar open) and prepare_native_begin(const NativeBeginArgs&) ahead of public begin admission on every batch/rich/TF/stream path; generic pre-begin ingress (C FX arrays staged and installed as a native curve once Ready).
  • Epochs: native_order v5, run_spec v2, driver v5, consumer v7, engine_script_run v17, source-adapter v2, fingerprint 17; authenticated v16→v17 relocation manifest; bidirectional rejection pairs; PF_ABI_VERSION 4; no new C export.
  • test_native_adapter_lowering_l1 (110 checks): cohort no-target / growth / 50%-of-cohort / unrelated-opening preservation / membership-order determinism / CashPerExecution ticket / pre-open current execution / lower-TF sub-bar fill sequence / C stream begin provider / staged FX activation / precommit-overflow ordering.

Verification: preflight 13/13; ci_verify release 372/372; ci_verify native 381/381; settlement matrix 65 compiles / 238 links / 0 pending; src/source/ byte-identical to L0; mirror header sha unchanged.

luisleo526 and others added 18 commits September 15, 2026 00:53
… sub-two-bar begins (R4-D L1b)

Add the v2 NativeRunSpec state and validator fence, and enforce the NativeBeginArgs sub-two-bar boundary at public begin.

Run the generic consumer on timestamp-derived per-bar O/H/L/C partitions without inferred aggregation, while retaining the existing empty-timeframe stream refusal.

Add native spec/fixture witnesses, version-guard coverage, and the reviewed run-spec header pin.

Contract rules: §0.2–§0.3; §3.1; A4; A11.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…NativeBeginArgs (R4-D L1c)

Pass the rich overload borrowed SymInfo through the native pre-begin provider, preserve null semantics on the other begin entries, and pin the additive value member in the ABI manifest/checkers. Extend the native fixture witness to verify by-value metadata projection and hash distinction.

Contract rules: section 3.1; P8a/P8b; P11; A8; A12.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

WIP: add the dead-code PineExecutionAdapter, PineScheduler, PineNativeHost fixture, source-state hashing, A11/A12 provider copies, and exact native deferred-ANY oracle twin. The twin remains intentionally failing at the pre-command native timestamp admissibility boundary; no literal oracle assertion was weakened.

Contract rules: §0, §2 P1/P3/P5/P7/P8/P13/P15, §3.2–§3.5; amendments A2–A8, A11, A12; deferred-ANY pin P-DA1–P-DA7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… and audit every native-only refusal (R4-D L1d)

Add the hashed Canonical/LegacyTolerant slot-label policy and the explicit strict-by-default legacy batch structural tolerance. Preserve raw timestamp decision labels under the compatibility policy, retain the legacy timestamp-overflow refusal, and pin the spec/driver ABI checker and relocation-manifest rows.

Add pure-native witnesses for the L0 1000/2000/3000/4000 ms shape, canonical refusal, raw decision coordinates, market fill progression, structural tolerance, and policy hash coverage. Contract rules: §0, A11, A12, A13, A4, A5.

Verification: ci_verify release and native each have only test_native_oracle_deferred_any_witnesses_l2 failing: known WIP failure owned by L2, fixed when the source provider opts into the A13 policies. All L1d-owned witnesses and guards are green.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Extend the L2 fixture-only adapter, scheduler, PineNativeHost, source-state hash coverage, and exact native-route oracle twins. The deferred-ANY, magnifier, >64-fill, frozen-size, and reversal witnesses pass; the POOC immediate twin remains blocked by a native-vs-legacy execution allowance/close-size divergence recorded in the L2 report.

Contract rules: §0, P1–P9, P13, P15, §3.2–§3.5; amendments A2, A4–A13; P-DA1–P-DA7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Repair fixture-host configuration retention, percentage close snapshots, immediate-close lowering, per-origin bracket lifecycle, source pyramiding accounting, terminal receipt handling, source-state hashing, and the exact deferred-birth oracle twin. POOC/immediate and deferred-birth literals are now green; remaining exact-twin repair ledger is recorded in LANDING-L2-REPORT.md.

Contract rules: §0, P1–P9, P13, P15, §3.2–§3.5; amendments A2, A4–A13; P-DA1–P-DA7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Extend the fixture-only lowering with POOC ordering, deferred relative exits, source mintick retention, frozen priced reversals, and paired later-same-tick reversal semantics. Add exact native fixture twins for POOC freeze, relative exits, close-only reversals, and later-tick reversals.

Contract rules: §0, P1–P9, P13, P15, §3.2–§3.5; amendments A2, A4–A13; P-DA1–P-DA7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Extend fixture-only COOF callback cadence with first-open and later Applied recalculations, retained source context, tail command deferral, and fully hashed source scheduler/adapter state. Keep the existing native fixture oracle set green while the remaining exact COOF rows are recorded as WIP evidence.

Contract rules: §0, P1–P9, P13, P15, §3.2–§3.5; amendments A2, A4–A13; P-DA1–P-DA7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…intrabar matching to the native kernel (R4-D L1e)

Allow copied account-currency FX configuration to be staged before a run and after completion or cooperative abort, with staged FX and driver facts folded into continuation identity. Add IntrabarPath::SampleEligibility and generic decision-context driver statistics so hosts can select discrete distribution samples or the default continuous segments. Update the native ABI manifest and ownership guards, with native fixture coverage for FX replacement/clear/abort and distribution fill splits.

Contract: §0.2, §3.1 staged configuration ingress and intrabar path; P8b; P15; amendments A5, A15, A16.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Opt source fixture magnifier paths into L1e DistributionSamples eligibility and project generic driver statistics into the legacy-compatible fixture diagnostics. The exact source magnifier oracle then exposed the remaining LegacyTolerant raw-partition intrabar grouping gap, recorded in the L2 report without altering literals.

Contract rules: §0, P8b, P15, §3.2–§3.5; amendments A13, A15–A17.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Freeze default stop-entry sizing at the directionally snapped stop level and add fixture-native stop-snapshot and ShortSeed role witnesses for fixed and percent books. ShortSeed plan handles are run/incarnation-qualified, invalidated on terminal receipt, and source-hashed.

Contract rules: §0, P5, P9, P13, P15, §3.2–§3.5; amendments A2, A4–A17; P-DA1–P-DA7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Reproduce staged-FX frozen admission, broker-open FX rollover liquidation, and the source scheduler refusals on the fixture-only adapter route.\n\nContract rules: §0, §3.2–§3.5, P2, P5, P6, P13, P15; amendments A13, A15, A16, A17.\n\nCo-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Restore fixture-source timeframe/day-partition/report lifecycle; add exact day-key and replacement-reversal twins; and carry COOF tail/open behavior through source lowering.\n\nContract rules: §0, §3.2–§3.5, P2, P4–P9, P13, P15; amendments A13, A15, A16, A17.\n\nCo-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>\nClaude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Implement the source-owned frozen same-bar MARKET transaction batch, targeted-close artifact, and gross placement admission census; register the unchanged exact fixture twin. Hash all added placement and batch state.

Contract rules: §0, P4, P6, P9, §3.2, §3.3, §3.5, P13, P15; amendments A13, A17.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Add exact fixture-native frozen-size coverage and source lowering for frozen lot sizing, default strategy.order, OCA sibling semantics, source stop placement/admission, and tick-projected market fills. Preserve unregistered exact STOP twins and derived fixture views for the remaining direct-owner cases; no legacy owner is reintroduced.

Contract rules: §0, P2, P4, P5, P6, P9, §3.2, §3.3, §3.4, §3.5, P13, P15; deferred-ANY P-DA1–P-DA5; amendments A13, A17, A18, A19.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Refine the derived fixture pending projection so a targeted close exposes its truthful request label while preserving the source-owned batch facts. This advances the exact fixed ShortSeed oracle evidence without restoring a legacy pending book.

Contract rules: §0, §3.4, §3.5, P9, P13; amendment A17.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…r feed exists (R4-D L1f)

Add the generic synthesized IntrabarPath variant, validation, FNV path digest, driver delivery, and statistics coverage.

Advance intrabar decision floors at emitted sub-bar points so applied-callback requests remain eligible within the active script bar. Preserve lower-feed and no-path behavior, and update native ABI manifests/checkers and native witnesses.

Contract: §0.2, §3.1, P15; amendments A13, A16, A18, A19.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
… host without switching the generated route (R4-D L2)

Complete the L1f source projection, fill-bar margin slice, and variable ShortSeed lowering on the fixture-only native route.

Add exact full fixture coverage for stop snapshots and fixed/percent ShortSeed books; retain all added adapter state in the source hash.

Contract: §0, §2 P2/P4-P9/P13/P15, §3.2-§3.5, P-DA1-P-DA5; amendments A15-A20.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

R4-D L2 landed at 4ad7b4bPineExecutionAdapter + PineScheduler on a fixture host source::PineNativeHost : NativeStrategyHost; the live PineStrategyHost and the generated route are untouched (legacy-route protected-path diff 0).

  • 19 of 23 L0 oracle TUs have exact green native-route twins (deferred-ANY witnesses, deferred birth, FX 129 checks, day-key 101, frozen-size 60, POOC freeze/immediate, relative exit 58, reversal families incl. replaced-percent 95 and same-bar tx 45, ShortSeed 144/86, stop-snapshot 146, >64 fills, magnifier barstate).
  • 4 TUs map to the deletion ledger per A14/A20 (they drive the legacy pending book or read legacy-owner internals; behaviour covered by the registered twins).
  • 2 twins still fail on one generic kernel gap (sampled-point stop activation is equality-only; sample-born ordering) → amendment A21, fixed in the next micro-landing L1g before the switch.
  • Local profiles: release 395/395, native 404/404; mirror SHA unchanged; PF_ABI_VERSION 4; no new C export.

Evidence root: tasks/r4-d/LANDING-L2-REPORT.md (+ RESUME1–5) in the campaign evidence directory.

…d order sample-born requests by ordinal (R4-D L1g)

Represent DistributionSamples, synthesized samples, and lower-TF endpoint samples as degenerate one-price decision bars so the generic matcher preserves inclusive activation and point-gap pricing. Register the two unchanged L2 oracle twins and add native witnesses for crossing activation/fill price and later-sample birth eligibility.

Rules: R4-D contract §0.2, §3.1/P15; amendments A16, A18, A19, and A21.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

L1g landed at 2281ee9 (amendment A21): every sampled decision point (DistributionSamples, synthesized, lower-TF ENDPOINTS) is now one generic one-price decision bar (O=H=L=C=sample, Open coordinate). The defect was coordinate classification: non-first samples equal to a sub-bar low/high were labelled Confirmed+Low/High, which the generic trigger validator rejects as an excursion class, so a below-level sample never activated a stop while an exact non-extreme sample did. No source-conditioned branch, no new spec/hash field.

  • Both formerly failing L2 twins (test_native_oracle_magnifier_distribution_l2, test_native_oracle_coof_l2) registered unchanged and green; two new generic witnesses (below-level activation + legacy one-price fill rule; sample-born ordinal eligibility).
  • release 399/399, native 408/408; pending_order_mirror.hpp SHA unchanged; PF_ABI_VERSION 4.

Next on this branch: L3a (the switch of PineStrategyHost onto the native kernel). Codegen pair: pineforge-codegen-oss#130.

luisleo526 and others added 3 commits September 15, 2026 11:19
…h the adapter and scheduler (R4-D L3a)

Rebase the live source host onto NativeStrategyHost, merge the L2 fixture behavior through a PineNativeHost compatibility alias, and route source commands, begins, C projections, and stream handling through PineExecutionAdapter and PineScheduler.

Preserve the frozen C ABI/mirror while adding native-route C stream and pending-intent projection witnesses; retain unreachable legacy bodies for L3b and register the approved fixture/oracle dispositions.

Contract: §0, §2 P2/P5-P8/P11-P15, §3.2-§3.5, §6; amendments A4-A8 and A11-A22; deferred-ANY pin P-DA1-P-DA7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…egister the A24 targets (R4-D L3a-fix)

Copy map-backed request handles and placement snapshots before adapter erasure or submission can invalidate them.

Re-register the A24 behavioral targets and rewrite the syminfo index fixture to observe the switched public route with unchanged literals.

Contract: R4-D §0; A20; A23; A24.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
…ve scheduler hooks and copy request handles before retiring adapter placements (R4-D L3a-fix)

Restore the legacy source security/timeframe feed cadence through the switched scheduler and provider, including raw input visibility, source-series/index projection, split-feed ordering, and quiet source abort reporting.

Add the permitted generic accepted-input hook and abort-reporting run-spec policy with continuation hash, ABI relocation, and native witness coverage; retain strict native defaults.

Replace the market-admission owner-book harness with the A25 fixture/public projection twin and preserve A23 lifetime-copy coverage from the WIP parent.

Contract: §0, P7b/P7c, P8a, P11, P13-P15; amendments A13, A20, A23-A25.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

L3a landed — the switch (7024f0a + fix d23f50d). source::PineStrategyHost now derives from NativeStrategyHost; every generated strategy, every run*/stream begin and every C export runs on the native execution kernel through PineExecutionAdapter + PineScheduler (prepare_native_beginadmit_public_beginNativeExecutionConsumer). The legacy Pine loop is compiled-but-unreachable and is deleted in the next landing (L3b).

  • Generated surface unchanged (codegen pair pineforge-codegen-oss#130 adds the price-less-exit lowering and the PINEFORGE_HAS_NATIVE_LOWERING_V1 fence); C pending exports read the new PendingIntentView; pending_order_mirror.hpp byte-identical; PF_ABI_VERSION 4.
  • Oracle discipline: 17 L0 oracle TUs green unchanged on the native route, 2 rewritten to public projections with the same literals, 4 owner-internal TUs mapped to the deletion ledger; all 27 L2 twins green.
  • Repairs from the root audit: A23 heap-use-after-free in the adapter's retire (9 container-lifetime sites fixed; Linux ASan clean), A24 18 security/timeframe/syminfo/abort tests re-registered and green unchanged, A25 the scheduler now feeds the same generic engine_security.cpp sequence from the native hooks; two generic kernel additions only: on_native_input(Bar, NativeInputContext) and NativeRunSpec::abort_reporting.
  • Local profiles: release PASS, native PASS, Linux ASan/UBSan 240/241 (the one failure is the pre-existing test_native_calendar tzdata precondition in a minimal container; the GitHub Ubuntu lane is authoritative).

Evidence: tasks/r4-d/LANDING-L3A-REPORT.md in the campaign evidence directory.

…eachable behind the native switch (R4-D L3b)

Delete the retired execution consumer, source pending-book types, legacy matching/settlement/scheduler/stream bodies, lifecycle seams, ShortSeed storage, and base POOC/COOF fields after the L3a native switch.

Project the frozen pending-row ABI from PendingIntentView placement/native facts, retain the switched scheduler/security adapters, update ABI/version/hash guards and relocation evidence, and migrate affected tests, examples, and documentation.

Contract rules: §0.1-§0.4, §1, §3.5-§3.6, P6, P10, P12, P13, P14, P15, A14, A20, A23, A24, A25.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iF71UAEuQ7F6eqWgecAHm
@luisleo526

Copy link
Copy Markdown
Collaborator Author

L3b landed at d1a0862 — the legacy Pine execution loop is gone. 182 files, +1,657 / −33,644 lines: LegacyCompatibilityConsumer and its factory, seams S01–S09/S22–S24, the executable PendingOrder book and its second matching loop, the legacy scheduler/magnifier/stream/settlement bodies, the ShortSeed enum storage, the base POOC/COOF fields and the language mixin are deleted. One execution owner remains (NativeExecutionConsumer); the C pending-row prefix is projected from PendingIntentView with byte-identical layout.

  • Purity census (Python re): 0 product references to any retired symbol; hash-coverage waivers 41 → 38.
  • Local profiles: release 225/225, debug 225/225, native 234/234, sanitizers (GCC 16 ASan+UBSan) 225/225.

Next: integration profiles + compile-backed codegen suite, Fable final review on the exact pair (engine d1a0862 / codegen pineforge-codegen-oss#130 @ 66612ed), then the single composite Cloud Run sweep over the 4190-probe corpus and the gate.

luisleo526 and others added 30 commits September 17, 2026 08:24
…le (R4-D L10n)

After close_all (or any flatten) the cohort keeps its prior-cycle origins;
they are neither pending nor opened, so a strategy.exit re-issued with the
same (exit id, from_entry) for the new cycle walked stale handles and never
attached to the new parent. ab9714b keys exits per position cycle
(cycle_filled_entry_ids_ cleared on flat). Only origin-zero, pending or
opened origins are kept now, restoring the empty-origins first-cycle path
while the new parent is still staged in pending_same_bar_commands_.

Reproduction: probe9 "A v0" (legacy: 2 trades, flat; native: position stuck
+1); population probe bprakaash-new-era-strategy-1-0 (371 -> 5 trades).
Pinned in tests/test_l10n_exit_reissue_after_close_all.cpp with embedded bars.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
… L10o)

run_begin only configured the request.security evaluator surface when the
run was not "static eligible" (a stream, a magnified run, or an explicit
input/script timeframe). ab9714b run_tf_impl (pine_scheduler.cpp:1249-1323)
configures it unconditionally for every overload the generated wrapper
calls (run_backtest and run_backtest_full both route through the 7-argument
run); empty timeframes only select auto-detection. With auto-detected
timeframes every request.security series therefore stayed na on the
switched route: the 16 mtf-* and analyzer-self-test corpus scenarios
produced 0 trades locally. With the evaluators configured, 20 of the 21
request.security scenarios replay identically to the legacy owner
(mtf-roll-state-60-240-d-minimal-01 still diverges at trade #78).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…te request.security evaluators on it (R4-D L10o-2)

test_script_run_prepare_l4d pins the legacy contract that the bare
run(bars, n) lifecycle never configures the request.security evaluator
surface while the timeframe-aware overloads always do.  Both public
overloads produced identical NativeBeginArgs, so the host could only guess
from empty timeframes (which merely request auto-detection).  The kernel now
reports the overload identity as NativeBeginArgs::simple_run (a generic
lifecycle fact, ruled A47) and the scheduler gates the surface on that.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…0o-3)

check_broker_state_hash_coverage flagged the new retained begin field.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…shots with their position cycle (R4-D L10q)

pyramid-terrace-staged-entry-01 trades #647/#648: the owner exits both
staged lots at 2025-10-26 01:45 @3926.03; the switched route only exited on
the next bar @3931.40 because a prior-cycle Close placement still blocked
the exit reservation.  Outstanding Close and CloseAll instructions are now
cancelled and retired alongside bracket orders when a position flattens,
and submitted close placement snapshots record their position cycle so a
prior cycle's close never blocks a later reservation.  Pinned with embedded
bars in tests/test_l10q_pyramid_terrace_exit.cpp (W18b, Gemini).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…cap (R4-D L10s)

mtf-roll-state-60-240-d-minimal-01 trades #77/#78: two strategy.entry calls
with different ids ("R60" and "D") fired on the same bar while flat and the
switched route admitted both lots under pyramiding=1; the owner admits one.
Same-bar market entries in the same direction, whether opening from flat or
adding to a position, now count the pending same-direction commands (staged,
pending and live placements of the current script bar) against the
configured pyramiding cap and are rejected once the cap is met.  Pinned with
embedded bars in tests/test_l10s_pyramiding_same_bar_ids.cpp (W19a, Gemini;
the executor's test-keyed host hunk was dropped: L10o-2 carries the
overload identity instead).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
… re-armed stop's forced price to the tick (R4-D L10r)

order-dual-stop-both-touch-priority-01 trades #143/#144: two stop entries
touched on one bar filled in the reverse order and the second lot one tick
off.  A same-id Entry/Order replacement now retains its predecessor's
source_sequence so the book keeps the owner's creation order across
re-issues; flat-armed entry-stop arbitration compares source_sequence
instead of command_sequence; and a throttled-reopen re-arm's forced
execution price is rounded directionally to the tick like every other
stop fill.  Pinned with embedded bars in
tests/test_l10r_dual_stop_same_bar_order.cpp (W18c, Gemini).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
… the trigger (R4-D L10p)

bracket-exit-three-way-set-once-entry-01 trade #539: the owner fills the
set-once three-way exit on the entry bar (2025-12-25 08:15); on the switched
route binary representation error floated the one-shot trailing limit a few
ulps above the bar high so it only filled 23 bars later.  The level is now
snapped onto the price grid before submission and the resolved exit-trail
limit fill price is clamped to the trigger level so it never violates the
limit threshold.  Pinned with embedded bars in
tests/test_l10p_three_way_entry_bar_exit.cpp (W18a, Gemini).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…e live position (R4-D L10t)

Population collapse mechanism C: after a partial (qty_percent) or
percent-rounded exit the switched route kept a zero or dust lot open, which
blocked every later entry under pyramiding=0 and was printed as a trade
months later (francescodimichele 651 -> 23 trades, p181342x 431 -> 93, joat
193 -> 106 on the ETH feed).  The host now drops pyramid entries below the
lot epsilon after every applied fill and resets to flat when nothing
remains; POOC-flushed closes cap their target to the live physical units
and use Flatten/Reduce intents instead of overshooting Transacts; the exit
dedupe key uses the real 0x1f separator.  With this, francescodimichele,
p181342x, sunitkumar, tomukasss and r2keymoneymind replay identically to
the owner on the ETH feed; joat keeps one differing row (follow-up).  Pinned
with embedded bars in tests/test_l10t_partial_exit_residual.cpp (W20a,
Gemini; the executor's extra POOC limit-at-close market fill was dropped as
out of scope).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…zation (R4-D L10w)

waranyutrkm-inside-day-breakout-strategy trade #26: after a short-to-long
flip the switched route booked a zero-quantity long lot (a 4x-epsilon
margin-call Reduce produced by floating-point residue at a 1x full-margin
opening) and printed it as a trade.  ab9714b pine_fills.cpp:1572-1575
discards a dust-sized restore requirement before lot quantization; the
adapter now does the same.  A plain resting stop with the implicit
strategy.exit quantity (NaN) also receives the fill-based drawdown
normalization on the ordinary route, as the owner does.  Pinned with
embedded bars in tests/test_l10w_zero_qty_entry.cpp (W21a, glm-5.3).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…ble against the owner's trigger close (R4-D L10v)

Under process_orders_on_close the legacy owner's post-calculation fill pass
(ab9714b pine_fills.cpp: pooc_short_exit_trigger_close 7318-7365, the
eligibility gate 7621-7648 and exit_same_bar_reissue 7810-7843) fills a
priced exit leg placed by this bar's calc at the close when it is already
marketable against the trigger close the owner selects (stop leg first, one
leg per exit order); the switched route left it resting for the next bar,
so the first qty_percent leg of a multi-leg exit filled one bar late
(projectsyndicate 2735 differing rows, joat #44).  The booked stop close
slips on the closing side's path (short close = buy: close + slippage,
long close = sell: close - slippage; limit legs never slip).  With this
both population reproductions replay identically to the owner and the A29
twin test_pooc_short_close_tick_l4d passes 183/183.  Pinned with embedded
bars in tests/test_l10v_first_partial_leg_timing.cpp (W20b glm-5.3-flash,
repaired by W20b-2 qwen3.8-max).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
From the independent review of aaa2c3a..9d23cfa
(tasks/r4-d/exact/REVIEW-QWENMAX-L10-REPORT.md):
 1. throttled re-arm queue deduped by source identity (one re-arm per bar);
 2. live rows with a recorded cancellation no longer count against the
    pyramiding cap;
 4. the interval cache is a per-consumer member instead of a thread_local
    shared by every engine on the thread (generic, no behaviour change);
 5. the single-lot position() fast path guards qty > 0 like the weighted
    path;
 6. command_sequence_for_exit selects rows by (exit id, from_entry);
 7. broker_bar_cursor is documented as a pure per-bar cache and waived
    fail-closed in check_broker_state_hash_coverage.py.
Item 3 (close on a resting same-bar entry) was found unreachable through
the public host surface and is not included.  Full corpus replay: no
identical scenario changed and no first divergence moved; pinned checks in
tests/test_l10z_review_fixes.cpp (W22a, qwen3.8-max).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…l-percent bracket reissue as unchanged (R4-D L10x)

fran-pineda-strategy-461-ts-m15 trade #351: the re-issued take-profit
limit (2409.49) was projected one binary64 ULP onto the wrong side of the
grid, so the generic kernel correctly refused it on the touch bar and the
short exited a bar later at a lower price.  A source level that is on the
chart grid now stays at that level; a re-issued default bracket whose
normalized percent is within 1e-12 of 100 is the same full-position
reservation as the owner treats it; and a resting stop with the implicit
(NaN) full-position quantity receives the owner's fill-based drawdown
normalization.  Pinned with embedded bars in
tests/test_l10x_reissued_limit_touch_bar.cpp (W21b, glm-5.3).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…adapter-lowering-20260914-int

Conflict in the resting-stop drawdown normalization gate resolved as the
union of the L10w and L10x findings: explicit or implicit (NaN) stop
quantity, every route except POOC combined with calc_on_order_fills.
…sidual lot (R4-D L10y)

yukozb-gold-ny-orb-v19-close-20-00 #2/#3 and ahtisham-ee-decoded-
volatility-expansion-ahtisham #126/#127: with default_qty_value=100 the
legacy owner admits the entry and books it as a main lot plus a residual
margin-call lot closed again on the entry bar; the switched route refused
the whole entry.  The adapter now sizes and admits the full-equity entry
the way the owner's fill-time affordability and margin-call slice do, and
samples the residual lot's open extremes like the owner.  Both population
reproductions replay identically to the owner.  Pinned with embedded bars
in tests/test_l10y_full_equity_entry_split.cpp (W21c, qwen3.8-max).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
…adapter-lowering-20260914-int

Conflict in submit_margin_call_slice resolved by keeping the L10w form of
the dust-restore discard; L10y found the same owner rule with the same
epsilon.
The union merge dropped L10y's local kSliceQtyEpsilon (same 1e-10 value).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKCCnMS51GLmRbA3AHtBDb
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