Something broke and the cause is unknown — scan tai-robot bot debug logs and news-bridge logs for known error signatures (tracebacks, corrupted state, failed Discord sends, refused swaps). Use after a crash, for "is there anything scary in the logs?", or as the first look before debug. Retired local n8n logs are history only (n8n-debug); live W1–W4 failures are bridge-health.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Log Scan?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ericwu13-log-scan)
---
name: log-scan
description: Something broke and the cause is unknown — scan tai-robot bot debug logs and news-bridge logs for known error signatures (tracebacks, corrupted state, failed Discord sends, refused swaps). Use after a crash, for "is there anything scary in the logs?", or as the first look before debug. Retired local n8n logs are history only (n8n-debug); live W1–W4 failures are bridge-health.
---
# Log Scan
> **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`). Data host,
> host naming and the no-scripts rule → `start-here` §7. 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.
Quick look, not a full scan: `/api/bot` is the last 150 lines of the
newest debug log (`scripts/dashboard/snapshot.py` `MAX_LOG_LINES`).
```bash
curl -s "http://<Steven tailnet IP>:8765/api/bot?id=<SYMBOL>_<bot>"
```
Address in `hosts.local.yaml`. A full scan is a read-only ssh read,
permission per start-here. No scripts on the host. `<install_dir>`
is `steven.install_dir` in `hosts.local.yaml`:
```powershell
Get-ChildItem <install_dir>\data\live\*\debug_*.log | Where-Object LastWriteTime -gt (Get-Date).AddDays(-7) | Select-String -Pattern '<pattern>'
```
`check_logs.py` on Steven is not supported (`scripts/monitor/check_logs.py`
`main` takes no base-dir).
Fallback, this PC only:
```bash
C:/Python313/python.exe -s scripts/monitor/check_logs.py
```
Scans, per bot directory, the newest two `debug_YYYYMMDD.log` files from
the **last 7 days** (older logs are archaeology from retired test bots).
`n8n-service.log` and `~/.n8n/n8nEventLog.log` are history-only (retired
local n8n, stopped 2026-10-24). Do not treat them as live bridge health —
live W1–W4 are `bridge-health`.
## Pattern → severity
The app's log handler prints **no levelname**, so severity comes from the
message body:
| Level | Pattern |
|---|---|
| P1 | `news framework DISABLED` |
| P1 | `Corrupted signal ledger` |
| P1 | `Corrupted state file` |
| P1 | `Unrecoverable apply error` |
| P1 | `Cannot restore leg` |
| P1 | `Traceback (most recent call last)` |
| P2 | `Event calendar unusable or stale` |
| P2 | `Discord send failed` |
| P2 | `Daily report generation failed` |
| P2 | `malformed vote file` |
| P2 | `could not remove vote file` |
| P2 | `swap_strategy refused` |
| P2 | `Discarded pending recommendation` |
| P3 | `Dropped out-of-order aggregated bar` |
| P3 | `Discarded recommendation` |
| P2 | `n8n.workflow.failed` — check_logs.py reports only the last 24 h, so a hit means the retired local n8n ran again (W1–W4 double-run risk); report it, don't ignore it |
Findings are deduped per (pattern, file) and capped at 5 example lines,
each redacted before it is printed.
## Gotchas
- **No levelnames in the app log** — `grep ERROR` finds nothing useful.
Match message bodies (the table above) instead.
- **Debug logs are per-TPE-date and never rotated**; a busy bot's daily
log reaches ~9 MB. The helper tails them (2 MB) rather than reading
whole files — do the same if you go in manually.
- Log lines carry two clocks: `[<TPE> / <local>]`. The **first**
timestamp is TPE. The second is the host's local clock (clocks → `start-here` §4)
and must never be used for reasoning about sessions.
- `swap_strategy refused` is often legitimate (one of the 5 safety gates:
not flat, veto, in replay, timeframe mismatch, insufficient bars) —
read the reason before treating it as a bug.
- A `Traceback` in a log from months ago is a retired test bot, not an
incident; the 7-day window exists for exactly that reason. If you widen
it manually, check the bot is one that still runs.
- A `n8n.workflow.failed` hit from `check_logs.py` is a P2 (row above):
the script reports only the last 24 h and local n8n is retired, so a
hit means it ran again. Report it; `n8n-debug` is history only, do not
run it. A live bridge failure or a missing vote → `bridge-health`.
## Next steps
- traceback in a live bot → the repo's `debug` skill (root-cause → fix → review); release → `CLAUDE.md` § Release Process
- `n8n.workflow.failed` from check_logs.py → report it as a P2 (local n8n
ran again, W1–W4 double-run risk); `n8n-debug` is history only, do not
run it. A live bridge silence or missing vote → `bridge-health`
- `Discord send failed` → confirm `notifications.*` wiring with
`deploy-check`