From 857e717e6343fa5c2ae96664bdc64741d5ba6830 Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 17 May 2026 21:22:34 +0100 Subject: chore: remove LLM module + all dependent surfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wholesale removal of the LLM integration layer. ~14,200 LOC deleted across backend and frontend. All chat-driven UIs go with it. ## Backend - Delete `src/llm/` (7,400 LOC): claude/groq clients, contract_tools, contract_evaluator, discuss_tools, mesh_tools, phase_guidance, task_output, templates, markdown round-trip, tools, transcript_analyzer. - Delete handlers wholly dependent on LLM: - `chat.rs` (file-level LLM chat at /files/{id}/chat) - `mesh_chat.rs` (mesh & task LLM chat + history) - `templates.rs` (/contract-types listing) - Strip LLM uses from `mesh_daemon.rs`: - `compute_action_directive` (used phase_guidance::check_deliverables_met to nudge supervisors with "all tasks done" messages). The auto-PR path below still fires when all tasks finish, so no behaviour lost. - `crate::llm::markdown_to_body` → inline 1-line replacement that wraps markdown content in a single BodyElement::Markdown. The editor re-parses on display, so round-trip is preserved. - Drop routes: /files/{id}/chat, /mesh/chat, /mesh/chat/history, /mesh/tasks/{id}/chat, /contract-types. - Drop the matching openapi registrations. ## Frontend - Delete components that were LLM-only: - `mesh/UnifiedMeshChatInput.tsx` - `listen/DiscussContractModal.tsx` - `listen/TranscriptAnalysisPanel.tsx` - `listen/ContractPickerModal.tsx` - `files/CliInput.tsx` - Delete the entire /listen page (its primary value-add was voice → LLM analysis → contract creation; without LLM the page is just a transcript display with no obvious user purpose). - Delete `hooks/useMeshChatHistory.ts` and `lib/listenApi.ts` (transcript-analysis API client to the already-Phase-5-removed listen handlers). - Strip api.ts of LLM exports: LlmModel, ChatMessage/Request/Response, UserQuestion/Answer, chatWithFile, MeshChat* types & functions, getMeshChatHistory, clearMeshChatHistory, chatWithMeshContext, ContractTypeTemplate, listContractTypes, chatWithContract, getContractChatHistory, clearContractChatHistory, discussContract, PhaseDefinition, DeliverableDefinition. - mesh.tsx: drop UnifiedMeshChatInput render + the chatContext memo + handleTaskUpdatedFromCli (only consumer was the input). - files.tsx: drop CliInput render + handleGenerateFromElement + handleBodyUpdate + handleClearFocus + suggestedPrompt state (all CliInput-only). - NavStrip: drop the /listen link. - main.tsx: drop the /listen route. ## Net diff: 37 files changed, 58 insertions, 14,281 deletions. Co-Authored-By: Claude Opus 4.7 (1M context) --- makima/src/llm/contract_evaluator.rs | 97 ------------------------------------ 1 file changed, 97 deletions(-) delete mode 100644 makima/src/llm/contract_evaluator.rs (limited to 'makima/src/llm/contract_evaluator.rs') diff --git a/makima/src/llm/contract_evaluator.rs b/makima/src/llm/contract_evaluator.rs deleted file mode 100644 index e63bbfa..0000000 --- a/makima/src/llm/contract_evaluator.rs +++ /dev/null @@ -1,97 +0,0 @@ -//! Contract Evaluator - LLM-based evaluation of completed contracts against directive. -//! -//! This module will be reimplemented as part of the directive verification engine. -//! See the orchestration module for the new evaluation system. -//! -//! The new evaluation system will provide: -//! - Tiered verification (programmatic verifiers first, then LLM evaluation) -//! - Composite confidence scoring (weighted combination of results) -//! - Pluggable verifier interface (test runner, linter, build, type checker) -//! - Proper integration with the directive chain steps - -use serde::{Deserialize, Serialize}; -use sqlx::PgPool; -use uuid::Uuid; - -// use crate::db::models::{Contract, DirectiveAcceptanceCriterion, DirectiveRequirement}; - -/// Result of contract evaluation -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct ContractEvaluationResult { - /// Whether the contract passed evaluation - pub passed: bool, - /// Overall score from 0.0 to 1.0 - pub overall_score: f64, - /// Results for each acceptance criterion - pub criteria_results: Vec, - /// Summary feedback from the evaluator - pub summary_feedback: String, - /// Instructions for rework if failed - pub rework_instructions: Option, -} - -/// Per-criterion evaluation result (legacy - kept for compatibility) -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct EvaluationCriterionResultLegacy { - pub criterion_id: String, - pub criterion_text: String, - pub passed: bool, - /// Score (0.0-1.0) - pub score: f64, - pub feedback: String, - /// Evidence supporting the evaluation - pub evidence: Vec, -} - -/// File content for evaluation context -#[derive(Debug, Clone)] -pub struct FileContent { - pub path: String, - pub content: String, -} - -/// Contract evaluator for LLM-based assessment. -/// -/// NOTE: This is a stub implementation. The full evaluation system will be -/// implemented as part of the orchestration/verifier module. -pub struct ContractEvaluator { - _pool: PgPool, -} - -impl ContractEvaluator { - /// Create a new contract evaluator. - pub fn new(pool: PgPool) -> Self { - Self { _pool: pool } - } - - /// Evaluate a contract - stub implementation. - /// - /// This will be reimplemented in the orchestration module with: - /// - Programmatic verification (tests, lint, build) - /// - LLM evaluation - /// - Composite scoring - pub async fn evaluate_contract( - &self, - _contract_id: Uuid, - ) -> Result { - // TODO: Implement using the new directive evaluation system - Err(ContractEvaluatorError::NotImplemented( - "Contract evaluator will be reimplemented with directive system".to_string(), - )) - } -} - -/// Error types for contract evaluation. -#[derive(Debug, thiserror::Error)] -pub enum ContractEvaluatorError { - #[error("Database error: {0}")] - Database(#[from] sqlx::Error), - - #[error("LLM error: {0}")] - Llm(String), - - #[error("Not implemented: {0}")] - NotImplemented(String), -} -- cgit v1.2.3