feat(types): extend GeneratedQuestion with skill_target & difficulty_steps

- Add skill_target (str | None) and difficulty_steps (int | None) fields
  to GeneratedQuestion dataclass with field(default=None)
- Update loader.py to pass new fields from JSON (backward-compatible)
- Update pools.py _q_to_dict/_dict_to_q for serialization compat
- Add question_gen_v2 config section to default.yaml
- Add comprehensive test coverage (7 tests)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-11 23:05:38 -04:00
parent 043d4aa46f
commit 811ffa648b
5 changed files with 206 additions and 1 deletions
+4
View File
@@ -139,6 +139,8 @@ def _q_to_dict(q: GeneratedQuestion) -> dict:
"answer": q.answer,
"source_nodes": list(q.source_nodes),
"difficulty": q.difficulty,
"skill_target": q.skill_target,
"difficulty_steps": q.difficulty_steps,
}
@@ -160,6 +162,8 @@ def _dict_to_q(d: dict) -> GeneratedQuestion:
answer=d["answer"],
source_nodes=tuple(d.get("source_nodes", ())),
difficulty=d.get("difficulty", "medium"),
skill_target=d.get("skill_target"),
difficulty_steps=d.get("difficulty_steps"),
)
+2
View File
@@ -46,6 +46,8 @@ def load_benchmark(questions_dir: Path) -> list[GeneratedQuestion]:
answer=qa["answer"],
source_nodes=tuple(qa.get("source_nodes", ())),
difficulty=qa.get("difficulty", _LEGACY_DEFAULT_DIFFICULTY),
skill_target=qa.get("skill_target"),
difficulty_steps=qa.get("difficulty_steps"),
)
)
return results