EU Parliament Monitor — API Documentation - v0.9.12
    Preparing search index...

    Function detectProceduresFeedStaleTail

    • Detect whether a procedures feed response is in a stale historical-tail mode — i.e., the newest dated item is older than PROCEDURES_STALENESS_YEAR_THRESHOLD.

      During parliamentary recesses the EP procedures/feed endpoint may return historical archive data in ID order rather than current procedures. This function detects that condition so callers can emit a 🟡 procedures-feed: recess mode audit row instead of treating the response as usable current data.

      Date extraction order per item: dateInitiated, then dateLastActivity, then reference (first four characters). The first valid 4-digit year found in the range [1952, 2100] is used.

      Returns false when the payload is undefined, contains no items, or has no parseable years.

      Parameters

      • payload: Record<string, unknown> | undefined

        Parsed procedures feed payload

      Returns boolean

      true when the newest dated item is earlier than PROCEDURES_STALENESS_YEAR_THRESHOLD