Back to skills
SKILL.md
Evo Debug
ASecurityDiagnose the strategy-evolution pipeline β did the weekly Saturday run fire, which phase did it reach, why did it skip or fail, and why candidates rarely PASS (first PASS 2026-10-10, knob mode). Use when evolution seems silent, a Saturday run is missing, no 𧬠Discord message arrived, or the weekly review flags an evolution finding.
- 3 stars
- 0 votes
- 0 copies
- 2 views
- Added November 16, 2026
Works with
Security analysis
100/100npx -y skills add ericwu13/tai-robot --skill evo-debug --agent claude-codeAre you the author of Evo Debug?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ericwu13-evo-debug)---
name: evo-debug
description: Diagnose the strategy-evolution pipeline β did the weekly Saturday run fire, which phase did it reach, why did it skip or fail, and why candidates rarely PASS (first PASS 2026-10-10, knob mode). Use when evolution seems silent, a Saturday run is missing, no 𧬠Discord message arrived, or the weekly review flags an evolution finding.
---
# Evolution Debugging
> **Where the data is (since 2026-10-24/25):** the live fleet (12 headless
> `tai_backtest.exe` bots), the bot dashboard and the W1βW4 bridge tasks
> run on **Steven**, not this PC. This PC's `data\live` holds only
> retired/test bots and its n8n is stopped. Read live state from the
> dashboard API (`http://<Steven tailnet IP>:8765/api/fleet`,
> `/api/bot?id=<SYMBOL>_<bot>`; address in `hosts.local.yaml`) or run the
> checker on Steven via `tailscale-ssh`. A run of a checker on this PC
> describes this PC only β never publish it as fleet health. Host map β
> `start-here`. Run checkers from an up-to-date checkout
> (`git rev-list --count HEAD..origin/master` = 0); the main tree may be
> weeks behind.
Run the mechanical check first, then map symptoms below:
```bash
C:/Python313/python.exe -s scripts/monitor/check_evolution.py
```
## How it works (1 paragraph you must hold in mind)
Evolution is **per-bot**: on TPE **Saturday** (~04:58) a cheap
fitness check runs at session end, and (β₯**05:05**, on the 30s poll) the AI
pipeline runs β but ONLY if a **non-regime** bot is deployed and RUNNING
in that process (GUI or headless CLI/EXE β `HeadlessBotApp` inherits
`_check_weekly_evolution`; on Steven every non-regime bot runs its own slot), and `evolution.auto_pipeline` isn't false. Regime
bots are excluded by design (`hasattr(runner,'on_status_poll')` gate,
run_backtest.py ~6635/7135) and produce **zero** artifacts β silence from
a regime bot is not a failure. There is no
watermark-based timer; `evolution_watermark.json` only records the design
cut (`trade_count`) shown to the AI. The weekly latch (`_weekly_evo_done`)
is in-memory β restarting the GUI on a Saturday re-arms it.
## The evidence map (outside the GUI, only these exist)
| Evidence | Where | Meaning |
|---|---|---|
| `bot_evolution` row | `data\ai_usage.csv` (**UTC** timestamps; TPE = +8) | plan phase reached that day |
| `evolution_codegen_1`/`_2` rows | same | codegen reached / retried |
| `evolution_watermark.json` `at` | bot dir (TPE stamp) | pipeline attempt finished (even failed) |
| `evolution.json` | bot dir | fitness baseline; rewritten only on >0.05 improvement β frozen is normal |
| `data\changelog.json` entry (date is machine-local) + `data\evolution_pool.db` row | install root of the bot's host | a PASS (`validated`, not deployed β the owner promotes; first PASS 2026-10-10, knob mode). `strategies\index.json` is NOT touched on PASS |
| `𧬠ι±ζ«θͺεζΌε β¦ starting` / `ζΌεθ©ε Fitness: β¦` / `EVO pipeline error:` | bot `debug_*.log` | start / score / crash |
| 𧬠Discord messages | evolution channel | verdicts + auto-run skips |
**Observability gap:** every mid-pipeline stage message (`EVO 1/3β¦`, the
verdict block, `no_change` notices) goes to the **Tk chat widget only** β
not the debug log, not `_last_session.json`. Outside the GUI, outcome =
Discord + ai_usage call_sites. Don't conclude "nothing happened" from the
debug log alone.
## Classifying a run from the debug log alone (the `msg_len` signature)
The bot's `debug_*.log` records every Discord send as `Discord send
attempt: channel=β¦, msg_len=N, bot=β¦`. `notify_evolution` prepends a
header `**[YYYY-MM-DD HH:MM:SS]** \`<bot>\` \`<symbol>\`` + newline, so
the length = template + header (header β 25 + 3 + len(bot name) + 8 + 1).
Find the `𧬠ι±ζ«θͺεζΌε β¦ starting` line, then the FIRST send after it:
| Ξt after start | msg_len | Meaning (run_backtest.py) |
|---|---|---|
| β€ 2 s | β 200β210 + name | holdout skipγθ¨η·΄ηͺη‘ζ°δΊ€ζγ(~:4748) β BY DESIGN, watermark unchanged |
| β€ 2 s | β 300 + name | young-session skipγθ³ζε€ͺζ°γ(~:4779) β BY DESIGN |
| 30β90 s (after the K-line fetch) | 71 + header β 110β130 | plan said `no_change` (~:5095) β one `bot_evolution` row in ai_usage, no codegen row |
| 60β120 s | β 1000β1500 | **verdict block** (`evolution_verdict`, discord_notify.py ~:361) β PASS or FAIL; text only in Discord |
| any | starts with `𧬠EVO FAIL` / `EVO ERROR` β check the log for `EVO codegen attempt β¦ failed` / `EVO pipeline error` | failure paths (Discord-notified since #108) |
Before the plan call the live slot fetches native `kline_minute` bars via
the Capital API (`θ«ζ±Kη· [n/33] β¦ min=15` lines, run_backtest.py
~:5338-5372); no fetch = the skip branch returned first. The verdict text
is NOT persisted locally (chat auto-save only at window close; the bot
token cannot read Discord history β HTTP 403). The same signature applies
to other users' bundles attached to GitHub issues.
## Efficacy, not just liveness (validated 2026-09-12, weekly-review addendum)
- Attempt history = `ai_usage.csv` per Saturday: plan row without a
codegen row = `no_change`. On this machine candidates were generated on
only 4 Saturdays (06-20, 06-27, 07-04, 08-01), all FAIL.
- **Why plans say no_change**: the prompt rule "fewer than 30 trades β
continue collecting, no change" (~:4832) is read by the model against a
trade list that contains ONLY trades new since the last watermark
(`sent_lines = trade_lines[omitted:cut_idx]` ~:4778; 3 trades on
09-12, 1 trade in issue #94). The watermark advances right after the
worker thread starts (~:4894), whatever the plan says. Fixed in v2.19.0 (#118/#120).
- **Gate defect**: `max_drawdown_pct` is 0.00 when the window's equity
never goes positive (metrics.py sentinel, initial_balance=0), so the
baseline-relative dd gates (pipeline.py ~:260, ~:528-534) reject every
candidate in a losing-baseline fortnight. Fixed in v2.19.0 (#118/#120).
- Gates ARE reachable: replaying the exact pipeline on 0422's real data,
2/10 single-parameter neighbours PASS; binding gates are PF-vs-baseline
(strict β₯) and the design-window MaxDD ratio. Deterministic (seed 42).
- Latent: candidate class name not enforced (a PASS could overwrite the
live strategy's stored source β fixed in v2.19.0 (#118/#120)); Monte Carlo is a no-op for
every AI strategy (`**kwargs` signatures β no numeric defaults).
- Short bots (1β7 trades / 2 wk) cannot evolve: 5-trade floor + the <30
rule. By design; owner decision.
- The empirical harness lives in the session scratchpad
(`empirical/evo_gates.py`): loads a bot's 1-min CSVs, aggregates to
native bars, runs `run_deep_validation` + `decide_deep_verdict` for a
perturbation family. Rebuild it when a deep audit is triggered.
## Symptom β cause
| Symptom | Likely cause β verify |
|---|---|
| No Saturday `bot_evolution` row at all | GUI closed / no non-regime bot RUNNING at 05:05 TPE Sat (6 of 11 recent Saturdays missed this way) / `auto_pipeline: false`. Check which bots were live: locks + debug logs for that Saturday. |
| Bot totally silent (no artifacts ever) | It's a regime bot β by design. Or the dialog deployed it after Saturday. |
| `bot_evolution` row but no codegen row | Either knob mode (watermark `at` inside the slot, `directives.knobs` set, multifold + month gates in `evolution_history.jsonl` `gates`) β never infer "stopped at plan" from ai_usage alone (#161) β or the plan said `no_change` β almost always because the model applied the "<30 trades" rule to the watermark-windowed new-trade list (see Efficacy below; fixed in v2.19.0 (#118/#120)), or payload degraded to plan-only (>600k chars). Check debug log `ζΌεθ©ε Fitness:` line and the `msg_len` β 110β130 send. |
| `EVO pipeline error:` in debug log | Worker crash (API/quota/parse) β full traceback is right there; **no Discord is sent on this path**. |
| Run skipped `θ¨η·΄ηͺη‘ζ°δΊ€ζ` | Watermark cut β₯ current design cut β **by design**, self-heals as trades age past the rolling 14-day holdout. Not a bug. |
| GUI frozen on a Saturday morning | The API-key modal (`_show_api_key_dialog`) fires from the poll thread when the key is missing β blocks the whole app until dismissed. Check `ai.google_api_key`/provider config presence (never the value). |
| Every verdict FAILs, `changelog.json` never appears | Structural: the verdict gate stack (src/evolution/pipeline.py `decide_deep_verdict`) β mutation-expression β₯3 divergent trades, MC CV β€0.30, OOS β₯ baseline, PF/DD ratios, absolute PF β₯1.0, plus the plan's own criteria. PASS is rare (first one 2026-10-10): review the FAIL verdict blocks in Discord history before touching thresholds β and never relax `ABS_PF_FLOOR` casually. |
| Discord silent though the run happened | `_discord` is constructed only at bot deploy; `discord_evolution_channel_id` empty falls back to the main channel; manual (𧬠button) runs suppress skip/error notices by design. |
> Line numbers (`~:NNNN`) in this skill predate ~2026-10 and have shifted by
> 1,600β3,000 lines β grep the quoted literal (e.g. `θ¨η·΄ηͺη‘ζ°δΊ€ζ`,
> `ζΌεθ©ε`) instead. Per-attempt outcome is now in each bot dir's
> `evolution_history.jsonl` (`final_status`, `gates.*.reasons`); the
> `msg_len` table is a legacy fallback.
## Cadence math (this machine)
The slot is Sat 05:05 TPE on the host that runs the bot (Steven for the
fleet). clocks β `start-here` Β§4. `ai_usage.csv`
timestamps are UTC (TPE β 8): a healthy Saturday run shows ~`Fri
21:05 UTC` rows.
## Escalation
A code-level root cause goes through `validate-findings` then `fix-pr`.
Threshold/design changes (verdict gates, cadence) are product decisions β
present the evidence and ask the user; do not auto-tune them.
Attribution
Related skills
View all in devops βComments
Loading commentsβ¦
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.