Skip to content

docs+execution: current-state README и RESULTS, отказ подставлять корзину вместо оператора - #85

Merged
gistrec merged 4 commits into
mainfrom
fix/basket-guard-and-docs
Aug 31, 2026
Merged

gistrec merged 4 commits into
mainfrom
fix/basket-guard-and-docs

Conversation

@gistrec

@gistrec gistrec commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

Закрывает #5 и #24 плюс один пункт из бэклога #36.

#5 — README отрицал сильнейшую часть проекта

Строка 36 гласила «Paper / live execution is intentionally out of scope» — при 14 модулях в execution/, живом mainnet-кроне с 2026-08-24 и публичном дашборде, который не был упомянут ни разу.

Первый экран переписан под current state:

  • что торгуется, с какого числа, ссылка на живой дашборд и скриншот (ops/static/og-image.png уже был сгенерирован и лежал неиспользованным);
  • таблица четырёх слоёв со ссылками на вложенные README;
  • сквозная диаграмма данные → сигнал → ордер → журнал → алерты;
  • упоминание трёхфлагового гейта и лестницы выката.

Project layout дополнен paper_trading/, execution/, monitoring/, dashboard/, ops/, constraints.txt. Секция Tests переписана по фактам ci.yml: ~1400 тестов, матрица 3.11–3.13, coverage-floor 70%, установка через констрейнты, плюс упоминание защитных стабов. Roadmap: выполненное перенесено в Done, открытым остался survivorship состава корзины.

Честность не потеряна ради подачи: DSR 0.037 ≈ 0 назван прямо на первом экране, рядом с объявлением live-состояния, вместе с тем, на чём реально стоит деплой.

#24 — RESULTS.md числил стратегию на testnet

Несуществующий Sharpe +1.81 был исправлен раньше, волной DSR-конвенции (строка 116 уже объясняла происхождение). Оставалось состояние:

Было Стало
PAPER (Binance testnet) в таблице и легенде LIVE (Binance mainnet, capped)
«Currently paper-trading (Binance testnet)» «Currently trading live (Binance mainnet, real money, capped)»
«Next gate: 4–8 clean weeks of testnet» лестница, которая реально пройдена
«a deliberate code-path migration to Kraken» назван устаревшим: план отменён 2026-07-09
ссылка на правило CLAUDE.md «Live orders only on testnet» названо снятым; что пришло на замену

Отменённый план и снятое правило названы явно как устаревшие, а не молча удалены — иначе читатель, видевший старую версию, не поймёт, что изменилось.

Таблица стратегий и вердикты REJECT не тронуты, как и требует issue. Оставшиеся упоминания Kraken — это Kraken как площадка данных в кросс-проверках, к отменённой миграции отношения не имеют.

Из бэклога #36: тихая подмена корзины

parts = [p.strip().upper() for p in value.split(",") if p.strip()]
if not parts:
    return _DEFAULT_BASKET      # <-- переменная ЗАДАНА, но не распарсилась

TRADE_LAB_PAPER_BASKET="," или пробелы — оператор пытался что-то сказать, это не дошло, и исполнитель молча торговал состав, которого никто не просил. Состав корзины — пиннутый параметр; выбирать его за оператора нельзя, это тот же класс, что тихое сокращение корзины.

Незаданная переменная по-прежнему означает дефолт. Заданная и пустая теперь падает с PaperConfigError, подсказывая закомментировать строку.

Проверено на живом окружении: в .env.testnet и .env.mainnet на сервере строка закомментирована, то есть os.getenv вернёт None — крон не затронут.

Полный сьют: 1410 passed, ruff чист.


Closes #5%0ACloses #24

…зину вместо оператора

#26/#32-соседи по бэклогу закрыты раньше; здесь три оставшихся пункта.

#5 — README отрицал execution-слой. Строка «Paper / live execution is
intentionally out of scope» стояла при 14 модулях в execution/, живом
mainnet-кроне и публичном дашборде, который не был упомянут ни разу. Первый
экран переписан под current state: что торгуется, с какого числа, ссылка на
дашборд и скриншот, таблица четырёх слоёв со ссылками на вложенные README и
сквозная диаграмма данные → сигнал → ордер → журнал → алерты. Project layout
дополнен paper_trading/, execution/, monitoring/, dashboard/, ops/ и
constraints.txt. Секция Tests переписана по фактам ci.yml: ~1400 тестов,
матрица 3.11–3.13, coverage-floor 70%, установка через констрейнты. Roadmap:
выполненные пункты перенесены в Done, вместо них открытым остался
survivorship состава корзины.

Честность на первом экране сохранена: DSR 0.037 ≈ 0 назван прямо там же, где
объявлено live-состояние, вместе с тем, на чём реально стоит деплой.

#24 — RESULTS.md числил стратегию на testnet. Несуществующий Sharpe +1.81 был
исправлен раньше (волна DSR-конвенции), оставалось состояние: статус в таблице,
легенда, раздел «Currently paper-trading», обещание миграции на Kraken и
ссылка на правило CLAUDE.md «Live orders only on testnet», которого больше нет.
Статус — LIVE (Binance mainnet, capped) с 2026-08-24; описана фактически
пройденная лестница; отменённый план Kraken и снятое правило названы явно как
устаревшие, а не молча удалены. Таблица стратегий и вердикты REJECT не тронуты.

Из бэклога #36: _parse_basket подставлял дефолтную корзину не только когда
переменная не задана, но и когда она задана и парсится в ноль символов («,»,
пробелы). Оператор пытался что-то сказать, это не дошло — и исполнитель молча
торговал состав, которого никто не просил. Состав корзины пиннутый параметр,
выбирать его за оператора нельзя. Незаданная переменная по-прежнему означает
дефолт; заданная и пустая теперь падает. В обоих env-файлах на сервере строка
закомментирована, живой крон не затронут.

Closes #5
Closes #24
@gistrec

gistrec commented Aug 30, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa9f364aef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md Outdated
Comment on lines +541 to +543
constraints.txt Pinned dependency set — CI and the server
install through it, so the tested versions
are the trading versions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop claiming CI uses a nonexistent constraints file

At this commit, a repo-wide tree search shows no constraints.txt, and .github/workflows/ci.yml lines 48–50 installs directly with pip install -e without a -c option. Consequently, users cannot follow this documented reproducibility path, and CI is not testing the dependency versions used by the server as claimed; either commit and apply the constraints file in CI or remove these assertions.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Верно — constraints.txt появляется в PR #83, в этом дереве его нет, так что README обещал бы несуществующий путь воспроизводимости и ложно описывал бы CI.

Убрал упоминания отсюда: и из Project layout, и из секции Tests. Они вернутся вместе с самим файлом в #83, где утверждение будет истинным. Спасибо, что проверили дерево, а не описание.

Comment thread README.md Outdated
| Layer | What it does | Where |
|---|---|---|
| Research | fetch → strategies → backtest → walk-forward → DSR → ensemble | this README |
| Forward harness | daily paper clock, frozen-config gate, vintage store, look-ahead detector, behavioural fingerprint monitor | `src/trade_lab/paper_trading/` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Link the forward harness to its actual README

This row promises a README but points readers to src/trade_lab/paper_trading/, which contains no README in the reviewed tree. The forward-harness documentation is actually at paper_trading/README.md in the repository root, so the table should link there as the execution and monitoring rows do.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Верно, README харнесса лежит в корне (paper_trading/README.md), а не в src/trade_lab/paper_trading/. Ссылка исправлена, теперь строка оформлена так же, как строки execution и monitoring.

Comment thread README.md Outdated
Comment on lines +74 to +75
reconstruction, wait-for-ack, and an fsynced JSONL journal. Exchange-
agnostic through ccxt; the exchange is the single source of truth and

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not describe the execution layer as exchange-agnostic

The live execution path currently supports only Binance: execution/broker.py defines VERIFIED_EXCHANGES = {"binance"} and Broker.connect rejects every other CCXT exchange before making a network call because its idempotency parameters are Binance-specific. Calling this layer exchange-agnostic can lead operators to configure another advertised CCXT venue only to have all status, dry-run, and execution commands refuse to start; document it as Binance-only until another exchange is implemented and verified.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Подтверждено и исправлено — VERIFIED_EXCHANGES = frozenset({"binance"}), и Broker.connect отвергает всё остальное до сетевого вызова. Формулировка «exchange-agnostic» действительно могла привести оператора к настройке другой площадки с последующим отказом всех команд.

Написал как есть: построено на ccxt, но намеренно Binance-only в рантайме, с указанием причины (параметры идемпотентности венечно-специфичны, и непроверенная площадка не должна достигаться случайно). Это, кстати, не противоречит правилу проекта «keep execution exchange-agnostic via CCXT» — оно про архитектуру слоя, а не про список разрешённых венью.

Comment thread README.md
Comment on lines +13 to +14
collapsed into a headline. The deployed config's honest DSR under the
project's own conservative deflator is **0.037 ≈ 0** — the deploy case

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope the blanket DSR convention around this exception

This adds a conservative-convention DSR to the README, but the same page still states at lines 62–65 that every DSR in the README uses the minimal 1/sqrt(T) convention. Although the later convention section recognizes the conservative exception, the earlier blanket guarantee now directly contradicts it and can cause readers to compare 0.037 under the wrong deflator; update that earlier statement to carry the same explicit-exception wording.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Принято, и это неприятно точное попадание: я добавил консервативные 0.037 на первый экран и оставил предложение «Every DSR in this README is the minimal 1/sqrt(T)» нетронутым. Ровно тот класс бланкетных утверждений о конвенции, который в этом проекте правился четырьмя итерациями подряд, и я его повторил.

Исключение теперь названо прямо в том же предложении, а не только в разделе ниже.

Comment thread README.md
Comment on lines +5 to +9
A crypto research framework **and the live trading system that came out
of it**. One strategy survived the validation stack and has been placing
real orders on Binance mainnet since **2026-08-24**, with capped capital,
under a daily cron — with a public read-only dashboard showing every
cycle it runs: **[trade-lab.gistrec.cloud](https://trade-lab.gistrec.cloud/)**.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the canonical phase record when declaring live status

This declares that mainnet orders have been live since August 24, but the repository's CLAUDE.md lines 8–9 still defines the current phase as mainnet read-only observation and says live orders will happen only after a future smoke test. Because that file identifies itself as the permanent project rules to read at the start of every session, leaving it stale gives operators and future maintainers an authoritative operational state that contradicts this new public status; update the phase record in the same change.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Согласен, и это важнее остальных пунктов: CLAUDE.md объявляет себя постоянными правилами, читаемыми в начале каждой сессии, то есть даёт авторитетное состояние. Он числил текущей фазой mainnet read-only observation и обещал live «только после смоук-теста» — при том, что лестница пройдена 2026-08-24.

Обновил секцию Current phase: лестница описана как завершённая, состояние — LIVE с 2026-08-24, ~148 USDT, с оговоркой, что форвард-тест идёт, а не пройден (живой выборке недели, она подтверждает пайплайн, а не эдж). Заодно поправил первую строку: «transitioning into paper trading» → «now runs a live trading system». Хард-правила не тронуты.

Comment thread RESULTS.md
result.

## What "PAPER" status actually means
## What "LIVE" status actually means (and what it does not)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Repair references to the renamed status section

Renaming this heading leaves inbound references stale: CLAUDE.md line 12 and findings/production_config_v1.md lines 348–349 still direct readers to RESULTS.md § "What PAPER status actually means," which no longer exists. Update those references to the LIVE title or retain a compatible anchor so readers can locate the convention explanation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Верно. CLAUDE.md обновлён на новый заголовок.

findings/production_config_v1.md править не стал: по правилам проекта findings/ — иммутабельная история, а не текущий индекс. Вместо этого оставил под новым заголовком в RESULTS.md явную оговорку о переименовании со старым названием, чтобы и старые ссылки, и поиск по «What PAPER status actually means» приземлялись в нужное место.

… устаревшая фаза

Все шесть подтверждены по коду и по дереву.

«Exchange-agnostic through ccxt» — неправда в рантайме: VERIFIED_EXCHANGES =
frozenset({"binance"}), и Broker.connect отвергает любую другую биржу до
сетевого вызова, потому что параметры идемпотентности венечно-специфичны.
Оператор, настроивший другую площадку, получил бы отказ всех команд. Написано,
как есть: построено на ccxt, но намеренно Binance-only в рантайме, с указанием
причины.

Бланкетное заявление «Every DSR in this README is the minimal 1/sqrt(T)» — я
добавил на первый экран консервативные 0.037 и оставил это предложение
нетронутым. Ровно тот класс ошибки, который правился в волне DSR-конвенции
четыре раза. Теперь исключение названо прямо в том же предложении.

Ссылка на README форвард-харнесса вела в src/trade_lab/paper_trading/, где
README нет — он в корне репозитория.

Упоминания constraints.txt убраны: файл появляется в PR #83, и в этом дереве
его нет, то есть README обещал бы несуществующий путь воспроизводимости.
Вернутся вместе с файлом.

CLAUDE.md числил текущей фазой mainnet read-only observation и обещал live
только после смоук-теста — при том, что лестница пройдена 2026-08-24, и файл
сам объявляет себя постоянными правилами, читаемыми в начале каждой сессии.
Оператор или будущий сопровождающий получал бы авторитетное состояние,
противоречащее публичному статусу. Фаза описана как есть, включая оговорку,
что форвард-тест идёт, а не пройден.

Переименование раздела RESULTS.md оставило висячие ссылки. CLAUDE.md обновлён;
записи в findings/ не тронуты — это иммутабельная история, поэтому под новым
заголовком оставлена оговорка со старым названием, чтобы старые ссылки и поиск
приземлялись.
gistrec added a commit that referenced this pull request Aug 30, 2026
Перенесено из PR #85 по замечанию Codex: там constraints.txt ещё не
существует, поэтому README обещал бы несуществующий путь. Здесь файл есть,
и утверждение истинно.

Заодно секция Install теперь ведёт через scripts/install_runtime.sh, а не
через голый pip install -e ".[dev]" — разработчик получает тот же
зафиксированный набор, что CI и сервер, а не свежий резолв.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6bc643c2a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread RESULTS.md
1. **Testnet paper trading** — validated the order pipeline (idempotent `clientOrderId`, reconstruction, wait-for-ack, journal schema). Note that testnet **cannot** validate the signal path: Binance testnet wipes its candle history roughly monthly, so SMA(200) never warms and no buy order is ever placed there.
2. **Mainnet read-only observation** — 6-hourly dry-run cron against a key with no trading permission. Mainnet has full kline history, so this is where the SMA(200) / ladder signal path was actually exercised.
3. **Capped smoke test** (≤ 25 USDT) — one real order end to end.
4. **Daily live cron** — since 2026-08-24; the first cycle filled 7 of 7 basket legs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the first-live-cycle history

The production chronology encoded in tests/test_execution_tracking.py lines 1697–1706 says the live cron first ran on 2026-08-24 with orders_executed=[], while the seven catch-up buys landed on 2026-08-25. Calling those fills the first cycle misstates the start of live coverage; describe them as the first order-bearing cycle or mention the initial no-order cycle.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь не соглашусь — проверил по продовому журналу, а не по фикстуре.

2026-08-24: live-циклов=1 outcome=['success'] филлов=7 объём=99.05 USDT
2026-08-25: live-циклов=1 outcome=['success'] филлов=0
2026-08-26: live-циклов=1 outcome=['success'] филлов=7 объём=49.71 USDT   <- пополнение до 150
2026-08-27..30: по одному циклу, филлов 0

(агрегация по ended_at из data/journal/cycles_mainnet.jsonl на сервере)

Первый живой цикл действительно закрыл 7 из 7 ног на 99.05 USDT. Утверждение в RESULTS.md верно.

Расхождение в источнике: tests/test_execution_tracking.py:1697 — это стилизованный сценарий для теста bootstrap-разметки со своими датами (08-20 намерение симуляции, 08-24 пустой цикл, 08-25 семь докупок), а не запись продовой хронологии. Сбило вас, справедливо, то, что его докстринг начинается словом «Production shape» — я это поправлю отдельно, потому что формулировка вводит в заблуждение и человека тоже.

Кстати, обе картины примиряются, если помнить про смещение на день: coid несёт дату сигнала (дата запуска − 1), поэтому цикл, завершившийся 08-24, несёт филлы с датой сигнала 08-23 — именно это число фигурирует в #77 как bootstrap_date.

Comment thread RESULTS.md Outdated
* Until paper trading is done: this strategy is **not cleared for real money**, even though it has cleared every backtest-side gate.
* Now: **live on Binance mainnet with real money since 2026-08-24**, ~148 USDT, placed daily by the `paper-place-orders` cron. The first live cycle filled 7 of 7 basket legs. See `src/trade_lab/execution/README.md` for the pipeline and the rollout ladder that was walked (testnet pipeline validation → mainnet read-only observation → capped smoke test → daily live cron).
* An earlier revision of this file promised a "code-path migration to Kraken" and cited a CLAUDE.md rule "Live orders only on testnet". Both are obsolete: the Kraken plan was cancelled on 2026-07-09 (the premise that Binance is geo-blocked for the owner was simply wrong), and that hard rule no longer exists. What replaced it is the three-flag mainnet gate plus the rollout ladder — mainnet is still not a flag-flip.
* Next: accumulate forward-test evidence at this size. The live sample is weeks old and proves the *pipeline*, not the *edge* — at this horizon it cannot distinguish a working strategy from a lucky one, and it is not expected to.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe the live sample as days old

As this document is explicitly current as of 2026-08-30 and dates the live start to 2026-08-24, the live sample is only six days old, not “weeks old.” This exaggerates the maturity of the forward evidence in the section intended to qualify exactly how little that sample proves.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Верно и особенно неудобно, потому что это преувеличение стояло ровно в том абзаце, который существует, чтобы ограничить, насколько мало доказывает форвард-выборка. 2026-08-24 → 2026-08-30 — шесть дней. Написал «six days» с явной привязкой к дате документа.

Замечание Codex на #85. Документ датирован 2026-08-30, старт живой торговли —
2026-08-24, то есть шесть дней. «Weeks old» преувеличивало зрелость
форвард-свидетельства ровно в том абзаце, который существует, чтобы
ограничить, насколько мало оно доказывает.
Сценарий bootstrap-разметки начинался словами «Production shape» и перечислял
даты, которых в проде не было: там первый живой цикл завершился 2026-08-24 и
сразу закрыл все семь ног на 99.05 USDT, а фикстура намеренно разносит первый
запуск крона и филлы, чтобы проверять более трудный случай.

Формулировка сбила ревьюера, который принял фикстуру за источник истины о
хронологии. Теперь сказано прямо: даты выбраны под сценарий, а продовая
картина приведена рядом.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@gistrec
gistrec merged commit 72e54b4 into main Aug 31, 2026
4 checks passed
@gistrec
gistrec deleted the fix/basket-guard-and-docs branch August 31, 2026 02:33
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.

docs: README отрицает execution-слой — переписать под current-state (live mainnet)

1 participant