Repository navigation
feat(search): rank node search and version kegs - #124
Merged
Merged
Conversation
Kegs gain an immutable storage version. `tap keg create --kegv` and the keg_create tool's `kegv` property ask the Hub for 2025-07 (KEGv1, the default) or 2026-09 (a KEGv2 preview); an unversioned create omits the field so older Hubs keep accepting it, and an unknown version is refused before any request. Keg listings, keg_search, orientation tables and keg info carry the version and label KEGv2 kegs; KEGv1 output is unchanged. Keg info tolerates a missing settings summary. KEG_VERSION_UNSUPPORTED (409) maps to keg.ErrKegVersionUnsupported, kept apart from NOT_SUPPORTED, which callers treat as an absent optional capability.
node_search and `tap node search` ask the Hub's POST /api/v1/tap/search for nodes ranked by relevance across every KEG the call may read, one KEG (keg/--keg), or listed KEGs (kegs/--kegs). Query, cursor and limit pass through unchanged; an omitted limit lets the Hub choose. Hits carry a reference, score, title, matched fields, ranking sources and a highlighted snippet; responses report the ranking mode and page with an opaque cursor. Under a flight the search never leaves the cover: a named KEG outside it is refused, listed KEGs outside it are dropped with a warning, and a scope that narrows to nothing returns no hits without asking the Hub. Hosts serving their own MCP endpoint inject a NodeSearchProvider. The regex tool is renamed: node_search becomes node_grep and `tap node search PATTERN` becomes `tap node grep PATTERN`, otherwise unchanged. A Hub without the search route yields ErrRankedSearchUnavailable pointing at node grep.
Under a strict schema policy every agent edit needed an explicit schema, even one that only replaced a typed node's body, so the first content edit an agent made failed. A content-only edit now keeps the stored type and is validated against it. An untyped node, content whose frontmatter names another type, a metadata-only edit, and an edit of both parts still need a selection. The selection error now names the schema field and lists the keg's schemas, the SCHEMA_INVALID guidance points at schema instead of content or meta, and the write tools say a strict keg needs schema on every create and on edits that supply meta.
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.
Summary
Ranked node search and versioned kegs, already on
feat/search-platform:node_searchranks nodes by relevance across the KEGs a call may read; the regex search stays asnode_grep.--kegv); an operation a version does not offer fails withKEG_VERSION_UNSUPPORTED, and a version the hub refused or did not apply is reported.Tests
go build ./...,go vet ./..., andgo test ./...pass at this commit (the suite includeslint:docsandlint:fs).Stack
Part of a stacked series that makes up the next release. Merge in order (rebase merge); each PR is based on the one before it.
none, settingsaliasestap auth statusnode_editunified diff patchesnode_mergeandkeg_replacetap urland theurltooltap info