v2: Seal of Reliability: Re-evaluate a feed when a past UNKNOWN becomes known

Open
#1,803 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend, databases

Research direction

Read the existing #1763 backfill implementation to understand how a feed is cold-started and evaluated through today, and where today's state is saved. Identify how late inputs are detected for a single feed; the payload does not name the relevant files or tests. Done means a detected late input triggers a full re-evaluation for that feed and saves only today's seal state.

Written by the indexing model from the issue text.

Description

A criterion can come out UNKNOWN on a given day because an input was missing — e.g.
Compliant has no validation report yet for the latest dataset. When that input arrives
later (the report lands after the fact), the stored seal state was computed without it and
may now be wrong. We need to re-run the evaluation so the feed's seal reflects it.

How

Reuse the #1763 backfill: cold-start the feed and march to today, saving only today's
state — just triggered for a single feed when a late input is detected, rather than as a
bulk run. Because the state is path-dependent (see #1763), the whole window is re-derived
rather than a single day patched.

Note

The following is now covered by #1809
A daily state snapshot (one seal_criterion row per feed, criterion and day) would:

  • let a correction resume from the day before the change instead of cold-starting the whole
    window;

  • preserve each criterion's past values — a real historical record — making re-evaluation
    more precise, since Official and Stable could be judged against their actual past values
    (only back to when snapshotting began, though; earlier days still fall back to assumed
    values — likely the earliest one we recorded);

  • cost DB space (one row per feed, per criterion, per day), which would need to be
    evaluated but is not expected to be huge.

  • We should consider the possibility of an audit trail for that, so we can explain to the user why a seal changed after a reevaluation.

Dominant language
Python
Stars
34
Forks
7
Avg merge
2d 22h
Merged PRs (30d)
21

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MobilityData/mobility-feed-api

All issues in MobilityData/mobility-feed-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.