How the rule engine applies a filter

Filters are JSON files. One engine reads them, measures each district and reports a result with its evidence. The example here is the one filter built so far: heat in the hours rice flowers are open.

The whole flow

Five steps, left to right. Adding a filter means adding JSON files; the engine itself doesn't change.

Why this filter has its own dataset

Our daily data only knows the day's hottest moment, which comes after the flowers have closed. So the filter reads a separate file holding only the temperature in the flowering hours.

Follow one district through the filter

Pick a district, a rice duration and a variety's heat class. These are saved results from the real engine.

What the filter does across India

Flagged by this filter (flowering hours)Would be marked using the day's maximum

Show flagged districts

What the result can be

Every district gets exactly one result for each filter. A missing value is never treated as a pass.

ResultMeaningIn this filter
FlaggedA warning; the district stays in the listToo hot in the flowering hours in enough seasons
PassedMeasured and no problem foundUnder the limit often enough
Not applicableCouldn't be measured, and says why
ExcludedMarked unsuitableNot used by this filter
PenalisedScore multiplied by a factorNot used by this filter

What the evidence card adds

The rule decides. The card explains why, how far to trust it, and what to ask. Removing the card leaves the result the same; a test checks this.

Why it could be wrong

    Where the numbers come from

      The files behind this filter

      The real JSON, under tools/rules/crops/rice/.

      
      
      To add another filter: if it needs new data, add a file and a source; then add a signal if no existing one measures it, a rule, and its evidence card. Restart the scoring server. The engine checks every link when it loads and names the broken file.