Skip to content

Add inventory-backed endpoint execution#9

Merged
Bogyie merged 3 commits into
bog-220-kis-sdkfrom
issue/BOG-247-inventory-api-foundation
May 29, 2026
Merged

Add inventory-backed endpoint execution#9
Bogyie merged 3 commits into
bog-220-kis-sdkfrom
issue/BOG-247-inventory-api-foundation

Conversation

@Bogyie

@Bogyie Bogyie commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add InventoryCatalog, InventoryRequest, and KisClient::execute_inventory so the SDK can call every bundled official KIS inventory endpoint by stable operation id.
  • Generate curated operation ids across all 338 endpoints, validate required query/body/non-standard headers locally, require explicit TR ID overrides for ambiguous endpoints, and reject real-only endpoints in mock mode.
  • Reuse the existing prepared execution path for typed methods and document the low-level inventory execution API while preserving the current typed domestic stock API surface.
  • Classify inventory operation kind from contract kind and path semantics so non-trading POST endpoints such as realtime/websocket calls are not blocked by the live trading guard, while order mutations remain protected.

Commits

  • 6321964 - feat: add inventory-backed endpoint execution
  • 8c0289d - docs: clarify inventory execution API scope
  • 8939795 - fix: classify inventory operations by contract kind

Verification

  • cargo fmt --all --check
  • git diff --check
  • cargo test --locked
    • tests/mock_server_contract.rs: 4 passed
    • tests/sdk_core.rs: 15 passed
    • doc-tests: 0 passed
  • Targeted retests passed:
    • cargo test --locked inventory_operation_kind_uses_contract_kind_not_http_method_only
    • cargo test --locked inventory_real_non_trading_post_is_not_blocked_by_live_trading_guard
    • cargo test --locked real_cash_order_is_blocked_before_network_without_live_trading_guard
  • GitHub checks:
    • Package validation: success
    • Publish action dry run: success
    • Publish to crates.io: skipped

Review evidence

  • QA retest: PASS on commit 8939795.
  • Documentation rereview: PASS after README and usage guide scope alignment.
  • Design rereview: PASS after operation-kind classification moved from HTTP method only to contract kind/path semantics.
  • Security rereview: PASS for live trading guard, real non-trading POST behavior, order mutation blocking, validation, and mock/real safety boundaries.

Safety and limits

  • No live KIS API calls, real orders, real credentials, release, publish, or final/base branch merge were performed during implementation or review.
  • Real trading mutations remain locally blocked by KisError::LiveTradingDisabled.
  • Real-only inventory endpoints are locally rejected in Environment::Mock with KisError::UnsupportedEnvironment.
  • Unknown non-GET contract kinds conservatively remain TradingMutation.

Related

  • Multica: BOG-248

Co-authored-by: multica-agent <github@multica.ai>

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

This PR successfully adds inventory-backed endpoint execution to the KIS SDK. The implementation is well-structured with proper validation, error handling, and comprehensive test coverage.

Key Changes:

  • Added execute_inventory API to call any of the 338 captured KIS endpoints by stable operation ID
  • Implemented InventoryCatalog with validation for required query/body/header fields before network I/O
  • Refactored execution logic into shared execute_prepared method for code reuse
  • Added comprehensive tests covering validation, fallback, and environment constraints

Security & Safety:

  • Real trading mutations remain blocked locally by KisError::LiveTradingDisabled
  • Real-only endpoints are rejected in mock environment ✅
  • Fallback credentials are properly isolated (no credential leakage) ✅
  • Input validation happens before network I/O ✅

The code is production-ready with no blocking issues identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Bogyie and others added 2 commits May 30, 2026 08:31
Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
@Bogyie
Bogyie merged commit 706ab16 into bog-220-kis-sdk May 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant