5c6085df99eee83c989c1f0fb5a19f09adcee66e
- Domain: add ModelState, ModelStateEvent, ModelNotReady, ManageModelLifecycle (in-port), ModelLoader and ModelStateEventBus (out-ports) - Application: InMemoryModelStateEventBus; ModelLifecycleService — state machine (ReentrantLock), lazy load on first request, idle-timeout auto-unload (configurable via trueref.embedding.idle-timeout-seconds, default 300 s), job-guard (skips unload while ingestion running), platform-thread CUDA executor - Adapters: OnnxModelLoader wires embedder + reranker start/stop; remove @PostConstruct/@PreDestroy from OnnxEmbeddingService and OnnxRerankerService; requireStarted() now throws ModelNotReady instead of IllegalStateException - REST: GET /api/model/status, POST /api/model/unload (409 when jobs running, force=true to override), GET /api/model/status/stream (SSE) - GlobalExceptionHandler: ModelNotReady -> 503 + Retry-After header - HybridSearchService: calls lifecycle.ensureReady() before every search so both REST and MCP paths get ModelNotReady (-> 503 / MCP error) when unloaded - TrueRefMcpTools: catches ModelNotReady, returns retry hint in MCP error text - Tests: InMemoryModelStateEventBusTest, ModelLifecycleServiceTest (10 cases), OnnxModelLoaderTest, GlobalExceptionHandlerTest — all 41 tests green Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
trueref
Self-hosted Context7 clone in Java 21 + Spring Boot 3.5: indexes git repositories per tag, exposes a Streamable-HTTP MCP server, REST + Swagger, and a SvelteKit dashboard for ingestion observability and querying.
See:
- ARCHITECTURE.md — design, hexagonal layout, pipelines, MCP/REST surfaces.
- CODE_STYLE.md — conventions.
- FINDINGS.md — research notes backing every choice.
Quickstart
./mvnw -DskipTests package
java -jar trueref-bootstrap/target/trueref.jar
Browse:
- UI: http://localhost:8080/
- Swagger: http://localhost:8080/swagger-ui.html
- MCP endpoint: http://localhost:8080/mcp
- Actuator: http://localhost:8080/actuator
Description
Languages
Java
76.3%
Svelte
11.4%
Python
5.9%
TypeScript
3.4%
Shell
1.6%
Other
1.2%