p2.1: honcho-embed, wayback http/204, memento, keys owner
Embed requests send dixie.embed_model (default honcho-embed). Wayback accepts http://web.archive.org, rewrites to https, skips non-200 closest.status. Memento-Datetime is parsed as an HTTP date and future/garbage values become empty snapshot_at. keys add writes via temp+fchown/chmod/rename so root does not clobber keys.toml. Digest fallback is capped at the 6k-token budget.
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"time"
|
||||
|
||||
"git.wntrmute.dev/kyle/sift/internal/auth"
|
||||
"git.wntrmute.dev/kyle/sift/internal/digest"
|
||||
"git.wntrmute.dev/kyle/sift/internal/fetch"
|
||||
"git.wntrmute.dev/kyle/sift/internal/guard"
|
||||
)
|
||||
@@ -156,6 +157,18 @@ func TestDigestFallbackWhenUnset(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCapDigestFallback(t *testing.T) {
|
||||
big := strings.Repeat("word ", 50000)
|
||||
out, warn := capDigestFallback(big, nil)
|
||||
if digest.EstTokens(out) > digest.SmallDoc {
|
||||
t.Fatalf("tokens %d", digest.EstTokens(out))
|
||||
}
|
||||
joined := strings.Join(warn, " ")
|
||||
if !strings.Contains(joined, "digest budget") {
|
||||
t.Fatalf("warn %v", warn)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNever502(t *testing.T) {
|
||||
s, key := setupAPI(t, nil)
|
||||
rec := postJSON(t, s, "/v2/scrape", key, map[string]string{"url": "http://127.0.0.1/"})
|
||||
|
||||
Reference in New Issue
Block a user