Repository navigation
perf: defer vault indexing to background goroutine for instant MCP startup (#36) - #38
Merged
Merged
Conversation
…artup (#36) - Split initObsidianBackend() into fast path (store, Ollama, vault client) and deferred path (indexVault, external pages, watcher) - MCP server starts in <1s; background goroutine handles indexing - Shared sync.Mutex between background indexing and index/reindex MCP tools prevents concurrent operations (spec 011 integration) - atomic.Bool indexReady flag reported via health tool so agents can check indexing status - 7 new tests covering deferred indexing, fast startup, mutex blocking, and ready flag lifecycle
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ GO | golangci-lint | yes | yes | no | no | 44.74s |
| markdownlint | 1 | 0 | 42 | 0 | 1.5s | |
| ✅ REPOSITORY | gitleaks | yes | no | no | 2.38s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.28s |
Detailed Issues
⚠️ MARKDOWN / markdownlint - 42 errors
AGENTS.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 509]
AGENTS.md:26:401 error MD013/line-length Line length [Expected: 400; Actual: 461]
AGENTS.md:65:15 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:65:35 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:65:130 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:66:16 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:66:43 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:66:163 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:91:11 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:91:21 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:91:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:91:11 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:114:13 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:114:34 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:114:56 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:114:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:114:13 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:114:34 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:213:8 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:213:16 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:213:30 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:213:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:213:8 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:213:16 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:222:11 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:222:25 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:222:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:222:11 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:238:8 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:238:22 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:238:40 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:238:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:238:8 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:238:22 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:317:8 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:317:18 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:317:32 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:317:41 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:317:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:317:8 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:317:18 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:317:32 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff
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
executeServe()to start the MCP server before vault indexing — server ready in <1 second instead of 32 seconds on large reposinitObsidianBackend()split into fast path (store open, Ollama check, vault client) and deferred path (indexVault, external pages, watcher)sync.Mutexfrom spec 011'sindex/reindextools — prevents concurrent indexing operationsatomic.BoolindexReadyflag reported viahealthMCP tool so agents can check if background indexing is completeCloses #36
Spec Artifacts
Full Speckit spec in
specs/012-background-index/— spec (3 user stories, 10 FRs), plan, research (5 items), quickstart, tasks (9 tasks, all complete).