H1 reslice: preserve explicit RSS/Atom feed kind - #43
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review🚫 Merge blocked: 2 serious issue(s) found in high-risk files ⚖️ Codex Review Arbitration🚫 block: Both current findings remain valid against the cumulative diff. In 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🟠 [HIGH] Logic in
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c018a04e9c
ℹ️ 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".
| if any(child.tag != "item" and child.tag not in rss_metadata for child in channel): | ||
| raise FeedXmlError("feed_schema_invalid") |
There was a problem hiding this comment.
Allow RSS extension metadata under channel
When a valid RSS 2.0 channel includes module metadata such as atom:link or sy:updatePeriod under <channel>, this new whitelist treats the feed as feed_schema_invalid before parsing any <item> rows. I checked .github/workflows/rss_source_pipeline.yml, and the scheduled pipeline runs this parser against config/free_rss_feeds.csv with --continue-on-feed-error, so common extensible feeds can now be marked failed and lose all rows even though their item structure is valid; keep the root/channel checks closed without rejecting namespaced channel metadata.
Useful? React with 👍 / 👎.
| error=f"{type(exc).__name__}: {exc}", | ||
| ) | ||
| parsed = parse_feed_snapshot(fetcher(feed.feed_url), feed, max_items=max_items_per_feed) | ||
| feed_rows = [PrimitiveRow.from_mapping(row).to_mapping() for row in parsed.entries] |
There was a problem hiding this comment.
Allow feeds with blank authors
When a feed config omits the optional author value or leaves it blank, load_feed_config() still constructs FeedConfig(..., author=""), and downstream source-item loading also treats author as optional, but this new PrimitiveRow.from_mapping() conversion rejects the empty author via _exact_str. A non-empty feed that previously wrote rows with a blank author is now recorded as failed or raises before writing any of its items.
Useful? React with 👍 / 👎.
| code = getattr(exc, "code", "fetch_failed") | ||
| if type(code) is not str or not re.fullmatch(r"[a-z][a-z0-9_]{0,63}", code): | ||
| code = "fetch_failed" |
There was a problem hiding this comment.
Preserve parser error codes in feed status
When parse_feed_snapshot() rejects a feed, such as feed_schema_invalid or feed_xml_oversize, the scheduled RSS workflow continues on feed errors and records this status, but FeedXmlError only stores the code as its exception message and has no .code attribute. This fallback therefore reports every parser/schema/size failure as fetch_failed, losing the sanitized producer-boundary reason that the new status format is trying to expose.
Useful? React with 👍 / 👎.
| if item["state"] == "accepted": | ||
| if item["accepted_row_count"] == 0 or item["error_code"] is not None: | ||
| _fail("feed_state_invalid") |
There was a problem hiding this comment.
Reject accepted wire feeds with unknown kind
When validating externally supplied status bytes with parse_status_bytes() or serialize_status(), a feed can be state: "accepted" while still carrying kind: "unknown"; the counters can then make publication_complete true even though accepted producer records explicitly reject unknown feed kinds. This weakens the status boundary for consumers that trust parsed status flags without rebuilding from feed rows.
Useful? React with 👍 / 👎.
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: b452cf5b75
ℹ️ 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".
| complete = bool(feeds) and failed == 0 and quarantined == 0 and accepted == len(feeds) | ||
| if data["publication_complete"] != complete or data["eligible_for_live_publication"] != complete: |
There was a problem hiding this comment.
Require zero rejected rows before marking complete
When validating externally supplied status bytes via parse_status_bytes() or serialize_status(), a status with every feed in accepted state but rejected_row_count > 0 still recomputes publication_complete and eligible_for_live_publication as true here. That lets consumers that gate live publication on these flags accept a partial/rejected producer snapshot; include rejected_rows == 0 or reject nonzero feed rejections in the completeness check.
Useful? React with 👍 / 👎.
Scope
Fresh H1 reslice from
origin/main@294e30b8eed36f070299b1dc01d34955fb262918; PR #42 is closed/frozen evidence and was not reused.This PR fixes the producer-owned feed parsing/status boundary only:
parse_feed_snapshot()returns explicitfeed_kind(rss2/atom) with the same immutable entries snapshot; empty feeds preserve their real kind.(published_at, item_id)to match emitted CSV order.No workflow, publish, QAR, weekly artifact, permission, or automation changes are included.
Validation
uv run pytest -q: 134 passedpython3 -m compileall -q src scripts tests: passedgit diff --check: passedruff: unavailable in environment