12 Commits

Author SHA1 Message Date
Codex Local c5f921243e feat: wire vLLM + TEI embedding backend
- LLM_API_KEY support across all LLM calls
- TEI embedding server (bge-m3, :9500)
- Hierarchical AGENTS.md documentation
- CLAUDE.md updated for new architecture
2026-04-08 09:41:51 +02:00
Codex Local d4188583ab fix(personas): converge feedback runtime and dpo export 2026-03-25 22:34:00 +01:00
L'électron rare 19b9193e29 Merge remote-tracking branch 'origin/main' + feat: smart routing, response cleaning, single responder, typing fix
- lot-66: pickResponders topic-based routing (search→Sherlock, image→Picasso, etc.)
- lot-67: cleanPersonaResponse strips think tokens + persona name prefix
- lot-68: maxGeneralResponders default 1, configurable via MAX_GENERAL_RESPONDERS
- lot-69: typing indicator moved after memory load, closer to Ollama call

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 23:38:03 +01:00
Codex Local 06ea18f425 feat: session 2026-03-19 — 35 lots (24-58), 311 tests, 12 services
Highlights:
- Streaming chat chunks + web search auto (Sherlock/SearXNG)
- pino structured logging (43->0 console.log)
- Zod validation (19 schemas API + storage)
- Qwen3-TTS 0.6B + 33 persona voices
- Docling + bge-reranker RAG pipeline
- React lazy routes (-50% bundle), virtualized chat
- SEC-01->05 all resolved
- A11y WCAG (40 ARIA attrs)
- Perf + error telemetry endpoints
- Systemd units (TTS, LightRAG, reranker)
- p-limit Ollama, WS reconnect, signal handlers
- createId thread-safe via crypto.randomBytes (lot-59)
- Hyperparam bounds validation with Zod schema (lot-60)
- DPO extractDPOPairs warns on empty pairs (lot-61)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 22:54:32 +01:00
L'électron rare d2fed6087a feat: Add MCP server and smoke test scripts
- Introduced `mcp-server.js` to expose KXKM personas as MCP tools, supporting chat, persona listing, web search, and status checks.
- Implemented `mcp-server-smoke.js` for testing the MCP server functionality, ensuring compatibility with both new and legacy message formats.
- Created `setup-voice-clone.sh` for managing voice cloning environment setup, including bootstrapping, sample generation, and smoke testing.
- Added `state.json` to track project status and task outputs for various batches.
- Generated summary files for deep cycle and overall project status, capturing performance and security findings.
2026-03-19 16:18:44 +01:00
L'électron rare 6238b11c2c fix: commit packages/ui exports + Dockerfile pre-built strategy
- packages/ui/src/index.ts: getRunStatusClass, publishUiCssVariables, getPersonaColor
  (ces exports étaient dans le working dir mais jamais commités)
- Dockerfile: stratégie pre-built (build sur host, COPY dans l'image)
  Résout le problème rolldown/Vite dans Docker

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 18:50:21 +01:00
L'électron rare 87d47e964e tests: sandbox.ts + training.ts coverage (37 tests, 209 total)
- validateSandboxConfig: 6 tests (null, defaults, overrides, mode validation)
- wrapCommand: 7 tests (none/subprocess/container, escaping, network, workDir)
- buildTrlCommand: 5 tests (SFT, LoRA, QLoRA, 4bit, escaping)
- buildUnslothCommand: 3 tests (basic, quantize, no-quantize)
- validateJobSpec: 8 tests (null, types, defaults, merge, fallback)
- parseTrainingMetrics: 7 tests (JSON, key:value, scientific notation, empty)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 14:18:36 +01:00
L'électron rare 7c39e91e94 lot-20: deep audit, refactoring, UI Minitel, Discord bot, storage tests
Refactoring:
- ws-chat.ts 1449→803 LOC + 3 modules (ws-ollama, ws-multimodal, ws-persona-router)
- app.ts 1325→664 LOC + 4 route files (session, personas, node-engine, chat-history)

Security (9 P0/P1 fixes):
- PDF handler semaphore double-release
- Path traversal voice-sample (3 endpoints)
- Analytics endpoint auth (ops:read)
- crypto.randomBytes for createId
- Timing-safe verifyPassword
- applyPatches type guard
- ErrorBoundary React
- Accessibility role=log
- Async I/O (writeFileSync→fsp.writeFile)

UI Minitel globale:
- MinitelFrame wraps tout (login inclus)
- Animation modem à l'ouverture
- Pseudo sans auth, easter egg 3615 ULLA
- Barre fonctionnelle Sommaire/Chat/Retour/Personas/Fin
- Menu sommaire overlay, PersonaList arborescente par modèle
- Responsive 4 breakpoints (480/768/1200/1600px)

Infrastructure:
- SearXNG dans docker-compose (profile v2)
- Discord Pharmacius bot (scripts/discord-pharmacius.js + profile discord)
- Perf middleware + /api/v2/perf endpoint
- ops/v2/perf-monitor.js TUI
- scripts/bench-embeddings.js

Tests:
- Storage package: 50 tests (mock pool, 0→50 coverage)
- Total: 173 tests, 0 fail

Audit: 0 security findings, 20 perf patterns, debt score 80/100

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 13:42:04 +01:00
L'électron rare ec85ca5e5b chore: deep audit, hardening, docs sync and workflow cleanup 2026-03-17 10:22:22 +01:00
L'électron rare c1440de5c4 feat: admin UI personas React (toggle, edit prompt, model select)
- PersonaList: status dot vert/rouge, toggle ON/OFF, style disabled
- PersonaDetail: edit summary/systemPrompt, select model (dropdown),
  toggle enabled, feedback dates, pre-formatted prompt display
- API: POST /api/admin/personas/:id/toggle endpoint
- api.ts: togglePersona() method
- styles.css: status dots, toggle buttons, select, IRC aesthetic
- PersonaRecord: champ enabled ajouté

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 20:58:02 +01:00
Codex Local 05cd47dc5d Lot 11: feature parity V2, correctifs sécurité P0/P1, Docker, veille OSS
Phase A — Recherche:
- Deep analyse code V1+V2: 29 findings (2 P0, 8 P1, 12 P2, 7 P3)
- Veille OSS Lot 11: 22 projets analysés (vLLM, AG-UI, TRL CLI, Prefect...)
- Recherche HuggingFace: modèles persona-ready, datasets DPO, outils LoRA

Phase B — Correctifs sécurité:
- P0 SEC-01: Path traversal node-engine-runner.js (reject absolute + boundary check)
- P0 SEC-04: V2 login role self-assignment (viewer default, ADMIN_TOKEN required)
- P1 BUG-06: Health endpoint DATABASE_URL leak (redacted to storageMode)
- P1 BUG-02: Timeout promise leak (AbortSignal cancel)
- P1 SEC-03: Attachment endpoints unauthenticated (requireAdminNetwork)

Phase C — Feature parity V2 (10/10):
- Recovery on crash + cancel support (worker + storage + API)
- Slash commands (11 commands + parser + permissions + 17 tests)
- Conversational memory (addToMemory, buildLlmContext, clearMemory)
- Status strip, subnet gate, retention sweep, export HTML
- Tab completion (nicks + slash commands)
- File upload (base64 in Chat.tsx)

Phase D — Docker:
- Multi-stage Dockerfile (Node 22 alpine, tini)
- docker-compose.yml (5 services: app, api, worker, postgres, ollama)
- .dockerignore

152 tests (119 backend + 33 React), 0 failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 06:38:45 +01:00
Codex Local cee246a6a9 Refonte globale P0→P9 : sécurité, V2 monorepo TypeScript, tests, tooling
- P0: Correctifs sécurité critiques (injection bash, path traversal, SSRF, rate limiting)
- P1: Audit logging, session pruning, WS validation, CSRF protection
- P2: Ollama SDK migration, admin API deduplication, attachment hardening
- P3: Node Engine store complet (graphs, runs, models, deployments)
- P4: Admin UI Node Engine (éditeur visuel, runs, queue viewer)
- P5: Persona pipeline (sources, feedback, Pharmacius, editorial)
- P6: V2 packages TypeScript (core, auth, chat-domain, persona-domain, node-engine, storage, tui)
- P7: V2 apps (api + worker + web React), ops TUI, migration/rollback scripts
- P8: Training adapters (TRL/Unsloth), sandboxing (subprocess/container), Turborepo, CI
- P9: Tests (102 backend node:test + 33 React Vitest/RTL), code quality review

135 tests, 0 failures. 8 packages + 3 apps V2. 42 modules V1 validés.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 06:15:04 +01:00