Repository navigation
feat(memory): a guarded fetch, and UrlLoader over any loader source - #249
Conversation
|
Warning Review limit reached
This review includes 6 billable files and costs up to $1.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 1 minute for your next included review. View limit details
Comment |
Reviewer's GuideIntroduces a security-hardened fetch pipeline for externally supplied URLs and refactors UrlLoader to consume arbitrary loader sources with injectable fetching, while maintaining existing LoaderRegistry/global-fetch compatibility. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…and UrlLoader over any loader source
…d not ask for, the caller's abort and options out of range
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
PR Summary by QodoAdd guarded URL fetching and injectable document loading
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1. Fetches reach the wrong default port
|
… XHTML or PDF answer
…s to the checked address
…swer it has no loader for, and names no address in the refusal
Summary
Adds guardedFetch for addresses a person gives a server, and lets UrlLoader take any { getLoader } with an injected fetchDocument.
Linked issues
Closes #240
Type of change
How this was verified
src/cognition/memory/io/ingestion/__tests__/guardedFetch.test.ts(8 cases, against a loopback server reached through a made-up host and a stand-in resolver) and__tests__/UrlLoader.test.ts(5), in CI. The tests were pushed first, on their own, and read red at the type check on the missing module and options (run 38069596625); with the code, Test & Lint, Batch-1 gated tests and Release dry run are green (run 38070142912), and again with two more cases for a protocol upgrade, a coding the request did not ask for, the caller's abort and options out of range (run 38070635221).A review follow-up adds the fifth UrlLoader case: with
fetchDocument, an HTML, XHTML or PDF answer the loader source has no loader for is refused with an error that names the media type and not the address, where the first version returned the raw markup as the text. That case was pushed first and read red on its assertion (run 38077613895), and is green with the fix (run 38077947877). The third guardedFetch case now also reads the Host header the stand-in received: it names the host, though the connection went to the checked address.Migration notes
None.
Checklist
!before the colon for a change that breaks users (feat!:orfeat(api)!:).Summary by Sourcery
Add secure fetching for user-supplied addresses and make UrlLoader configurable with injected fetching and arbitrary loader sources.
New Features:
Enhancements:
Documentation:
Tests: