Commit Graph
29 Commits
Author SHA1 Message Date
kyleandornith-1.5-35b-a3b f57aaef59e pdftext: extract PDF text in a re-exec'd child (sift pdftext) with a deadline
The parser is pure Go but a goroutine cannot be killed, so extraction runs in
a child process: the binary re-executed as `sift pdftext`, reading the PDF on
stdin and writing JSON Lines on stdout, killed at a deadline by the parent.

pdftext.go holds the types, the five errors, Extract (reader.Open with
ErrWrongPassword -> ErrEncrypted, per-page recover, trailer /Info /Title, and
rule-3 UTF-16BE/Latin-1 text decode) and ChildMain (soft 768 MiB memory limit,
-no env read, no network, exit codes 0/3/4/1). outline.go walks /Outlines ->
/First -> /Next with /First children at level+1, resolving /Dest and /GoTo /A
dests to 1-based pages, bounded at 10,000 items and never visiting an object
twice. runner.go is the Runner: env-isolated child (nil env is an empty
environment), 60 s deadline, 64 MiB output cap, 200 MiB stdin cap, stderr
capped at 4 KiB, exit-code to error mapping, and Doc parsing with ErrNoText.
cmd/sift/main.go adds the unlisted `pdftext` case. tools.go is removed; the
go-pdfkit modules stay vendored.

Co-Authored-By: ornith-1.5-35b-a3b <ornith-1.5-35b-a3b@llama.cpp.invalid>
2026-09-25 22:58:05 -07:00
kyleandornith-1.5-35b-a3b 13365a2daa clean, fetch: recognise PDFs; 100 MB / 120 s for PDFs; FetchIf revalidates
Recognise PDFs in clean.Kind (declared types and %PDF- sniffing on
octet-stream/bodyless bodies), give PDF responses the 100 MB body cap and
120 s deadline while web pages keep 5 MB / 20 s, and add FetchIf, which
sends If-None-Match / If-Modified-Since and maps a 304 to a Resource with
Status 304 and an empty Body. Fetch and FetchIf share one doFetch path for
guard, client, limits and error mapping.

Co-Authored-By: ornith-1.5-35b-a3b <ornith-1.5-35b-a3b@llama.cpp.invalid>
2026-09-25 22:40:04 -07:00
kyleandClaude Opus 5.5 7fa5bd21b2 p5a: fix a deadlock in the given TestFetchIf (lock held across a request); run notes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:45:57 -07:00
kyleandClaude Opus 5.5 cfde35397a P5a plan: PDF documents — seven Ornith tasks with acceptance tests first
docs/plans/p5a: 01 kind+fetch limits, 02 pdftext child + runner, 03 dcache PDF tables,
04 pdfpool, 05 pdfdoc render (map/pages/grep), 06 api, 07 digest citations, metrics, CLI,
skill, unit, README. Given tests compile against a panic-only skeleton and fail there for the
intended reasons; PDFs for tests are built by internal/pdftest (given), plus two qpdf-encrypted
fixtures.

Owner changes for the run: vendor go-pdfkit/extract v0.3.0 + reader v0.6.0 (pinned via
tools.go until task 02); AGENTS.md, tools/run-plan.sh (enforces a Co-Authored-By trailer for
the model), docs/implementer-log.md, `make gate`; gofmt (whitespace) on clean.go and guard;
TestUnsupportedType uses a zip now that PDFs are supported; requestDeadline 90→210 s and
writeTimeout 120→240 s for the PDF path's worst case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 20:47:38 -07:00
kyleandClaude Opus 5.5 3f2b78d4aa docs: P5a — PDF documents (pure-Go extract in a re-exec'd child, per-page cache, map, pages/grep, 2-worker pool)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 20:19:39 -07:00
kyle 4372673184 p2.7: prometheus /metrics
Default GET /metrics is Prometheus text; JSON stays at /metrics.json
and ?format=json. :8443 needs the metrics caller bearer; loopback
stays open. Restricted callers have no per-caller series and no
tavily:restricted gauge.
2026-09-23 21:49:38 -07:00
kyle c19a58d1e3 docs: P2.7 prometheus /metrics
Design only. JSON stays at /metrics.json and ?format=json.
2026-09-23 21:36:48 -07:00
kyle e62cfc8660 p3: no Tavily daily cap for restricted callers
Restricted searches skip the cap check. Credits land on
tavily:restricted so they never raise the fleet row. Fleet at cap
still falls through.
2026-09-23 16:27:07 -07:00
kyle 1c57845ebd p3: keep original URLs on RRF/dedupe; rerank=false is not a merge
CanonicalURL is the dedupe key only. Hits keep the first source's
original URL, including a trailing slash. Dedupe has the same rule.
2026-09-23 16:04:45 -07:00
kyle b6e1cdf825 p3: map Brave LLM Context; RRF merge; per-source no_rerank
Live llm/context hits live in grounding.generic plus a URL-keyed
sources map, not a sources array. Fan-in uses reciprocal-rank fusion
instead of cosine. no_rerank keeps that source's own order as a prefix.
2026-09-23 16:02:21 -07:00
kyle 35e2356541 p3: actually blind bake-off packs
Rewrite A-D to [{rank, url, title, snippet}] only. Fail closed if
searxng/brave/tavily/hermes appear outside url or snippet. Self-test
and a 28-query fake-dump dry run pass.
2026-09-23 14:13:26 -07:00
kyle 9a8dae3948 p3: harvest 28 bake-off queries with targets and blind protocol
Kyle-approved fleet harvest. Sibling targets (domain/page or open).
Runner labels A-D; mapping stays in a sealed key file until scoring.
2026-09-23 14:09:42 -07:00
kyle f748e695b1 p2.6: warn when permit_restricted has no key
CheckMappings now logs WARN for each permit_restricted name missing
from keys.toml, so a missing straylight-gs key is visible at start
and on reload instead of passing silently.
2026-09-23 12:19:10 -07:00
kyle d7873403ff p3: search API, pinned sources, cache, CLI
POST /v1/search and /v2/search fan in SearXNG, Brave LLM Context, and
Tavily from config-fixed endpoints. Public sources refuse private A
records; SearXNG is a loopback-only client, not the fetch guard.

Cache keys include caller class. Restricted callers search like the
fleet; logs omit query, hosts, URLs, and upstream errors. Degraded
results are not stored. Tavily sends search_depth=basic and drops
answer. Missing keys surface in /healthz.

Default-on sources stay off until the bake-off. Query harvest is not
in this commit.
2026-09-23 12:17:51 -07:00
kyle 3687636ed7 p2.6: partition dcache by caller class; pin restricted workspace
Digest, chunk-embed, and question-embed keys include fleet|restricted so
a fleet caller cannot observe a restricted cache hit. Digest.Run takes
the class from permit_restricted.

A permit_restricted caller whose keys.toml workspace is not
guardian-star is refused at Search (no Honcho request) and flagged at
serve start and keys reload.

docs: P3 restricted callers search like the fleet; cache/logs isolate.
2026-09-23 11:51:39 -07:00
kyle 7be4ed1d43 p2.5: redact reason/err for permit_restricted logs
Guard messages embed the hostname (resolve <host>, no addresses for
<host>). Restricted callers now log a coarse reason class and err=-.
Test dumps slog records and forbids the hostname anywhere in them.

docs: P3 review — fail-closed search, cache class, public dialer
2026-09-23 11:47:37 -07:00
kyle 2d376d3ad1 docs: P3 spec — search API, sources, cache, bake-off
No code. Default-on sources left to the bake-off. Restricted-caller
paid-engine question left open for Kyle.
2026-09-23 11:43:03 -07:00
kyle 85113f9c0b p2.5: log host=- for permit_restricted callers
Scrape, fetch, refused, fetch-failed, and internal lines redact the
host for callers in context.permit_restricted. final_url stays in the
response. Test captures slog records, not the journal.
2026-09-23 11:40:45 -07:00
kyle e36da19f57 p2.4: restricted workspace for permitted callers
guardian-star context is allowed only when the authenticated caller is in
permit_restricted and mapped to that workspace. Fleet callers remapped to it
still refuse. CLI client.toml: SIFT_CLIENT, then $HERMES_HOME/sift, then ~/.config.
2026-09-23 08:33:58 -07:00
kyleandClaude Opus 5.5 505e113b64 docs: P2 scope line matches §2a caches
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 23:47:24 -07:00
kyleandClaude Opus 5.5 9f8d9f4f13 docs: P2 — bounded in-sift queue; digest + chunk-embedding caches pulled forward
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 23:47:09 -07:00
kyleandClaude Opus 5.5 cb0cb83fb9 docs: P2 spec — digest (bounded, streaming, thinking off), Honcho context (guardian-star refused), recover ladder
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 23:43:40 -07:00
kyleandClaude Opus 5.5 d404657820 docs: P1.1 dynamic self-IP deny (DDNS/trace discovery, keep previous, atomic swap)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 22:06:20 -07:00
kyleandClaude Opus 5.5 6cb206fb27 docs: P1 spec — clean fetch, auth, CLI, contract facts from firecrawl-py 4.17.0, talos wiring
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:38:29 -07:00
kyleandClaude Opus 5.5 3b41d6ffbc plan: UA decided — default sift/<ver>, config override, measure bot-blocks
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:28:04 -07:00
kyleandClaude Opus 5.5 7d4f090a12 skill: sift as the explicit first step for fetch/search; plan §4.3 CLI client, --recover, UA policy
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:25:57 -07:00
kyleandClaude Opus 5.5 1e915ce715 plan: Makefile for non-Nix hosts (source of truth for build flags)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:15:29 -07:00
kyleandClaude Opus 5.5 e9aea1829e plan: Go instead of Python (Kyle's preference); dialer-Control SSRF check, gojq
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:05:59 -07:00
kyleandClaude Opus 5.5 94876864e5 sift: implementation plan
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:00:00 -07:00