Skip to content

Add small-account cash substitution notes#68

Merged
Pigbibi merged 1 commit into
mainfrom
fix/small-account-cash-note
May 27, 2026
Merged

Add small-account cash substitution notes#68
Pigbibi merged 1 commit into
mainfrom
fix/small-account-cash-note

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add shared small-account cash compatibility result with cash substitution notes
  • add shared i18n note formatter for platform notifications
  • bump package version to 0.7.34

Tests

  • PYTHONPATH=src python -m pytest tests/test_small_account_compatibility.py -q

@Pigbibi Pigbibi merged commit ceb84a3 into main May 27, 2026
1 check passed
@Pigbibi Pigbibi deleted the fix/small-account-cash-note branch May 27, 2026 14:30

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7e89fd1d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +126 to +130
remaining_non_safe_targets = [
symbol
for symbol in normalized_candidates
if float(adjusted_targets.get(_normalize_symbol(symbol), 0.0) or 0.0) > 0.0
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude safe-haven symbols from the remaining-risk check

When callers use the default candidate_symbols=None and pass safe_haven_cash_symbols, normalized_candidates becomes every adjusted target, including the safe-haven sleeve. A positive safe-haven target is then counted in remaining_non_safe_targets, so the not remaining_non_safe_targets guard never allows the documented cash substitution path to run (e.g. SOXX below one share with BOXX as the only remaining $1,224 sleeve leaves BOXX untouched). The tests avoid this by explicitly passing only the risk symbol as candidate_symbols, but the public default makes the new helper skip the fallback in the natural all-targets call path.

Useful? React with 👍 / 👎.

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