Files
lcbp3/specs/200-fullstacks/233-ai-model-ocr-runner-management/tasks.md
T
admin bc754e66fd
CI / CD Pipeline / build (push) Successful in 4m52s
CI / CD Pipeline / deploy (push) Successful in 17m39s
690602:0957 ADR-033-233 #01
2026-06-02 09:57:48 +07:00

2.6 KiB

Tasks: AI Model & OCR Runner Management

  • T001: Create the feature documentation structure in specs/200-fullstacks/233-ai-model-ocr-runner-management/
  • T002: Create Architecture Decision Record ADR-033 to document decisions
  • T003: [Backend] Inject OcrService and register GET /ai/ocr-engines endpoint in ai.controller.ts
  • T004: [Backend] Register POST /ai/ocr-engines/:engineId/select endpoint in ai.controller.ts
  • T005: [Backend] Implement resilient fallback in fetchAndCacheVramStatus() within vram-monitor.service.ts to resolve "OOM Guard" stuck issue
  • T006: [Backend] Update SandboxOcrEngineType in sandbox-ocr-engine.service.ts to accept precise model types
  • T007: [Backend] Add loadModel(modelName: string): Promise<boolean> method in ollama.service.ts
  • T008: [Backend] Refactor activateAiModel() in ai.service.ts to call ollamaService.loadModel() and throw BusinessException on loading failure before DB update
  • T009: [Backend] Update checkHealth() in ollama.service.ts to fetch loaded models dynamically from /api/ps
  • T010: [Frontend] Add active model and loading/active status badges to the "System Toggle" Card next to the AI Enable switch in page.tsx
  • T011: [Backend] Write unit test case in ai.service.spec.ts to verify activateAiModel() fails gracefully if model pre-loading returns false
  • T012: [Frontend] Swap sub-tabs buttons and change the default activeTab to 'sandbox' in OcrSandboxPromptManager.tsx
  • T013: [Frontend] Update dropdown engine options in OcrSandboxPromptManager.tsx to match exact labels
  • T014: [Backend] Update resolved engine types validation in submitSandboxOcr within ai.controller.ts
  • T015: [Sidecar] Update dynamic engine mapping in sidecar app.py
  • T016: [Backend/Ollama] Add unloadModel(modelName: string): Promise<boolean> in ollama.service.ts to unload models with keep_alive: 0 (Suggestion 1)
  • T017: [Backend/Ollama] Integrate model unloading on active model switch in ai.service.ts (Suggestion 1)
  • T018: [Sidecar] Protect ocr-sidecar endpoints with X-API-Key headers check in fastapi app.py (Suggestion 2)
  • T019: [Backend] Add X-API-Key client header in DMS Backend ocr.service.ts and sandbox-ocr-engine.service.ts (Suggestion 2)
  • T020: Verify strict TypeScript standards (pnpm --filter backend build)
  • T021: Verify all unit tests pass successfully
  • T022: Run git status and verify no debug console.log or invalid files exist