generate_eval_dir

Function generate_eval_dir 

Source
pub fn generate_eval_dir(
    lesson: &Lesson,
    suite: &EvalSuite,
    lesson_id: &str,
    lesson_path: &Path,
) -> Result<Vec<(PathBuf, String)>, GenError>
Expand description

Generate the smevals eval-dir file tree for suite, tagged with lesson_id.

Pure and deterministic (§2.1, §5.1): returns (relative_path, contents) pairs — eval.yaml, configs/default.yaml, graders/default.yaml, and tasks/case-N.yaml for each case in document order — with no filesystem access, so the file set, byte-stability, and injection defense are asserted directly in integration tests. The effectful half is write_eval_dir.

lesson_id must be a slug (see GenError::InvalidLessonId); the suite must be non-empty (see GenError::EmptySuite). lesson supplies the eval’s name-space context (its exercise prompt becomes the eval description). lesson_path is data: each task’s lesson: key carries it (as the file the runner grades — AC-3 forwards it verbatim to blendtutor eval <path>), and the generator never touches the filesystem it names. The CLI canonicalizes the real lesson file to an absolute path before calling this; the pure function emits whatever path it is given.