Skip to content

Add bounded BNB wallet evidence to Earn diagnosis - #271

Merged
Pigbibi merged 1 commit into
mainfrom
fix/binance-daily-state-20260913
Sep 13, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
fix/binance-daily-state-20260913

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Problem

The bounded earn-forward-diagnose run can leave a positive BNB residual unexplained even when Spot/Flexible Earn, realtime counters, trades, and external flows are stable. The existing BNB wallet activity helper only returned counts, so one diagnostic run could not compare the already approved assetDividend and Spot dribblet surfaces.

Change

  • Keep diagnose_bnb_wallet_activity backward compatible and optionally retain its two response row sets in memory for the new diagnostic consumer only.
  • In earn-forward-diagnose, call those two GETs only for a positive BNB residual when the other bounded checks are stable.
  • Validate the checkpoint-to-now window, row uniqueness, Decimal amounts, BNB targetAsset, and aggregate shape without exposing amounts or source IDs.
  • Report exact dividend, transfer, fee-adjusted, and combined comparison flags, sanitized source failure metadata, and a separate one-eight-decimal-unit residual flag. Fee and dividend net semantics remain explicitly unverified; all causal and execution flags remain false.
  • Add bounded regression coverage and operator documentation.

Validation

  • .venv/bin/python -m pytest -q — 855 passed, 91 subtests passed.
  • .venv/bin/ruff check application/broker_reconciliation.py scripts/migrate_daily_accounting_state.py tests/test_balance_flow_diagnostics.py tests/test_earn_forward_diagnosis.py — passed.
  • No remote workflow was dispatched by this change.

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi
Pigbibi merged commit 0f40d19 into main Sep 13, 2026
1 check passed
@Pigbibi
Pigbibi deleted the fix/binance-daily-state-20260913 branch September 13, 2026 10:36
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