LincPayandClaude Opus 5 cf27258e26 fix(features): attribute staleness to the data that built the feature
Staleness was district-wide: the newest market row for the district,
whatever commodity it belonged to, stamped onto every price feature. That
was a fair approximation while every commodity came from the same daily
Agmarknet pull. Manual entry ended it — milk and egg arrive monthly, so a
dairy enterprise's output_price_change, built entirely from a month-old
milk rate, inherited yesterday's maize freshness and sailed through the
staleness gate that exists to catch exactly that.

Each price feature now carries the age of its own oldest contributing
commodity, and margin_squeeze takes the staler of its two halves — a
squeeze is only as current as the older side of it.

Measured: output_price_change and margin_squeeze now report 3–24 days
where they previously reported 1–8, which is the truth rather than maize's
answer to a question about milk.

Catalogue tolerances for the price features go to 35 days, the slowest
source that legitimately feeds them. Ten days would gate every dairy and
poultry price feature out of every rule permanently — uploaded data
landing in the table and changing nothing. RuleEvaluator takes the
stricter of rule and catalogue, so this is the permissive floor and the
trip-wire remains where tightening belongs.

FeatureCatalog.seed now reconciles existing rows instead of only inserting
absent ones. Insert-if-absent left every database seeded before a
tolerance changed running on the old value, silently, in the direction
that decides whether a rule may fire at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 15:24:07 +05:30
S
Description
No description provided
498 KiB
Languages
Java 100%