Skip to content

Claude/audit deleted files wpq6 c#27

Merged
Frostbite1536 merged 5 commits intomainfrom
claude/audit-deleted-files-Wpq6C
Mar 16, 2026
Merged

Claude/audit deleted files wpq6 c#27
Frostbite1536 merged 5 commits intomainfrom
claude/audit-deleted-files-Wpq6C

Conversation

@Frostbite1536
Copy link
Owner

No description provided.

claude added 5 commits March 15, 2026 08:16
…an API surface

- Remove 93 unused imports/variables across all test and production files
- Move _parse_timestamp to utils/time_utils.py as public parse_timestamp
- Move _sanitize_filename to utils/export.py as public sanitize_filename
- Add type annotations to sanitize_numeric, _normalize_datetime, parse_timestamp
- Replace bloated Args/Returns docstrings with concise single-line docstrings
- Extract _export_with_logging helper to deduplicate export boilerplate
- Delete dead get_current_active_user (redundant with get_current_user)
- Add typed SignupResponse schema replacing untyped dict response
- Fix compute_realized_pnl docstring to match pnl_is_set semantics
- Rename FilterParams.types to trade_types (with alias for backward compat)
- Fix silent error swallow in fetch_market_details
- Convert run_api.py/run_gui.py dependency checks to importlib.util.find_spec
- Add .desloppify/ to .gitignore

https://claude.ai/code/session_01GsZ8qwDvTX3Z8knHfKgnpQ
… test

1. run_gui.py: Restore special tkinter handling in dependency check.
   importlib.util.find_spec('tkinter') returns None on Linux systems
   with system-installed tkinter (C extension), even though the module
   is importable. Reverted to __import__ for tkinter specifically.

2. tests/static_patterns/test_imports.py: Restore all module imports in
   test_all_modules_import_together. The desloppify commit removed them,
   leaving the circular import detection test as just "assert True".

https://claude.ai/code/session_01AJkJyGzyutD8YjR3cbq2Np
1. pnl_calculator.py: FIFO calculator used trade.price (market reference)
   instead of trade.cost/trade.shares (actual cost basis) for both buy
   queue entries and sell revenue. This ignored fees and caused incorrect
   PnL for providers where cost != price*shares (notably Kalshi).

2. gui.py: Temp file leak when json.dump fails — tmp_path was assigned
   after json.dump, so NameError in finally block masked the real error
   and leaked the temp file. Moved tmp_path assignment before json.dump.

3. gui.py: _fetch_in_progress flag permanently stuck if root.after()
   fails (user closes GUI during API fetch). Added try/except around
   root.after in the error path to reset the flag.

4. pro.py: Cumulative PnL chart used float accumulation, violating the
   project invariant (CLAUDE.md: use Decimal loop for PnL accumulation).
   Switched to Decimal accumulator matching pnl.py and enhanced.py.

5. data_tools.py: Guard clauses called error_result() directly inside
   @safe_tool handlers, bypassing the decorator's error handling. Changed
   to raise ValueError, letting @safe_tool handle it consistently.

https://claude.ai/code/session_01AJkJyGzyutD8YjR3cbq2Np
_apply_position_pnl now skips trades with pnl_is_set=True, enforcing
CLAUDE.md invariant #2 ("Never overwrite pnl_is_set=True trades").
Currently all Kalshi trades start with pnl_is_set=False so this is
preventive, but it protects against future changes that might call
this method on trades that already have provider-set PnL.

https://claude.ai/code/session_01AJkJyGzyutD8YjR3cbq2Np
@Frostbite1536 Frostbite1536 merged commit bfec902 into main Mar 16, 2026
4 of 5 checks passed
@Frostbite1536 Frostbite1536 deleted the claude/audit-deleted-files-Wpq6C branch March 17, 2026 00:32
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.

2 participants