Conversation
Scoring breakdowns resolved indicator names only through the variables map, so computed variables (e.g. a freshwater-ecotoxicity aggregate rebuilt from its organics/inorganics parts) leaked their raw TOML key into API responses and the UI. Add an optional [methods.scoring.labels] table (var -> display label); name resolution now checks labels, then variables, then falls back to the key. Labels are also exposed in list_scoring_sets.
A [methods.scoring.labels] key that matches no computed or primitive variable was parsed and then silently never displayed, so a config typo (e.g. 'eft' for 'etf') left the raw key leaking into breakdowns with no signal. The decoder now fails with the offending key names, surfacing the mistake at config load instead of hiding it.
The nested findWithDefault encoded the labels → variables → raw-key precedence in argument position, where a swapped argument would still type-check. A single lookup in ssLabels <> ssVariables states the same priority left-to-right, matching the identity-default idiom used elsewhere. The spec now also covers the raw-key fallback its docstring already promised, and uses a neutral scoring-set name.
score_activities summary mode emitted only the raw variable key in dominant_indicator, so clients showed an opaque key (e.g. 'etf') for the very field meant for human triage — while score_activity's breakdown now resolves display labels. Carry the indicator's display name alongside the key; it was already in hand via siCategory.
The list_scoring_sets tool description now names the labels key it returns, the pyvolca ScoringIndicator docstring no longer claims category is always an impact category (README regenerated), and the changelog gains an entry for the feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scoring-set breakdowns resolve each indicator's display name through the
variablesmap (var → impact category). Computed variables live incomputed, notvariables, so their raw TOML key (e.g.etf) leaked into/impactsresponses and every consumer UI instead of a human-readable name.This adds an optional
[methods.scoring.labels]table to scoring-set config:Name resolution is now labels → variables → raw key.
list_scoring_setsexposes the labels so clients can render them too. A label naming an unknown scoring variable (a typo likeeft) is rejected at config load instead of being silently ignored. Covered byScoringLabelSpecandConfigSpec.