2.7 KiB
2.7 KiB
Task 4 Report — Narrow harness embedding configuration to internal Ollama
Status
Implemented on 2026-08-08 in /Users/mp/projects/ThothII/.worktrees/git-workspace-registry.
RED evidence
Command:
cd harness
./.venv/bin/pytest tests/test_internal_embeddings.py tests/test_config_resources.py -q
Observed before implementation:
- exit code
1 10 failed, 10 passed- failures proved the missing
OllamaInternalEmbeddingsclient and missing internal-only config validation
Representative failures:
ImportError: cannot import name 'OllamaInternalEmbeddings'AttributeError: 'EmbeddingsConfig' object has no attribute 'provider'- config tests
DID NOT RAISE ConfigErrorfor external provider, API key, and non-private base URL
GREEN evidence
Focused behavior suite:
cd harness
./.venv/bin/pytest tests/test_internal_embeddings.py tests/test_config_resources.py -q
- exit code
0 20 passed
Relevant harness verification:
cd harness
./.venv/bin/pytest tests/test_internal_embeddings.py tests/test_config_resources.py tests/test_ollama_ensure.py -q
- exit code
0 36 passed, 2 warnings
Changed-file lint:
cd harness
./.venv/bin/ruff check tht/config.py tht/config_compat.py tht/vectorstore/embeddings.py tht/cli/ollama_cmd.py tests/test_config_resources.py tests/test_internal_embeddings.py
- exit code
0 All checks passed!
Patch hygiene:
git diff --check
- exit code
0
What changed
- translated schema-v3
resources.embeddingsinto the harness-compatible embedding config view - validated the internal embedding contract only for that runtime-owned
resources.embeddingspath:- provider must be
ollama_internal - model must be
qwen3-embedding:0.6b - dimensions must be
1024 - base URL must be
http://embedding:11434or loopback HTTP on port11434 - extra fields like
api_keyare rejected
- provider must be
- replaced the active embed client with
OllamaInternalEmbeddings, using one bounded/api/embedrequest per batch - removed task/query prefix rewriting from the active embedding path
- validated response count, vector dimension, and finite numeric values before returning embeddings
- kept
tht ollama ensure --jsonstdout pristine while warming through the internal client
Self-review
- kept changes inside the brief-listed files
- preserved DWH and session-persistence behavior
- preserved the legacy
OllamaEmbeddingsimport path as an alias to avoid unrelated call-site churn
Concerns
- the focused harness verification still emits two pre-existing warnings:
DeprecationWarningfromtestcontainers.postgresFutureWarningbecauseresourcescurrently flows through the legacy config translation path