Visión general
Esta documentación cubre todas las interfaces públicas de Coclico. Versión actual: 1.0.4.
- Namespace principal:
Coclico.Services - Modelos:
Coclico.Models - ViewModels:
Coclico.ViewModels - Framework: .NET 10, C# preview, WPF-UI 4.2
ICacheService
Caché en memoria thread-safe con TTL por entrada. Implementado por CacheService (singleton).
public interface ICacheService
{
T? Get<T>(string key);
void Set<T>(string key, T value, TimeSpan? ttl = null);
bool TryGet<T>(string key, out T? value);
void Invalidate(string key);
void InvalidateAll();
} IDynamicTracer
Telemetría del sistema en tiempo real. Implementado por DynamicTracerService (singleton).
public record TelemetrySnapshot(
DateTimeOffset Timestamp,
double CpuPercent, // 0.0 – 100.0
long RamUsedMb,
long RamTotalMb,
double NetworkInKbps,
double NetworkOutKbps
); IRollbackService
Gestión de snapshots para rollback de parches de IA. Debe llamarse antes de cualquier File.WriteAllText disparado por IA.
public interface IRollbackService
{
Task<Guid> CreateSnapshotAsync(string filePath, CancellationToken ct = default);
Task RestoreAsync(Guid snapshotId, CancellationToken ct = default);
IReadOnlyList<SnapshotInfo> GetSnapshots();
Task PruneAsync(TimeSpan maxAge);
} IOptimizationEngine
Motor de optimización autónomo (Fase 2). Ejecuta un bucle de ciclo de 30 segundos en segundo plano.
public interface IOptimizationEngine
{
Task StartAsync(CancellationToken ct);
Task StopAsync();
OptimizationResult? LastResult { get; }
event Action<OptimizationResult>? CycleCompleted;
} ISourceAnalyzer
Análisis AST de C# basado en Roslyn (Fase 3.3). Calcula CC, métricas Halstead e Índice de Mantenibilidad por método.
public record MethodMetrics(
string MethodName,
int CyclomaticComplexity, // Umbral de alerta CC: > 10
double HalsteadVolume,
double HalsteadDifficulty,
double HalsteadEffort,
double MaintainabilityIndex // 0–100, mayor es mejor
); IAuditLog
Diario de auditoría NDJSON de solo anexión que incluye contexto completo de decisiones de IA para trazabilidad LLM.
ISecurityPolicy
Controla qué operaciones pueden realizar los nodos de Flow Chain. Los valores predeterminados codificados no suprimibles no pueden ser reemplazados por configuración.
AppSettings
Modelo de configuración principal. Gestionado por SettingsService, persistido en %APPDATA%\Coclico\settings.json.
public class AppSettings
{
public string Language { get; set; } = "es";
public string Theme { get; set; } = "Dark";
public string AccentColor { get; set; } = "#6366F1";
public LaunchMode LaunchMode { get; set; } = LaunchMode.Manual;
public bool AutoPatcherAuditOnly { get; set; } = true;
public int AuditRetentionDays { get; set; } = 90;
public bool UseVulkanAcceleration { get; set; } = true;
} NodeType — 28 tipos de nodos
Proceso (KillProcess, LaunchProcess, RestartService, StopService, StartService), Registro (SetRegistryValue, DeleteRegistryKey), Archivos (CreateDirectory, DeleteFile, MoveFile, CopyFile), Scripts (RunScript), Limpieza (CleanTemp, EmptyRecycleBin, FlushDns, ClearBrowserCache, ClearEventLogs, ClearPrefetch, ClearThumbnailCache, ClearWindowsErrorReports), Memoria (FreeRam, SetWorkingSet), Red (PingHost, DisableNetworkAdapter, EnableNetworkAdapter), Control (Wait, Condition, Log, Notification).
ConditionOperator — 10 operadores
Equals, NotEquals, GreaterThan, LessThan, GreaterOrEqual, LessOrEqual, Contains, NotContains, IsEmpty, IsNotEmpty.
OnErrorAction
ContinueNext(por defecto) — registrar error, continuar al siguiente nodoStopChain— detener la ejecución inmediatamenteSkipToEnd— omitir nodos intermedios, ejecutar solo el último nodo
Categorías Limpieza Profunda — 10
Temp Windows, Caché Navegadores, Logs del Sistema, Papelera, Temp Usuario, Caché Miniaturas, Informes de Error Windows, Instaladores Antiguos, Caché DNS (dnsapi.dll), Archivos Prefetch.
Fuentes de Aplicaciones — 8
Registro HKLM, Registro HKCU, Steam (libraryfolders.vdf), Epic Games (manifests JSON), GOG Galaxy (SQLite), Ubisoft Connect, EA App (manifests XML), Rockstar Games Launcher, Microsoft Store (paquetes AppX via PowerShell).
Estructura de archivos
%APPDATA%\Coclico\
├── settings.json
├── security-policy.json
├── flow-chains\ # Definiciones WorkflowPipeline
├── audit\ # Log de auditoría NDJSON
├── logs\ # Serilog rolling daily (14 días)
├── rollback\ # Snapshots IRollbackService
└── resource\model\
└── IA-support-chat.gguf Formato NDJSON auditoría
Cada línea es un objeto JSON independiente que incluye marca de tiempo, tipo de acción, contexto de IA (modelo, hash del prompt, tokens de respuesta, latencia) y resultado de validación del parche (CC original, CC parcheado, aprobación del Digital Twin).