REPOSITORY CODING · EASY
Drainage alerts omit observations exactly at the intervention threshold
The threshold is inclusive, but boundary observations disappear from triage. Repair classification while retaining normal observations below threshold.
Repository ImplementationDrainage inspection impact desk
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
Go · 30 minute session
- An inspection desk uses a directed asset map to report which downstream assets can be affected by a blockage. This is reachability triage, not a hydraulic flow simulation. Links point downstream. Loops and multiple routes are legal; self-links, duplicate assets and unknown links are rejected.
- A survey observation has a stable id and nonnegative revision. Select the greatest revision per observation id before checking withdrawn, severity or asset. A correction can move a survey to another asset. Identical redelivery is allowed, but conflicting evidence at the same revision is invalid.
- An asset is blocked if at least one current, nonwithdrawn observation has severity greater than or equal to threshold. Severity is 0..5 and threshold is 1..5. Withdrawn observations still participate in revision selection.
- For each blocked asset, follow all downstream links with cycle protection. Exclude that source from its own impact list, even if a loop comes back. An affected asset lists each upstream blockage once. A blockage can itself be affected by another blockage.
- Sort blocked assets, affected assets and source lists by ID. An affected asset without downstream links is an outfall. Report each outfall once. Keep disconnected blockages in blocked even if they affect nothing. Empty arrays remain arrays.