All notable changes to MindSpark: ThoughtForge are documented here.
Format: Keep a Changelog Versioning: Semantic Versioning
Phase 8 — Robustness, Self-Healing, and Production Hardening
src/thoughtforge/utils/health.py—HealthCheckerwith per-component checks (config, backend, DB, memory, disk, dependencies);report()produces a human-readable diagnosticsrc/thoughtforge/utils/self_heal.py—SelfHealerwith config repair, JSONL line quarantine with backup, YAML/JSON reset, and DB integrity + schema rebuild;atomic_write()helper for all file writessrc/thoughtforge/utils/perf.py—PerfTrackerring-buffer (1000 events) with p50/p95/p99 stats;get_perf_tracker()module singleton;bottleneck_report()ASCII tablesrc/thoughtforge/etl/db_integrity.py—DBIntegrityCheckerwith PRAGMA integrity_check, WAL enforcement, FTS5 shadow-table validation, VACUUM, and 24-hour result cacheforge_doctor.py— root-level diagnostic CLI:python forge_doctor.py [--fix] [--json] [--verbose]ThoughtForgeCore:sanitise_query()applied on everythink()entry;PerfTrackerrecords total/retrieval/generation latency;SelfHealer.heal_all()runs on startuprun_thoughtforge.py:ThoughtForgeErrorcaught atmain()— prints user-friendly message + suggested fix instead of traceback- Fixed
retry.pysentinel syntax (_SENTINEL := object()in default was invalid Python 3.10 — moved to module level) - 90 new tests across
test_phase8_health.py,test_phase8_errors.py,test_phase8_perf.py
- 620 tests passing (530 → 620, +90 in Phase 8)
Phase 7 — Setup Wizard + Multi-Backend + Chat Mode
setup_thoughtforge.py— interactive setup wizard: detects hardware, checks for running backends, guides model selection/pull, builds knowledge base, runs test query, writesconfigs/user_config.yamlsrc/thoughtforge/inference/unified_backend.py—UnifiedBackendABC withGenerationRequest/GenerationResponsedataclasses andload_backend_from_config()factorysrc/thoughtforge/inference/ollama_backend.py— Ollama HTTP backend with model listing and pull supportsrc/thoughtforge/inference/lmstudio_backend.py— LM Studio / generic OpenAI-compatible backendsrc/thoughtforge/inference/hf_backend.py— HuggingFace Inference API backend with retry on 503src/thoughtforge/inference/turboquant_backend.py— TurboQuantEngine wrapped asUnifiedBackendsrc/thoughtforge/inference/model_browser.py— curated GGUF catalogue (14 models, 5 hardware tiers) withhuggingface_hubdownload and local GGUF detectionsrc/thoughtforge/cognition/chat_history.py—ChatHistorywith OpenAI-format export, char-budget trimming, and JSON persistenceconfigs/user_config.yaml— user config template with all backend settingsrun_thoughtforge.py—--chatpersistent chat mode,--history,--system,--backendflags; in-chat commands:/clear,/save,/load,/history,/quitThoughtForgeCore.think()gains optionalhistory: ChatHistoryparameter; context injected into scaffoldThoughtForgeCore.__init__()gains optionalbackend: UnifiedBackendparameter- 83 new tests in
test_phase7_backends.pyandtest_phase7_chat.py
Test suite: 530 tests passing (up from 447)
1.0.0 — 2026-03-31
Phase 0 — Foundation
- Full package structure:
src/thoughtforge/{knowledge,inference,etl,cognition,refinement,utils}/ pyproject.toml,requirements.txt,setup.pywith all optional extras- Six hardware profile JSONs:
phone_low,pi_zero,pi_5,desktop_cpu,desktop_gpu,server_gpu - GitHub Actions CI: lint (ruff + mypy) + test matrix (Ubuntu/Windows/macOS × Python 3.10–3.12)
configs/default.yaml,CONTRIBUTING.md,.gitignore
Phase 1 — Memory Forge + Sovereign RAG
- All 14 data structure types (
PersonalityCoreRecord,UserPreferenceRecord,UserFactRecord,EpisodicMemoryRecord,ResponsePatternRecord,ActiveThreadStateRecord,InputSketch,MemoryActivationBundle,CognitionScaffold,CandidateRecord,FragmentRecord,FinalResponseRecord,WritebackRecord,RuntimeTurnState) MemoryForge— hybrid SQL+vector retrieval with activation scoring and bundle assemblyMemoryStore— file-based persistent store (YAML, JSONL, JSON)MemoryLifecycle— 4-mode pruning: light, routine, heavy, emergency- ETL pipelines: Wikidata (streaming ijson), DBpedia, ConceptNet, GeoNames, 40 built-in reference files
EmbeddingStore— sentence-transformer embeddings (all-MiniLM-L6-v2) via sqlite-vssforge_memory.pyClick CLI:init / wikidata / conceptnet / geonames / dbpedia / reference / embeddings / status / all
Phase 2 — TurboQuant Universal Inference Engine
TurboQuantEngine— llama-cpp-python wrapper with strict token budget enforcement, multi-draft generationBackendDetector— auto-detects CUDA, ROCm, Vulkan, Metal, CPU with priority orderingHardwareProfileLoader— loads profile JSON, auto-detects hardware tier- 6 hardware profiles fully specified (RAM, VRAM, quantization, token budgets, draft counts)
Phase 3 — Cognition Scaffolds + Orchestration
InputRouter— intent classification (8 categories), tone detection, retrieval path derivationScaffoldBuilder— table-drivenCognitionScaffoldassembly (goal, tone, focus, avoid, depth, fact_block)PromptBuilder— mode-specific candidate prompts, refine prompts, repair promptsThoughtForgeCore.think()— 8-step mandatory pipeline: retrieve → score → scaffold → generate → salvage → enforce → write back → returnconfigs/personality_core.yaml— Skald persona (calm, direct, cite-or-explain)- Heuristic scoring: keyword_overlap, genericness_penalty, specificity_score, length_score (no judge model)
Phase 4 — Fragment Salvage + Refinement
FragmentSalvage— multi-pass draft scoring (length 45% + citation 55%), sentence-level extraction, up to 2 refine passesEnforcementGate— citation integrity, length (≥5 words), genericness checks; soft-fail[Forge:]notesThoughtForgeCore— wiredFragmentSalvage+EnforcementGateinto_compose_final()run_thoughtforge.py— interactive REPL (Forge>) + single-query CLI with argparseFinalResponseRecord.enforcement_passed/.enforcement_notesfields
Phase 5 — Edge + Cross-Platform Deployment
OnnxExporter— exports sentence-transformer models to ONNX (optimum → torch fallback, int8 quantization)ONNXEmbedder— drop-in onnxruntime encoder with mean-pool + L2 normalizationEdgeSubsetBuilder— builds reduced SQLite knowledge DB for edge profiles (50K–200K entities)Dockerfile— multi-stage Python 3.11-slim,--build-arg PROFILE, healthcheckdocker-compose.yml— desktop, GPU, Pi, phone named servicesscripts/install_linux.sh— Debian/Ubuntu/Arch/Fedora with auto-detectionscripts/install_mac.sh— Homebrew + Apple Silicon Metal flagscripts/install_windows.ps1— PowerShell + Vulkan flagscripts/install_termux.sh— Termux/Android, phone_low profile, ARM buildscripts/install_pi.sh— Pi Zero/5 auto-detect via/proc/meminfo, Vulkan VideoCore VII
Phase 6 — Testing, Benchmarking, Release
ProfileBenchmark— per-profile metrics: citation accuracy, latency (avg/median/p95), token efficiency, enforcement pass ratePersonaConsistencyScorer— phrase-level Skald persona validation; generic penalty + Norse tone bonus + citation bonuslocustfile.py— Locust load test in no-HTTP mode (ThoughtForgeUser)- Integration test suite: end-to-end
think(), multi-call stability, knowledge-only mode,FinalResponseRecordcompleteness - Adversarial test suite: empty input, whitespace, very long query, SQL injection string, Unicode/emoji, repeated queries
- MkDocs documentation site with Material theme: index, quickstart, hardware profiles, API reference
CHANGELOG.md,MODEL_CARD.md
- 433 tests passing across 8 test modules
- Platform: Windows 11, Python 3.10.11 (CI: Ubuntu/Windows/macOS × Python 3.10–3.12)
- ONNX export requires
optimumortorch(not in default install) EdgeSubsetBuilderrequires a populated full DB to subset from- Locust load tests run in Python-native mode — HTTP deployment wrapper not included in v1.0
- sqlite-vss vector search is optional — falls back to SQL-only retrieval if not installed
- Wikidata full dump ETL requires ~100 GB free disk + several hours of processing time
0.1.0 — 2026-03-31
Initial development builds (Phases 0–5). See commit log for details. Not released publicly.