Add compatible strict source freshness evidence#53
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review🚫 Merge blocked: 1 serious issue(s) found in high-risk files 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🟠 [HIGH] Logic in
|
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f6ca8418e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _RFC2822_RE = re.compile( | ||
| r"^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{1,2} (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) " | ||
| r"\d{4} \d{2}:\d{2}:\d{2} (?:[+-]\d{4}|UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT)$" |
There was a problem hiding this comment.
Allow weekday-less RFC 2822 RSS dates
For RSS feeds whose lastBuildDate is a valid RFC 822/2822 timestamp without the optional weekday, such as 12 Jul 2026 11:00:00 GMT, this regex marks the signal invalid because it requires a Mon,/Tue, prefix. build_freshness_evidence() then fails any present-but-invalid RSS freshness signal before considering Last-Modified, so those feeds cannot produce freshness evidence even though the producer supplied a standards-compliant timezone-qualified date.
Useful? React with 👍 / 👎.
| if type(value) is not str or not _IMF_RE.fullmatch(value): | ||
| return False, None | ||
| try: | ||
| parsed = dt.datetime.strptime(value, "%a, %d %b %Y %H:%M:%S GMT").replace(tzinfo=dt.UTC) |
There was a problem hiding this comment.
Reject IMF-fixdate headers with mismatched weekdays
When Last-Modified is the first available freshness signal and its weekday does not match the calendar date, such as Mon, 12 Jul 2026 11:00:00 GMT, strptime still returns July 12 and this code treats the header as valid. That lets malformed HTTP freshness metadata mark a feed eligible despite the strict IMF-fixdate contract; compare the parsed weekday back to the header before returning True.
Useful? React with 👍 / 👎.
|
PERMANENT_FREEZE: the final closure is exhausted and strict provider-date parsing remains underspecified (weekday consistency and RSS optional-weekday grammar). Preserving this PR as evidence. No second closure, rerun, thread bypass, or merge; provider-content freshness will be re-arbitrated before any successor. |
Scope
Fresh producer fetch/freshness boundary reslice from latest main; no reuse of frozen PR #52.
Validation
Review mode: preflight then one concentrated review; no merge/rerun/poll requested.