H2A: add pure feed status decision foundation - #46
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] Bug 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: 5641e948f3
ℹ️ 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".
| def _row_key(row: _Row) -> tuple[str, str]: | ||
| return row.published_at, row.item_id |
There was a problem hiding this comment.
Make row digests deterministic for tied row keys
When an accepted feed contains two rows with the same published_at and item_id but different content, this sort key leaves their order tied, so Python's stable sort preserves the incoming row order and both row_digest and aggregate_row_digest change if the same rows arrive in a different order. Since this module is producing canonical evidence, include the remaining row fields in the key or reject duplicate row keys before hashing.
Useful? React with 👍 / 👎.
| def _row(value: object) -> _Row: | ||
| data = _mapping(value, frozenset(_ROW_KEYS), "row_invalid") | ||
| values = [_string(data[key], "row_invalid", allow_empty=key == "author") for key in _ROW_KEYS] | ||
| return _Row(*values) |
There was a problem hiding this comment.
Validate accepted row timestamps before success
Accepted rows are accepted after only _string checks, so an outcome with published_at like not-a-date still returns DecisionKind.SUCCESS and eligible_for_live_publication=True. The existing source-items consumer derives event dates from this field and calls parse_date, so a malformed timestamp can be marked live-eligible here and then fail the pipeline when a matching item is extracted; validate the ISO/Z timestamp before counting the row accepted.
Useful? React with 👍 / 👎.
Scope
Fresh H2A from latest
origin/main@294e30b8eed36f070299b1dc01d34955fb262918; PR #45 is closed/frozen contract-conflict evidence and was not reused.This is a pure typed decision foundation over already-validated per-feed primitive outcomes:
StatusEvidenceplus explicitProducerDecision(success,quarantine,hard_fail);BaseExceptionpropagates.No raw XML/RSS/Atom parsing, I/O writer, workflow, publish, weekly, QAR, permission, or automation changes are included.
Validation