Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .codex/commands/optimize-money-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<topic>` 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
Expand Down
2 changes: 1 addition & 1 deletion .codex/commands/optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<topic>` 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
Expand Down
21 changes: 19 additions & 2 deletions .codex/skills/optimize-money-mode/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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-<topic> 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.
Expand Down
26 changes: 14 additions & 12 deletions .codex/skills/optimizer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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-<topic>
git status --porcelain # must print nothing
git fetch origin main
git switch -c codex/polymarket-optimize-<topic> 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 <branch>` and do not reset it.
For POSIX callers, `bash .codex/skills/optimizer/bootstrap.sh <branch>` 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

Expand Down Expand Up @@ -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"
```

Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Loading