docs: sync CLAUDE.md with live-mode hard-disable and CI matrix#118
Merged
Conversation
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.
cgfixit
marked this pull request as ready for review
July 13, 2026 13:58
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
Full verification pass over
CLAUDE.md(fact-checked against current source) and the.claude/*skill/command wiring, requested as a repo-setup/config-verification task. Fixed three stale claims found inCLAUDE.md; everything else checked out.Why
Per
CLAUDE.md's own meta-rule: "when this document and the code disagree, the code is right... fix the doc in the same PR." Three same-day merges (PRs #115-#117, all landed 2026-07-13 before this session) changed behavior the doc describes:CLAUDE.mdsaid--mode liveCLI override bypasses the load-time private-key check and told agents to "flag, don't fix unprompted."main.py::run_bot(as of commita2cbffd, PR fix: refuse unsupported CLOB V1 live startup #116) now re-runsvalidate_live_config()on CLI override and unconditionally raisesConfigErrorwheneverconfig.mode == "live"— this build's CLOB V1 client is disabled outright for live trading, regardless of credentials. The gap is closed; the doc described a state that no longer exists. Confirmed bytests/test_main.py::test_cli_live_override_revalidates_live_credentialsandtest_live_mode_refuses_unsupported_clob_v1.CLAUDE.md's Commands section claimed "CI runs on py3.10/3.11/3.12.".github/workflows/ci.yml:34only tests["3.11", "3.12"].pyproject.tomlstill declaresrequires-python = ">=3.10"/target-version = "py310", but 3.10 isn't actually exercised by CI.portfolio.py::close_position"(tag C4)," but theC4comment tag only exists incopier.py(the caller), not on the guard clause itself inportfolio.py.Also updated the System Map's live-mode sentence to describe the current hard-disable instead of implying live mode is runnable with the right flag/key/preflight.
Everything else verified as accurate (spot-checked via a dedicated code-vs-doc pass): the six-loop
run_botstartup wiring andsupervise()backoff,rebalance_loop/exit_check_loopbehavior,DataClientbeing dead at runtime, the logger-hierarchy claim, the trader score formula ((4.0·sharpe + 3.5·consistency + 2.5·recency) / 10),_compute_thresholds()TP/SL structure and its three call sites, the full retry matrix (entry/resting/exit),Decimal-via-str()exposure accounting, paper-fill fee/slippage precedence, all other mistakes-table anchors, config wiring (RiskConfig(...), the coupled-slippagemodel_validator,TestShippedConfigMatchesCodeDefaults), ruff config, and all referenced doc files existing.Also verified
.claude/*structure and wiring (no changes needed):api-drift-audit,fact-check,next-chunk,preflight) and 4 commands (deploy-check,next-chunk,optimizer,pr-sweep) are all present, have valid frontmatter/content, and load correctly in this session (confirmed each appears in the session's available skill/command list)..claude/settings.json's Stop hook (dirty-tree guard) is intact and correctly configured..claude/commands/optimizer.mdredirecting to.codex/skills/optimizer/is an intentional cross-tool convention (documented inAGENTS.md: "Existing Claude-side audit notes live in.claude/commands/optimizer.md; keep Codex guidance repo-native and tool-agnostic"), not a misconfiguration — confirmed.codex/skills/optimizer/bootstrap.shexists.probe.sh,preflight.sh) passbash -n.Validation
Docs-only change (no code touched), but ran the full local CI parity gate per repo convention:
Note: one run of the full suite showed a single flaky failure (
tests/test_copier.py::TestStructuredEvents::test_position_opened_event_emitted, a wall-clock timing assertion off by 1 microsecond:0.001672 >= 0.001673). Confirmed pre-existing and unrelated to this change — it passed in 5/5 isolated reruns and in a subsequent full-suite rerun (623/623 passed). Not fixed here per the "pre-existing failures are reported, not bundled" tie-breaker.Risk to monitor
None — no code changed, only
CLAUDE.mdprose/anchors. Nothing to monitor at runtime.Generated by Claude Code