Skip to content

refactor(notifications): migrate to shared renderer_base#308

Merged
Pigbibi merged 4 commits into
mainfrom
refactor/notification-unification
Jul 8, 2026
Merged

refactor(notifications): migrate to shared renderer_base#308
Pigbibi merged 4 commits into
mainfrom
refactor/notification-unification

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace duplicated helpers with imports from quant_platform_kit.notifications.renderer_base.

Depends on: QuantPlatformKit#200

Changes

  • notifications/renderers.py: 681 → 427 lines (-254)
  • Deleted local copies of 20+ shared functions
  • Preserved LB-specific functions:
    • _LONG_BRIDGE_ZH_NOTIFICATION_REPLACEMENTS
    • _format_source_input_line / _append_source_input_line
    • _build_benchmark_lines / _has_benchmark_context
    • Income layer / risk position fields
    • _localize_timing_contract thin wrapper (LB notification localisation fallback)
  • Renderer public API unchanged

🤖 Generated with Claude Code

…-share compatibility

QQQM (TQQQ's unlevered sleeve in tqqq_growth_income) was not in the
whole-share retention whitelist. When the strategy's target for QQQM
was below 1 share price, the small account compatibility layer zeroed
the target, creating an artificial sell signal. After selling, the
system couldn't buy back because the target (below 1 share) couldn't
be fulfilled, leaving the account in cash.

Add QQQM to:
- SMALL_ACCOUNT_EXISTING_WHOLE_SHARE_RETENTION_SYMBOLS (unconditional)
- SMALL_ACCOUNT_EXISTING_WHOLE_SHARE_RETENTION_MIN_TARGET_SHARE_RATIO_BY_SYMBOL (0.85)
- SMALL_ACCOUNT_WHOLE_SHARE_BOOTSTRAP_MIN_TARGET_SHARE_RATIO_BY_SYMBOL (0.85)

Co-Authored-By: Claude <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@chatgpt-codex-connector

This comment has been minimized.

@Pigbibi Pigbibi enabled auto-merge (squash) July 8, 2026 21:12
@Pigbibi Pigbibi force-pushed the refactor/notification-unification branch from 0c0149a to d054f39 Compare July 8, 2026 21:14
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Replace the per-symbol hardcoded whitelist with a universal rule:
if the account already holds a symbol (>0 shares) AND the strategy
wants to keep >= 85% of 1 share's value, retain the position.

This prevents the sell-then-fail-to-rebuy cycle for ALL symbols,
not just those in the whitelist. Genuine reductions (target << 85%
of 1 share) are NOT blocked — the sell proceeds normally.

The 0.85 default threshold means:
- QQQM $262.74 target vs $292.42 price → 90% → retain
- SOXX $155 target vs $537 price → 29% → sell (genuine reduction)

Legacy whitelist (TQQQ, SOXL) and per-symbol ratio overrides
(e.g. SOXX:0.90) are kept as safety nets.

Co-Authored-By: Claude <noreply@anthropic.com>
@Pigbibi Pigbibi force-pushed the refactor/notification-unification branch from d054f39 to abc2d36 Compare July 8, 2026 21:16
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Co-Authored-By: Claude <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Co-Authored-By: Claude <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Pigbibi Pigbibi merged commit f4c7ac2 into main Jul 8, 2026
2 checks passed
@Pigbibi Pigbibi deleted the refactor/notification-unification branch July 8, 2026 21:35
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