Skip to content

fix(cli): honest execution contract — acceptance vs fills, simulated dry-run, session overflow warning (STO-1731) - #56

Merged
unohee merged 1 commit into
mainfrom
feat/sto-1731-honest-execution-contract
Aug 28, 2026
Merged

fix(cli): honest execution contract — acceptance vs fills, simulated dry-run, session overflow warning (STO-1731)#56
unohee merged 1 commit into
mainfrom
feat/sto-1731-honest-execution-contract

Conversation

@unohee

@unohee unohee commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Why

KIS rt_cd == "0" is order ACCEPTANCE, not a fill. The old contract conflated them three ways: slice status filled (docstring said 접수), submittedQuantity described as 실제 집행된 수량, and a dry run reporting completed. On an unfilled limit order a caller reads '1,000 shares done' with zero trades.

What

  1. Slice status filledaccepted — journal reader keeps legacy filled; SLICE_FILLED stays as deprecated alias
  2. Dry-run status completedsimulated — top-level distinction from real execution; exit code still 0
  3. submittedQuantity docstring — acceptance, not fills
  4. Session overflow pre-warning — prompt shows ⚠ 마감 초과 (slice count + lost shares); same warning in result.notes for --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

  • Execution tests: 172 passed (updated dry-run status assertions to the new contract)
  • Full suite: 85 pre-existing local-environment failures unchanged (verified against clean tree)

…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).
@unohee
unohee merged commit 0b649ea into main Aug 28, 2026
1 check failed
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