fix: refuse unsupported CLOB V1 live startup#116
Merged
Conversation
cgfixit
marked this pull request as ready for review
July 13, 2026 07:28
cgfixit
pushed a commit
that referenced
this pull request
Jul 13, 2026
Verified CLAUDE.md against current source (main.py, tracker.py, risk_manager.py, copier.py, clob_client.py, portfolio.py, config.py, pyproject.toml, .github/workflows/ci.yml). Three stale claims found and fixed per the doc's own meta-rule (code wins, fix the doc): - The Tier 3 "known gap" (--mode live CLI override bypassing the load-time private-key check) is stale: main.py::run_bot now re-runs validate_live_config() on CLI override AND unconditionally raises ConfigError whenever config.mode == "live" (unsupported CLOB V1), landed today in PR #116 (commit a2cbffd). Updated the system map and Tier 3 bullet to describe the current hard-disable instead of the closed gap. - CI's matrix (.github/workflows/ci.yml) tests only py3.11/3.12, not 3.10 as the Commands section claimed; added a caveat noting the pyproject.toml floor (>=3.10, target-version py310) isn't actually exercised by CI. - The close_position() anchor cited "tag C4" on portfolio.py, but that comment tag only exists in copier.py (the caller); corrected the anchor to say so. Everything else checked (six-loop startup wiring, tracker score formula, TP/SL structure, retry matrix, Decimal exposure, paper fill fee/slippage precedence, config wiring, ruff config, referenced docs) matches the code exactly. Also verified .claude/* is correctly wired: all 4 skills (api-drift-audit, fact-check, next-chunk, preflight) and 4 commands (deploy-check, next-chunk, optimizer, pr-sweep) are present, valid, and load in-session; settings.json's Stop hook is intact; .claude/commands/optimizer.md's redirect to .codex/skills/optimizer/ is an intentional cross-tool convention documented in AGENTS.md, not a misconfiguration.
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.
What changed
mode: livebefore logger, network, database, or trading-client constructionRoot cause
Production trading moved to CLOB V2 on 2026-04-28, but this repository still pins and calls the legacy V1 Python client and V1 order structures. A warning allowed operators to mistake unsupported startup for live readiness.
Impact
Paper mode is unchanged. Live mode now fails closed until a separate supported V2 migration is implemented and validated.
Validation
pytest tests/test_main.py tests/test_config.py -q -p no:cacheprovider— 47 passedpython -m py_compile polymarket_copier/main.py tests/test_main.py— passedruff check polymarket_copier/main.py tests/test_main.py— passedruff format --check polymarket_copier/main.py tests/test_main.py— passedRisk
Intentional live-mode startup break. Credential validation still runs for CLI live overrides; no order, wallet, paper-mode, or persistence behavior changed.
Reference: https://docs.polymarket.com/v2-migration