Add bounded website feed discovery - #67
Conversation
Let applications discover advertised RSS, Atom, and JSON Feed URLs with ordered metadata and explicit verification status. Use optional HTML5 parsing to keep head metadata separate from scripts and page content. Share HTTP transport with fetch while preserving legacy defaults. Add explicit destination policies, DNS pinning, redirect credential handling, and streamed time and body-size limits for discovery and opt-in fetching. Cover the workflow with local HTTP/TLS and controlled DNS fixtures, and include a tested Feedbag alternative, usage examples, and release notes. Closes #61
|
@greptileai Please review current head |
|
Hound is applying defaults that conflict with this repository’s |
Greptile SummaryAdds bounded website feed discovery backed by the shared policy-controlled HTTP transport.
Confidence Score: 5/5The current head appears safe to merge with no outstanding correctness, security, or repository-rule findings. The added HTTPS normalization matches the documented discovery contract and remains subject to the existing URL validation, destination policy, TLS hostname verification, redirect bounds, and request limits. The previous conditional-structure thread is manually resolved, and no new actionable issue remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Discovery input] --> B{Explicit scheme?}
B -- No --> C[Prepend HTTPS]
B -- Yes --> D[Retain scheme]
C --> E[Validate URL and destination policy]
D --> E
E --> F[Bounded HTTP request]
F --> G{Redirect?}
G -- Yes --> H[Validate next hop and enforce redirect limit]
H --> F
G -- No --> I{Direct feed?}
I -- Yes --> J[Return verified document candidate]
I -- No --> K[Parse HTML head with Nokogiri HTML5]
K --> L[Return ordered deduplicated advertised candidates]
Reviews (3): Last reviewed commit: "feat: default bare discovery domains to ..." | Re-trigger Greptile |
Select the exception class once and use a single guard for the redirect limit. Preserve the legacy fetch error and bounded transport error while addressing the review request for linear control flow. See #67
|
@greptileai Please review current head |
|
The new Hound comments also use defaults instead of |
Accept website domains without requiring callers to supply a scheme. Normalize discovery inputs before the existing destination checks and preserve explicit schemes. Keep HTTP fallback out of discovery. Verify bare domains, paths, queries, and protocol-relative inputs over a local TLS connection. Preserve private-address and unsupported-scheme rejection. The live lucascarlson.net call discovers its RSS feed. See #67
|
@greptileai Please review current head |
|
The latest 16 Hound threads have the same configuration mismatch: |
Add
SimpleRSS.discoverso an application can start with a website URL, choose among advertised RSS/Atom/JSON feeds, and then use the existing parser. Discovery returns candidate metadata and makes only the initial request plus bounded redirects.Closes #61. Based on latest
masterat3c1f114, including JSON Feed support from #66.Example: discover, choose, and fetch
Add the optional HTML parser to the application:
The application chooses a candidate. Advertised type hints are unverified; a direct feed response is parsed and returned with
source: :documentandverified: true, including empty feeds.Bare domains now default to HTTPS:
This exact call was verified live. Bare domains with paths and protocol-relative inputs also use HTTPS. Explicit schemes retain their meaning and unsupported schemes are rejected. Include the scheme when specifying a port; discovery does not fall back to HTTP after an HTTPS failure.
Example: configure request limits
Defaults are a 10-second total HTTP/DNS budget, five redirects, and 2 MiB of transferred/decompressed body data across the redirect chain. Candidate URLs, pagination, articles, scripts, and assets are not fetched.
An application can explicitly configure an internal-feed policy:
Behavior and compatibility
fetchand discovery. Ordinaryfetchretains its defaults;network_policy: :publicopts into the same bounded transport as discovery.:unrestrictedpolicy.[]for successful pages with no supported advertisements; expose separate HTTP, policy, timeout, redirect, size, transport, dependency, and parsing errors.Validation