desktop: Fix with AI on scan findings that need a code change (aiFix: true, AI_FIX_RULES). The host (src-tauri/src/ai_fix.rs) runs the owner's local Claude Code headless in the app folder with Read / Edit / Write / Grep / Glob only (Bash, web tools, sub-agents disallowed) and a prompt it builds from the finding's fields; it refuses while the folder has uncommitted files, streams progress, times out after 10 min with a heartbeat, kills the process group on Cancel or exit, and records the run's changed files so Undo restores exactly those; the window shows the diff with Keep / Undo and rescans. Without claude the button copies the prompt (Copy for AI). Only the claude binary, git and kill / taskkill are started there (tests/security.rs); tests/ai_fix.rs covers the prompt, dirty-tree refusal, undo scope, timeout and cancel

This commit is contained in:
CRTkafa 2026-10-15 06:26:29 +08:00
parent 992f5bcc0e
commit c95f2af8ff
24 changed files with 1023 additions and 10 deletions

View file

@ -446,6 +446,25 @@ export const tr: Record<keyof typeof en, string> = {
'checks.fixHint.play.listing': "Mağaza metni dosyasını Google Play'e gönderir (yalnız metin, yayınlanmaz). Önce deneme çalıştırmasını görürsün.",
'checks.fixHint.apple.listing': 'Mağaza metnini ve telif hakkını App Store sürümüne gönderir (yalnız metin, incelemeye gönderilmez). Önce deneme çalıştırmasını görürsün.',
'checks.fixHint.apple.review_details': 'App Review iletişim bilgisini ve notları ayardan gönderir (incelemeye gönderilmez). Önce deneme çalıştırmasını görürsün.',
'ai.run': 'Yapay zekâyla düzelt',
'ai.runHint': "Claude Code'u bu bilgisayarda, uygulama klasöründe yalnız dosya araçlarıyla çalıştırır (okuma ve düzenleme; komut, ağ, git push yok). Farkı görür, geri alabilirsin.",
'ai.copy': 'Yapay zekâ için kopyala',
'ai.copyHint': 'Claude Code (claude) kurulu değil: bu bulgu için bir istemi yapay zekâ ajanına yapıştırmak üzere kopyalar.',
'ai.starting': 'Claude Code başlıyor...',
'ai.running': 'Claude Code bu bulguyu düzeltiyor (en çok 10 dakika).',
'ai.dirty': 'Uygulama klasöründe commit edilmemiş {count} dosya var: önce commit et ya da stash yap ki Geri al tam olarak yapay zekânın değiştirdiğini geri yüklesin.',
'ai.noGit': 'Uygulama klasörü bir git deposunda değil: Yapay zekâyla düzelt fark ve Geri al için git ister.',
'ai.cancelled': 'İptal edildi',
'ai.timedOut': '10 dakika sonra durduruldu',
'ai.noChanges': 'Hiçbir dosya değişmedi',
'ai.changed': 'Değişen dosya: {count}',
'ai.stillThere': 'tarama hâlâ bildiriyor',
'ai.gone': 'tarama artık bildirmiyor',
'ai.diff': 'Değişiklikler',
'ai.keep': 'Tut',
'ai.undo': 'Geri al',
'ai.undone': 'Geri alındı. Geri yüklenen dosya: {count}',
'ai.failed': 'Yapay zekâyla düzeltme başarısız: {msg}',
'checks.accepted': 'Kabul edildi: {reason}',
'checks.sev.blocker': 'Engel',
'checks.sev.high': 'Yüksek',