Add Finam Trade Pro REST plugin with gRPC JWT renewal#167
Add Finam Trade Pro REST plugin with gRPC JWT renewal#167xlabtg merged 8 commits intoxlabtg:mainfrom
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#166
Solution summaryDone Implemented and pushed the Finam Trade Pro plugin in PR 167: #167 What changed:
Verification:
PR 167 is marked ready for review. Useful next steps:
This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (288.7K + 12.2M cached) input tokens, 49.8K output tokens, $8.668605 cost 🤖 Models used:
📎 Log file uploaded as Repository (73206KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit b688965.
|
Thanks for the implementation — there is a lot of good structure here, and the plugin already looks much closer to something Teleton can build on. However, I don’t think PR #167 is ready to merge yet. There are still a few important issues to address:
Overall, I like the direction and the codebase shape, but I would strongly recommend fixing at least items 1 and 3 before merge, and clarifying or completing item 2 so the PR matches the actual acceptance criteria of #166. |
|
🤖 AI Work Session Started Starting automated work session at 2026-04-20T00:32:51.561Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (239.2K + 15.4M cached) input tokens, 38.7K output tokens, $9.787518 cost 🤖 Models used:
📎 Log file uploaded as Repository (26565KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
Thanks for the follow-up iteration — this revision is clearly stronger than the previous one. The earlier concerns about REST decimal payload shape and IPv6/private-network SSRF coverage look materially addressed now:
That said, I still see two points that should be resolved before merge:
So from my side:
Overall, this is now a much stronger PR, but I would still ask for one more cleanup pass on the security finding and the issue-closure claim. |
|
🤖 AI Work Session Started Starting automated work session at 2026-04-20T00:57:28.671Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
|
Follow-up to the latest review:\n\n- Addressed the CodeQL regex concern: current |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (106.0K + 3.7M cached) input tokens, 15.8K output tokens, $2.731622 cost 🤖 Models used:
📎 Log file uploaded as Gist (18246KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
The static review looks much better now, and the earlier implementation issues appear resolved. At this point, the remaining concern is not the diff itself but merge confidence for a trading/broker integration. Before merge, I would like one more focused hardening pass aimed at operational safety, with evidence in the PR:
I am not asking for a large redesign here. The code review is already in much better shape. What is still needed is a final evidence-based validation pass so this can be merged with professional confidence rather than only static confidence. |
|
🤖 AI Work Session Started Starting automated work session at 2026-04-20T01:19:10.565Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
|
Follow-up to the operational-safety review:
What I could verify in this workspace: npm run finam:live-smoke -- --dry-run
node --test plugins/finam-trade/tests/*.test.js
npm run validate
npm run lint
npm test
npm run typecheck
node scripts/build-sdk.mjs
npm audit --audit-level=high --prefix plugins/finam-trade
npm audit --audit-level=high
npx eslint experiments/finam-live-smoke.mjs
git diff --checkResults: focused Finam tests passed (16), full suite passed (398), validate/lint/typecheck/build-sdk passed, high-severity audits passed, and the dry-run prints the credentialed smoke plan without secrets. Live positive broker smoke tests were not run here because this environment does not have |
|
Additional follow-up after the new smoke-runner commit:
The remaining blocker is still live positive broker validation with a non-production Finam account. The PR remains draft until that credentialed smoke evidence is supplied. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (157.8K + 8.3M cached) input tokens, 36.6K output tokens, $5.764985 cost 🤖 Models used:
📎 Log file uploaded as Repository (42532KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
Thanks for the latest pass — this PR is much stronger now. The earlier code-level concerns around payload mapping, SSRF hardening, and CodeQL findings look materially addressed, and the new However, I still would not call this fully merge-ready for a broker/trading integration until these two remaining points are resolved:
So from my side:
|
|
🤖 AI Work Session Started Starting automated work session at 2026-04-20T01:40:01.947Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
|
Follow-up to the latest review:
No source-code changes were needed in this pass, so there is no new commit to push. I am intentionally leaving the PR as draft because live positive broker validation still requires |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (43.0K + 703.5K cached) input tokens, 9.8K output tokens, $0.787652 cost 🤖 Models used:
📎 Log file uploaded as Gist (11130KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Refs #166.
Adds a new
finam-tradeTeleton plugin with 27 Finam Trade API tools covering accounts, orders, market data, instruments, reports, and usage metrics.This PR implements the REST request/response tool surface and an opt-in gRPC JWT renewal stream. It does not yet expose Finam's market/account/order/report streaming subscriptions as Teleton tools.
Implementation
FinamAuthforFINAM_SECRETloading, JWT session creation, JWTexpparsing, pre-expiry refresh, token-details account discovery, and optional gRPCAuthService.SubscribeJwtRenewalsupport.{ success, data/error }responses.sdk.dbis available..env.example, manifest metadata, package lock, registry entry, and root README listing.Review Follow-Up
@grpc/grpc-jsand a minimalAuthService.SubscribeJwtRenewalproto.npm run finam:live-smoke.Operational Readiness / Known Limits
FINAM_SECRET,FINAM_LIVE_ACCOUNT_ID, and sandbox/non-production order payloads are not available in the environment.finam_get_accountsfinam_get_account_infofinam_generate_reportfinam_place_orderandfinam_place_sltpchecks with explicit JSON payloadsFINAM_LIVE_ENABLE_GRPC=1FINAM_LIVE_ENABLE_TRADING=1and explicitFINAM_LIVE_PLACE_ORDER_JSON/FINAM_LIVE_SLTP_JSONpayloads are supplied. Returned order IDs are cancelled by default.Refs #166and avoid issue-closing keywords unless the remaining gRPC streaming scope is accepted as follow-up work.Verification
Results:
npm run validate: passed with the existingcasinoempty-tools warning.npm run lint: passed with existing repo warnings only, no errors.npm run typecheck: passed.node scripts/build-sdk.mjs: passed.npm audit --audit-level=high --prefix plugins/finam-trade: passed with 0 vulnerabilities.npm audit --audit-level=high: passed; npm still reports existing moderate advisories below the configured threshold.Refs #166
Fixes #166