Claude/expert bug audit prompt cm i3w#26
Merged
Frostbite1536 merged 3 commits intomainfrom Mar 13, 2026
Merged
Conversation
Targets the gaps between prior audits: cross-component contract violations, state machine transition errors, multi-provider interaction bugs, and invariant drift. Organized as 6 targeted passes referencing ARCHITECTURE.md and STATE_MACHINE_DIAGRAMS.md directly. https://claude.ai/code/session_01A2iVUP7rbKpQ3raiDNBEah
Six-pass audit targeting inter-component bugs that survive per-module reviews: - 3 High: vars(t) in pnl.py, analysis tools ignore filtered_trades, tax FIFO lots not keyed by source (cross-provider bug) - 3 Medium: persistence restores stale filters, wrong currency symbol in mixed portfolios, Inf cost silently zeros ROI - 4 Low: Decimal handler missing in serializer, Kalshi pnl_is_set invariant, hardcoded $ in metrics, SQLite REAL type https://claude.ai/code/session_01A2iVUP7rbKpQ3raiDNBEah
Bug 1: pnl.py — Float cumsum for exposure calculation, now uses Decimal
Bug 2: pnl.py — Float sum in by_source breakdown, now uses Decimal
Bug 3: pnl.py — calculate_market_pnl float accumulation + missing sanitize_numeric
Bug 4: kalshi.py — str(raw.get("count", 0)) produces "None" for null count
Bug 5: kalshi.py — Missing sanitize_numeric() on PnL from positions API
Bug 6: kalshi.py — _apply_position_pnl only matched "sell", missed other sell types
Bug 7: filters.py — _normalize_datetime return type annotation (datetime→Optional)
Bug 8: tax.py — Decimal converted to float before subtraction, causing precision loss
Bug 9: chart_tools.py — _CHART_GENERATORS missing "global" caused unhandled KeyError
Bug 10: validators.py — validate_positive_int rejected float-typed integers (5.0)
https://claude.ai/code/session_01A2iVUP7rbKpQ3raiDNBEah
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.
No description provided.