Skip to content

fix: refuse unsupported CLOB V1 live startup#116

Merged
cgfixit merged 1 commit into
mainfrom
agent/fail-closed-legacy-clob-live
Jul 13, 2026
Merged

fix: refuse unsupported CLOB V1 live startup#116
cgfixit merged 1 commit into
mainfrom
agent/fail-closed-legacy-clob-live

Conversation

@cgfixit

@cgfixit cgfixit commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What changed

  • refuse mode: live before logger, network, database, or trading-client construction
  • remove the obsolete experimental readiness warning
  • replace warning tests with a startup-refusal regression test

Root 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 passed
  • python -m py_compile polymarket_copier/main.py tests/test_main.py — passed
  • ruff check polymarket_copier/main.py tests/test_main.py — passed
  • ruff format --check polymarket_copier/main.py tests/test_main.py — passed

Risk

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

@cgfixit
cgfixit marked this pull request as ready for review July 13, 2026 07:28
@cgfixit
cgfixit merged commit 6e2db11 into main Jul 13, 2026
7 checks passed
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.
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