Skip to content

feat(search): rank node search and version kegs - #124

Merged
jlrickert merged 11 commits into
mainfrom
feat/search-platform
Oct 13, 2026
Merged

jlrickert merged 11 commits into
mainfrom
feat/search-platform

Conversation

@jlrickert

Copy link
Copy Markdown
Owner

Summary

Ranked node search and versioned kegs, already on feat/search-platform:

  • node_search ranks nodes by relevance across the KEGs a call may read; the regex search stays as node_grep.
  • KEGs can be created and labeled with a KEG version (--kegv); an operation a version does not offer fails with KEG_VERSION_UNSUPPORTED, and a version the hub refused or did not apply is reported.
  • Search maps an unavailable search route and a missing login to codes, scopes explicit and implicit KEGs by one cover rule, lets the hub scope governed searches to the cover, and shows the next cursor in text output.
  • A content-only edit on a strict keg keeps the node's type.

Tests

go build ./..., go vet ./..., and go test ./... pass at this commit (the suite includes lint:docs and lint: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.

  1. feat/search-platform: ranked node search and versioned kegs
  2. feat/tool-categories-explore: tool categories and the public directory
  3. feat/cover-follows-links: covers follow note links, role none, settings aliases
  4. feat/auth-personal-namespace: personal namespace in tap auth status
  5. feat/node-edit-patch: node_edit unified diff patches
  6. feat/keg-trash: restorable trash
  7. feat/node-merge-replace: node_merge and keg_replace
  8. feat/hub-url: tap url and the url tool
  9. feat/tap-info: tap info

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.
@jlrickert
jlrickert merged commit 322fd5d into main Oct 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant