Skip to content

Historical Candle Fixes - Balance Fixes - Documentation Specification - Etc#113

Open
sixtysixx wants to merge 41 commits into
ChipaDevTeam:masterfrom
sixtysixx:master
Open

Historical Candle Fixes - Balance Fixes - Documentation Specification - Etc#113
sixtysixx wants to merge 41 commits into
ChipaDevTeam:masterfrom
sixtysixx:master

Conversation

@sixtysixx

@sixtysixx sixtysixx commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

[0.2.12] - 2026-06-30

Added

  • UTC Candle Compilation: Refactored candle compilation to fetch raw 1-second ticks and manually build candles based on UTC time boundaries (timestamp / period * period), avoiding server-side candle time-alignment mismatches, overlaps, and gaps.
  • Added getBalance to initial connection messages to ensure balance is fetched immediately upon reconnecting.
  • Added warnings and logging to previously swallowed async channel errors.
  • Exposed more functions in the python documentation wrapper.

Changed

  • Replaced the Notify-based wait primitives in Signals with stateful tokio::sync::watch to prevent TOCTOU race conditions.
  • Derived Debug for Action in crates/bindings_pyo3/src/framework.rs to fix test compilation.
  • Updated all internal crates and dependencies to version 0.2.12.

Fixed

  • Fixed subscription restoration to fire on both on_connect and on_reconnect paths so subscriptions are not lost on explicit disconnects.
  • Fixed memory leaks: Added pruning/eviction to latest_ticks in GetCandlesApiModule and cleared pending state (pending_market_orders, recent_trades, pending_deals) on reconnection.
  • Fixed panics: Replaced .expect() calls with poison recovery (.unwrap_or_else(|e| e.into_inner())) in state.rs and raw.rs, and returned Result from RuleBuilder::regex() instead of panicking on invalid regexes.
  • Fixed module lifecycle hang: Implemented proper waiter notification on module Drop for PendingTrades, Raw, and HistoricalData modules.
  • Fixed command queue mismatches in pending_trades.rs by separating queues per command type.

Summary by CodeRabbit

  • New Features
    • Added nocaptchaai as a supported CAPTCHA-solver backend for login.
    • Expanded UniFFI bindings with additional PocketOption constructors and new PocketOption APIs for pending-order cancellation, tick/candle helpers, connection state controls, and asset readiness; added a Tick record type.
  • Bug Fixes
    • Improved connection/reconnect lifecycle handling and added safer connection initialization timeout behavior.
    • Strengthened trade and pending-order correlation/cleanup and reduced memory growth via candle/tick buffer pruning.
    • Improved subscription/unsubscribe error reporting and reliability.
  • Chores
    • Refreshed CI/dependency automation, docs, and project templates; updated release/version metadata and raised Python minimum version to 3.9.

sixtysixx and others added 30 commits June 25, 2026 11:37
…entation

- Implement unit tests for PocketError variants in `error.rs`, covering scenarios like invalid assets, order failures, and timeouts.
- Add tests for `TradeState` and `StateBuilder` in `state.rs`, ensuring default values and methods function correctly.
- Enhance the Python `PocketOption` client with detailed docstrings for methods, improving usability and clarity.
- Remove deprecated Dockerfiles and example scripts to streamline the project structure.
- Update README and documentation to reflect changes in the core crate and testing framework.
- Added balance retrieval command to keep_alive module.
- Refactored PendingTradesApiModule to separate pending requests into open, cancel, and cancel multiple requests.
- Improved error handling in response routing for subscriptions and trades.
- Updated historical candle retrieval methods to ensure strict UTC alignment and prevent server-side mismatches.
- Deprecated the old history method in favor of the new candles method.
- Enhanced documentation for clarity on new features and changes.
- Updated dependencies in macros crate for improved stability.
- Added comprehensive tests for PocketOption functions, ensuring robust integration coverage.
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [mlugg/setup-zig](https://github.com/mlugg/setup-zig) from 1 to 2.
- [Release notes](https://github.com/mlugg/setup-zig/releases)
- [Commits](mlugg/setup-zig@v1...v2)

---
updated-dependencies:
- dependency-name: mlugg/setup-zig
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 16.4.0 to 17.0.8.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v16.4.0...v17.0.8)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-version: 17.0.8
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v4...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Updates the requirements on [uniffi](https://github.com/mozilla/uniffi-rs) to permit the latest version.

Updates `uniffi` to 0.32.0
- [Changelog](https://github.com/mozilla/uniffi-rs/blob/v0.32.0/CHANGELOG.md)
- [Commits](mozilla/uniffi-rs@v0.31.2...v0.32.0)

---
updated-dependencies:
- dependency-name: uniffi
  dependency-version: 0.32.0
  dependency-type: direct:production
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…ns/setup-python-6

Bump actions/setup-python from 5 to 6
…aged-17.0.8

Bump lint-staged from 16.4.0 to 17.0.8
…/setup-zig-2

Bump mlugg/setup-zig from 1 to 2
…ns/checkout-7

Bump actions/checkout from 4 to 7
…ns/download-artifact-8

Bump actions/download-artifact from 4 to 8
…ies-96546c0a2d

Update uniffi requirement from 0.31.2 to 0.32.0 in the rust-dependencies group
Bumps [mozilla/sccache-action](https://github.com/mozilla/sccache-action) from 0.0.6 to 0.0.10.
- [Release notes](https://github.com/mozilla/sccache-action/releases)
- [Commits](Mozilla-Actions/sccache-action@v0.0.6...v0.0.10)

---
updated-dependencies:
- dependency-name: mozilla/sccache-action
  dependency-version: 0.0.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…la/sccache-action-0.0.10

Bump mozilla/sccache-action from 0.0.6 to 0.0.10
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2a0425ca-dce8-46c9-9eb4-8e91a95242ba

📥 Commits

Reviewing files that changed from the base of the PR and between 29d7b8d and 4e7e035.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (45)
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/documentation.md
  • .github/ISSUE_TEMPLATE/feature_request.md
  • .github/ISSUE_TEMPLATE/question.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/workflows/CI.yml
  • .github/workflows/deploy.yml
  • CHANGELOG.md
  • crates/binary_options_tools/src/pocketoption/candle.rs
  • crates/core/src/rules.rs
  • crates/core/src/signals.rs
  • docs/OVERVIEW.md
  • docs/api/python.md
  • docs/api/python.md.bak
  • docs/api/reference.md
  • docs/api/reference.md.bak
  • docs/architecture/dataflow.md
  • docs/architecture/dataflow.md.bak
  • docs/architecture/raw-module.md
  • docs/architecture/raw-module.md.bak
  • docs/architecture/structure.md
  • docs/examples/csharp/index.md
  • docs/examples/go/index.md
  • docs/examples/index.md
  • docs/examples/javascript/index.md
  • docs/examples/kotlin/index.md
  • docs/examples/python/async/index.md
  • docs/examples/python/sync/index.md
  • docs/examples/ruby/index.md
  • docs/examples/rust/index.md
  • docs/examples/swift/index.md
  • docs/guides/assets-timeframes.md.bak
  • docs/guides/python-pystrategy-trading-bot.md.bak
  • docs/guides/raw-handler.md.bak
  • docs/guides/trading.md.bak
  • docs/intro.md
  • docs/project/deployment.md
  • docs/tutorials/index.md
  • docs/tutorials/scripts/index.md
  • docusaurus.config.js
  • mkdocs.yml
  • package.json
  • python/BinaryOptionsToolsV2/pocketoption/synchronous.py
  • sidebars.js
  • src/css/custom.css
💤 Files with no reviewable changes (1)
  • mkdocs.yml
✅ Files skipped from review due to trivial changes (13)
  • docs/api/python.md.bak
  • docs/guides/raw-handler.md.bak
  • .github/ISSUE_TEMPLATE/documentation.md
  • docs/architecture/raw-module.md.bak
  • .github/ISSUE_TEMPLATE/question.md
  • docs/guides/assets-timeframes.md.bak
  • .github/ISSUE_TEMPLATE/feature_request.md
  • docs/guides/python-pystrategy-trading-bot.md.bak
  • docs/architecture/dataflow.md.bak
  • docs/api/reference.md.bak
  • .github/PULL_REQUEST_TEMPLATE.md
  • docs/guides/trading.md.bak
  • .github/ISSUE_TEMPLATE/bug_report.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/core/src/rules.rs
  • crates/core/src/signals.rs
  • python/BinaryOptionsToolsV2/pocketoption/synchronous.py

📝 Walkthrough

Walkthrough

This PR updates release metadata, docs/site tooling, Rust core and PocketOption runtime behavior, bindings, and Python wrappers for v0.2.12. It also rewrites templates, documentation pages, examples, and tests to match the new API and site structure.

Changes

Release, templates, and repository metadata

Layer / File(s) Summary
Templates and contributor docs
/.github/*, agents/*, .gitignore, tests/login_test.txt
GitHub issue, PR, funding, and contributor guidance files were updated, along with ignore rules and the login-request fixture.
CI, dependency, and release metadata
Cargo.toml, crates/*/Cargo.toml, python/pyproject.toml, package.json, .github/workflows/CI.yml, .github/workflows/deploy.yml, .github/dependabot.yml, CHANGELOG.md, README.md, python/README.md, docs/*, codemap.md
Versions, workflows, dependency automation, changelog, and docs metadata were updated for the release and site migration.

Core Rust runtime and PocketOption engine

Layer / File(s) Summary
Core primitives and connection flow
crates/core/src/*, crates/core/tests/*
Signals, client callbacks, message types, rule helpers, and core tests were updated together.
PocketOption modules and state
crates/binary_options_tools/src/pocketoption/*, crates/binary_options_tools/tests/*, crates/binary_options_tools/examples/*
Candle compilation, pending-trade routing, trade correlation, subscriptions, raw handling, state cleanup, and related examples/tests were updated.

Bindings and Python-facing APIs

Layer / File(s) Summary
Bindings surface and exported types
crates/bindings_pyo3/*, crates/bindings_uniffi/*
PyO3 and UniFFI bindings added exported types, constructors, utilities, and wrapper methods.
Python package, login, and sync wrapper
python/BinaryOptionsToolsV2/*, python/README.md, tests/python/*, examples/python/*
The Python login flow gained a nocaptchaai backend, synchronous wrapper behavior was refactored, and Python tests/docs/examples were updated around the new paths.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions as GitHub Actions
  participant DocusaurusConfig as docusaurus.config.js
  participant DocsSite as Docusaurus site
  participant PagesDeploy as GitHub Pages deploy
  GitHubActions->>DocusaurusConfig: build config and sidebar
  DocusaurusConfig->>DocsSite: route docs, examples, tutorials
  GitHubActions->>PagesDeploy: upload build artifact
  PagesDeploy->>DocsSite: publish site
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • Rick-29
  • theshadow76

Poem

🐇 A changelog hops from dusk to dawn,
New candles close, new watches spawn.
The docs take on a Docusaurus glow,
And Python learns a new backend to know.
With twitching ears, I cheer this run —
v0.2.12 leaps out in the sun.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using "Etc" instead of clearly describing the main change. Replace it with a concise, specific summary of the primary change, such as the candle compilation and connection-handling updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the library to version 0.2.12, introducing UTC-aligned candle compilation from raw 1-second ticks, adding a NoCaptchaAI login backend, transitioning wait primitives in Signals to tokio::sync::watch to prevent race conditions, and resolving several memory leaks and module lifecycle hangs. Feedback on these changes highlights several critical issues: a timezone conversion bug in the Python wrapper's open_pending_order that uses local time instead of UTC; an O(N) performance bottleneck in prune_latest_ticks that should be optimized to target only the active symbol; a logic bug in trades.rs where non-deterministic HashMap key iteration breaks FIFO matching for failed trades; a graceful shutdown bug in pocket_client.rs caused by aborting the runner task prematurely; and a silent error-handling issue in the UniFFI client when parsing invalid URLs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread python/BinaryOptionsToolsV2/pocketoption/asynchronous.py
Comment thread crates/binary_options_tools/src/pocketoption/modules/get_candles.rs
Comment thread crates/binary_options_tools/src/pocketoption/modules/get_candles.rs
Comment thread crates/binary_options_tools/src/pocketoption/modules/get_candles.rs
Comment thread crates/binary_options_tools/src/pocketoption/modules/trades.rs
Comment thread crates/bindings_uniffi/src/platforms/pocketoption/client.rs
Comment thread crates/binary_options_tools/src/pocketoption/pocket_client.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 20

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs (1)

454-477: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep single-cancel and batch-cancel success types branch-specific.

cancel_pending_order() only accepts CancelSuccess, while cancel_pending_orders() only accepts BatchCancelSuccess. This mapper can emit the opposite variant (BatchSuccess in the single branch, SingleSuccess/Placeholder in the batch branch), which sends the handle into its unexpected-response timeout path. The queued _ticket/_tickets are also discarded, so placeholder payloads cannot be rewritten into the right shape.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs`
around lines 454 - 477, The cancel response mapping in
pending_trades::handle_message is mixing single and batch cancel result shapes,
causing cancel_pending_order() and cancel_pending_orders() to receive the wrong
CommandResponse variants. Update the matching logic for the
"successcancelPendingOrder"/"failcancelPendingOrder" and
"successcancelPendingOrders"/"failcancelPendingOrders" branches so each one
emits only its own branch-specific success type, using the queued ticket(s) to
populate any placeholder response correctly instead of discarding them. Keep the
response construction aligned with CancelServerResponse and CommandResponse so
single-cancel never produces BatchCancelSuccess and batch-cancel never produces
CancelSuccess.
🧹 Nitpick comments (7)
tests/python/test_pocketoption.py (1)

16-35: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Always close the sync client on failing assertions.

api.close() only runs on the success path here. If any assertion fails first, the sync wrapper’s background loop/thread stays alive and can bleed into later tests. Use with PocketOption(ssid) as api: (or a finally) so teardown is unconditional.

Suggested change
 def test_sync_connection_basic(ssid):
     """Test synchronous connection and basic info retrieval."""
     try:
-        api = PocketOption(ssid)
-
-        # Test basic properties
-        assert api.is_demo() is True
-
-        # Test balance (should be positive for a real demo account)
-        balance = api.balance()
-        assert float(balance) >= 0
-
-        # Test server time
-        server_time = api.server_time()
-        assert server_time > 0
-
-        api.close()
+        with PocketOption(ssid) as api:
+            # Test basic properties
+            assert api.is_demo() is True
+
+            # Test balance (should be positive for a real demo account)
+            balance = api.balance()
+            assert float(balance) >= 0
+
+            # Test server time
+            server_time = api.server_time()
+            assert server_time > 0
     except Exception as e:
         if "Authentication rejected" in str(e) or "swap-ssid" in ssid:
             pytest.skip(f"Skipping test: No valid credentials provided. Error: {e}")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/python/test_pocketoption.py` around lines 16 - 35, The test in
PocketOption currently closes the client only on the success path, so failing
assertions can leave the sync wrapper background loop/thread running. Update the
test to ensure unconditional teardown by using the PocketOption context manager
in place of the manual open/close pattern, or move api.close() into a finally
block around the existing assertions in test_pocketoption. Keep the existing
exception handling for authentication skips, but make sure cleanup always runs
even when assert is_demo, balance(), or server_time() fails.
crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs (3)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Narrow the lint allowance further if possible.

Replacing #![allow(warnings)] with specific allowances is good. Consider also removing this blanket attribute and fixing the underlying warnings, since AGENTS.md now requires "no warnings allowed in the final code."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs`
at line 1, The crate-level allowance is too broad in pending_trades_tests.rs, so
narrow it down further or remove it entirely if the warnings can be fixed.
Review the imports, variables, and test helpers in the pending_trades_tests
module and eliminate the underlying unused code instead of relying on the
blanket attributes; if any allowances remain necessary, keep only the specific
ones tied to the symbols causing warnings.

142-144: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Pre-existing pattern: module_task.abort() without awaiting cleanup.

Multiple tests abort the module task without awaiting its completion. This can leave channels and state in an inconsistent state, potentially causing resource leaks or panics in subsequent test runs depending on drop order. Consider let _ = module_task.await; after abort, or use a graceful shutdown signal.

This is a pre-existing issue not introduced by this diff.

Also applies to: 198-198, 223-225, 272-272, 300-300, 362-362, 462-464, 539-541, 591-593, 635-637, 706-708, 792-794, 882-884, 955-957, 1026-1028, 1101-1103

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs`
around lines 142 - 144, Multiple tests in pending_trades_tests abort the spawned
module task without waiting for it to finish, which can leave cleanup
incomplete. Update each test that creates module_task with tokio::spawn and
later calls module_task.abort() to also await the task afterward, or replace the
abort flow with a graceful shutdown path so the module can exit cleanly. Apply
this consistently across the affected test cases in pending_trades_tests,
keeping the fix near the module_task and module.run() setup/teardown.

128-129: 🩺 Stability & Availability | 🔵 Trivial | ⚖️ Poor tradeoff

Pre-existing pattern: sleep-based synchronization is fragile.

Multiple tests use tokio::time::sleep(Duration::from_millis(10)) between sending a command and sending the corresponding message (e.g., lines 168, 248, 318, 483, 661, 730, 897, 969, 1042, 1117). This is a race condition: if the module task hasn't reached the await point, the message may arrive before the module is ready to receive it. Consider replacing with explicit synchronization (e.g., tokio::sync::Barrier or awaiting an internal state signal).

This is a pre-existing issue not introduced by this diff; no action required unless modifying these tests.

Also applies to: 208-210, 289-289, 447-449, 523-526, 619-622, 690-693, 867-869, 940-942, 1011-1013, 1086-1088

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs`
around lines 128 - 129, No code change is required for this diff because the
sleep-based synchronization issue is pre-existing and not introduced by the
ws_rx_clone / tokio::spawn test setup. If you do touch these
pending_trades_tests cases later, replace the repeated
tokio::time::sleep(Duration::from_millis(10)) handoffs with explicit
synchronization in the affected test helpers and flows so the command/message
ordering is coordinated deterministically.
.github/ISSUE_TEMPLATE/feature_request.md (1)

20-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Don't hardcode Python in the API example block.

The project exposes Rust and Python surfaces, so a fixed python fence nudges reporters toward the wrong API for core or bindings requests. A neutral fence, or a prompt to pick the relevant language, keeps the template usable across the repo.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/ISSUE_TEMPLATE/feature_request.md around lines 20 - 26, The
API/Usage Example section currently hardcodes a Python code fence, which biases
the template toward one surface; update the feature request template so the
example block uses a neutral language fence or prompts the reporter to choose
the relevant language for the request. Adjust the markdown in the Proposed API /
Usage Example section to keep it applicable to both Rust and Python surfaces.
.github/ISSUE_TEMPLATE/question.md (1)

16-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the environment section language-agnostic.

This repo accepts support questions for the Rust crates too, but the template now only asks for Python-specific version info. Adding a generic runtime/toolchain field or explicit Rust/Cargo versions will make non-Python reports much easier to reproduce.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/ISSUE_TEMPLATE/question.md around lines 16 - 20, The issue is that
the question template’s Environment Details section is Python-specific and does
not capture Rust crate support details. Update the environment section in the
issue template to be language-agnostic by replacing or supplementing the Python
Version field with a generic runtime/toolchain field and/or explicit Rust/Cargo
version fields, so support questions for the Rust crates can be reproduced. Keep
the existing Environment Details block and adjust its labels to cover both
Python and Rust contexts.
crates/binary_options_tools/src/pocketoption/pocket_client.rs (1)

1-2: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the deprecation suppression to the compatibility shim.

#![allow(deprecated)] hides new deprecation warnings for the whole module. Since history() is just a compatibility alias now, switch internal callers like subscribe_with_history() to candles() and keep any allow(deprecated) as narrow as possible.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/binary_options_tools/src/pocketoption/pocket_client.rs` around lines 1
- 2, The module-wide deprecation suppression is too broad; narrow it so only the
compatibility shim uses it. Update internal callers in pocket_client.rs,
especially subscribe_with_history(), to use candles() instead of history(), and
keep any allow(deprecated) attribute scoped only to the history() alias or the
smallest possible item rather than the whole module.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/CI.yml:
- Line 57: The non-deploy jobs are using the default checkout behavior, which
leaves persisted credentials available to later steps; update each affected
checkout invocation in CI.yml (the Linux, macOS, sdist, and release jobs) to
match the hardened Windows job by disabling persisted checkout credentials in
the actions/checkout setup. Use the existing checkout step as the anchor and
ensure the same no-persist-credentials setting is applied consistently across
those job definitions.

In @.gitignore:
- Around line 90-92: The `.gitignore` entry for `tests/login_test.txt` is
ineffective because the file is already tracked; update the change so the
sensitive file is removed from source control rather than just ignored, and keep
the ignore rule only for future untracked additions. Locate the tracked
test-data entries in the `.gitignore` diff and make sure the
`tests/login_test.txt` content is deleted from the repository history/state for
this PR, with any required secret rotation handled separately.

In `@crates/binary_options_tools/src/pocketoption/candle.rs`:
- Line 724: The compiled candles are being emitted as unfinished because
`compile_candles_from_ticks()` currently sets `is_closed` to false even for
buckets that are already finalized. Update the candle construction in
`candle.rs` so the emitted candle from `compile_candles_from_ticks()` is marked
closed when it has been fully compiled, and only keep the trailing in-progress
candle open if that behavior is still intended; use the
`compile_candles_from_ticks` flow and the candle struct field assignment to
locate the change.

In `@crates/binary_options_tools/src/pocketoption/modules/historical_data.rs`:
- Around line 514-521: The Drop implementation for HistoricalDataApiModule is
silently discarding the only Shutdown signal when
command_responder.as_sync().try_send fails, which can leave a pending
historical-data request stuck forever. Update the drop path to use a guaranteed
wake-up mechanism for the pending_request cleanup instead of a best-effort send,
and make sure the req_id from pending_request always reaches the responder even
when the channel is full.

In `@crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs`:
- Around line 346-348: The pending-order response handling in `PendingTrades` is
reassigning the queued `req_id` too early, so `openPendingOrder` success
responses can complete the wrong caller when responses arrive out of order.
Update the correlation logic in the `pending_open_requests` flow and the
handlers around `open_pending_order()`, `successopenPendingOrder`, and the
related cancel/multiple request paths so the original response `req_id` is
validated against the queued request before attaching the caller’s `req_id`, and
only then is the request completed or retried.

In `@crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs`:
- Around line 904-907: The explicit unsubscribe path in `unsubscribe()` still
leaves `self.sender` intact, so `Drop` can send a second unsubscribe for the
same `subscription_id`. Update the `Subscription`/`Subscriptions` state so a
successful manual `unsubscribe()` marks the stream as already cleaned up, and
make the `Drop` cleanup check that flag before sending. Use the existing
`unsubscribe`, `Drop`, `sender`, and `subscription_id` logic to ensure only one
unsubscribe is ever emitted.
- Around line 567-573: The SubscriptionSuccess send failure path in
SubscriptionsApiModule::handle_subscription must roll back the already-created
subscription instead of only logging the error. In the `if let Err(e) =
self.command_responder.send(CommandResponse::SubscriptionSuccess { ... }).await`
branch, clean up `subscription_id` by removing the inserted subscription and
undoing any associated state so it no longer counts toward `max_subscriptions`.
Reuse the existing subscription-tracking logic in the surrounding subscription
flow to ensure the rollback happens only for this delivery failure.

In `@crates/binary_options_tools/src/pocketoption/modules/trades.rs`:
- Around line 138-147: The failure-matching logic in `trades.rs` is now
selecting an arbitrary `HashMap` entry for identical `(asset, amount)` trades,
which can route `failopenOrder` to the wrong `req_id`; restore an ordered
secondary index keyed by `(asset, amount) -> VecDeque<Uuid>` and use it to
assign failures FIFO. Update the `failure_matching` handling and the related
success/send-failure paths in the matching flow (including the code around
`open_order`/failure resolution) so specific UUIDs are removed from the queue
when a request completes, instead of searching the triple-key map for a first
match.

In `@crates/binary_options_tools/src/pocketoption/pocket_client.rs`:
- Around line 191-197: The timeout branch in PocketClient initialization is
leaving the spawned runner detached; update the error path in the
`new_with_url()` flow around `tokio::spawn(...)` and `client.wait_connected()`
so the runner is explicitly aborted before returning the `PocketError::General`
timeout. Use the `JoinHandle` from the spawn, and in the `Err(_)` arm of the
`tokio::time::timeout` match ensure the background task is stopped before
exiting.
- Around line 886-887: The `candles` method is multiplying public input with
`1000 * period` before `compile_candles` can validate it, which can overflow and
panic or wrap. Update `PocketClient::candles` to guard this calculation by using
a checked/saturating conversion to the lookback window and return an error when
`period` is too large, keeping the fix local to `candles` and aligned with
`compile_candles`.

In `@crates/bindings_uniffi/src/platforms/pocketoption/client.rs`:
- Around line 458-464: The `active_assets` method in `PocketOptionClient` is
collapsing the core client’s optional “not loaded yet” state into an empty list
via `unwrap_or_default()`, so UniFFI callers can’t distinguish loading from no
assets. Update `active_assets()` to preserve the absence case from
`inner.active_assets().await` instead of always returning `Ok(Vec<Asset>)`, and
keep the conversion path that maps loaded assets through `Asset::from` only when
the inner value is present.
- Around line 506-508: The wait_for_assets method currently passes timeout_secs
directly into StdDuration::from_secs_f64, which can panic for invalid values.
Update client.rs in wait_for_assets to validate the timeout first by using
StdDuration::try_from_secs_f64 or an equivalent check, and convert any failure
into a UniError::General return instead of calling the inner wait_for_assets
with an invalid duration.
- Around line 522-525: The URL filtering in new_with_config currently silently
drops malformed entries via url::Url::parse(...).ok(), which can change the
caller’s intended fallback set. Update the parsing path in the new_with_config
flow to validate every supplied URL and return an error as soon as any entry is
malformed instead of collecting only the valid ones; use the existing URL
parsing logic around parsed_urls to locate and adjust this behavior.

In `@crates/bindings_uniffi/src/tracing.rs`:
- Around line 5-8: `init_tracing` in tracing.rs currently uses
`tracing_subscriber::fmt().init()`, which can panic if tracing is initialized
more than once. Make this startup path idempotent by switching to `try_init()`
and ignoring the already-initialized case, or by guarding the setup with
`OnceLock`/equivalent so repeated calls to `init_tracing` remain harmless.

In `@crates/core/src/client.rs`:
- Around line 455-469: The Runner callback block is treating every successful
socket open the same, so connect-only and reconnect-only side effects are no
longer separated. Update the logic in the Runner path around the on_connect and
on_reconnect callback calls to distinguish the first successful connection from
later reconnects, using the existing connection state in client.rs. Keep
on_connect limited to the initial cold start and invoke on_reconnect only after
a true reconnect, preserving the current callback signatures and warning logs.

In `@crates/core/src/rules.rs`:
- Around line 440-450: The `RuleBuilder::regex` method currently takes `self`
but never uses it, and it rebuilds a fresh `Rule::Matcher` with empty
`conditions`, which drops any prior builder state. Update `regex` to either
behave like a true constructor, matching `text_regex` by removing `self`, or, if
it must stay as an instance method, preserve the existing `self.inner` and its
conditions when attaching the `Matcher::Text(TextMatcher::Regex(...))`. Keep the
fix localized to `regex` and align its behavior with the other `RuleBuilder`
methods.

In `@crates/core/src/signals.rs`:
- Around line 31-45: The wait_connected and wait_disconnected methods in Signals
only await a single watch update, so they can return before the requested state
is actually reached. Update both methods to loop on the cloned
connected_receiver and re-check the predicate after each rx.changed().await
until *rx.borrow() is true for wait_connected and false for wait_disconnected.

In `@python/BinaryOptionsToolsV2/pocketoption/synchronous.py`:
- Around line 127-131: The Synchronous constructor is incorrectly registering
the background loop on the caller thread before starting it, which can leave the
caller bound to a loop owned by another thread and later a closed loop after
close(). Update the event-loop setup in synchronous.py so asyncio.set_event_loop
is called inside the worker thread that runs self._loop.run_forever, and keep
the constructor thread free of loop registration.
- Around line 565-567: The synchronous `shutdown()` method in
`SynchronousBinaryOptionsToolsV2` only stops the async client and leaves the
wrapper’s event loop/thread alive. Update `shutdown()` to delegate to `close()`
(or perform `_cleanup_loop()` under the same lock used by the wrapper) so the
public shutdown path fully releases resources. Reference the `shutdown()`,
`close()`, and `_cleanup_loop()` methods in `synchronous.py` when making the
change.

In `@tests/login_test.txt`:
- Around line 4-9: The raw login request fixture has an incorrect Content-Length
header, which will cause HTTP/1.1 replay to hang waiting for nonexistent body
bytes. Update the request in login_test.txt so the advertised Content-Length
matches the actual serialized form body for the email/password payload, keeping
the body and header consistent.

---

Outside diff comments:
In `@crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs`:
- Around line 454-477: The cancel response mapping in
pending_trades::handle_message is mixing single and batch cancel result shapes,
causing cancel_pending_order() and cancel_pending_orders() to receive the wrong
CommandResponse variants. Update the matching logic for the
"successcancelPendingOrder"/"failcancelPendingOrder" and
"successcancelPendingOrders"/"failcancelPendingOrders" branches so each one
emits only its own branch-specific success type, using the queued ticket(s) to
populate any placeholder response correctly instead of discarding them. Keep the
response construction aligned with CancelServerResponse and CommandResponse so
single-cancel never produces BatchCancelSuccess and batch-cancel never produces
CancelSuccess.

---

Nitpick comments:
In @.github/ISSUE_TEMPLATE/feature_request.md:
- Around line 20-26: The API/Usage Example section currently hardcodes a Python
code fence, which biases the template toward one surface; update the feature
request template so the example block uses a neutral language fence or prompts
the reporter to choose the relevant language for the request. Adjust the
markdown in the Proposed API / Usage Example section to keep it applicable to
both Rust and Python surfaces.

In @.github/ISSUE_TEMPLATE/question.md:
- Around line 16-20: The issue is that the question template’s Environment
Details section is Python-specific and does not capture Rust crate support
details. Update the environment section in the issue template to be
language-agnostic by replacing or supplementing the Python Version field with a
generic runtime/toolchain field and/or explicit Rust/Cargo version fields, so
support questions for the Rust crates can be reproduced. Keep the existing
Environment Details block and adjust its labels to cover both Python and Rust
contexts.

In
`@crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs`:
- Line 1: The crate-level allowance is too broad in pending_trades_tests.rs, so
narrow it down further or remove it entirely if the warnings can be fixed.
Review the imports, variables, and test helpers in the pending_trades_tests
module and eliminate the underlying unused code instead of relying on the
blanket attributes; if any allowances remain necessary, keep only the specific
ones tied to the symbols causing warnings.
- Around line 142-144: Multiple tests in pending_trades_tests abort the spawned
module task without waiting for it to finish, which can leave cleanup
incomplete. Update each test that creates module_task with tokio::spawn and
later calls module_task.abort() to also await the task afterward, or replace the
abort flow with a graceful shutdown path so the module can exit cleanly. Apply
this consistently across the affected test cases in pending_trades_tests,
keeping the fix near the module_task and module.run() setup/teardown.
- Around line 128-129: No code change is required for this diff because the
sleep-based synchronization issue is pre-existing and not introduced by the
ws_rx_clone / tokio::spawn test setup. If you do touch these
pending_trades_tests cases later, replace the repeated
tokio::time::sleep(Duration::from_millis(10)) handoffs with explicit
synchronization in the affected test helpers and flows so the command/message
ordering is coordinated deterministically.

In `@crates/binary_options_tools/src/pocketoption/pocket_client.rs`:
- Around line 1-2: The module-wide deprecation suppression is too broad; narrow
it so only the compatibility shim uses it. Update internal callers in
pocket_client.rs, especially subscribe_with_history(), to use candles() instead
of history(), and keep any allow(deprecated) attribute scoped only to the
history() alias or the smallest possible item rather than the whole module.

In `@tests/python/test_pocketoption.py`:
- Around line 16-35: The test in PocketOption currently closes the client only
on the success path, so failing assertions can leave the sync wrapper background
loop/thread running. Update the test to ensure unconditional teardown by using
the PocketOption context manager in place of the manual open/close pattern, or
move api.close() into a finally block around the existing assertions in
test_pocketoption. Keep the existing exception handling for authentication
skips, but make sure cleanup always runs even when assert is_demo, balance(), or
server_time() fails.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de51bc12-3310-4fa2-b401-bac286c3c5ae

📥 Commits

Reviewing files that changed from the base of the PR and between d31cfba and dfd43f7.

📒 Files selected for processing (116)
  • .github/FUNDING.yml
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/ISSUE_TEMPLATE/documentation.md
  • .github/ISSUE_TEMPLATE/feature_request.md
  • .github/ISSUE_TEMPLATE/question.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/dependabot.yml
  • .github/workflows/CI.yml
  • .gitignore
  • CHANGELOG.md
  • Cargo.toml
  • README.md
  • agents/AGENTS.md
  • agents/guidelines.md
  • agents/product.md
  • agents/tech-stack.md
  • codemap.md
  • crates/binary_options_tools/Cargo.toml
  • crates/binary_options_tools/examples/pending_trades_example.rs
  • crates/binary_options_tools/src/pocketoption/candle.rs
  • crates/binary_options_tools/src/pocketoption/connect.rs
  • crates/binary_options_tools/src/pocketoption/error.rs
  • crates/binary_options_tools/src/pocketoption/modules/deals.rs
  • crates/binary_options_tools/src/pocketoption/modules/get_candles.rs
  • crates/binary_options_tools/src/pocketoption/modules/historical_data.rs
  • crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs
  • crates/binary_options_tools/src/pocketoption/modules/mod.rs
  • crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs
  • crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs
  • crates/binary_options_tools/src/pocketoption/modules/raw.rs
  • crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs
  • crates/binary_options_tools/src/pocketoption/modules/trades.rs
  • crates/binary_options_tools/src/pocketoption/modules/trades_tests/common.rs
  • crates/binary_options_tools/src/pocketoption/pocket_client.rs
  • crates/binary_options_tools/src/pocketoption/ssid.rs
  • crates/binary_options_tools/src/pocketoption/state.rs
  • crates/binary_options_tools/src/pocketoption/types.rs
  • crates/binary_options_tools/src/pocketoption/utils.rs
  • crates/binary_options_tools/tests/deals_module_cleanup.rs
  • crates/binary_options_tools/tests/pending_trades_cleanup.rs
  • crates/bindings_pyo3/Cargo.toml
  • crates/bindings_pyo3/src/error.rs
  • crates/bindings_pyo3/src/framework.rs
  • crates/bindings_pyo3/src/lib.rs
  • crates/bindings_pyo3/src/pocketoption.rs
  • crates/bindings_uniffi/Cargo.toml
  • crates/bindings_uniffi/bo2_macros/Cargo.toml
  • crates/bindings_uniffi/build.rs
  • crates/bindings_uniffi/src/error.rs
  • crates/bindings_uniffi/src/platforms/pocketoption/client.rs
  • crates/bindings_uniffi/src/platforms/pocketoption/raw_handler.rs
  • crates/bindings_uniffi/src/platforms/pocketoption/stream.rs
  • crates/bindings_uniffi/src/platforms/pocketoption/types.rs
  • crates/bindings_uniffi/src/platforms/pocketoption/validator.rs
  • crates/bindings_uniffi/src/test.rs
  • crates/bindings_uniffi/src/tracing.rs
  • crates/bindings_uniffi/src/utils.rs
  • crates/core/Cargo.toml
  • crates/core/README.md
  • crates/core/docs/testing-framework.md
  • crates/core/examples/basic_connector_usage.rs
  • crates/core/macros/Cargo.toml
  • crates/core/macros/src/modules/lightweight.rs
  • crates/core/macros/src/rule.rs
  • crates/core/src/client.rs
  • crates/core/src/message.rs
  • crates/core/src/middleware.rs
  • crates/core/src/rules.rs
  • crates/core/src/signals.rs
  • crates/core/tests/rule_macro_tests.rs
  • crates/core/tests/runner_command_tests.rs
  • crates/core/tests/stream_tests.rs
  • crates/core/tests/testing_wrapper_tests.rs
  • crates/core/tests/two_step_standalone.rs
  • crates/macros/Cargo.toml
  • crates/macros/examples/action_example.rs
  • crates/macros/readme.md
  • crates/macros/src/lib.rs
  • docker/macos/Dockerfile
  • docker/windows/Dockerfile
  • docs/api/reference.md
  • docs/architecture/structure.md
  • docs/tutorials/scripts/SSID_Fetcher_UserScript.user.js
  • examples/python/async/login_with_email_and_password.py
  • examples/python/async/test_pending_orders.py
  • examples/python/backtest_example.py
  • examples/python/sync/login_with_email_and_password.py
  • package.json
  • python/BinaryOptionsToolsV2/__init__.py
  • python/BinaryOptionsToolsV2/pocketoption/__init__.py
  • python/BinaryOptionsToolsV2/pocketoption/asynchronous.py
  • python/BinaryOptionsToolsV2/pocketoption/synchronous.py
  • python/BinaryOptionsToolsV2/pocketoption/tools/login.py
  • python/BinaryOptionsToolsV2/validator.py
  • python/README.md
  • python/pyproject.toml
  • tests/conftest.py
  • tests/login_test.txt
  • tests/python/core/test_basic.py
  • tests/python/core/test_config.py
  • tests/python/core/test_validator.py
  • tests/python/pocketoption/test_async_mocked.py
  • tests/python/pocketoption/test_asynchronous.py
  • tests/python/pocketoption/test_demo_ssid.py
  • tests/python/pocketoption/test_login.py
  • tests/python/pocketoption/test_raw_handler.py
  • tests/python/pocketoption/test_sync_mocked.py
  • tests/python/pocketoption/test_synchronous.py
  • tests/python/test_pocketoption.py
  • tests/python/tracing/test_tracing.py
  • tests/rust/Cargo.toml
  • tests/rust/comprehensive_pocketoption_tests.rs
  • tests/rust/pocketoption_client_tests.rs
  • tests/rust/raw_module_tests.rs
  • tests/rust/validator_tests.rs
💤 Files with no reviewable changes (15)
  • docker/windows/Dockerfile
  • agents/product.md
  • agents/tech-stack.md
  • crates/macros/readme.md
  • examples/python/backtest_example.py
  • agents/guidelines.md
  • tests/rust/pocketoption_client_tests.rs
  • tests/rust/raw_module_tests.rs
  • crates/core/macros/src/modules/lightweight.rs
  • tests/rust/validator_tests.rs
  • crates/binary_options_tools/src/pocketoption/modules/mod.rs
  • crates/bindings_uniffi/src/platforms/pocketoption/raw_handler.rs
  • crates/macros/examples/action_example.rs
  • crates/core/examples/basic_connector_usage.rs
  • crates/macros/src/lib.rs

Comment thread .github/workflows/CI.yml
Comment thread .gitignore
Comment thread crates/binary_options_tools/src/pocketoption/candle.rs
Comment thread crates/core/src/rules.rs Outdated
Comment thread crates/core/src/signals.rs
Comment thread python/BinaryOptionsToolsV2/pocketoption/synchronous.py
Comment thread python/BinaryOptionsToolsV2/pocketoption/synchronous.py
Comment thread tests/login_test.txt Outdated
dependabot Bot and others added 3 commits June 30, 2026 13:23
Updates the requirements on [uniffi](https://github.com/mozilla/uniffi-rs) to permit the latest version.
- [Changelog](https://github.com/mozilla/uniffi-rs/blob/v0.32.0/CHANGELOG.md)
- [Commits](mozilla/uniffi-rs@v0.31.1...v0.32.0)

---
updated-dependencies:
- dependency-name: uniffi
  dependency-version: 0.32.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Update uniffi requirement from 0.31.1 to 0.32.0
@sixtysixx sixtysixx reopened this Jun 30, 2026
sixtysixx and others added 3 commits June 30, 2026 07:26
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.0 to 7.0.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4.4.0...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@sixtysixx sixtysixx marked this pull request as draft June 30, 2026 13:37
sixtysixx and others added 4 commits June 30, 2026 10:21
- Created a new sidebar configuration file (sidebars.js) to structure documentation navigation.
- Added categories for API Reference, Examples, Guides, Architecture, Tutorials, and Project Info.
- Introduced custom CSS (custom.css) for global styles, including typography, hero section, feature cards, navigation, footer, and custom scrollbar.
- Enhanced dark mode styles for various components.
…ns/upload-artifact-7.0.1

Bump actions/upload-artifact from 4.4.0 to 7.0.1
@sixtysixx sixtysixx marked this pull request as ready for review June 30, 2026 17:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

🧹 Nitpick comments (24)
docs/intro.md (1)

68-68: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/intro.md` at line 68, The markdown document is missing a required
trailing newline, which triggers the MD047 lint issue. Update the end of the
file so it terminates with a newline character, keeping the existing content
unchanged and ensuring the final paragraph in the document ends cleanly.
docs/architecture/dataflow.md (2)

60-60: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/dataflow.md` at line 60, The docs entry for
pocket_client.rs is missing a trailing newline, so update the dataflow markdown
content to end the file cleanly with a final newline character. Locate the
`pocket_client.rs` bullet in the architecture dataflow document and ensure the
file terminates with one newline at the end of the last line.

43-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Empty section placeholders reduce documentation utility.

Four section headings ("ClientBuilder...", "Inbound message flow...", "Outbound message flow...", "Reconnect flow...") have no content. If Mermaid diagrams were removed intentionally, either add prose replacements or remove the headings to avoid confusing readers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/dataflow.md` around lines 43 - 49, Remove the empty
placeholder sections in dataflow.md: the ClientBuilder/Runner/module
registration, Inbound message flow, Outbound message flow, and Reconnect flow
headings currently have no content. Either add the intended prose or diagram
replacement under each heading, or delete the headings entirely so the document
does not present empty sections.
docs/tutorials/index.md (1)

70-70: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/tutorials/index.md` at line 70, The markdown file is missing a trailing
newline, which triggers the MD047 check. Update the end of the document so the
final line in the tutorials index is followed by a newline character; no content
changes are needed, just ensure the file ends cleanly.
docs/OVERVIEW.md (1)

72-72: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (MD047). This is a trivial fix that improves file compatibility with Unix tools and editors.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/OVERVIEW.md` at line 72, The markdown file is missing a trailing newline
at the end of the document, which triggers the MD047 formatting issue. Update
the final line in the document so it ends with a newline character; this is a
simple file-ending fix and does not require any content changes.
docs/examples/swift/index.md (2)

43-45: 🎯 Functional Correctness | 🔵 Trivial | ⚖️ Poor tradeoff

Same concern as Rust docs: fixed sleep is fragile.

The 5-second Task.sleep is marked as "Critical!" but is not a robust synchronization mechanism. If a proper readiness API exists, document it; otherwise note this as a known limitation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/swift/index.md` around lines 43 - 45, The Swift example uses a
fixed Task.sleep as a synchronization step, which is fragile and should not be
presented as a reliable readiness mechanism. Update the PocketOption
initialization example in the Swift docs to either document the proper
readiness/polling API if one exists, or explicitly label the sleep-based
approach as a known limitation/workaround rather than “Critical!”; keep the
guidance aligned with the same concern in the Rust docs.

49-49: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/swift/index.md` at line 49, The Swift examples note in the
markdown is missing a trailing newline, so update the content in the
docs/examples/swift index entry to ensure the file ends with a newline
character. Locate the markdown text referencing BinaryOptionsToolsUni/out/swift
and make sure the final line is properly terminated.
docs/examples/rust/index.md (2)

176-176: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/rust/index.md` at line 176, The markdown example file is
missing the required trailing newline, so update the document end to ensure it
terminates with a newline character. Locate the final content in the Rust
examples index and make sure the file ends cleanly after the last sentence.

139-144: 🎯 Functional Correctness | 🔵 Trivial | ⚖️ Poor tradeoff

Document why fixed sleep is needed instead of proper synchronization.

The "Critical!" 5-second sleep is a fragile pattern. If the library has a proper connection-ready notification (e.g., api.wait_for_connect().await), document that instead. If not, consider this for a future API improvement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/rust/index.md` around lines 139 - 144, Update the Rust example
in the docs to avoid presenting the fixed 5-second sleep as the recommended
connection strategy; in the example section around PocketOption::new, explain
why synchronization is needed and prefer any existing readiness API such as
wait_for_connect() if available. If no such API exists, reword the note to
clearly mark the sleep as a temporary workaround and mention it as a future API
improvement rather than a required pattern.
docs/architecture/raw-module.md (3)

223-223: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/raw-module.md` at line 223, The markdown file is missing a
trailing newline, which triggers the MD047 lint rule. Update the document so it
ends with a newline character after the final content in the raw-module markdown
file; no other content changes are needed.

63-78: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Fix heading spacing for proper Markdown rendering.

Multiple ### headings in the API Sketch section are directly followed by content without blank lines (MD022). Add blank lines after headings to ensure consistent rendering across Markdown parsers.

📝 Proposed spacing fix
 ### PocketOption
+
 - `raw_handle()` → `RawHandle`
 - `create_raw_handler(validator, keep_alive)` → `RawHandler`
 
 ### RawHandle
+
 - `create(validator, keep_alive)` → `RawHandler`
 - `remove(id)` → `bool`
 
 ### RawHandler
+
 - `id()` → `Uuid`
 - `send_text(text)`
 - `send_binary(bytes)`
 - `send_and_wait(msg)` → next matching `Message`
 - `wait_next()` → next matching `Message`
 - `subscribe()` → `AsyncReceiver<Message>`
 - **Drop**: auto-remove validator and stream
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/raw-module.md` around lines 63 - 78, The API Sketch section
has Markdown heading spacing issues: the `### PocketOption`, `### RawHandle`,
and `### RawHandler` headings are followed immediately by list content without
blank lines. Update the `raw-module.md` section so each of these headings is
separated from the following content by a blank line, keeping the existing
symbols and list items intact.

137-183: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix heading and fence spacing throughout Validator Types and Use Cases sections.

Multiple heading and fence blocks lack surrounding blank lines (MD022, MD031), which can cause rendering issues in strict Markdown parsers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/raw-module.md` around lines 137 - 183, Fix the Markdown
spacing in the Validator Types and Use Cases sections by adding the missing
blank lines around headings and fenced code blocks to satisfy MD022 and MD031.
Update the affected content in the raw-module documentation so each heading is
separated by blank lines from surrounding text, and each code fence in the
use-case examples has the required blank line before and after it.
docs/examples/kotlin/index.md (1)

48-48: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (markdownlint MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/kotlin/index.md` at line 48, The markdown example file is
missing a trailing newline, which triggers markdownlint MD047. Update the file
content so it ends with a final newline character, keeping the existing Markdown
structure unchanged.
docs/examples/python/async/index.md (1)

410-410: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (markdownlint MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/python/async/index.md` at line 410, The markdown example file
is missing a trailing newline, which triggers MD047. Update the document so it
ends with a single newline character; this is just a formatting fix and does not
require any content changes.
docs/examples/index.md (1)

105-105: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (markdownlint MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/index.md` at line 105, The markdown file is missing a trailing
newline, which triggers markdownlint MD047. Update the end of the document in
the affected example content so it terminates with a single newline; this is a
formatting-only fix and no code symbols need to change.
docs/architecture/structure.md (1)

191-191: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (markdownlint MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/structure.md` at line 191, The markdown file is missing a
trailing newline, triggering MD047. Update the affected document so it ends with
a final newline character; this is a formatting-only fix in the content around
the “Examples serve as functional tests” section.
docs/examples/javascript/index.md (2)

169-171: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Align trade result method naming across bindings.

JavaScript uses api.result(trade.id) while Python uses api.check_win(trade.id). This cross-language inconsistency complicates the mental model for users switching between languages. Consider aligning these method names.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/javascript/index.md` around lines 169 - 171, The trade result
API naming is inconsistent across bindings, with JavaScript using
api.result(trade.id) while Python uses api.check_win(trade.id). Update the
JavaScript example to use the same method naming convention as the other
bindings, and make sure the referenced call in the example stays aligned with
the underlying API method so users see a consistent cross-language mental model.

311-311: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (markdownlint MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/javascript/index.md` at line 311, The markdown example content
is missing a trailing newline, which triggers the MD047 lint rule. Update the
end of the file so the final line in the examples section is followed by a
newline, preserving the existing text and ensuring the file ends cleanly.
docs/examples/python/sync/index.md (1)

298-298: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (markdownlint MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/python/sync/index.md` at line 298, The markdown file is missing
a trailing newline, which triggers MD047. Update the document so it ends with a
newline after the last line, keeping the existing content unchanged.
docs/examples/ruby/index.md (1)

55-55: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (markdownlint MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/ruby/index.md` at line 55, The markdown example file is missing
a trailing newline, which triggers MD047. Update the end of
docs/examples/ruby/index.md so it ends with a single newline character; no
content changes are needed.
docs/examples/go/index.md (1)

55-55: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add trailing newline.

File is missing a trailing newline (markdownlint MD047).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/go/index.md` at line 55, The markdown example file is missing a
trailing newline, causing the MD047 lint failure. Update the end of the document
so it terminates with a newline character, keeping the content unchanged; this
is a simple formatting fix in the docs/examples/go/index.md markdown example.
.github/workflows/deploy.yml (1)

8-11: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Scope pages: write / id-token: write to the deploy job.

The build job only needs contents: read; the elevated Pages and OIDC permissions are required solely by the deploy job. Move them down to job-level permissions to follow least privilege (per zizmor excessive-permissions).

🔒 Suggested scoping
 permissions:
   contents: read
-  pages: write
-  id-token: write
 
 concurrency:
   group: pages
   cancel-in-progress: false

 jobs:
   build:
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     steps:
@@
   deploy:
     needs: build
     runs-on: ubuntu-latest
+    permissions:
+      pages: write
+      id-token: write
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 8 - 11, The workflow permissions
are too broad at the top level: only the build job should keep contents: read,
while pages: write and id-token: write must be scoped to the deploy job. Update
the deploy workflow by moving the elevated permissions into the deploy job’s
job-level permissions block and keep the build job limited to contents: read.
Use the existing build and deploy job definitions in deploy.yml to place the
permissions where they belong.

Source: Linters/SAST tools

src/css/custom.css (1)

9-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Resolve Stylelint errors (import-notation, value-keyword-case).

Stylelint flags these as errors, which can fail the lint step: line 9 expects the plain-string @import notation (drop url(...)), and the generic font keywords on lines 21–22 should be lowercase (blinkmacsystemfont, roboto, oxygen, ubuntu, cantarell, menlo, monaco, consolas).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/css/custom.css` around lines 9 - 22, Stylelint is failing on the Google
Fonts import and the font-family keywords in custom.css. Update the top-level
`@import` in the stylesheet to use the plain-string import notation instead of
url(...), and lower-case the generic font keywords in the :root font stack
entries for --ifm-font-family-base and --ifm-font-family-monospace. Keep the
existing font lists and only adjust the notation/casing so the stylesheet passes
import-notation and value-keyword-case.

Source: Linters/SAST tools

crates/binary_options_tools/src/pocketoption/candle.rs (1)

409-441: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reduce duplication between new_with_closed_status and TryFrom<(BaseCandle, String)>.

The per-field Decimal::from_f64(...).ok_or(...) conversion logic is now duplicated almost verbatim in both constructors. Consider having TryFrom delegate to new_with_closed_status (passing false) to keep a single conversion path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/binary_options_tools/src/pocketoption/candle.rs` around lines 409 -
441, The conversion logic for building a Candle is duplicated between
new_with_closed_status and TryFrom<(BaseCandle, String)>; consolidate it into a
single path. Update the TryFrom implementation to delegate to
new_with_closed_status with is_closed set to false, and keep the
Decimal::from_f64 validation and BinaryOptionsError handling only in
new_with_closed_status so all field conversions stay consistent in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/CI.yml:
- Around line 37-42: The Deploy step in the CI workflow uses an outdated
peaceiris/actions-gh-pages version and should be updated from the current action
reference to a supported release, using the existing Deploy job in CI as the
locator. While updating that step, also account for the overlap with the
separate docs deployment workflow so only one Pages publishing path remains; if
deploy.yml already handles publishing, remove or disable this CI deploy step to
avoid duplicate Pages deploys.
- Line 259: The PyPI publish workflow currently disables metadata verification
via the verify-metadata setting, which bypasses twine check. Update the publish
job in the CI workflow to keep verify-metadata enabled, or if it must remain
disabled, add a separate metadata validation step before the publish step so
package metadata is still checked. Use the existing PyPI publish configuration
in the workflow to locate the change.

In @.github/workflows/deploy.yml:
- Around line 21-22: The Checkout step in the build job is leaving persisted Git
credentials available to later steps and third-party actions. Update the
actions/checkout usage in the deploy workflow to disable credential persistence
by setting persist-credentials to false on the Checkout step, using the existing
checkout action block as the place to fix it.
- Around line 1-47: The GitHub Pages setup is split between two deployment
paths, so align everything around the new `deploy-pages` workflow or the
branch-based `gh-pages` flow. Update the `deploy` job in `deploy.yml` together
with the CI workflow entry points that still publish `build/` to `gh-pages`, and
revise `docs/project/deployment.md` so the documented Pages configuration
matches the actual workflow used.

In `@docs/api/python.md`:
- Around line 142-144: The Python example is incorrectly treating
PocketOptionAsync as awaitable even though its constructor and is_demo() are
synchronous. Update the example so the client is created directly with
PocketOptionAsync(...) and then call client.is_demo() without await; keep the
warning/return logic in the same surrounding example block.

In `@docs/api/reference.md`:
- Around line 25-30: Update the Rust dependency snippet in the docs to match the
current crate version by changing the binary_options_tools entry from the old
0.1 series to 0.2. Keep the surrounding dependency examples unchanged, and make
sure the install instructions in reference.md align with the version used
elsewhere in the PR.

In `@docs/architecture/raw-module.md`:
- Line 143: Update the `regex()` documentation entry to reflect that
`RuleBuilder::regex()` now returns a `Result`, not a plain validator. In the
`regex(pattern)` section of the raw module docs, adjust the signature to
indicate `-> Result<Validator, Error>` or explicitly mention that invalid
patterns return an error, so readers understand the failure path when locating
`regex()` in the docs.
- Around line 93-95: The example import in the raw module docs uses the wrong
crate name, so update the snippet to use binary_options_tools instead of
binary_options_tools_pocketoption. Keep the same symbols (PocketOption,
Validator, Outgoing) but point them at the published crate name used in
Cargo.toml and the rest of the docs so the copy-paste example compiles.

In `@docs/architecture/structure.md`:
- Line 33: The repository layout diagram contains a typo in the workflows path,
showing repeated nested github directories. Update the structure entry for the
workflows folder in the markdown diagram so it uses the correct
.github/workflows/ path, and verify the surrounding repository tree entries
remain consistent.

In `@docs/examples/csharp/index.md`:
- Around line 25-36: The C# examples page has a naming mismatch between the run
commands and the example list: the commands in the examples section refer to
project files, while the listed items in the Examples section use source-file
names. Update the references in this page so they consistently point to the same
artifact type, using the identifiers shown in the markdown such as the Basic and
Balance example entries and the dotnet run commands.
- Around line 41-51: The C# snippet uses the wrong API surface and should match
the actual examples in the C# sample files. Update the example to use the same
library and entry points as the `PocketOption` examples (importing
`BinaryOptionsToolsUni`, creating the client with `PocketOption.NewAsync(...)`,
and keeping `client.BalanceAsync()`), and remove the outdated
`BinaryOptionsToolsV2`, `InitAsync`, and `ShutdownAsync` references so the docs
align with the real C# API.

In `@docs/examples/javascript/index.md`:
- Around line 56-58: The JavaScript example uses a longer initialization delay
than the Python and Go examples, so update the wait in the JavaScript docs
snippet to match the standardized connection stabilization time used elsewhere.
Adjust the delay in the example’s connection setup section so all language
examples are consistent and reference the same wait duration.

In `@docs/examples/rust/index.md`:
- Around line 49-50: The Rust example instructions are misleading because
basic.rs depends on external crates, so the standalone rustc command will fail.
Update the example in the docs index to either remove the rustc invocation or
replace it with a note clarifying that rustc only works for dependency-free
standalone files, and point readers to the appropriate cargo run --example usage
instead.
- Line 17: The Rust example dependency version is outdated; update the
binary_options_tools entry in the example so it matches the current release used
by the PR. Adjust the version string from the old 0.1 value to the current 0.2
series (or the exact 0.2.12 release) in the example snippet so users install the
correct package version.

In `@docs/examples/swift/index.md`:
- Line 48: The SwiftUI example link currently points to a generated output path
that does not exist in this project layout. Update the link in the docs example
to use the actual UniFFI output location from the BinaryOptionsToolsUni project
root, or make it relative to the build output so it resolves correctly; use the
docs/examples/swift/index.md link target as the reference point when adjusting
the path.

In `@docs/project/deployment.md`:
- Around line 36-40: The manual deployment steps reference an undefined npm
script, so update the deployment instructions to match the available package
scripts. Either add a real deploy script in package.json and ensure it invokes
the intended deployment command, or remove the npm run deploy step from the
deployment guide so the docs only mention valid commands like build and
docs:build. Use the existing deployment section in the docs and the package
scripts list as the source of truth.
- Around line 17-19: The deployment docs are inconsistent between the Pages
Source steps and the GitHub Actions workflow. Update the instructions in the
deployment setup section, and the repeated troubleshooting note, to match the
workflow used by the documented deploy job with actions/upload-pages-artifact
and actions/deploy-pages: set GitHub Pages Source to GitHub Actions instead of
Deploy from a branch/gh-pages root. Keep the wording aligned with the workflow
terms so readers follow one valid deployment path, and reference the deployment
setup and troubleshooting sections consistently.

In `@docusaurus.config.js`:
- Around line 151-159: The Algolia settings in the docusaurus.config.js
configuration are still using placeholder values, so the DocSearch widget will
not work as shipped. Update the algolia block in the Docusaurus config to read
real DocSearch credentials from environment/secret injection, or remove the
entire algolia configuration until search is provisioned. Make sure the appId,
apiKey, and externalUrlRegex values are no longer placeholder literals in the
Docusaurus config.

---

Nitpick comments:
In @.github/workflows/deploy.yml:
- Around line 8-11: The workflow permissions are too broad at the top level:
only the build job should keep contents: read, while pages: write and id-token:
write must be scoped to the deploy job. Update the deploy workflow by moving the
elevated permissions into the deploy job’s job-level permissions block and keep
the build job limited to contents: read. Use the existing build and deploy job
definitions in deploy.yml to place the permissions where they belong.

In `@crates/binary_options_tools/src/pocketoption/candle.rs`:
- Around line 409-441: The conversion logic for building a Candle is duplicated
between new_with_closed_status and TryFrom<(BaseCandle, String)>; consolidate it
into a single path. Update the TryFrom implementation to delegate to
new_with_closed_status with is_closed set to false, and keep the
Decimal::from_f64 validation and BinaryOptionsError handling only in
new_with_closed_status so all field conversions stay consistent in one place.

In `@docs/architecture/dataflow.md`:
- Line 60: The docs entry for pocket_client.rs is missing a trailing newline, so
update the dataflow markdown content to end the file cleanly with a final
newline character. Locate the `pocket_client.rs` bullet in the architecture
dataflow document and ensure the file terminates with one newline at the end of
the last line.
- Around line 43-49: Remove the empty placeholder sections in dataflow.md: the
ClientBuilder/Runner/module registration, Inbound message flow, Outbound message
flow, and Reconnect flow headings currently have no content. Either add the
intended prose or diagram replacement under each heading, or delete the headings
entirely so the document does not present empty sections.

In `@docs/architecture/raw-module.md`:
- Line 223: The markdown file is missing a trailing newline, which triggers the
MD047 lint rule. Update the document so it ends with a newline character after
the final content in the raw-module markdown file; no other content changes are
needed.
- Around line 63-78: The API Sketch section has Markdown heading spacing issues:
the `### PocketOption`, `### RawHandle`, and `### RawHandler` headings are
followed immediately by list content without blank lines. Update the
`raw-module.md` section so each of these headings is separated from the
following content by a blank line, keeping the existing symbols and list items
intact.
- Around line 137-183: Fix the Markdown spacing in the Validator Types and Use
Cases sections by adding the missing blank lines around headings and fenced code
blocks to satisfy MD022 and MD031. Update the affected content in the raw-module
documentation so each heading is separated by blank lines from surrounding text,
and each code fence in the use-case examples has the required blank line before
and after it.

In `@docs/architecture/structure.md`:
- Line 191: The markdown file is missing a trailing newline, triggering MD047.
Update the affected document so it ends with a final newline character; this is
a formatting-only fix in the content around the “Examples serve as functional
tests” section.

In `@docs/examples/go/index.md`:
- Line 55: The markdown example file is missing a trailing newline, causing the
MD047 lint failure. Update the end of the document so it terminates with a
newline character, keeping the content unchanged; this is a simple formatting
fix in the docs/examples/go/index.md markdown example.

In `@docs/examples/index.md`:
- Line 105: The markdown file is missing a trailing newline, which triggers
markdownlint MD047. Update the end of the document in the affected example
content so it terminates with a single newline; this is a formatting-only fix
and no code symbols need to change.

In `@docs/examples/javascript/index.md`:
- Around line 169-171: The trade result API naming is inconsistent across
bindings, with JavaScript using api.result(trade.id) while Python uses
api.check_win(trade.id). Update the JavaScript example to use the same method
naming convention as the other bindings, and make sure the referenced call in
the example stays aligned with the underlying API method so users see a
consistent cross-language mental model.
- Line 311: The markdown example content is missing a trailing newline, which
triggers the MD047 lint rule. Update the end of the file so the final line in
the examples section is followed by a newline, preserving the existing text and
ensuring the file ends cleanly.

In `@docs/examples/kotlin/index.md`:
- Line 48: The markdown example file is missing a trailing newline, which
triggers markdownlint MD047. Update the file content so it ends with a final
newline character, keeping the existing Markdown structure unchanged.

In `@docs/examples/python/async/index.md`:
- Line 410: The markdown example file is missing a trailing newline, which
triggers MD047. Update the document so it ends with a single newline character;
this is just a formatting fix and does not require any content changes.

In `@docs/examples/python/sync/index.md`:
- Line 298: The markdown file is missing a trailing newline, which triggers
MD047. Update the document so it ends with a newline after the last line,
keeping the existing content unchanged.

In `@docs/examples/ruby/index.md`:
- Line 55: The markdown example file is missing a trailing newline, which
triggers MD047. Update the end of docs/examples/ruby/index.md so it ends with a
single newline character; no content changes are needed.

In `@docs/examples/rust/index.md`:
- Line 176: The markdown example file is missing the required trailing newline,
so update the document end to ensure it terminates with a newline character.
Locate the final content in the Rust examples index and make sure the file ends
cleanly after the last sentence.
- Around line 139-144: Update the Rust example in the docs to avoid presenting
the fixed 5-second sleep as the recommended connection strategy; in the example
section around PocketOption::new, explain why synchronization is needed and
prefer any existing readiness API such as wait_for_connect() if available. If no
such API exists, reword the note to clearly mark the sleep as a temporary
workaround and mention it as a future API improvement rather than a required
pattern.

In `@docs/examples/swift/index.md`:
- Around line 43-45: The Swift example uses a fixed Task.sleep as a
synchronization step, which is fragile and should not be presented as a reliable
readiness mechanism. Update the PocketOption initialization example in the Swift
docs to either document the proper readiness/polling API if one exists, or
explicitly label the sleep-based approach as a known limitation/workaround
rather than “Critical!”; keep the guidance aligned with the same concern in the
Rust docs.
- Line 49: The Swift examples note in the markdown is missing a trailing
newline, so update the content in the docs/examples/swift index entry to ensure
the file ends with a newline character. Locate the markdown text referencing
BinaryOptionsToolsUni/out/swift and make sure the final line is properly
terminated.

In `@docs/intro.md`:
- Line 68: The markdown document is missing a required trailing newline, which
triggers the MD047 lint issue. Update the end of the file so it terminates with
a newline character, keeping the existing content unchanged and ensuring the
final paragraph in the document ends cleanly.

In `@docs/OVERVIEW.md`:
- Line 72: The markdown file is missing a trailing newline at the end of the
document, which triggers the MD047 formatting issue. Update the final line in
the document so it ends with a newline character; this is a simple file-ending
fix and does not require any content changes.

In `@docs/tutorials/index.md`:
- Line 70: The markdown file is missing a trailing newline, which triggers the
MD047 check. Update the end of the document so the final line in the tutorials
index is followed by a newline character; no content changes are needed, just
ensure the file ends cleanly.

In `@src/css/custom.css`:
- Around line 9-22: Stylelint is failing on the Google Fonts import and the
font-family keywords in custom.css. Update the top-level `@import` in the
stylesheet to use the plain-string import notation instead of url(...), and
lower-case the generic font keywords in the :root font stack entries for
--ifm-font-family-base and --ifm-font-family-monospace. Keep the existing font
lists and only adjust the notation/casing so the stylesheet passes
import-notation and value-keyword-case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2a0425ca-dce8-46c9-9eb4-8e91a95242ba

📥 Commits

Reviewing files that changed from the base of the PR and between 29d7b8d and 4e7e035.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (45)
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/documentation.md
  • .github/ISSUE_TEMPLATE/feature_request.md
  • .github/ISSUE_TEMPLATE/question.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/workflows/CI.yml
  • .github/workflows/deploy.yml
  • CHANGELOG.md
  • crates/binary_options_tools/src/pocketoption/candle.rs
  • crates/core/src/rules.rs
  • crates/core/src/signals.rs
  • docs/OVERVIEW.md
  • docs/api/python.md
  • docs/api/python.md.bak
  • docs/api/reference.md
  • docs/api/reference.md.bak
  • docs/architecture/dataflow.md
  • docs/architecture/dataflow.md.bak
  • docs/architecture/raw-module.md
  • docs/architecture/raw-module.md.bak
  • docs/architecture/structure.md
  • docs/examples/csharp/index.md
  • docs/examples/go/index.md
  • docs/examples/index.md
  • docs/examples/javascript/index.md
  • docs/examples/kotlin/index.md
  • docs/examples/python/async/index.md
  • docs/examples/python/sync/index.md
  • docs/examples/ruby/index.md
  • docs/examples/rust/index.md
  • docs/examples/swift/index.md
  • docs/guides/assets-timeframes.md.bak
  • docs/guides/python-pystrategy-trading-bot.md.bak
  • docs/guides/raw-handler.md.bak
  • docs/guides/trading.md.bak
  • docs/intro.md
  • docs/project/deployment.md
  • docs/tutorials/index.md
  • docs/tutorials/scripts/index.md
  • docusaurus.config.js
  • mkdocs.yml
  • package.json
  • python/BinaryOptionsToolsV2/pocketoption/synchronous.py
  • sidebars.js
  • src/css/custom.css
💤 Files with no reviewable changes (1)
  • mkdocs.yml
✅ Files skipped from review due to trivial changes (13)
  • docs/api/python.md.bak
  • docs/guides/raw-handler.md.bak
  • .github/ISSUE_TEMPLATE/documentation.md
  • docs/architecture/raw-module.md.bak
  • .github/ISSUE_TEMPLATE/question.md
  • docs/guides/assets-timeframes.md.bak
  • .github/ISSUE_TEMPLATE/feature_request.md
  • docs/guides/python-pystrategy-trading-bot.md.bak
  • docs/architecture/dataflow.md.bak
  • docs/api/reference.md.bak
  • .github/PULL_REQUEST_TEMPLATE.md
  • docs/guides/trading.md.bak
  • .github/ISSUE_TEMPLATE/bug_report.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/core/src/rules.rs
  • crates/core/src/signals.rs
  • python/BinaryOptionsToolsV2/pocketoption/synchronous.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

🛑 Comments failed to post (18)
.github/workflows/CI.yml (2)

37-42: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Upgrade peaceiris/actions-gh-pages and resolve the duplicate Pages deploy.

actionlint reports the @v3 runner is too old for current GitHub Actions; bump to @v4. Note this docs deploy also overlaps with the new .github/workflows/deploy.yml (flagged there) — consolidating to one mechanism would make this step unnecessary.

🧰 Tools
🪛 actionlint (1.7.12)

[error] 38-38: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/CI.yml around lines 37 - 42, The Deploy step in the CI
workflow uses an outdated peaceiris/actions-gh-pages version and should be
updated from the current action reference to a supported release, using the
existing Deploy job in CI as the locator. While updating that step, also account
for the overlap with the separate docs deployment workflow so only one Pages
publishing path remains; if deploy.yml already handles publishing, remove or
disable this CI deploy step to avoid duplicate Pages deploys.

Source: Linters/SAST tools


259-259: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the workflow around the referenced line
nl -ba .github/workflows/CI.yml | sed -n '235,275p'

# Find all occurrences of verify-metadata in the repo
rg -n "verify-metadata" -S .

# Show nearby context for the workflow step using this setting
rg -n -C 3 "verify-metadata: false|verify-metadata:" .github/workflows/CI.yml

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 212


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Identify the action/step that consumes verify-metadata in this workflow
nl -ba .github/workflows/CI.yml | sed -n '220,270p'

# Search for package upload tooling or related config that may explain the flag
rg -n -C 4 "(twine|pypi|upload|publish|metadata)" .github/workflows/CI.yml pyproject.toml setup.cfg setup.py README.md .

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 212


🌐 Web query:

pypa gh-action-pypi-publish verify-metadata false metadata validation input documentation

💡 Result:

In the pypa/gh-action-pypi-publish GitHub Action, the verify-metadata input controls whether the action runs twine check to validate package metadata before uploading [1][2][3]. By default, this input is set to true [2]. To disable metadata validation, you can set the verify-metadata input to false in your workflow configuration [4][5][6]: jobs: pypi-publish: runs-on: ubuntu-latest steps: - uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} verify-metadata: false It is standard practice and highly recommended to run twine check locally or in a separate CI step immediately after building your distribution files to ensure they are valid, rather than relying solely on the upload step for this check [4][7][6]. The action's underlying script verifies this input and skips the twine check if it is set to a value other than false (case-insensitive) [1][3][8].

Citations:


🌐 Web query:

"verify-metadata" "gh-action-pypi-publish" docs

💡 Result:

The verify-metadata input for the pypa/gh-action-pypi-publish GitHub Action is used to enable or disable the automated validation of package metadata using twine check before uploading to PyPI [1][2]. By default, the action performs this validation [3]. If you wish to disable this check—for example, if you prefer to run twine check manually during your build process instead—you can set the input to false in your workflow file [1][4]: with: verify-metadata: false Under the hood, the action executes the following logic to determine whether to run the validation [3]: if [[ ${INPUT_VERIFY_METADATA,,}!= "false" ]]; then twine check ${INPUT_PACKAGES_DIR%%/}/* fi

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the relevant workflow section with line numbers
sed -n '235,275p' .github/workflows/CI.yml | cat -n

# Find any separate metadata validation / twine check in the repo
rg -n -C 3 "twine check|verify-metadata|metadata validation|twine-upload|gh-action-pypi-publish" .github/workflows . .

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 1872


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the relevant workflow section with line numbers
sed -n '235,275p' .github/workflows/CI.yml | cat -n

# Find any separate metadata validation / twine check in the repo
rg -n -C 3 "twine check|verify-metadata|metadata validation|twine-upload|gh-action-pypi-publish" .github/workflows .

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 1872


Keep verify-metadata enabled for the PyPI publish step. This skips twine check entirely; if disabling it is intentional, add a separate metadata validation step before publishing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/CI.yml at line 259, The PyPI publish workflow currently
disables metadata verification via the verify-metadata setting, which bypasses
twine check. Update the publish job in the CI workflow to keep verify-metadata
enabled, or if it must remain disabled, add a separate metadata validation step
before the publish step so package metadata is still checked. Use the existing
PyPI publish configuration in the workflow to locate the change.
.github/workflows/deploy.yml (2)

1-47: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect CI.yml triggers and docs deploy to confirm overlap
fd -t f 'CI.yml' -p '.github/workflows' --exec sed -n '1,45p' {}

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 1211


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find any Pages-related config or docs references that indicate which deployment path is intended.
rg -n --hidden --glob '!**/.git/**' \
  -e 'gh-pages' \
  -e 'deploy-pages' \
  -e 'upload-pages-artifact' \
  -e 'github-pages' \
  -e 'pages' \
  .github README.md docs . 2>/dev/null | head -n 200

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 3109


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect workflow files for the exact deployment mechanics and overlap.
for f in .github/workflows/deploy.yml .github/workflows/CI.yml; do
  echo "===== $f ====="
  sed -n '1,120p' "$f"
done

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 4566


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check whether the repository contains any GitHub Pages settings or deployment docs.
git ls-files | rg '(^|/)(README\.md|docs|.github/workflows/.*\.yml|\.github/.*)$'

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 615


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the deployment guide to see which GitHub Pages mechanism it instructs contributors to use.
sed -n '1,220p' docs/project/deployment.md

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 4821


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect Docusaurus config for the expected deployment target/base URL.
sed -n '1,120p' docusaurus.config.js

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 3500


Consolidate the GitHub Pages deployment path. .github/workflows/deploy.yml uses actions/deploy-pages, but .github/workflows/CI.yml still pushes build/ to gh-pages, and docs/project/deployment.md still tells users to select the branch-based setup. Align the workflow and Pages settings/docs around one source, or one of these deployment paths will be ineffective.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 21-22: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 10-10: overly broad permissions (excessive-permissions): pages: write is overly broad at the workflow level

(excessive-permissions)


[error] 11-11: overly broad permissions (excessive-permissions): id-token: write is overly broad at the workflow level

(excessive-permissions)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 1 - 47, The GitHub Pages setup is
split between two deployment paths, so align everything around the new
`deploy-pages` workflow or the branch-based `gh-pages` flow. Update the `deploy`
job in `deploy.yml` together with the CI workflow entry points that still
publish `build/` to `gh-pages`, and revise `docs/project/deployment.md` so the
documented Pages configuration matches the actual workflow used.

21-22: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Disable persisted checkout credentials.

The build job's checkout doesn't push, but the default config leaves the token in .git/config for later steps/third-party actions (zizmor artipacked). Add persist-credentials: false.

🔒 Suggested fix
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

      - name: Checkout
        uses: actions/checkout@v4
        with:
          persist-credentials: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 21-22: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 21 - 22, The Checkout step in the
build job is leaving persisted Git credentials available to later steps and
third-party actions. Update the actions/checkout usage in the deploy workflow to
disable credential persistence by setting persist-credentials to false on the
Checkout step, using the existing checkout action block as the place to fix it.

Source: Linters/SAST tools

docs/api/python.md (1)

142-144: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -nP 'def is_demo' --type=py -C2

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 172


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- repo files matching is_demo / PocketOptionAsync ---'
rg -n --hidden --glob '!**/.git/**' 'is_demo|PocketOptionAsync' .

echo
echo '--- candidate Python files containing class or method definitions ---'
rg -n --hidden --glob '*.py' 'class PocketOptionAsync|def is_demo|async def is_demo|class .*Async' .

echo
echo '--- docs/api/python.md around lines 120-240 ---'
sed -n '120,240p' docs/api/python.md

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 46118


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- asynchronous.py class start / init / awaitability ---'
sed -n '229,320p' python/BinaryOptionsToolsV2/pocketoption/asynchronous.py
echo
rg -n 'def __await__|async def __init__|def __init__|__await__' python/BinaryOptionsToolsV2/pocketoption/asynchronous.py

echo
echo '--- docs and examples using await PocketOptionAsync ---'
rg -n 'await PocketOptionAsync\(' docs examples python tests README.md crates -g '!**/.bak'

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 5208


Remove the await from PocketOptionAsync(...)

PocketOptionAsync is a normal constructor (__init__), not awaitable, and is_demo() is synchronous too. Use client = PocketOptionAsync("your_ssid"); the current example will raise at startup.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/api/python.md` around lines 142 - 144, The Python example is incorrectly
treating PocketOptionAsync as awaitable even though its constructor and
is_demo() are synchronous. Update the example so the client is created directly
with PocketOptionAsync(...) and then call client.is_demo() without await; keep
the warning/return logic in the same surrounding example block.
docs/api/reference.md (1)

25-30: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Stale Rust crate version in install instructions.

This PR bumps the crates to 0.2.12, but the Rust dependency snippet still pins binary_options_tools = "0.1". Update it to "0.2" so users don't pull an outdated crate.

📝 Suggested fix
 [dependencies]
-binary_options_tools = "0.1"
+binary_options_tools = "0.2"
 tokio = { version = "1", features = ["full"] }
 tokio-stream = "0.1"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.


🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/api/reference.md` around lines 25 - 30, Update the Rust dependency
snippet in the docs to match the current crate version by changing the
binary_options_tools entry from the old 0.1 series to 0.2. Keep the surrounding
dependency examples unchanged, and make sure the install instructions in
reference.md align with the version used elsewhere in the PR.
docs/architecture/raw-module.md (2)

93-95: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check actual crate names in workspace
fd 'Cargo.toml' crates/ --exec cat {} \; | rg -A 5 '^\[package\]' | head -30
rg 'name.*=' crates/*/Cargo.toml

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 1679


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== raw-module excerpt ==\n'
sed -n '80,105p' docs/architecture/raw-module.md

printf '\n== search crate-name usages ==\n'
rg -n 'binary_options_tools_pocketoption|binary_options_tools' docs crates -g '!**/target/**' | head -200

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 23013


Use binary_options_tools in the example. binary_options_tools_pocketoption doesn’t match the published crate name used elsewhere in the docs and Cargo.toml, so this import would fail for anyone copying the snippet.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/raw-module.md` around lines 93 - 95, The example import in
the raw module docs uses the wrong crate name, so update the snippet to use
binary_options_tools instead of binary_options_tools_pocketoption. Keep the same
symbols (PocketOption, Validator, Outgoing) but point them at the published
crate name used in Cargo.toml and the rest of the docs so the copy-paste example
compiles.

143-143: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update regex() documentation for Result return type.

Per PR objectives, RuleBuilder::regex() now returns Result. The documentation lists regex(pattern) without indicating it can fail. Update to show error handling (e.g., regex(pattern) -> Result<Validator, Error> or note that invalid patterns return an error).

📝 Proposed documentation update
- `regex(pattern)` - Match against regex pattern
+ `regex(pattern)` - Match against regex pattern (returns `Result`; invalid regex patterns will fail)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

 `regex(pattern)` - Match against regex pattern (returns `Result`; invalid regex patterns will fail)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/raw-module.md` at line 143, Update the `regex()`
documentation entry to reflect that `RuleBuilder::regex()` now returns a
`Result`, not a plain validator. In the `regex(pattern)` section of the raw
module docs, adjust the signature to indicate `-> Result<Validator, Error>` or
explicitly mention that invalid patterns return an error, so readers understand
the failure path when locating `regex()` in the docs.
docs/architecture/structure.md (1)

33-33: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix typo in repository layout diagram.

Line 33 shows .github/github/github/workflows/ with triple-nested github directories. This should be .github/workflows/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/structure.md` at line 33, The repository layout diagram
contains a typo in the workflows path, showing repeated nested github
directories. Update the structure entry for the workflows folder in the markdown
diagram so it uses the correct .github/workflows/ path, and verify the
surrounding repository tree entries remain consistent.
docs/examples/csharp/index.md (2)

25-36: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Minor: project vs source-file naming mismatch.

The run commands reference basic.csproj/balance.csproj, but the Examples list enumerates Basic.cs/Balance.cs. Align the names (or document the .csproj files) so readers can actually run the examples.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/csharp/index.md` around lines 25 - 36, The C# examples page has
a naming mismatch between the run commands and the example list: the commands in
the examples section refer to project files, while the listed items in the
Examples section use source-file names. Update the references in this page so
they consistently point to the same artifact type, using the identifiers shown
in the markdown such as the Basic and Balance example entries and the dotnet run
commands.

41-51: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Look for any C#/.NET bindings and the referenced symbols
fd -e cs -e csproj
rg -nP '\b(InitAsync|BalanceAsync|ShutdownAsync)\b' -g '*.cs' || echo "No C# binding symbols found"

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 356


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Files under docs/examples/csharp ==\n'
fd -a . docs/examples/csharp

printf '\n== C# example contents (first 220 lines each) ==\n'
for f in docs/examples/csharp/index.md examples/csharp/*.cs; do
  echo "--- $f ---"
  sed -n '1,220p' "$f"
  echo
done

printf '\n== Search for C#-specific binding surface and PocketOption usage ==\n'
rg -n "PocketOption|InitAsync|BalanceAsync|ShutdownAsync|namespace .*CSharp|class PocketOption|new PocketOption|balance\(|shutdown\(" . -g '!**/node_modules/**' -g '!**/dist/**' -g '!**/build/**'

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 50393


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== C# example index around the snippet ==\n'
nl -ba docs/examples/csharp/index.md | sed -n '1,120p'

printf '\n== Any docs references to these C# method names ==\n'
rg -n "InitAsync|BalanceAsync|ShutdownAsync" docs examples -g '!**/node_modules/**' || true

printf '\n== Any C# project files or source outside examples ==\n'
fd -a -e cs -e csproj .

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 255


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Minimal structural check: identify all C# source and project files in the repo.
git ls-files '*.cs' '*.csproj' 'docs/examples/csharp/*' | sort

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 358


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the example doc around the commented lines.
nl -ba docs/examples/csharp/index.md | sed -n '1,120p'

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 212


Use the C# API shown by the actual examples. The C# files under examples/csharp/*.cs import BinaryOptionsToolsUni and use PocketOption.NewAsync(...) with client.BalanceAsync(). BinaryOptionsToolsV2, InitAsync, and ShutdownAsync don’t match that surface, so this snippet will mislead readers.

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 51-51: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/csharp/index.md` around lines 41 - 51, The C# snippet uses the
wrong API surface and should match the actual examples in the C# sample files.
Update the example to use the same library and entry points as the
`PocketOption` examples (importing `BinaryOptionsToolsUni`, creating the client
with `PocketOption.NewAsync(...)`, and keeping `client.BalanceAsync()`), and
remove the outdated `BinaryOptionsToolsV2`, `InitAsync`, and `ShutdownAsync`
references so the docs align with the real C# API.
docs/examples/javascript/index.md (1)

56-58: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Standardize initialization wait time across language examples.

JavaScript examples use 5-second waits, while Python and Go examples use 2 seconds. Standardize to a consistent value across all language documentation to avoid confusing users about required connection stabilization time.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/javascript/index.md` around lines 56 - 58, The JavaScript
example uses a longer initialization delay than the Python and Go examples, so
update the wait in the JavaScript docs snippet to match the standardized
connection stabilization time used elsewhere. Adjust the delay in the example’s
connection setup section so all language examples are consistent and reference
the same wait duration.
docs/examples/rust/index.md (2)

17-17: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update version to match current release.

The example specifies binary_options_tools = "0.1" but the PR updates to version 0.2.12. Users following this will install an outdated version. Update to "0.2" or "0.2.12".

- binary_options_tools = "0.1"
+ binary_options_tools = "0.2"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

binary_options_tools = "0.2"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/rust/index.md` at line 17, The Rust example dependency version
is outdated; update the binary_options_tools entry in the example so it matches
the current release used by the PR. Adjust the version string from the old 0.1
value to the current 0.2 series (or the exact 0.2.12 release) in the example
snippet so users install the correct package version.

49-50: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove or correct the rustc instruction.

rustc basic.rs && ./basic will not compile successfully because basic.rs depends on external crates (binary_options_tools, tokio). This instruction is misleading for beginners. Either remove it or note that it only works for standalone files.

- ```bash
- rustc basic.rs && ./basic
- ```
+ > Note: `rustc` only works for standalone files without external dependencies. Use `cargo run --example <name>` for crate-based examples.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/rust/index.md` around lines 49 - 50, The Rust example
instructions are misleading because basic.rs depends on external crates, so the
standalone rustc command will fail. Update the example in the docs index to
either remove the rustc invocation or replace it with a note clarifying that
rustc only works for dependency-free standalone files, and point readers to the
appropriate cargo run --example usage instead.
docs/examples/swift/index.md (1)

48-48: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for Swift output directory
fd -i 'swift' --type d | head -20
ls -la BinaryOptionsToolsUni/out/swift/ 2>/dev/null || echo "Path not found"

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 224


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== docs/examples/swift/index.md (around line 48) ==\n'
cat -n docs/examples/swift/index.md | sed -n '35,60p'

printf '\n== search for BinaryOptionsToolsUni/out/swift and nearby references ==\n'
rg -n "BinaryOptionsToolsUni/out/swift|out/swift|swift/" -S docs examples .github . 2>/dev/null | head -200

printf '\n== repo files mentioning swift example docs ==\n'
git ls-files | rg '^docs/examples/swift/|^examples/swift/|swift'

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 2131


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== files/directories with BinaryOptionsToolsUni ==\n'
fd -HI 'BinaryOptionsToolsUni' .

printf '\n== files mentioning out/swift or uniffi-bindgen ==\n'
rg -n "out/swift|uniffi-bindgen|binary_options_tools_uni\.udl|SwiftUI examples" -S .

printf '\n== top-level tree (limited) ==\n'
find . -maxdepth 2 -type d | sort | sed -n '1,120p'

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 2200


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== docs/examples/swift/index.md ==\n'
cat -n docs/examples/swift/index.md | sed -n '1,80p'

printf '\n== examples/swift/index.md ==\n'
cat -n examples/swift/index.md | sed -n '1,80p'

printf '\n== agents/AGENTS.md excerpt around Swift generation ==\n'
cat -n agents/AGENTS.md | sed -n '98,112p'

printf '\n== crates/bindings_uniffi/README.md excerpt around generate command ==\n'
cat -n crates/bindings_uniffi/README.md | sed -n '256,274p'

Repository: ChipaDevTeam/BinaryOptionsTools-v2

Length of output: 4296


Fix the SwiftUI example path docs/examples/swift/index.md:49 points to BinaryOptionsToolsUni/out/swift/, but that path isn’t present here; the UniFFI generator writes to out/swift/ relative to the BinaryOptionsToolsUni project root. Update the link to the actual generated location or make it relative to the build output.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/swift/index.md` at line 48, The SwiftUI example link currently
points to a generated output path that does not exist in this project layout.
Update the link in the docs example to use the actual UniFFI output location
from the BinaryOptionsToolsUni project root, or make it relative to the build
output so it resolves correctly; use the docs/examples/swift/index.md link
target as the reference point when adjusting the path.
docs/project/deployment.md (2)

17-19: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Pages-source instructions contradict the Actions workflow.

Steps 5–6 tell users to set Source to Deploy from a branchgh-pages / root, but the workflow documented below (Lines 78–90) uses actions/upload-pages-artifact + actions/deploy-pages, which requires the Pages Source to be set to GitHub Actions. As written, following both sections won't produce a working deploy. The same gh-pages/root note recurs in the Troubleshooting section (Line 154).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/project/deployment.md` around lines 17 - 19, The deployment docs are
inconsistent between the Pages Source steps and the GitHub Actions workflow.
Update the instructions in the deployment setup section, and the repeated
troubleshooting note, to match the workflow used by the documented deploy job
with actions/upload-pages-artifact and actions/deploy-pages: set GitHub Pages
Source to GitHub Actions instead of Deploy from a branch/gh-pages root. Keep the
wording aligned with the workflow terms so readers follow one valid deployment
path, and reference the deployment setup and troubleshooting sections
consistently.

36-40: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

npm run deploy is not defined in package.json.

The package scripts only define start, build, serve, clear, docs:serve, and docs:build — there is no deploy script, so this manual step will fail with "missing script: deploy". Either add a deploy script (e.g., the Docusaurus docusaurus deploy command) or remove this instruction.

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 37-37: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/project/deployment.md` around lines 36 - 40, The manual deployment steps
reference an undefined npm script, so update the deployment instructions to
match the available package scripts. Either add a real deploy script in
package.json and ensure it invokes the intended deployment command, or remove
the npm run deploy step from the deployment guide so the docs only mention valid
commands like build and docs:build. Use the existing deployment section in the
docs and the package scripts list as the source of truth.
docusaurus.config.js (1)

151-159: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Algolia config uses placeholder credentials.

appId: 'YOUR_APP_ID' and apiKey: 'YOUR_API_KEY' (and the externalUrlRegex: 'external\\.com' placeholder) will ship a non-functional DocSearch widget to production. Either wire in real DocSearch values (via env/secret injection) or remove the algolia block until search is provisioned.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docusaurus.config.js` around lines 151 - 159, The Algolia settings in the
docusaurus.config.js configuration are still using placeholder values, so the
DocSearch widget will not work as shipped. Update the algolia block in the
Docusaurus config to read real DocSearch credentials from environment/secret
injection, or remove the entire algolia configuration until search is
provisioned. Make sure the appId, apiKey, and externalUrlRegex values are no
longer placeholder literals in the Docusaurus config.

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.

2 participants