fix(cli): honest execution contract — acceptance vs fills, simulated dry-run, session overflow warning (STO-1731) - #56
Merged
Conversation
…vs fills (STO-1731) KIS rt_cd == '0' means the order was ACCEPTED, not filled. The old contract conflated the two: slice status 'filled' (docstring said '주문 접수됨'), submittedQuantity described as '실제 집행된 수량', and a dry run reporting status 'completed' — three ways for a caller (the LLM included) to read '1,000 shares done' while a resting limit order had filled zero. - slice status 'filled' -> 'accepted' (journal reader keeps reading legacy 'filled' records; SLICE_FILLED stays as a deprecated alias) - dry-run top-level status 'completed' -> 'simulated' (exit code still 0) - submittedQuantity docstring states acceptance, not fills - a schedule that runs past the regular close now warns BEFORE execution: the confirmation prompt shows the slice count and shares that will be lost, and the same warning lands in result.notes for the --yes path (measured: 15:10 + 30min TWAP loses 33%) CHANGELOG 1.10.0 documents the contract changes. Execution tests: 172 passed; the 85 pre-existing local-environment failures are unchanged (verified against the clean tree).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
KIS
rt_cd == "0"is order ACCEPTANCE, not a fill. The old contract conflated them three ways: slice statusfilled(docstring said 접수),submittedQuantitydescribed as 실제 집행된 수량, and a dry run reportingcompleted. On an unfilled limit order a caller reads '1,000 shares done' with zero trades.What
filled→accepted— journal reader keeps legacyfilled;SLICE_FILLEDstays as deprecated aliascompleted→simulated— top-level distinction from real execution; exit code still 0submittedQuantitydocstring — acceptance, not fillsresult.notesfor --yes (measured: 15:10 + 30min TWAP loses 33%)CHANGELOG 1.10.0 documents the contract changes — callers must check slice status values and dry-run status.
Verification