بنقرة واحدة
scan-logs
Scan logs too large to read directly, using Gemini (scripts/logscan.py).
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Scan logs too large to read directly, using Gemini (scripts/logscan.py).
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Lint, run the pre-PR checks, commit, push, and author or update the branch's pull request in the required plain-text format. Use when committing, pushing, or creating/updating a PR.
Modify or upstream a Grug/Grugformer experiment variant.
Run a perf gate on a PR that touches lib/zephyr internals.
Curate the experiment report index at docs/reports/index.md.
Triage a failed canary ferry run (CI-invoked).
Refresh Marin TPU-vLLM forks from a tpu-inference release/LKG pair, update exact SHA pins, run TPU smokes, and open the Marin PR.
| name | scan-logs |
| description | Scan logs too large to read directly, using Gemini (scripts/logscan.py). |
Use scripts/logscan.py to analyze large log files. Two composable modes —
grep (find matching lines) and summarize (produce a markdown report) — used
independently or piped together.
GEMINI_API_KEY must be set.
Returns original log lines (with line numbers) matching a natural-language query. Uses small chunks (~5k tokens) for precision.
uv run scripts/logscan.py grep <logfile> "<query>"
Output goes to stdout as <line_number>: <line>, one per match.
Summarizes the log into a coherent narrative focused on the query. Uses larger chunks (~50k tokens) and hierarchically reduces per-chunk summaries into a final report.
uv run scripts/logscan.py summarize <logfile> "<query>"
Output is a markdown report on stdout.
grep's stdout feeds directly into summarize via --stdin — narrow to relevant
lines first, then summarize:
uv run scripts/logscan.py grep log.txt "errors" \
| uv run scripts/logscan.py summarize --stdin "summarize these errors"
| Argument | Description |
|---|---|
mode | grep or summarize |
logfile | Path to the log file (optional if --stdin) |
query | Natural language description of what to look for |
--chunk-tokens N | Tokens per chunk (default: 5000 for grep, 50000 for summarize) |
--concurrency N | Max parallel requests (default: 16) |
--model NAME | Gemini model (default: gemini-2.5-flash-lite) |
-v, --verbose | Print per-chunk results to stderr |
--stdin | Read input from stdin instead of a file |
# Find OOM errors in a training log
uv run scripts/logscan.py grep /tmp/train.log "out of memory errors or OOM kills"
# Summarize TPU failures
uv run scripts/logscan.py summarize /tmp/worker.log "TPU errors, device failures, or FAILED_PRECONDITION"
# grep then summarize for focused analysis
uv run scripts/logscan.py grep /tmp/controller.log "timeout" \
| uv run scripts/logscan.py summarize --stdin "what caused the timeouts?"
# Use a more capable model for complex analysis
uv run scripts/logscan.py summarize /tmp/big.log "race conditions or deadlocks" --model gemini-2.5-flash
Both modes print token usage stats to stderr when complete.
grep to find the failure region, then Read specific line rangessummarize to scan canary ferry logs for the root causegrep first to narrow down, then summarize the filtered output via --stdinsummarize handles hierarchical reduction automatically-v to see per-chunk results as they complete