shinka-inspect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Shinka Inspect Skill

Shinka Inspect Skill

Extract the strongest programs from a Shinka run and package them into a context file that coding agents can load directly.
提取Shinka运行过程中表现最优的程序,并将其打包为编码Agent可直接加载的上下文文件。

When to Use

适用场景

Use this skill when:
  • A run already produced a results directory and SQLite database
  • You want to inspect top-performing programs before launching the next batch
  • You want a compact context artifact instead of manually browsing the DB
Do not use this skill when:
  • You still need to scaffold a task (
    shinka-setup
    )
  • You need to run evolution batches (
    shinka-run
    )
在以下场景使用该技能:
  • 某次运行已生成结果目录和SQLite数据库
  • 你希望在启动下一批次前检查表现最优的程序
  • 你需要一个简洁的上下文工件,而非手动浏览数据库
请勿在以下场景使用:
  • 你仍需要搭建任务框架(
    shinka-setup
  • 你需要运行进化批次(
    shinka-run

What it does

功能说明

  • Uses
    shinka.utils.load_programs_to_df
    to read program records
  • Ranks programs by
    combined_score
  • Selects top-
    k
    correct programs (fallback to top-
    k
    overall if no correct rows)
  • Writes one Markdown bundle with metadata, ranking table, feedback, and code snippets
  • 使用
    shinka.utils.load_programs_to_df
    读取程序记录
  • combined_score
    对程序进行排名
  • 选择排名前k的正确程序(如果没有正确行,则回退到整体排名前k的程序)
  • 生成一个包含元数据、排名表、反馈和代码片段的Markdown包

Workflow

工作流程

  1. Confirm run artifacts exist
bash
ls -la <results_dir>
  1. Generate context bundle
bash
python skills/shinka-inspect/scripts/inspect_best_programs.py \
  --results-dir <results_dir> \
  --k 5
  1. Optional tuning knobs
bash
python skills/shinka-inspect/scripts/inspect_best_programs.py \
  --results-dir <results_dir> \
  --k 8 \
  --max-code-chars 5000 \
  --min-generation 10 \
  --out <results_dir>/inspect/top_programs.md
  1. Load output into agent context
  • Default output path:
    <results_dir>/shinka_inspect_context.md
  • Use it as the context artifact for next-step mutation planning
  1. 确认运行工件存在
bash
ls -la <results_dir>
  1. 生成上下文包
bash
python skills/shinka-inspect/scripts/inspect_best_programs.py \
  --results-dir <results_dir> \
  --k 5
  1. 可选调优参数
bash
python skills/shinka-inspect/scripts/inspect_best_programs.py \
  --results-dir <results_dir> \
  --k 8 \
  --max-code-chars 5000 \
  --min-generation 10 \
  --out <results_dir>/inspect/top_programs.md
  1. 将输出加载到Agent上下文
  • 默认输出路径:
    <results_dir>/shinka_inspect_context.md
  • 将其用作下一步突变规划的上下文工件

CLI Arguments

CLI参数

  • --results-dir
    : Path to run directory (or direct DB file path)
  • --k
    : Number of programs to include (default
    5
    )
  • --out
    : Output markdown path (default under results dir)
  • --max-code-chars
    : Per-program code truncation cap (default
    4000
    )
  • --min-generation
    : Optional lower bound on generation
  • --include-feedback
    /
    --no-include-feedback
    : Include
    text_feedback
    blocks
  • --results-dir
    :运行目录路径(或直接指定数据库文件路径)
  • --k
    :要包含的程序数量(默认值为
    5
  • --out
    :Markdown输出路径(默认位于结果目录下)
  • --max-code-chars
    :单个程序代码的截断上限(默认值为
    4000
  • --min-generation
    :可选的生成次数下限
  • --include-feedback
    /
    --no-include-feedback
    :是否包含
    text_feedback

Notes

注意事项

  • Ranking metric is
    combined_score
    .
  • If no correct rows exist, script falls back to top-score rows and labels fallback in output.
  • Script is read-only for run artifacts (writes only the markdown bundle).
  • 排名指标为
    combined_score
  • 如果没有正确行,脚本会回退到最高分的行,并在输出中标记回退状态。
  • 脚本对运行工件仅为只读操作(仅写入Markdown包)。