Repository navigation
perf(tapper): run whole TAP operations and grep on the Hub - #121
Merged
Merged
Conversation
A formatted grep, links, backlinks, or tags listing against a Hub keg read metadata once per rendered node, so one agent grep could make hundreds of sequential requests. Fields are now resolved where the data lives: - GrepOptions gains fields, offset, and limit; the keg pages matches and projects fields, so a formatted grep is one request. - ListViewOptions gains node_ids, so any known result set resolves its fields with one listing call. - RelatedNodes returns the pairs that produced each entry, replacing the per-input lookups the relationship observer made. - An optional RepositoryContentScan capability lets a backend answer grep in one scan, narrowed by an index when the pattern is a plain literal. - pkg/tapapi defines the wire contract for complete TAP operations a Hub executes under /api/v1/tap/*. - The client-side listing fallback for hubs without /list/view is removed, and the REST contract revision moves to 2026-09-28.
Links, backlinks, and tags against a Hub KEG composed several requests on the client, and every MCP tool call rebuilt the session's orientation from about five Hub requests (#123): - Tap.Operations executes links, backlinks, and tags as one unit. DefaultOperations forwards a Hub KEG's operation to /api/v1/tap/* through RemoteKeg.HubPost and composes KEG operations only without a Hub. - tap mcp reuses a session's resolved orientation for up to ten seconds. orient, session_refresh, flight mutations, and failed calls discard it; the Hub still rechecks authority on every request. - Single-node cat reads and touches in one request. - An invalid grep pattern is reported as invalid input.
RemoteKeg still reached the Hub through retired single-item and per-kind routes. Route every call through its replacement so those routes can go: - Move is a batch of one on POST /nodes/move. - RestoreSnapshot is a batch of one on POST /nodes/snapshots/restore, guarded by the hash from the node's metadata ETag. - File and image calls use the kind-qualified attachment routes. - RemoveBatch adapts POST /nodes/remove, the Hub's single removal contract; it previously expected a response shape the Hub never sent. Batch restore now accepts the root node, which can be restored from its own history; move and remove still refuse it.
Grep now streams a repository's content scan and keeps only matching lines, so memory follows the result rather than the KEG. The scan is narrowed by every substring a match must contain, taken from the parsed regular expression, so an index can serve regex patterns and not just plain literals. Case-insensitive substrings are limited to ASCII and split at 's' so a lowercase comparison never drops a match Go's case folding would find. ReadNodes gains meta_only: metadata and stats in one consistent read, without content or asset lists, for rendering metadata fields.
A repository implementing RepositoryGrep now runs the whole content search itself and returns only matching lines, so node content never has to be read out to be searched. The backend owns its regex dialect and reports a pattern it cannot evaluate as invalid; local KEGs keep Go's RE2 matcher. This replaces the content-scan capability and its substring extraction. The node_search tool now says which dialect applies: Go RE2 locally, PostgreSQL regular expressions on a Hub.
A node with no metadata whose stats predate the state hash still reads as a node: empty metadata and a hash derived from its content, matching a full read.
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.
Client half of the Hub's shared-application-API work (foldwise/tapper-hub#149–#153). It moves whole TAP operations and searches to the server, so one agent action is one request instead of hundreds, and adopts REST contract
2026-09-28.6ef218e). Grep, links, backlinks, and tags against a Hub KEG read metadata once per rendered node, so one agent grep could make hundreds of sequential requests.GrepOptionsgainsfields/offset/limit,ListViewOptionsgainsnode_ids, andRelatedNodesreturns the pairs that produced each entry.5a28410). The newpkg/tapapiholds the wire types.Tap.Operationssends links, backlinks, tags, and cat for a Hub KEG to/api/v1/tap/*, and composes the individual KEG operations only when there's no Hub.tap mcpreuses a session's resolved orientation for up to ten seconds instead of rebuilding it on every tool call.ab3ea8e).RemoteKegstops calling the retired single-item and per-kind routes. Move, snapshot restore, and remove become batches of one, and files and images use the kind-qualified attachment routes. The REST contract revision becomes2026-09-28.e3f1d5b). Grep streams a repository's content scan and keeps only matching lines, so memory follows the result rather than the KEG.ReadNodesgainsMetaOnly: metadata and stats without content, in one consistent read.2336e82). A repository implementingRepositoryGrepruns the whole search in its own regex engine and returns only matching lines. The Hub uses this to grep inside PostgreSQL. Local KEGs keep Go RE2, andnode_searchsays which dialect applies.aa17d20). A metadata-only read of a node with no metadata and old stats returns empty metadata and the same hash a full read gives.Compatibility: coordinated upgrade. This client requires a Hub that serves
2026-09-28, and that Hub (tapper-hub#152) removes the routes older clients call. Merge this before the Hub stack. Pinning the Hub to the merged SHA is left for release planning.Verification:
go build,go vet, andgo test ./...pass; so dogo test -raceforpkg/keg,pkg/tapper, andpkg/parity, andtask lint:docsandtask lint:fs.