chore(release): 0.13.2 -- the venue boundary, closed - #673
Merged
Conversation
0.13.1 shipped the desktop legs. This one ships what #669-#672 built on top of it: the long-only ruling is now enforced at the venue boundary and not only at the decision layer. WHAT REACHES THE DEPLOYMENT. Until now a SELL was sized from keel's own ledger, and the ledger runs high -- a venue that takes its taker fee out of the received base leaves less than the order said, a partial fill leaves less still, and an out-of-band transfer tells keel nothing. Ask a venue for base that is not there and a cash account rejects it; a margin-enabled one fills the difference by opening a short. Three mechanisms now stand in the way: * `_clamp_to_held` reduces a SELL to what the venue reports holding -- down only, never up, unchanged when the balance is unreadable (#667); * rail 21 refuses an order against a holding the venue affirmatively reports as empty, which is the one case the clamp deliberately will not touch (#667); * `sweep_orphan_brackets` cancels a resting SELL whose position has left the account, which no position-driven sweep could reach (#668). All three read `Balance.total`, never `Balance.available`: a resting bracket holds the base it commits, so `available` reads ~0 for exactly the products keel is protecting, and any of the three built on it would have refused every exit and cancelled every bracket on its first cycle. `keel doctor` gains `balance.drift` and `bracket.orphan`, both WARN -- every cause is legitimate and every one leaves the books and the account disagreeing until a human decides which it was. The live deployment has neither finding today; they exist so the next divergence is not found by asking an unrelated question. `docs/fiqh-basis.md` records rail 21 as the SECOND fiqh rail, anchored in *bay' ma la yamlik* (§65.4/§65.11) rather than in riba -- the oversell is impermissible before any interest is charged, so a riba-framed defence never reached it. The rail count moves from nineteen to twenty across guards.py and five documents. What stays open is #666: all three mechanisms fail OPEN on an unreadable balance, deliberately, which is survivable only while the account cannot go short -- and `verify_cash_account` exists on the Alpaca adapter alone. No migration: schema stays at v16. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NzuKAe2RVrPt9acVAWjRyL
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.
Version bump only — 8
pyproject.tomlfiles plusuv.lock, the same nine-file shape as the 0.13.1 bump. No code, no migration; schema stays at v16.What 0.13.2 carries to the deployment
~/keelis on 0.13.1 (9c11ead), which is exactly the commit #669–#672 were cut from. Everything below is currently unreleased:_clamp_to_heldreduces a SELL to what the venue reports holding — down only, never up, unchanged when unreadable. Rail 21 refuses an order against an affirmatively empty holding.sweep_orphan_bracketscancels a resting SELL whose position has left the account — order-driven, where every existing sweep is position-driven and so could not reach it.docs/fiqh-basis.mdrecords rail 21 as the second fiqh rail, anchored in bay' ma la yamlik rather than riba. Rail count nineteen → twenty acrossguards.pyand five docs.All three mechanisms read
Balance.total, neverBalance.available— a resting bracket holds the base it commits, soavailablereads ~0 for exactly the products keel is protecting.keel doctorgainsbalance.driftandbracket.orphan, both WARN. The live deployment has neither finding today; they exist so the next divergence isn't found by asking an unrelated question.Still open
#666. All three mechanisms fail open on an unreadable balance — correctly, since refusing a SELL over a quiet endpoint strands positions that wanted out. That is survivable only while the account cannot go short, and
verify_cash_accountexists on the Alpaca adapter alone.tests/test_fiqh_basis.pypins that two-sided, so it fails when #666 lands.Verification
Full suite 5109 passed / 3 skipped;
tests/test_packaging.pygreen, which is the check that catches a root-only bump with stale sibling pins.After merge: Actions → Release → Run workflow,
0.13.2,desktop: publish-unsignedfor the DMG/installer artifacts. Thehead -1closed-pipe bug that killed every desktop leg on v0.13.0 was fixed in 0.13.1 and is onmain.