fix(index): clean stale tool entries and include description in hash #283
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
Changes
Hash Functions (
internal/hash/hash.go)descriptionparameter toToolHash,ComputeToolHash,VerifyToolHashsha256(serverName + toolName + description + schemaJSON)Index Layer (
internal/index/)GetAllIndexedServerNames()method using MatchAll query with facetingIndexManagerinterfaceRuntime (
internal/runtime/lifecycle.go)cleanupOrphanedIndexEntries()comparing indexed vs active serversbackgroundToolIndexing()before discovery delayTests
internal/hash/hash_test.gowith 14 test casesGetAllIndexedServerNamesin bleve_test.goTestToolCacheInvalidation_DescriptionOnlyChangeandTestToolCacheInvalidation_OrphanCleanupTestE2E_ServerDeleteReaddDifferentToolsvalidating full lifecycleTest plan
go test ./internal/hash/... -v- 14 tests passgo test ./internal/index/... -v- 7 tests passgo test ./internal/runtime/... -v- All tests passgo test ./internal/appctx/... -v- 7 contract tests passgo test ./internal/server/... -run TestE2E_ServerDeleteReaddDifferentTools- E2E passgo test -race ./internal/...- No races./scripts/run-linter.sh- 0 issues🤖 Generated with Claude Code