@jagilber-org/index-server 1.22.1 → 1.26.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/CHANGELOG.md +91 -2
  2. package/CODE_OF_CONDUCT.md +2 -0
  3. package/CONTRIBUTING.md +32 -2
  4. package/README.md +82 -19
  5. package/SECURITY.md +17 -5
  6. package/dist/config/dashboardConfig.d.ts +3 -0
  7. package/dist/config/dashboardConfig.js +3 -0
  8. package/dist/config/defaultValues.d.ts +1 -1
  9. package/dist/config/defaultValues.js +1 -1
  10. package/dist/config/featureConfig.d.ts +2 -0
  11. package/dist/config/featureConfig.js +6 -1
  12. package/dist/config/runtimeConfig.d.ts +1 -1
  13. package/dist/config/runtimeConfig.js +8 -9
  14. package/dist/dashboard/client/admin.html +170 -53
  15. package/dist/dashboard/client/css/admin.css +132 -0
  16. package/dist/dashboard/client/js/admin.auth.js +25 -11
  17. package/dist/dashboard/client/js/admin.config.js +1 -1
  18. package/dist/dashboard/client/js/admin.feedback.js +328 -0
  19. package/dist/dashboard/client/js/admin.graph.js +120 -18
  20. package/dist/dashboard/client/js/admin.instructions.js +27 -13
  21. package/dist/dashboard/client/js/admin.logs.js +1 -5
  22. package/dist/dashboard/client/js/admin.maintenance.js +53 -8
  23. package/dist/dashboard/client/js/admin.messaging.js +1 -4
  24. package/dist/dashboard/client/js/admin.overview.js +5 -1
  25. package/dist/dashboard/client/js/admin.sessions.js +1 -1
  26. package/dist/dashboard/client/js/admin.utils.js +43 -1
  27. package/dist/dashboard/client/js/mermaid.min.js +813 -537
  28. package/dist/dashboard/export/DataExporter.js +2 -1
  29. package/dist/dashboard/server/AdminPanel.d.ts +3 -0
  30. package/dist/dashboard/server/AdminPanel.js +132 -35
  31. package/dist/dashboard/server/ApiRoutes.js +40 -9
  32. package/dist/dashboard/server/DashboardServer.js +1 -1
  33. package/dist/dashboard/server/FileMetricsStorage.d.ts +19 -0
  34. package/dist/dashboard/server/FileMetricsStorage.js +52 -5
  35. package/dist/dashboard/server/HttpTransport.js +6 -0
  36. package/dist/dashboard/server/InstanceManager.js +7 -2
  37. package/dist/dashboard/server/KnowledgeStore.js +7 -2
  38. package/dist/dashboard/server/MetricsCollector.d.ts +16 -0
  39. package/dist/dashboard/server/MetricsCollector.js +113 -17
  40. package/dist/dashboard/server/legacyDashboardHtml.js +7 -2
  41. package/dist/dashboard/server/middleware/ensureLoadedMiddleware.d.ts +1 -1
  42. package/dist/dashboard/server/middleware/ensureLoadedMiddleware.js +8 -3
  43. package/dist/dashboard/server/routes/admin.feedback.routes.d.ts +15 -0
  44. package/dist/dashboard/server/routes/admin.feedback.routes.js +188 -0
  45. package/dist/dashboard/server/routes/admin.routes.js +35 -27
  46. package/dist/dashboard/server/routes/alerts.routes.js +4 -3
  47. package/dist/dashboard/server/routes/api.feedback.routes.js +2 -1
  48. package/dist/dashboard/server/routes/api.usage.routes.js +8 -7
  49. package/dist/dashboard/server/routes/embeddings.routes.d.ts +2 -1
  50. package/dist/dashboard/server/routes/embeddings.routes.js +18 -9
  51. package/dist/dashboard/server/routes/graph.routes.js +10 -13
  52. package/dist/dashboard/server/routes/index.d.ts +1 -0
  53. package/dist/dashboard/server/routes/index.js +74 -39
  54. package/dist/dashboard/server/routes/instances.routes.js +2 -1
  55. package/dist/dashboard/server/routes/instructions.routes.js +46 -27
  56. package/dist/dashboard/server/routes/knowledge.routes.js +4 -3
  57. package/dist/dashboard/server/routes/logs.routes.js +5 -4
  58. package/dist/dashboard/server/routes/messaging.routes.js +15 -14
  59. package/dist/dashboard/server/routes/metrics.routes.js +14 -13
  60. package/dist/dashboard/server/routes/scripts.routes.js +6 -3
  61. package/dist/dashboard/server/routes/status.routes.js +5 -4
  62. package/dist/dashboard/server/routes/synthetic.routes.js +3 -2
  63. package/dist/dashboard/server/routes/usage.routes.js +2 -1
  64. package/dist/dashboard/server/utils/escapeHtml.d.ts +1 -0
  65. package/dist/dashboard/server/utils/escapeHtml.js +11 -0
  66. package/dist/dashboard/server/utils/pathContainment.d.ts +1 -0
  67. package/dist/dashboard/server/utils/pathContainment.js +15 -0
  68. package/dist/dashboard/server/wsInit.js +2 -2
  69. package/dist/lib/mcpStdioLogging.d.ts +165 -0
  70. package/dist/lib/mcpStdioLogging.js +287 -0
  71. package/dist/schemas/index.d.ts +37 -2
  72. package/dist/schemas/index.js +27 -3
  73. package/dist/server/backgroundServicesStartup.d.ts +7 -1
  74. package/dist/server/backgroundServicesStartup.js +25 -8
  75. package/dist/server/certInit.d.ts +97 -0
  76. package/dist/server/certInit.js +359 -0
  77. package/dist/server/certInit.types.d.ts +92 -0
  78. package/dist/server/certInit.types.js +34 -0
  79. package/dist/server/handshake/fallbackFrames.d.ts +31 -0
  80. package/dist/server/handshake/fallbackFrames.js +38 -0
  81. package/dist/server/handshake/initializeDetector.d.ts +31 -0
  82. package/dist/server/handshake/initializeDetector.js +88 -0
  83. package/dist/server/handshake/protocol.d.ts +15 -0
  84. package/dist/server/handshake/protocol.js +37 -0
  85. package/dist/server/handshake/readyEmitter.d.ts +6 -0
  86. package/dist/server/handshake/readyEmitter.js +88 -0
  87. package/dist/server/handshake/safetyFallbacks.d.ts +1 -0
  88. package/dist/server/handshake/safetyFallbacks.js +134 -0
  89. package/dist/server/handshake/stdinSniffer.d.ts +1 -0
  90. package/dist/server/handshake/stdinSniffer.js +260 -0
  91. package/dist/server/handshake/tracing.d.ts +16 -0
  92. package/dist/server/handshake/tracing.js +95 -0
  93. package/dist/server/handshakeManager.d.ts +23 -23
  94. package/dist/server/handshakeManager.js +36 -466
  95. package/dist/server/index-server.d.ts +23 -0
  96. package/dist/server/index-server.js +194 -9
  97. package/dist/server/mcpReadOnlySurfaces.d.ts +44 -0
  98. package/dist/server/mcpReadOnlySurfaces.js +297 -0
  99. package/dist/server/sdkServer.js +69 -7
  100. package/dist/server/transport.d.ts +5 -6
  101. package/dist/server/transport.js +46 -64
  102. package/dist/server/transportFactory.d.ts +3 -9
  103. package/dist/server/transportFactory.js +18 -380
  104. package/dist/services/atomicFs.d.ts +3 -0
  105. package/dist/services/atomicFs.js +171 -13
  106. package/dist/services/auditLog.d.ts +17 -2
  107. package/dist/services/auditLog.js +75 -14
  108. package/dist/services/bootstrapGating.js +1 -1
  109. package/dist/services/categoryRules.d.ts +10 -0
  110. package/dist/services/categoryRules.js +17 -0
  111. package/dist/services/classificationService.js +7 -5
  112. package/dist/services/embeddingService.d.ts +27 -11
  113. package/dist/services/embeddingService.js +51 -14
  114. package/dist/services/feedbackStorage.d.ts +39 -0
  115. package/dist/services/feedbackStorage.js +88 -0
  116. package/dist/services/handlers/instructions.add.js +429 -317
  117. package/dist/services/handlers/instructions.groom.js +128 -31
  118. package/dist/services/handlers/instructions.import.js +56 -23
  119. package/dist/services/handlers/instructions.patch.js +43 -32
  120. package/dist/services/handlers/instructions.query.js +20 -29
  121. package/dist/services/handlers/instructions.shared.d.ts +54 -0
  122. package/dist/services/handlers/instructions.shared.js +126 -1
  123. package/dist/services/handlers.activation.js +83 -81
  124. package/dist/services/handlers.dashboardConfig.d.ts +2 -2
  125. package/dist/services/handlers.dashboardConfig.js +1 -2
  126. package/dist/services/handlers.diagnostics.js +75 -54
  127. package/dist/services/handlers.feedback.d.ts +4 -11
  128. package/dist/services/handlers.feedback.js +11 -333
  129. package/dist/services/handlers.gates.js +69 -37
  130. package/dist/services/handlers.graph.js +2 -2
  131. package/dist/services/handlers.help.js +2 -2
  132. package/dist/services/handlers.instructionSchema.js +4 -2
  133. package/dist/services/handlers.integrity.js +42 -22
  134. package/dist/services/handlers.messaging.js +1 -1
  135. package/dist/services/handlers.metrics.js +51 -6
  136. package/dist/services/handlers.prompt.js +10 -2
  137. package/dist/services/handlers.search.js +94 -44
  138. package/dist/services/handlers.trace.js +1 -1
  139. package/dist/services/handlers.usage.js +38 -7
  140. package/dist/services/indexContext.d.ts +21 -1
  141. package/dist/services/indexContext.js +263 -78
  142. package/dist/services/indexLoader.d.ts +1 -0
  143. package/dist/services/indexLoader.js +28 -8
  144. package/dist/services/instructionRecordValidation.d.ts +39 -0
  145. package/dist/services/instructionRecordValidation.js +388 -0
  146. package/dist/services/instructions.dispatcher.js +4 -4
  147. package/dist/services/loaderSchemaValidator.d.ts +15 -0
  148. package/dist/services/loaderSchemaValidator.js +69 -0
  149. package/dist/services/logger.js +11 -2
  150. package/dist/services/mcpLogBridge.d.ts +49 -0
  151. package/dist/services/mcpLogBridge.js +83 -0
  152. package/dist/services/ownershipService.js +18 -8
  153. package/dist/services/performanceBaseline.js +23 -22
  154. package/dist/services/promptReviewService.d.ts +3 -1
  155. package/dist/services/promptReviewService.js +41 -13
  156. package/dist/services/regexSafety.d.ts +6 -0
  157. package/dist/services/regexSafety.js +46 -0
  158. package/dist/services/seedBootstrap.js +1 -1
  159. package/dist/services/storage/factory.d.ts +14 -1
  160. package/dist/services/storage/factory.js +61 -1
  161. package/dist/services/storage/jsonEmbeddingStore.d.ts +15 -0
  162. package/dist/services/storage/jsonEmbeddingStore.js +83 -0
  163. package/dist/services/storage/jsonFileStore.d.ts +3 -1
  164. package/dist/services/storage/jsonFileStore.js +8 -6
  165. package/dist/services/storage/migrationEngine.d.ts +13 -0
  166. package/dist/services/storage/migrationEngine.js +31 -0
  167. package/dist/services/storage/sqliteEmbeddingStore.d.ts +30 -0
  168. package/dist/services/storage/sqliteEmbeddingStore.js +222 -0
  169. package/dist/services/storage/sqliteStore.d.ts +3 -1
  170. package/dist/services/storage/sqliteStore.js +2 -2
  171. package/dist/services/storage/types.d.ts +48 -1
  172. package/dist/services/toolRegistry.js +77 -67
  173. package/dist/services/toolRegistry.zod.js +89 -86
  174. package/dist/services/tracing.js +5 -4
  175. package/dist/utils/envUtils.d.ts +4 -0
  176. package/dist/utils/envUtils.js +7 -0
  177. package/dist/utils/memoryMonitor.js +11 -10
  178. package/package.json +12 -4
  179. package/schemas/instruction.schema.json +38 -1
  180. package/scripts/copy-dashboard-assets.mjs +1 -1
  181. package/scripts/dist/README.md +1 -1
  182. package/scripts/generate-certs.mjs +201 -0
  183. package/scripts/setup-wizard.mjs +781 -0
  184. package/server.json +20 -0
  185. package/dist/externalClientLib.d.ts +0 -1
  186. package/dist/externalClientLib.js +0 -2
  187. package/dist/portableClientWrapper.d.ts +0 -1
  188. package/dist/portableClientWrapper.js +0 -2
  189. package/dist/services/indexingService.d.ts +0 -1
  190. package/dist/services/indexingService.js +0 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,87 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [1.26.1] - 2026-04-27
10
+
11
+ ### Fixed
12
+
13
+ - **CI**: Pinned `gitleaks` to v8.30.1 with SHA256 verification across all 3 jobs (PR, manual, scheduled). The previous `releases/latest` API lookup was racy and broke the workflow when GitHub returned an empty/malformed payload.
14
+ - **Tests**: `certInit.spec.ts` now accepts both `CN=localhost` and `CN = localhost` formats from `openssl x509 -text` (modern openssl emits the spaced form).
15
+ - **Tests**: `bugfixBatch1.spec.ts #135` no longer asserts that `instructions.groom.ts` directly references `isJunkCategory`; it is correctly used transitively via `normalizeCategories`.
16
+
17
+ ## [1.26.0] - 2026-04-26
18
+
19
+ ### Added
20
+
21
+ - **`--init-cert` CLI switch on `index-server`** to bootstrap a self-signed
22
+ TLS certificate + key for the admin dashboard via OpenSSL. Exits after
23
+ generation by default; pair with `--start` to continue normal startup using
24
+ the generated material (auto-wires `--dashboard-tls`). Supports `--cert-dir`,
25
+ `--cert-file`, `--key-file`, `--cn`, `--san`, `--days`, `--key-bits`,
26
+ `--force`, and `--print-env[=posix|powershell|both|auto]`. Path-traversal
27
+ guarded (SH-4); private key permissions set to `0600` on POSIX. See
28
+ `docs/cert_init.md`.
29
+
30
+ ### Changed
31
+
32
+ - `health_check` now reports audit-log health counters while exposing only sanitized audit persistence error messages.
33
+
34
+ ### Removed (breaking — MCP feedback surface)
35
+
36
+ - **MCP feedback tools collapsed to `feedback_submit` only (#111)**. The following MCP tools have been removed with no deprecation alias and no compatibility shim: `feedback_list`, `feedback_get`, `feedback_update`, `feedback_delete`, `feedback_stats`, `feedback_health`, `feedback_dispatch`. Agents must use `feedback_submit` to file entries. Human-operator CRUD now lives behind dashboard authentication at `GET/POST /admin/feedback`, `GET/PATCH/DELETE /admin/feedback/:id`, sharing the same `feedback/feedback-entries.json` store as the MCP submit path. GitHub issue handoff from the dashboard is browser-side, human-triggered, token-free, and targets `jagilber-org/index-server`. Spec: `specs/111-feedback-mcp-rip-down.md`.
37
+
38
+ ## [1.24.0] - 2026-04-24
39
+
40
+ ### Added
41
+
42
+ - `IEmbeddingStore` interface with pluggable embedding storage backends.
43
+ - `SqliteEmbeddingStore` — sqlite-vec backed embedding storage with native KNN search via `vec0` virtual table.
44
+ - `JsonEmbeddingStore` — file-based embedding storage adapter with brute-force cosine similarity search.
45
+ - `INDEX_SERVER_SQLITE_VEC_ENABLED` env var — opt-in toggle for sqlite-vec embedding storage (default: off).
46
+ - `INDEX_SERVER_SQLITE_VEC_PATH` env var — custom sqlite-vec native binary path override.
47
+ - `createEmbeddingStore()` factory function with automatic JSON fallback when sqlite-vec is unavailable.
48
+ - `resolveDevice()` — ONNX Runtime backend probe with injectable fallback chain (cuda → dml → cpu).
49
+ - `checkModelReadiness()` — startup check that warns when embedding model is missing with LOCAL_ONLY enabled.
50
+ - `checkNodeVersion()` — runtime version gate with clear error messages for feature-specific Node.js requirements.
51
+ - Embedding migration support: `migrateJsonEmbeddingsToStore()` for JSON → SQLite migration.
52
+ - 62 new embedding-related tests across 8 test files (contract, unit, integration, scenario).
53
+ - Documentation for all new env vars in configuration.md, mcp_configuration.md, vscode_mcp.md, deployment.md, docker_deployment.md, docker-compose.yml, runtime_config_mapping.md.
54
+ - Architecture docs updated with embedding store abstraction diagram and IEmbeddingStore interface reference.
55
+
56
+ ### Fixed
57
+
58
+ - Fixed dual-write stderr that caused duplicate log entries in VS Code Output panel.
59
+ - Fixed `.Count` on `$null` in `New-CleanRoomCopy.ps1` by wrapping collections in `@()`.
60
+ - Fixed tag-wiping in `Publish-ToMirror.ps1` and `publish-direct-to-remote.cjs` — publish scripts no longer delete existing remote tags (template-repo#47).
61
+
62
+ ### Changed
63
+
64
+ - Replaced 137 `console.*` calls with structured logger (`logError`/`logWarn`/`logInfo`/`logDebug`) across 27 server-side TypeScript files.
65
+ - Fixed severity misassignment in `promptReviewService.ts` — `logError` → `logWarn`/`logInfo` for non-error messages.
66
+ - Added embedding stress tests and `/api/embeddings/compute` route tests.
67
+ - Fixed `logInfo('')` empty-string calls in `performanceBaseline.ts` — replaced with `logInfo('---')` separators.
68
+ - Fixed `factory.ts` formatting defect (multi-statement single line in sqlite case block).
69
+ - Docker deployment docs now note Alpine/musl limitation for sqlite-vec native binary.
70
+
71
+ ## [1.23.1] - 2026-04-23
72
+
73
+ ### Changed
74
+
75
+ - Added MCP Registry metadata and aligned the package manifest for MCP-native distribution surfaces.
76
+ - Reworked install and configuration guidance so the MCP-native `npx --setup` flow is primary.
77
+ - Updated release automation for the migration handoff and tightened the private-repo release path so `jagilber-dev` releases do not attempt public npm or MCP Registry publication.
78
+ - Added minimal read-only MCP prompts and resources for setup, configuration, and verification guidance.
79
+
80
+ ### Removed
81
+
82
+ - Removed the legacy VS Code extension source tree, VSIX workflow, packaged VSIX artifacts, and extension-only release docs.
83
+
84
+ ### Migration Notes
85
+
86
+ - Existing deployments that previously relied on the unset mutation flag as an implicit read-only default must audit their runtime configuration before upgrading. If a deployment should remain read-only after upgrade, set `INDEX_SERVER_MUTATION=0` explicitly.
87
+
7
88
  ## [1.21.0] - 2026-04-17
8
89
 
9
90
  ### Added
@@ -203,11 +284,9 @@ The format is based on Keep a Changelog and this project adheres to Semantic Ver
203
284
 
204
285
  ### Fixed
205
286
 
206
- - **VSIX extension**: Renamed all "Catalog" references to "Index"/"Index Server" in extension UI (commands, walkthrough, settings, README, icon).
207
287
 
208
288
  ### Added
209
289
 
210
- - **Azure DevOps pipeline**: `azure-pipelines.yml` for private VSIX publishing via ADO.
211
290
 
212
291
  ## [1.16.0] - 2026-04-01
213
292
 
@@ -1352,3 +1431,13 @@ No client changes required. Enable `INDEX_SERVER_MEMOIZE=1` (and optionally `IND
1352
1431
  - Rename catalog_* MCP tools to index_*, add dashboard panel help docs, fix restore script zip support
1353
1432
 
1354
1433
  ## [1.16.2] - 2026-04-02
1434
+
1435
+ ## [1.26.0] - 2026-04-27
1436
+
1437
+ ### Added
1438
+
1439
+ - Add --init-cert CLI switch for self-signed dashboard TLS bootstrap (PR #233, issue #232)
1440
+
1441
+ ## [1.26.2] - 2026-04-27
1442
+
1443
+ ## [1.26.4] - 2026-04-28
@@ -32,6 +32,8 @@ This Code of Conduct applies within all community spaces, including GitHub repos
32
32
 
33
33
  Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer via [GitHub Issues](https://github.com/jagilber-org/index-server/issues) or by contacting the maintainer directly.
34
34
 
35
+ > **Private reporting:** If you do not feel comfortable reporting publicly, you may contact the maintainer privately using the email listed in the repository's GitHub profile. Reports will be kept confidential to the extent permitted by law and project operational needs.
36
+
35
37
  All complaints will be reviewed and investigated promptly and fairly. The project maintainer is obligated to respect the privacy and security of the reporter of any incident.
36
38
 
37
39
  ### Enforcement Guidelines
package/CONTRIBUTING.md CHANGED
@@ -23,13 +23,43 @@ Maintainers may use additional private development and publishing workflows inte
23
23
 
24
24
  Use feature branches. Submit PRs to `main`.
25
25
 
26
+ ## Pull Request Review
27
+
28
+ Fill out the PR template completely before requesting review.
29
+
30
+ ### Mandatory AI-Generated Code/Test Review
31
+
32
+ If any code or tests in the PR were generated or materially edited by an AI agent, reviewers MUST confirm all of the following before merge:
33
+
34
+ - [ ] No placeholder tests: no `placeholder`, `expect(true)`, `expect(1).toBe(1)`, or empty `() => {}` test bodies were introduced
35
+ - [ ] No new `it.skip()` or `describe.skip()` without a linked issue and inline justification
36
+ - [ ] Negative tests exist for handler changes, including invalid input, missing required fields, and non-existent resources where applicable
37
+ - [ ] Mutation-handler tests verify disk truth independently (for example, by reading the filesystem) rather than trusting only the server response
38
+ - [ ] No new `SKIP_OK` markers were added to normalize permanently skipped coverage
39
+ - [ ] Claimed test counts match real coverage and assertions
40
+ - [ ] No hardcoded success values such as `verified: true` or `created: true` were added unless computed from a real check
41
+ - [ ] Agent attestation metadata present on agent-authored commits (AG-4)
42
+ - [ ] Copilot `Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>` trailer present on Copilot-authored commits
43
+ - [ ] Tests added for behavioral changes (unit + integration where the change crosses a layer boundary)
44
+ - [ ] No hardcoded paths or secrets — all tunables routed through `src/config/runtimeConfig.ts` (`npm run guard:env` passes)
45
+ - [ ] `logAudit()` invoked on every mutation success and side-effecting error path
46
+ - [ ] `src/services/toolRegistry.ts` updated for new/changed tools (INPUT_SCHEMAS + STABLE + MUTATION + describeTool) and registered via `src/services/toolHandlers.ts`
47
+ - [ ] Conventional Commit subjects on every commit
48
+ - [ ] If `constitution.json` changed: `pwsh -File scripts/sync-constitution.ps1 -Check` passes and rendered `.md` files are regenerated
49
+ - [ ] Security-sensitive changes carry explicit Morpheus + Tank consensus approvals or a linked `.squad/decisions/` record
50
+ - [ ] Imported external code has a documented source and a `LICENSE`-compatible license, with attribution recorded in `THIRD-PARTY-LICENSES.md` where required
51
+
52
+ PRs that fail any AI-generated code/test review item must be sent back for correction before merge.
53
+
54
+ > **Full policy with examples, grep commands, and constitution references:** [`docs/pr_review_checklist.md`](docs/pr_review_checklist.md)
55
+
26
56
  ## Commit Messages
27
57
 
28
58
  Use conventional style where practical (feat:, fix:, docs:, chore:).
29
59
 
30
60
  ## Tests
31
61
 
32
- Include unit tests for new logic. Run `npm test` and ensure coverage not reduced.
62
+ Include unit tests for new logic. Run `npm test` for the default fast suite, and use `npm run test:slow` or `npm run test:all` when your change touches heavy integration/perf coverage.
33
63
 
34
64
  ### Repo Root Policy
35
65
 
@@ -50,7 +80,7 @@ All runtime and test tunables must flow through `src/config/runtimeConfig.ts`:
50
80
 
51
81
  1. If you need a new timing / wait value, extend `INDEX_SERVER_TIMING_JSON` key usage (e.g. `{"featureX.startupWait":5000}`) instead of adding `FEATUREX_STARTUP_WAIT_MS`.
52
82
  2. For logging verbosity, use `INDEX_SERVER_LOG_LEVEL` (levels: silent,error,warn,info,debug,trace) or add a trace token to `INDEX_SERVER_TRACE` (comma-separated) rather than a new boolean flag.
53
- 3. For mutation gating, rely on `INDEX_SERVER_MUTATION` (legacy `INDEX_SERVER_MUTATION` is auto-mapped; do not reintroduce it).
83
+ 3. For mutation control, rely on `INDEX_SERVER_MUTATION` (`0` forces read-only mode; do not introduce alternate flags).
54
84
  4. Fast coverage paths use `INDEX_SERVER_TEST_MODE=coverage-fast`; legacy `FAST_COVERAGE` accepted but should not appear in new code.
55
85
 
56
86
  If an absolutely new capability requires configuration:
package/README.md CHANGED
@@ -6,8 +6,6 @@
6
6
  [![npm version](https://img.shields.io/github/v/tag/jagilber-org/index-server?label=GitHub%20Packages)](https://github.com/jagilber-org/index-server/packages)
7
7
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D22%20LTS-brightgreen)](package.json)
8
8
  [![codecov](https://codecov.io/gh/jagilber-org/index-server/graph/badge.svg)](https://codecov.io/gh/jagilber-org/index-server)
9
- [![VS Code Marketplace](https://img.shields.io/visual-studio-marketplace/v/jagilber-org.index-server?label=VS%20Code%20Marketplace)](https://marketplace.visualstudio.com/items?itemName=jagilber-org.index-server)
10
- [![Open VSX](https://img.shields.io/open-vsx/v/jagilber-org/index-server?label=Open%20VSX)](https://open-vsx.org/extension/jagilber-org/index-server)
11
9
 
12
10
  ---
13
11
 
@@ -21,19 +19,45 @@ Index Server is a central knowledge base that AI agents connect to via the [Mode
21
19
 
22
20
  ---
23
21
 
24
- ## Quick Start
22
+ ## Quick Start Options
25
23
 
26
- ### Path A: npx (zero install)
24
+ ### Option A: MCP-native via `npx` (recommended)
25
+
26
+ Run the latest published package without cloning the repo. Choose this when you want the fastest local start and already have Node.js installed.
27
+
28
+ Start with the setup wizard so it can generate the right MCP client config for VS Code, Copilot CLI, or Claude Desktop:
29
+
30
+ ```bash
31
+ npx -y @jagilber-org/index-server@latest --setup
32
+ ```
33
+
34
+ To launch the server directly without the wizard:
35
+
36
+ ```bash
37
+ npx -y @jagilber-org/index-server@latest --dashboard
38
+ ```
39
+
40
+ #### Bootstrap HTTPS for the dashboard
41
+
42
+ Generate a self-signed TLS cert+key in one command (requires `openssl` on PATH):
27
43
 
28
44
  ```bash
29
- npx @jagilber-org/index-server@latest --dashboard
45
+ # Generate at ~/.index-server/certs/, then start with HTTPS automatically
46
+ npx -y @jagilber-org/index-server@latest --init-cert --start --dashboard
30
47
  ```
31
48
 
32
- ### Path B: VS Code Extension
49
+ `--init-cert` alone exits after generation. `--init-cert --start` continues
50
+ into normal startup with the generated cert wired into `--dashboard-tls`
51
+ automatically. See [`docs/cert_init.md`](docs/cert_init.md) for the full
52
+ flag reference, security notes, and troubleshooting.
33
53
 
34
- Install **Index Server** from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=jagilber-org.index-server) or [Open VSX](https://open-vsx.org/extension/jagilber-org/index-server).
54
+ ### Option B: VS Code MCP configuration
35
55
 
36
- ### Path C: Docker
56
+ Use VS Code's built-in MCP support with `.vscode/mcp.json` or your global `mcp.json`. You can add the server entry manually or run `npx -y @jagilber-org/index-server@latest --setup` to generate the config for you.
57
+
58
+ ### Option C: Docker
59
+
60
+ Run the server in a container. Choose this when you want isolated runtime dependencies or you are preparing a container-based deployment.
37
61
 
38
62
  ```bash
39
63
  docker compose up # HTTP on :8787
@@ -42,7 +66,9 @@ docker compose up tls # HTTPS on :8787 with self-signed certs
42
66
 
43
67
  See [Docker Deployment Guide](docs/docker_deployment.md) for volumes, environment variables, and production configuration.
44
68
 
45
- ### Path D: From source
69
+ ### Option D: From source
70
+
71
+ Clone and build the repository yourself. Choose this when you want to modify the server, run tests locally, or work from the latest source.
46
72
 
47
73
  ```bash
48
74
  git clone https://github.com/jagilber-org/index-server.git
@@ -51,9 +77,12 @@ npm install
51
77
  npm run build
52
78
  ```
53
79
 
54
- ### Configure your MCP client
80
+ ## Configure Your MCP Client
55
81
 
56
- Add to VS Code (`.vscode/mcp.json`):
82
+ > **Best practice:** set `INDEX_SERVER_DIR` to a well-known data folder such as `C:/mcp/index-data/instructions` or `~/.index-server/instructions`. Keep it outside VS Code and MCP client config paths so backups and reinstalls do not move or overwrite your catalog.
83
+
84
+ <details>
85
+ <summary>VS Code (`.vscode/mcp.json`)</summary>
57
86
 
58
87
  ```jsonc
59
88
  {
@@ -62,15 +91,23 @@ Add to VS Code (`.vscode/mcp.json`):
62
91
  "type": "stdio",
63
92
  "command": "npx",
64
93
  "args": [
94
+ "-y",
65
95
  "@jagilber-org/index-server@latest",
66
96
  "--dashboard"
67
- ]
97
+ ],
98
+ "env": {
99
+ "INDEX_SERVER_DIR": "C:/mcp/index-data/instructions",
100
+ "INDEX_SERVER_LOG_LEVEL": "info"
101
+ }
68
102
  }
69
103
  }
70
104
  }
71
105
  ```
72
106
 
73
- Copilot CLI (`~/.copilot/mcp-config.json`):
107
+ </details>
108
+
109
+ <details>
110
+ <summary>Copilot CLI (`~/.copilot/mcp-config.json`)</summary>
74
111
 
75
112
  ```json
76
113
  {
@@ -78,14 +115,21 @@ Copilot CLI (`~/.copilot/mcp-config.json`):
78
115
  "index-server": {
79
116
  "type": "stdio",
80
117
  "command": "npx",
81
- "args": ["@jagilber-org/index-server@latest", "--dashboard"],
118
+ "args": ["-y", "@jagilber-org/index-server@latest", "--dashboard"],
119
+ "env": {
120
+ "INDEX_SERVER_DIR": "C:/mcp/index-data/instructions",
121
+ "INDEX_SERVER_LOG_LEVEL": "info"
122
+ },
82
123
  "tools": ["*"]
83
124
  }
84
125
  }
85
126
  }
86
127
  ```
87
128
 
88
- Claude Desktop (`claude_desktop_config.json`):
129
+ </details>
130
+
131
+ <details>
132
+ <summary>Claude Desktop (`claude_desktop_config.json`)</summary>
89
133
 
90
134
  ```json
91
135
  {
@@ -93,21 +137,38 @@ Claude Desktop (`claude_desktop_config.json`):
93
137
  "index-server": {
94
138
  "type": "stdio",
95
139
  "command": "npx",
96
- "args": ["@jagilber-org/index-server@latest", "--dashboard"],
140
+ "args": ["-y", "@jagilber-org/index-server@latest", "--dashboard"],
141
+ "env": {
142
+ "INDEX_SERVER_DIR": "C:/mcp/index-data/instructions",
143
+ "INDEX_SERVER_LOG_LEVEL": "info"
144
+ },
97
145
  "tools": ["*"]
98
146
  }
99
147
  }
100
148
  }
101
149
  ```
102
150
 
151
+ </details>
152
+
103
153
  See [MCP Configuration Guide](docs/mcp_configuration.md) for advanced patterns, environment variables, and TLS setup.
104
154
 
105
155
  ### Verify
106
156
 
107
157
  - Server appears in your MCP client's server list
108
158
  - Run `tools/list` to see 40+ available tools
159
+ - Run `prompts/list` to discover setup/config/verification prompts
160
+ - Run `resources/list` to discover quickstart and configuration guides
109
161
  - Dashboard (if enabled) at `http://localhost:8787`
110
162
 
163
+ ### Built-in MCP prompts and resources
164
+
165
+ Clients that support MCP prompts/resources can use the built-in read-only setup guidance surface:
166
+
167
+ - Prompts: `setup_index_server`, `configure_index_server`, `verify_index_server`
168
+ - Resources: `index://guides/quickstart`, `index://guides/client-config`, `index://guides/verification`
169
+
170
+ These surfaces are intentionally static and read-only. Use them for setup help, config review, and verification/troubleshooting without changing server state.
171
+
111
172
  ### Enable Semantic Search (optional)
112
173
 
113
174
  Add one env variable to any MCP config above to get embedding-based similarity search:
@@ -199,9 +260,9 @@ See [dashboard.md](docs/dashboard.md) for full details. REST client scripts (`sc
199
260
 
200
261
  ## Security
201
262
 
202
- Index Server makes **zero telemetry calls** and sends **no data to external services** during normal operation. The dashboard binds to **localhost only** by default. All mutations require explicit enablement and are audit-logged. Fresh installations gate mutations until human confirmation via the bootstrap workflow.
263
+ Index Server makes **zero telemetry calls** and sends **no data to external services** during normal operation. The dashboard binds to **localhost only** by default. Mutations are audit-logged, can be forced read-only with `INDEX_SERVER_MUTATION=0`, and fresh installations gate writes until human confirmation via the bootstrap workflow.
203
264
 
204
- See [SECURITY.md](SECURITY.md) for vulnerability reporting and [Network Privacy Guide](docs/network-privacy.md) for offline deployment and verification.
265
+ See [SECURITY.md](SECURITY.md) for vulnerability reporting, [PRIVACY.md](PRIVACY.md) for data collection policy and optional outbound connections, and [Network Privacy Guide](docs/network-privacy.md) for offline deployment and verification.
205
266
 
206
267
  ---
207
268
 
@@ -210,7 +271,9 @@ See [SECURITY.md](SECURITY.md) for vulnerability reporting and [Network Privacy
210
271
  ```bash
211
272
  npm install # Install dependencies
212
273
  npm run build # Build TypeScript
213
- npm test # Run test suite
274
+ npm test # Run the fast default suite
275
+ npm run test:slow # Run heavy integration/perf tests
276
+ npm run test:all # Run the full Vitest suite
214
277
  npm run typecheck # Type checking
215
278
  npm run lint # Linting
216
279
  ```
package/SECURITY.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  Please report suspected vulnerabilities privately using one of these methods:
15
15
 
16
- 1. **GitHub Security Advisories** (preferred) — create a new advisory on the [public repository](https://github.com/jagilber-org/index-server/security/advisories).
16
+ 1. **GitHub Security Advisories** (preferred) — create a new advisory on the [public repository](https://github.com/jagilber-org/index-server/security/advisories). Advisories are always filed against the public mirror (`jagilber-org/index-server`), not the private dev repo.
17
17
  2. **Email** — contact the maintainer at the email listed in the repository's GitHub profile.
18
18
 
19
19
  When reporting, include:
@@ -25,7 +25,7 @@ When reporting, include:
25
25
  ### Response Timeline
26
26
 
27
27
  - **Acknowledgement**: within 48 hours of receipt
28
- - **Detailed response**: within 7 business days
28
+ - **Detailed response**: within 5 business days
29
29
  - **Fix or mitigation**: coordinated with reporter before public disclosure
30
30
 
31
31
  ## Vulnerability Disclosure
@@ -36,15 +36,27 @@ We follow responsible disclosure practices:
36
36
  - Prepare a fix and coordinate a release timeline with the reporter.
37
37
  - Credit reporters who wish to be acknowledged in the advisory and changelog.
38
38
 
39
+ ## Urgent Security Merge Policy
40
+
41
+ Critical or actively-exploited vulnerabilities may be merged with **zero pre-merge review** when delay would increase exposure risk. The following conditions apply:
42
+
43
+ 1. **Post-merge audit required** — a full code review MUST occur within 24 hours of the merge.
44
+ 2. **Commit or PR rationale** — the merge commit and/or PR description must document why the normal review process was bypassed (for example, active exploitation, severity, or blast radius).
45
+ 3. **Async reviewer sign-off** — at least one maintainer must provide a reviewing sign-off within 24 hours, confirming the fix is correct and complete.
46
+ 4. **Reference the vulnerability** — the commit and/or PR must reference the relevant CVE, advisory, or issue number.
47
+ 5. **Scope limit** — this policy applies **only** to critical and actively-exploited vulnerabilities. Non-critical security issues follow the standard review process.
48
+
49
+ If the post-merge audit reveals problems, a follow-up fix must be prioritized immediately. Abuse of this policy to bypass review for non-critical changes is a process violation.
50
+
39
51
  ## Security Practices
40
52
 
41
53
  - **Pre-commit hooks** scan for secrets and PII before code leaves the developer machine
42
54
  - **Bootstrap gating** — all mutation operations require explicit bootstrap confirmation
43
55
  - **Audit logging** — every Index mutation is logged with timestamp, action, and actor
44
56
  - **Content scanning** — automated checks before public publishing via dual-repo workflow
45
- - **Mutation controls** — `INDEX_SERVER_MUTATION` environment variable gates write operations
46
- - **Auth key support** — optional `INDEX_SERVER_AUTH_KEY` for securing dashboard and API access
57
+ - **Mutation controls** — `INDEX_SERVER_MUTATION=0` forces a read-only runtime when you need to disable write operations explicitly
58
+ - **Auth key support** — `INDEX_SERVER_AUTH_KEY` is documented as an environment variable for dashboard and API access but is **not enforced at runtime** — the server does not check or validate this key on any request path. This is an experimental placeholder. Do not rely on this setting for access control. See [CODE_SECURITY_REVIEW.md](CODE_SECURITY_REVIEW.md) § Security Gaps for implementation status.
47
59
 
48
60
  ## Hardening Notes
49
61
 
50
- This project includes enterprise hardening (see `HARDENING-DESIGN.md`). Keep auth secrets (`INDEX_SERVER_AUTH_KEY`) private. Avoid committing credentials or tokens.
62
+ This project includes enterprise hardening features (localhost-only dashboard binding, bootstrap gating, audit logging, mutation controls, pre-commit secret scanning). Keep any future auth secrets private. Avoid committing credentials or tokens.
@@ -16,6 +16,9 @@ interface DashboardHttpConfig {
16
16
  mutationEnabled: boolean;
17
17
  adminApiKey?: string;
18
18
  rateLimitEnabled: boolean;
19
+ rateLimitWindowMs: number;
20
+ rateLimitMax: number;
21
+ rateLimitMutationMax: number;
19
22
  tls: DashboardTlsConfig;
20
23
  }
21
24
  interface DashboardAdminConfig {
@@ -37,6 +37,9 @@ function parseDashboardConfig(mutationEnabled, instructionsBaseDir) {
37
37
  mutationEnabled,
38
38
  adminApiKey: process.env.INDEX_SERVER_ADMIN_API_KEY || undefined,
39
39
  rateLimitEnabled: !(0, envUtils_1.getBooleanEnv)('INDEX_SERVER_DISABLE_RATE_LIMIT'),
40
+ rateLimitWindowMs: Math.max(1, (0, configUtils_1.numberFromEnv)('INDEX_SERVER_RATE_LIMIT_WINDOW_MS', 60_000)),
41
+ rateLimitMax: Math.max(0, (0, configUtils_1.numberFromEnv)('INDEX_SERVER_RATE_LIMIT_MAX', 100)),
42
+ rateLimitMutationMax: Math.max(0, (0, configUtils_1.numberFromEnv)('INDEX_SERVER_RATE_LIMIT_MUTATION_MAX', 20)),
40
43
  tls: {
41
44
  enabled: (0, envUtils_1.getBooleanEnv)('INDEX_SERVER_DASHBOARD_TLS'),
42
45
  certPath: process.env.INDEX_SERVER_DASHBOARD_TLS_CERT || undefined,
@@ -25,7 +25,7 @@ export declare const DEFAULT_LIMITS: {
25
25
  readonly MAX_FEEDBACK_ENTRIES: 1000;
26
26
  readonly MAX_MESSAGES: 10000;
27
27
  readonly MAX_SESSION_HISTORY: 200;
28
- readonly BODY_WARN_LENGTH: 100000;
28
+ readonly BODY_WARN_LENGTH: 50000;
29
29
  readonly BODY_MIN_LENGTH: 1000;
30
30
  readonly BODY_MAX_LENGTH: 1000000;
31
31
  readonly AUTO_BACKUP_MAX_COUNT: 10;
@@ -30,7 +30,7 @@ exports.DEFAULT_LIMITS = {
30
30
  MAX_FEEDBACK_ENTRIES: 1000,
31
31
  MAX_MESSAGES: 10000,
32
32
  MAX_SESSION_HISTORY: 200,
33
- BODY_WARN_LENGTH: 100000,
33
+ BODY_WARN_LENGTH: 50000,
34
34
  BODY_MIN_LENGTH: 1000,
35
35
  BODY_MAX_LENGTH: 1000000,
36
36
  AUTO_BACKUP_MAX_COUNT: 10,
@@ -56,6 +56,8 @@ export interface StorageConfig {
56
56
  sqlitePath: string;
57
57
  sqliteWal: boolean;
58
58
  sqliteMigrateOnStart: boolean;
59
+ sqliteVecEnabled: boolean;
60
+ sqliteVecPath: string;
59
61
  }
60
62
  export declare function parseStorageConfig(): StorageConfig;
61
63
  export {};
@@ -110,12 +110,17 @@ function parseStorageConfig() {
110
110
  const raw = (process.env.INDEX_SERVER_STORAGE_BACKEND || 'json').toLowerCase();
111
111
  const backend = (raw === 'sqlite' ? 'sqlite' : 'json');
112
112
  if (backend === 'sqlite') {
113
- console.warn('[config] ⚠️ EXPERIMENTAL: SQLite storage backend selected. Limited testing has been performed. Use at your own risk.');
113
+ try {
114
+ process.stderr.write(JSON.stringify({ ts: new Date().toISOString(), level: 'WARN', msg: '[config] EXPERIMENTAL: SQLite storage backend selected. Limited testing has been performed. Use at your own risk.', pid: process.pid }) + '\n');
115
+ }
116
+ catch { /* ignore */ }
114
117
  }
115
118
  return {
116
119
  backend,
117
120
  sqlitePath: (0, configUtils_1.toAbsolute)(process.env.INDEX_SERVER_SQLITE_PATH, path_1.default.join(configUtils_1.CWD, dirConstants_1.DIR.DATA_SQLITE)),
118
121
  sqliteWal: (0, envUtils_1.parseBooleanEnv)(process.env.INDEX_SERVER_SQLITE_WAL, true),
119
122
  sqliteMigrateOnStart: (0, envUtils_1.parseBooleanEnv)(process.env.INDEX_SERVER_SQLITE_MIGRATE_ON_START, true),
123
+ sqliteVecEnabled: (0, envUtils_1.parseBooleanEnv)(process.env.INDEX_SERVER_SQLITE_VEC_ENABLED, false),
124
+ sqliteVecPath: process.env.INDEX_SERVER_SQLITE_VEC_PATH || '',
120
125
  };
121
126
  }
@@ -45,7 +45,7 @@ interface IndexConfig {
45
45
  govHash: IndexGovernanceConfig;
46
46
  maxFiles?: number;
47
47
  loadWarningThreshold?: number;
48
- /** Configurable warn/truncate/reject threshold for instruction body length (default 100000). */
48
+ /** Configurable warn/truncate/reject threshold for instruction body length (default 50000). */
49
49
  bodyWarnLength: number;
50
50
  /** Hard maximum body character length — schema reject ceiling, always 1MB. Not configurable. */
51
51
  bodyMaxLength: number;
@@ -105,12 +105,10 @@ function parseBufferRing() {
105
105
  return { append: append ?? true, preload };
106
106
  }
107
107
  function parseMutation() {
108
- if (process.env.INDEX_SERVER_MUTATION) {
109
- if (process.env.INDEX_SERVER_MUTATION === '1' || process.env.INDEX_SERVER_MUTATION === 'true')
110
- return true;
111
- return false;
112
- }
113
- return false;
108
+ const raw = process.env.INDEX_SERVER_MUTATION;
109
+ if (raw === undefined)
110
+ return true;
111
+ return (0, envUtils_1.parseBooleanEnv)(raw, false);
114
112
  }
115
113
  function parseCoverage() {
116
114
  const fast = process.env.INDEX_SERVER_COVERAGE_FAST === '1' || process.env.INDEX_SERVER_TEST_MODE === 'coverage-fast';
@@ -171,7 +169,10 @@ function parseIndexConfig() {
171
169
  const bodyMaxLength = defaultValues_1.DEFAULT_LIMITS.BODY_MAX_LENGTH;
172
170
  // Warn about removed legacy env var
173
171
  if (process.env.INDEX_SERVER_BODY_MAX_LENGTH !== undefined) {
174
- console.warn('[runtimeConfig] INDEX_SERVER_BODY_MAX_LENGTH is no longer recognized. Use INDEX_SERVER_BODY_WARN_LENGTH instead (default: 100000).');
172
+ try {
173
+ process.stderr.write(JSON.stringify({ ts: new Date().toISOString(), level: 'WARN', msg: '[runtimeConfig] INDEX_SERVER_BODY_MAX_LENGTH is no longer recognized. Use INDEX_SERVER_BODY_WARN_LENGTH instead (default: 50000).', pid: process.pid }) + '\n');
174
+ }
175
+ catch { /* ignore */ }
175
176
  }
176
177
  return {
177
178
  mode: deriveIndexMode(),
@@ -271,7 +272,6 @@ function applyProfileDefaults(profile) {
271
272
  setDefault('INDEX_SERVER_SEMANTIC_ENABLED', '1');
272
273
  setDefault('INDEX_SERVER_SEMANTIC_LOCAL_ONLY', '0');
273
274
  setDefault('INDEX_SERVER_LOG_FILE', '1');
274
- setDefault('INDEX_SERVER_MUTATION', '1');
275
275
  setDefault('INDEX_SERVER_DASHBOARD_TLS', '1');
276
276
  setDefault('INDEX_SERVER_METRICS_FILE_STORAGE', '1');
277
277
  setDefault('INDEX_SERVER_FEATURES', 'usage');
@@ -280,7 +280,6 @@ function applyProfileDefaults(profile) {
280
280
  setDefault('INDEX_SERVER_SEMANTIC_ENABLED', '1');
281
281
  setDefault('INDEX_SERVER_SEMANTIC_LOCAL_ONLY', '0');
282
282
  setDefault('INDEX_SERVER_LOG_FILE', '1');
283
- setDefault('INDEX_SERVER_MUTATION', '1');
284
283
  setDefault('INDEX_SERVER_DASHBOARD_TLS', '1');
285
284
  setDefault('INDEX_SERVER_METRICS_FILE_STORAGE', '1');
286
285
  setDefault('INDEX_SERVER_FEATURES', 'usage');