Skip to content

chore(release): 0.13.2 -- the venue boundary, closed - #673

Merged
eaitbrahim merged 1 commit into
mainfrom
chore-v0.13.2-bump
Sep 1, 2026
Merged

chore(release): 0.13.2 -- the venue boundary, closed#673
eaitbrahim merged 1 commit into
mainfrom
chore-v0.13.2-bump

Conversation

@eaitbrahim

Copy link
Copy Markdown
Contributor

Version bump only — 8 pyproject.toml files plus uv.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

~/keel is on 0.13.1 (9c11ead), which is exactly the commit #669#672 were cut from. Everything below is currently unreleased:

#667 _clamp_to_held reduces 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.
#668 sweep_orphan_brackets cancels a resting SELL whose position has left the account — order-driven, where every existing sweep is position-driven and so could not reach it.
#669/#672 docs/fiqh-basis.md records rail 21 as the second fiqh rail, anchored in bay' ma la yamlik rather than riba. Rail count nineteen → twenty across guards.py and five docs.

All three mechanisms 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.

keel doctor gains balance.drift and bracket.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_account exists on the Alpaca adapter alone. tests/test_fiqh_basis.py pins that two-sided, so it fails when #666 lands.

Verification

Full suite 5109 passed / 3 skipped; tests/test_packaging.py green, 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-unsigned for the DMG/installer artifacts. The head -1 closed-pipe bug that killed every desktop leg on v0.13.0 was fixed in 0.13.1 and is on main.

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
@eaitbrahim eaitbrahim self-assigned this Sep 1, 2026
@eaitbrahim
eaitbrahim merged commit 6ca893a into main Sep 1, 2026
4 checks passed
@eaitbrahim
eaitbrahim deleted the chore-v0.13.2-bump branch September 1, 2026 12:22
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