diff --git a/.codex/commands/optimize-money-mode.md b/.codex/commands/optimize-money-mode.md index 7d8d665..a51ed46 100644 --- a/.codex/commands/optimize-money-mode.md +++ b/.codex/commands/optimize-money-mode.md @@ -5,8 +5,9 @@ live-money-readiness work in `PolyMarket_Mimic_Trader`. When the user asks to improve non-paper mode: -- start from fresh `origin/main` +- require a clean tree, fetch `origin/main`, and create a `codex/polymarket-money-mode-` branch from it; switch to an existing branch without resetting it - read the repo's profitability, strategy, readiness, and audit `.md` files first +- inspect `polymarket_copier/main.py::run_bot` before planning; treat live mode as disabled unless current code proves otherwise - verify current Polymarket docs, geoblock behavior, and legal constraints before asserting anything - optimize for execution correctness, fee-aware edge preservation, wallet/auth correctness, and fail-closed compliance - do not claim "likely profitable" or "legal" without fresh evidence and an explicit caveat diff --git a/.codex/commands/optimizer.md b/.codex/commands/optimizer.md index 917a813..a4cb58a 100644 --- a/.codex/commands/optimizer.md +++ b/.codex/commands/optimizer.md @@ -6,7 +6,7 @@ PolyMarket_Mimic_Trader optimizer workflow. When the user asks to optimize, harden, audit, or open focused improvement PRs: - inspect only for read-back or review requests -- run `bash .codex/skills/optimizer/bootstrap.sh [branch-name]` when execution is requested +- for execution, require a clean tree, run `git fetch origin main`, and create a `codex/polymarket-optimize-` branch from `origin/main`; switch to an existing branch without resetting it - scan CI, tests, `polymarket_copier/`, config, and API or SQLite choke points - deduplicate against open PRs before choosing focus areas - group work into small draft-PR chunks instead of one broad rewrite diff --git a/.codex/skills/optimize-money-mode/SKILL.md b/.codex/skills/optimize-money-mode/SKILL.md index 260619b..2d3b648 100644 --- a/.codex/skills/optimize-money-mode/SKILL.md +++ b/.codex/skills/optimize-money-mode/SKILL.md @@ -4,7 +4,7 @@ description: >- Live-money-readiness optimizer for PolyMarket_Mimic_Trader. Use when asked to review profitability docs, improve non-paper mode, verify wallet/API correctness, or harden the code for real-money paths without weakening safety - rules. + rules. Read-only for findings; edits and PRs require an explicit execution request. --- # Optimize Money Mode @@ -16,6 +16,20 @@ readiness. It cannot honestly certify that the bot is legal or "likely to make money consistently" without fresh external evidence, venue-specific legal review, and measured execution data. Do not blur that line. +## Current Build Boundary + +Before live-mode work, inspect `polymarket_copier/main.py::run_bot` at the +target revision. Current `main` rejects `config.mode == "live"` because its +Polymarket CLOB V1 order path is unsupported. Treat that as an intentional hard +stop: + +- Do not run `--mode live`, remove or bypass the gate, or use real-wallet + credentials as a test. +- Limit this workflow to paper-mode evidence and readiness or audit changes + unless the user explicitly authorizes a separate live-mode design review. +- If the gate changes, re-read the code and update this skill in the same PR; + do not assume this boundary still holds. + ## Read First Before proposing or editing anything, read the repo's business and money-mode @@ -104,7 +118,10 @@ Without that, phrase it as risk reduction or readiness improvement, not alpha. When the user asks you to execute this workflow: -1. Start from fresh `origin/main`. +1. Start from fresh `origin/main`: require `git status --porcelain` to print + nothing, run `git fetch origin main`, then run + `git switch -c codex/polymarket-money-mode- origin/main`. If the + branch exists, switch to it without resetting it. 2. Read the repo docs above. 3. Verify the current Polymarket docs and legal baseline above. 4. Produce findings and choose one high-leverage chunk. diff --git a/.codex/skills/optimizer/SKILL.md b/.codex/skills/optimizer/SKILL.md index 20b7b15..05e7121 100644 --- a/.codex/skills/optimizer/SKILL.md +++ b/.codex/skills/optimizer/SKILL.md @@ -4,7 +4,8 @@ description: >- Codex-native PolyMarket_Mimic_Trader optimization workflow. Use when working in cgfixit/PolyMarket_Mimic_Trader and the user asks Codex to optimize the repo, harden CI, audit code, security, or financial-risk assumptions, propose - focused improvements, or open optimization PRs against main. + focused improvements, or open optimization PRs against main. Read-only for + review requests; edit, commit, and PR steps require an explicit execution request. --- # Optimizer @@ -24,7 +25,7 @@ instructions below as authoritative for Codex here. requests, inspect only. - All shell, network, git, and GitHub actions remain governed by the active Codex sandbox, approval, and authentication rules. -- Use `.codex/skills/optimizer/bootstrap.sh` as the bundled harness path. +- Use the native Git bootstrap below. `bootstrap.sh` remains optional for POSIX callers; do not require Bash on Windows. - Use local `git` for branch creation, commits, and pushes. - Prefer the GitHub app or plugin for PR and issue data when available. Use `gh` as fallback for listing PRs, checking auth, and creating draft PRs. @@ -55,20 +56,21 @@ Read code for leverage: ## Step 0 - Bootstrap -From the repo root, run the bundled harness when the user has asked to execute -the optimization workflow: +From the repo root, require a clean tree and start the work branch from fresh +`origin/main`: ```bash -bash .codex/skills/optimizer/bootstrap.sh codex/polymarket-optimize- +git status --porcelain # must print nothing +git fetch origin main +git switch -c codex/polymarket-optimize- origin/main ``` -Omit the branch argument for a local inventory against the current branch. With -a branch argument, the script fetches `origin/main` and creates or checks out -the requested branch without force-resetting existing branch work. +If the branch already exists, use `git switch ` and do not reset it. +For POSIX callers, `bash .codex/skills/optimizer/bootstrap.sh ` is an +optional equivalent; it does not force a Git identity. -The harness does not force a git identity. It prints the current git identity -and only changes it when explicit `CODEX_GIT_USER_NAME` or -`CODEX_GIT_USER_EMAIL` environment variables are set. +For a read-only inventory, omit the branch creation and inspect the current +clean checkout. ## Step 1 - Read-Only Scan @@ -198,7 +200,7 @@ PolyMarket_Mimic_Trader gates are: ```bash powershell -File scripts/check-lint.ps1 -python -m mypy polymarket_copier +python -m mypy polymarket_copier --ignore-missing-imports --no-strict-optional pytest -v -m "not integration" ``` diff --git a/AGENTS.md b/AGENTS.md index 7793e8e..39c4376 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -30,7 +30,7 @@ Validation commands: - `ruff check .` and `ruff format --check .` (both are CI gates; `scripts/check-lint.ps1` is a Windows PowerShell wrapper around the same two commands) - `mypy polymarket_copier --ignore-missing-imports --no-strict-optional` (exact CI flags) - `python -m polymarket_copier.main --mode paper --config config.yaml` -- Or run everything at once: `bash .claude/skills/preflight/preflight.sh` +- On POSIX hosts with Bash available, the all-in-one preflight is `bash .claude/skills/preflight/preflight.sh`. On Windows, run the individual CI gates above; `powershell -File scripts/check-lint.ps1` covers both Ruff gates. Repo facts: