Context
The component-aware scoring model (#7) introduced EvaluationUnit — one unit per leaf product (charm/snap), identified by (repo, subpath). Scorers already iterate leaf units internally via build_graph + resolve_leaf_units.
However, the nightly GHA workflow (compute-metrics.yml) still invokes scorers once per root product. If the same charm appears as an inline leaf in two different root products, the scorer runs against that repo twice — wasting API quota and potentially producing divergent results if the repo state changes mid-run.
What needs to change
Update compute-metrics.yml to:
- Resolve all leaf evaluation units across all root product YAMLs before dispatching any scorer jobs
- Deduplicate by
(repo, subpath) — each unique (repo, subpath) pair runs exactly once
- Attribute the results back to all root products that reference that leaf when assembling computed files
The scorer Python code already outputs {"leaf-id": {metrics}} dicts and merge_computed.py already reads the leaf_metrics envelope — so the scorer contract is already correct. Only the GHA orchestration layer needs updating.
Acceptance criteria
- A charm shared by two root products produces exactly one scorer API call per run
computed/ files are populated correctly for all root products that reference the shared leaf
- No regression in nightly scoring for single-leaf products
Notes
- The
resolve_leaf_units() function in engine/graph.py can be used (or called via a small Python helper script) to enumerate all unique leaf units across all product YAMLs
- This is purely a GHA/orchestration change; no Python engine or scorer logic changes are needed
Context
The component-aware scoring model (#7) introduced
EvaluationUnit— one unit per leaf product (charm/snap), identified by(repo, subpath). Scorers already iterate leaf units internally viabuild_graph+resolve_leaf_units.However, the nightly GHA workflow (
compute-metrics.yml) still invokes scorers once per root product. If the same charm appears as an inline leaf in two different root products, the scorer runs against that repo twice — wasting API quota and potentially producing divergent results if the repo state changes mid-run.What needs to change
Update
compute-metrics.ymlto:(repo, subpath)— each unique(repo, subpath)pair runs exactly onceThe scorer Python code already outputs
{"leaf-id": {metrics}}dicts andmerge_computed.pyalready reads theleaf_metricsenvelope — so the scorer contract is already correct. Only the GHA orchestration layer needs updating.Acceptance criteria
computed/files are populated correctly for all root products that reference the shared leafNotes
resolve_leaf_units()function inengine/graph.pycan be used (or called via a small Python helper script) to enumerate all unique leaf units across all product YAMLs