Repository navigation
Add an offline discovery index of downloadable search shards - #169
Merged
Merged
Conversation
docpull index build turns locked project runs into SQLite FTS shards of page URLs, titles, and headings, with no page bodies, and records each shard's sha256 in manifest.json. docpull index pull downloads shards from an explicit HTTPS manifest URL through the DNS-pinned private-network guard, refuses redirects, enforces a total size limit, and installs only shards that match their sha256. docpull search --backend index and serve --compat --search-backend index search installed shards without sending the query anywhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
admin-raintree
enabled auto-merge (squash)
October 12, 2026 20:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the client and builder for a discovery index. Users download search shards once and then search them offline, so no query is sent to a third party. Hosting the shards and the scheduled crawl that builds them will come in a later PR.
What's new
docpull index build --project … --out DIR --name NAMEdocuments.jsonl.NAME.sqlite: an FTS5 table over title, headings, and URL, plus content hash, fetch time, and source.DIR/manifest.json.docpull index pull [MANIFEST_URL]DOCPULL_INDEX_URL.UrlValidatorand the existing DNS-pinned_ValidatedResolver, with redirects refused.--max-bytes(default 500 MB) before any download.docpull index listshows installed shards.docpull search --backend index, plusserve --compat --search-backend index:--include-contentstill fetches hits through the local pipeline.DOCPULL_INDEX_DIR, or$XDG_DATA_HOME/docpull/indexwhen unset.--index-diroverrides it onindex,search, andserve.Not included
provenance.pycan be added once a published key exists.search_webhas neither yet, so they should be added together.ponytail:comment notes this.Checks
tests/test_discovery_index.pycovers:http://and private hosts_fetch_bytesdownloadedhttps://example.com/through the pinned resolver and enforced its cap.docpull index buildover a 3,000-document project produced a 737 KB shard.docpull search --backend indexandPOST /searchonserve --compat --search-backend indexreturned results.bun run validate:fullpasses: 1,068 Python tests pass and 18 are skipped. Lint, mypy, the JS SDK, and the reproducible build also pass.🤖 Generated with Claude Code