Skip to content

Exit binding tests: pin that the cap part judges an add once - #344

Merged
luisleo526 merged 1 commit into
mainfrom
px/w1-cap-test
Oct 5, 2026
Merged

luisleo526 merged 1 commit into
mainfrom
px/w1-cap-test

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Tests only. This adds one committed test for the exit-binding cap condition that engine #341 added: the cap part acts on an add only at the first opening after the add's call.

  • The case: a mechanism case in tests/test_exit_binding_tapes.cpp, cap-add-judged-once. It checks the engine's own rows on the existing tapes' bars; it is not a TradingView tape. At pyramiding 1 under process_orders_on_close, an add called at the cap beside a close of the held entry is kept at the next opening. That add must still rest and fill at its limit, 3804.34 on 2025-11-03 02:30 UTC. The case asserts three rows, the same rows with the cap part off, and backtest equal to stream.
  • Mutation: with the condition deleted, the case fails. It books two rows, because the add is withdrawn at a later opening. The rest of the suite passes either way, which is why the condition needed a test.
  • Scope: no change under src/ or include/. The fixture README names the case.

Verify bundles on this tree: release 862, sanitizers 840, debug 843, kernel 307 with 0 boundary findings, parity 312/312 with 0 moved, subset 54, docs.

🤖 Generated with Claude Code

The cap part of the exit-binding rule (withdraw_unplaced_cap_adds) acts on
an add only at the first opening after the add's call
(placement_script_open_ms != last_broker_open_ms_). No test covered that
condition: with it deleted, the whole suite still passed.

Add one mechanism case to test_exit_binding_tapes: engine rows on the tapes'
bars, not a TradingView tape. At pyramiding 1 under process_orders_on_close,
an add called at the cap beside a close of the held entry is kept at the
next opening (the position is flat), and a later market entry refills the
cap. The add must still rest and fill at its limit, 3804.34 on 2025-11-03
02:30 UTC, for three rows, with every part on and with the cap part off,
and the forward stream must close the backtest's trades. Without the
condition the engine withdraws the add at the opening after the refill and
books two rows.

Tests only: src/ and include/ are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@luisleo526
luisleo526 merged commit c714984 into main Oct 5, 2026
17 checks passed
@luisleo526
luisleo526 deleted the px/w1-cap-test branch October 5, 2026 12:03
luisleo526 added a commit that referenced this pull request Oct 6, 2026
* docs: release notes and version scoping for v1.3.0

CHANGELOG 1.3.0: confirmed-bar admission in pineforge-live (#342), the Pine
adapter changes of #341, #345 and #347, tests and docs (#343, #344); no
report key changes; the state-hash recipe additions of #341 and #347, domain
tags and the v19 epoch unchanged; migration.

Version scoping: README, install.md and public-contract.md name v1.3.0, its
tarballs, the engine1.3.0-codegen1.3.0 image and the 1.3.0 pair. The
confirmed-bar receipt and its admission, marked unreleased after 1.2.0 by
#342, ship in 1.3.0 (README, strategy-capabilities.md, runner/README.md).

Codegen license lines (README, LEGAL.md, docs/pages/index.md): the PineForge
Source License 1.2 from codegen 1.3.0; 1.2.0 keeps 1.1, releases up to 1.1.0
the PolyForm Noncommercial terms.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs: release 1.3.0's grades in the README and the changelog, from the facts tokens

The README's release sentence moves to the releases[1.3.0] tokens, and its
main-scoreboard lines re-render the values defe41f (#343) rendered at
pineforge-release 3e39d64, and the 1.3.0 changelog says which registry
baseline grades the release and why that baseline is the release's code,
all rendered from pineforge-release facts/facts.json at ff21de0 (#32). The
changelog sentence extends the last line of the "What a script author sees"
bullet that 0e1ced7 added.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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