perf(semantic-search): snapshot manifest partitions#65
Merged
Conversation
This was referenced Jun 24, 2026
40d1f17 to
a53c3bf
Compare
aryasaatvik
added a commit
that referenced
this pull request
Jun 26, 2026
## Summary
Hardens the tool manifest projection used by indexing so manifest reads
observe the same stale-catalog freshness behavior as `tools.list`, and
lets plugins persist explicit source revisions for produced tool
catalogs.
This keeps the existing separate `tool_schema_manifest` table and column
shape. The change is a greenfield semantic cleanup of the manifest
contract, not a table rewrite.
## Changes
- Run stale connection catalog sync before `executor.tools.manifest()`
reads manifest rows.
- Add optional `ResolveToolsResult.sourceRevision` so plugins can
describe the source revision that produced a catalog.
- Persist plugin-provided source revisions into manifest rows, falling
back to the existing generic integration/connection revision when
absent.
- Set OpenAPI source revisions from `specHash`.
- Set MCP source revisions from a hash of the discovered MCP tool
manifest.
- Add SDK regressions for stale manifest self-healing and
plugin-provided source revision persistence.
## Call Stack
```text
executor.tools.manifest(filter)
-> syncStaleConnectionTools()
-> compare integration.config_revised_at with connection.tools_synced_at
-> produceConnectionTools() for stale connections
-> read tool_schema_manifest rows
-> apply filters and policy visibility
-> return compact indexing projection
```
```text
plugin.resolveTools()
-> returns tools, definitions, optional sourceRevision
produceConnectionTools()
-> sourceRevision ?? generic integration/connection revision
-> write tool rows, definition rows, manifest rows, catalog revision row
```
## Tests
- `bun run --cwd packages/core/sdk test -- src/executor.test.ts`
- `bun run --cwd packages/core/sdk typecheck`
- `bun run --cwd packages/plugins/openapi test --
src/sdk/spec-blob.test.ts src/sdk/plugin.test.ts`
- `bun run --cwd packages/plugins/openapi typecheck`
- `bun run --cwd packages/plugins/mcp test -- src/sdk/plugin.test.ts`
- `bun run --cwd packages/plugins/mcp typecheck`
- `bun run --cwd packages/plugins/semantic-search test --
src/sdk/tool-search-index.test.ts`
- `bun run --cwd packages/plugins/semantic-search typecheck`
- `bunx oxfmt --check packages/core/sdk/src/plugin.ts
packages/core/sdk/src/executor.ts packages/core/sdk/src/executor.test.ts
packages/plugins/openapi/src/sdk/backing.ts
packages/plugins/mcp/src/sdk/plugin.ts`
- `bunx oxlint -c .oxlintrc.jsonc --deny-warnings
packages/core/sdk/src/plugin.ts packages/core/sdk/src/executor.ts
packages/core/sdk/src/executor.test.ts
packages/plugins/openapi/src/sdk/backing.ts
packages/plugins/mcp/src/sdk/plugin.ts`
- `git diff --check`
## Notes
No deploy was performed. This is one milestone PR rather than a stack
because the existing semantic-search indexing code already consumes
`tools.manifest()` and passed its targeted tests against this change.
<!-- stack:links:start -->
### [Stack](https://github.com/aryasaatvik/stack)
1. **#63** 👈 current
2. #64
3. #65
<!-- stack:links:end -->
3beadf6 to
14f8258
Compare
a53c3bf to
e25c61a
Compare
aryasaatvik
added a commit
that referenced
this pull request
Jun 26, 2026
## Summary Carries the tool manifest projection into semantic-search scan jobs by retaining each manifest source revision alongside the fingerprint. This makes index work traceable to the source catalog version that produced it without adding schema reads to scan. ## Changes - Add optional `sourceRevision` to semantic-search index jobs. - Copy `ToolSchemaManifest.sourceRevision` into both skipped and changed scan jobs. - Add regression coverage that manifest source revisions survive scan materialization. ## Call Stack ```text ToolSearchIndex.create() -> executor.tools.manifest() -> write manifest snapshot ToolSearchIndex.scan() -> read manifest projection -> compare manifest.indexFingerprint with stored fingerprint -> write IndexJob(sourceRevision, fingerprint, path, status) ``` ## Tests - `bun run --cwd packages/plugins/semantic-search test -- src/sdk/tool-search-index.test.ts` - `bun run --cwd packages/plugins/semantic-search typecheck` - `bunx oxfmt --check packages/plugins/semantic-search/src/sdk/collections.ts packages/plugins/semantic-search/src/sdk/tool-search-index.ts packages/plugins/semantic-search/src/sdk/tool-search-index.test.ts` - `bunx oxlint -c .oxlintrc.jsonc --deny-warnings packages/plugins/semantic-search/src/sdk/collections.ts packages/plugins/semantic-search/src/sdk/tool-search-index.ts packages/plugins/semantic-search/src/sdk/tool-search-index.test.ts` ## Stack Base: #63 <!-- stack:links:start --> ### [Stack](https://github.com/aryasaatvik/stack) 1. #63 2. **#64** 👈 current 3. #65 <!-- stack:links:end -->
Cover the manifest snapshot invariant that scans use the create-time manifest even if the live catalog changes before scan. This protects the KV-only scan path from accidental live-manifest fallback.
e25c61a to
65d62e1
Compare
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
Hardens the per-run manifest snapshot layer so scans are pinned to the manifest captured at index creation time. This protects the KV-only scan path from accidentally falling back to a later live catalog read.
Changes
scandoes not reread a changed live manifest aftercreate.Call Stack
Tests
bun run --cwd packages/plugins/semantic-search test -- src/sdk/tool-search-index.test.tsbun run --cwd packages/plugins/semantic-search typecheckbunx oxfmt --check packages/plugins/semantic-search/src/sdk/tool-search-index.test.tsbunx oxlint -c .oxlintrc.jsonc --deny-warnings packages/plugins/semantic-search/src/sdk/tool-search-index.test.tsStack
Base: #64
Stack