Skip to content

Perf: parse scene YAMLs once in generate-batch (discover → select → summary) #8

@shaypal5

Description

@shaypal5

Context

generate-batch currently parses every matching scene YAML up to three times:

  1. _discover_scene_configs() — parses all YAMLs to filter by project/tier
  2. _select_configs_by_typology() — parses the selected paths again to read violence_typology
  3. _print_selection_summary() — parses again to build the typology count table

Proposed fix

Return SceneConfig objects (or a (Path, SceneConfig) tuple) from _discover_scene_configs and thread them through _select_configs_by_typology and _print_selection_summary, so each YAML is parsed exactly once.

Impact

Low priority: Phase 1 config libraries are small (<50 configs) so the overhead is negligible today. Worth addressing before Phase 3 scale-up (~hundreds of templates).

Flagged from PR #7 review (COPILOT-4).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions