PIX-14540: bound trend-aligned local-stop deferral #612

Open
andrei wants to merge 0 commits from agent/devops/pix-14540-bounded-local-stop into master
Owner

PIX-14540 bounded alternative после закрытого PR #610.

Что изменено:

  • Для trend-aligned local-stop breach (Sell+bearish, Buy+bullish) обычный LOCAL_STOP_NOTIONAL_RATIO breach больше не закрывает leg сразу: сначала отменяются exposure-expanding orders той же стороны.
  • Tail-loss protection сохранён: при loss >= 3 * max(LOCAL_STOP_MIN_LOSS_USD, notional * LOCAL_STOP_NOTIONAL_RATIO) leg закрывается прежним reduceOnly market close.
  • neutral/ranging/unknown не считаются trend-aligned и fail-closed закрываются на обычном local-stop cap.

Проверка:

  • RED до фикса: pytest backend/tests/test_grid_short_guard.py::test_short_local_stop_trend_aligned_breach_cancels_before_hard_cap -q падал, потому что AVAX закрывался сразу.
  • После фикса: pytest backend/tests/test_grid_short_guard.py -q -> 35 passed.
  • git diff --check -> clean.
  • gitnexus detect-changes -> 2 files, 8 symbols, affected processes 0, risk low.

Нужен independent exact-SHA review перед merge/deploy.

PIX-14540 bounded alternative после закрытого PR #610. Что изменено: - Для trend-aligned local-stop breach (`Sell`+`bearish`, `Buy`+`bullish`) обычный `LOCAL_STOP_NOTIONAL_RATIO` breach больше не закрывает leg сразу: сначала отменяются exposure-expanding orders той же стороны. - Tail-loss protection сохранён: при loss >= `3 * max(LOCAL_STOP_MIN_LOSS_USD, notional * LOCAL_STOP_NOTIONAL_RATIO)` leg закрывается прежним `reduceOnly` market close. - `neutral`/`ranging`/unknown не считаются trend-aligned и fail-closed закрываются на обычном local-stop cap. Проверка: - RED до фикса: `pytest backend/tests/test_grid_short_guard.py::test_short_local_stop_trend_aligned_breach_cancels_before_hard_cap -q` падал, потому что AVAX закрывался сразу. - После фикса: `pytest backend/tests/test_grid_short_guard.py -q` -> `35 passed`. - `git diff --check` -> clean. - `gitnexus detect-changes` -> 2 files, 8 symbols, affected processes 0, risk low. Нужен independent exact-SHA review перед merge/deploy.
fix(grid): bound trend-aligned local stop deferral
All checks were successful
Arnold Forgejo CI / backend-tests (pull_request) Successful in 12m15s
Arnold Forgejo CI / frontend-audit (pull_request) Successful in 19s
Arnold Forgejo CI / secret-scan (pull_request) Successful in 3s
Forgejo Smoke Test / Smoke (pull_request) Successful in 1s
Arnold Forgejo CI / backend-tests (push) Successful in 12m18s
Arnold Forgejo CI / frontend-audit (push) Successful in 18s
Arnold Forgejo CI / secret-scan (push) Successful in 3s
Deploy Arnold (Forgejo self-hosted) / deploy (push) Successful in 14m6s
43956e1795
Author
Owner

PIX-14540 review gate: нужен independent exact-SHA review для head 43956e1795 перед merge/deploy. PR #610 закрыт и не должен переоткрываться; этот PR содержит bounded alternative с сохранением LOCAL_STOP_NOTIONAL_RATIO tail-loss protection.

PIX-14540 review gate: нужен independent exact-SHA review для head 43956e179541a816e66faba550a0e1582cc72a10 перед merge/deploy. PR #610 закрыт и не должен переоткрываться; этот PR содержит bounded alternative с сохранением LOCAL_STOP_NOTIONAL_RATIO tail-loss protection.
arnold-reviewer left a comment

Проверил exact head 43956e1795 против base 12d6c31480. Дефектов не нашел. Логика bounded deferral сохраняет отмену expanding orders, откладывает reduce-only close только для trend-aligned legs до hard cap и сохраняет fail-closed close path для neutral/hard-cap. Проверка: python3 -m pytest backend/tests/test_grid_short_guard.py -q => 35 passed.

Проверил exact head 43956e179541a816e66faba550a0e1582cc72a10 против base 12d6c31480e54c1ad179fb17d3d6ad2154582c7e. Дефектов не нашел. Логика bounded deferral сохраняет отмену expanding orders, откладывает reduce-only close только для trend-aligned legs до hard cap и сохраняет fail-closed close path для neutral/hard-cap. Проверка: python3 -m pytest backend/tests/test_grid_short_guard.py -q => 35 passed.
All checks were successful
Arnold Forgejo CI / backend-tests (pull_request) Successful in 12m15s
Arnold Forgejo CI / frontend-audit (pull_request) Successful in 19s
Arnold Forgejo CI / secret-scan (pull_request) Successful in 3s
Forgejo Smoke Test / Smoke (pull_request) Successful in 1s
Arnold Forgejo CI / backend-tests (push) Successful in 12m18s
Arnold Forgejo CI / frontend-audit (push) Successful in 18s
Arnold Forgejo CI / secret-scan (push) Successful in 3s
Deploy Arnold (Forgejo self-hosted) / deploy (push) Successful in 14m6s
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin agent/devops/pix-14540-bounded-local-stop:agent/devops/pix-14540-bounded-local-stop
git switch agent/devops/pix-14540-bounded-local-stop

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff agent/devops/pix-14540-bounded-local-stop
git switch agent/devops/pix-14540-bounded-local-stop
git rebase master
git switch master
git merge --ff-only agent/devops/pix-14540-bounded-local-stop
git switch agent/devops/pix-14540-bounded-local-stop
git rebase master
git switch master
git merge --no-ff agent/devops/pix-14540-bounded-local-stop
git switch master
git merge --squash agent/devops/pix-14540-bounded-local-stop
git switch master
git merge --ff-only agent/devops/pix-14540-bounded-local-stop
git switch master
git merge agent/devops/pix-14540-bounded-local-stop
git push origin master
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
europa-tech-srl/arnold-trader-app!612
No description provided.