Silence LongBridge checks and clarify buy note#68
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Silence successful detection-path notifications for LongBridge while keeping execution reports and logs intact, add the missing
/probeendpoint used by Cloud Scheduler, and clarify the buy-skip reason when the target gap is below the minimum one-share order size.Why
The scheduled
/precheckendpoint is intended to detect startup/runtime problems and leave an audit trail, not send a normal successful rebalance notification every morning. Today it still used the real Telegram notification port during validation-only runs, so successful dry-run checks produced user-facing notifications.The Cloud Scheduler post-open
/probejobs are also configured, but the LongBridge service currently has no/proberoute, so those requests return 404 instead of checking broker/account availability.Separately, buy orders that were skipped because the target allocation gap was smaller than one whole share could be reported as a cash shortage. In the SG example, available cash was enough for one share, but the target gap was intentionally below one-share price, so the message was misleading.
Changes
/probeas a dry-run report-scoped broker/account health check.Validation
env PYTHONPATH=/home/ubuntu/Projects/QuantPlatformKit/src:/home/ubuntu/Projects/UsEquityStrategies/src python -m pytest tests/test_runtime_composer.py tests/test_request_handling.py::RequestHandlingTests::test_handle_probe_checks_account_snapshot_without_success_notification tests/test_request_handling.py::RequestHandlingTests::test_handle_probe_failure_sends_notification tests/test_request_handling.py::RequestHandlingTests::test_run_strategy_validation_only_uses_dry_run_composer -qpython -m unittest tests.test_rebalance_servicepython -m py_compile main.py application/runtime_composer.py application/execution_service.py notifications/telegram.py tests/test_runtime_composer.py tests/test_request_handling.py tests/test_rebalance_service.py