arrow_backRetour aux issues
rajfirke/provena
#107
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
TrailAggregator.query(trail_label=...) silently returns all trails for an unknown label
ecoDébutant
bug
good first issue
descriptionDescription
## Summary
`TrailAggregator.query(trail_label=...)` silently falls back to querying **all** registered trails when the given label doesn't exist, instead of returning an empty result (or raising). `TrailAggregator.get_trail()` handles the same situation correctly.
## Current behavior
```python
# src/provena/aggregator.py
targets = (
{trail_label: self._trails[trail_label]}
if trail_label and trail_label in self._trails
else self._trails
)
```
Verified:
```python
agg.add("agent1", trail1)
agg.add("agent2", trail2)
agg.query(trail_label="nonexistent_agent")
# -> returns records from BOTH agent1 and agent2
agg.get_trail("nonexistent_agent")
# -> None (correct)
```
When `trail_label` is truthy but not a registered key, the condition is `False`, so `targets` falls back to `self._trails` (every trail) instead of an empty mapping.
## Expected behavior
An unknown `trail_label` should restrict the query to nothing (empty result), matching the behavior of `get_trail()` for the same input. E.g. `self._trails.get(trail_label) if trail_label else self._trails`, wrapped to produce `{trail_label: trail}` only when found, else `{}`.
## Why
This inverts the caller's intent: someone filtering by a specific agent's trail (e.g. a typo'd label, or a label from a trail that hasn't registered yet) silently gets data from every agent instead of nothing — exactly the kind of governance-query bug that's hard to notice because it doesn't error, it just returns plausible-looking data from the wrong scope.
**Difficulty:** Trivial — one-line fix in `src/provena/aggregator.py`. `tests/test_aggregator.py` currently only tests the valid-label path; add a case for an unknown label.
Issues similaires
calkit/calkit
star53
Poids du dépôt moyen
VS Code extension should be robust to YAML parser errors
Seeing this error: ``` Failed to read calkit.yaml: YAMLParseError: A block sequence may not be used as an implicit map…
Python
bug
good first issue
fu351/Doberman-Core
star211
Poids du dépôt léger
dash: a manual Refresh control
The dashboard polls: `refreshStats()` (`src/doberman/dash/app.py:408`) every 5 s and `refreshPending()` (`:546`) every …
Python
enhancement
good first issue
fu351/Doberman-Core
star211
Poids du dépôt léger
dash: "Copy details" button on each pending-approval card
Each pending-approval card in the dashboard (`renderPending`, `src/doberman/dash/app.py:448-544`) shows the risk badge,…
Python
enhancement
good first issue