api: serve PDFs — extraction in the child under the pool, full text or map, errors

Route "pdf" through clean.Kind in doFetch/cleanFetched: extract under the pool
(keyed by caller class + document hash, one per caller), map the five pdftext
errors plus a pool panic to 422, ErrBusy to 503+Retry-After 10, ErrCallerBusy to
429, and answer with the whole text or the map. Adds RetryAfter to fetch.Error
and the matching header. No cache, pages or grep — those are task 07.

Co-Authored-By: ornith-1.5-35b-a3b <ornith-1.5-35b-a3b@llama.cpp.invalid>
This commit is contained in:
2026-09-26 04:04:11 -07:00
co-authored by ornith-1.5-35b-a3b
parent 9c858aded9
commit 93ec310113
5 changed files with 603 additions and 42 deletions
+4 -3
View File
@@ -43,9 +43,10 @@ func (r *Resource) SHA256() string {
// Error is a fetch failure with the HTTP status sift should return to its caller.
type Error struct {
Status int
Msg string
Hint string
Status int
Msg string
Hint string
RetryAfter int // seconds to wait before retrying; 0 = none
}
func (e *Error) Error() string { return e.Msg }