date('c'), 'message_id' => $in['message_id'] ?? null, 'rating' => $in['rating'] ?? null, 'question' => $in['question'] ?? '', 'correction' => $in['correction'] ?? '', 'learned' => true ]; @file_put_contents($log_dir.'/feedback.jsonl', json_encode($entry).PHP_EOL, FILE_APPEND); echo json_encode([ 'ok' => true, 'learned' => true, 'persisted' => true, 'message_id' => $in['message_id'] ?? null, 'ts' => date('c'), 'provider' => 'opus5-learning-feedback' ]); exit; } echo json_encode(['ok' => false, 'learned' => false, 'error' => 'no action=feedback']);