evaluateDetailed method

CoherenceReport evaluateDetailed({
  1. required List<Concept> workspaceConcepts,
  2. required ConceptualGraph graph,
})

Produces a full CoherenceReport for diagnostic purposes.

Implementation

CoherenceReport evaluateDetailed({
  required List<Concept> workspaceConcepts,
  required ConceptualGraph graph,
}) {
  final semantic = _computeSemanticCoherence(workspaceConcepts, graph);
  final temporal = _computeTemporalCoherence(workspaceConcepts);
  final activation = _computeActivationCoherence(workspaceConcepts);
  final conflicts = _detectConflicts(workspaceConcepts);

  final overall = (semantic * 0.45) +
      (temporal * 0.25) +
      (activation * 0.20) +
      (conflicts.isEmpty ? 0.10 : 0.0);

  final theme = _findDominantTheme(workspaceConcepts, graph);

  final report = CoherenceReport(
    overallCoherence: overall.clamp(0.0, 1.0),
    semanticCoherence: semantic,
    temporalCoherence: temporal,
    activationCoherence: activation,
    conflictingPairs: conflicts,
    dominantTheme: theme,
    timestamp: DateTime.now(),
  );

  if (report.isLowCoherence) {
    _logger.warning(
        'Low coherence detected: ${(overall * 100).toStringAsFixed(1)}% '
        '(${workspaceConcepts.length} concepts)');
  }

  return report;
}