BEHAVIOR-003: learn causal shadow triggers
Some checks failed
quality / test (3.11) (push) Has been cancelled
quality / test (3.13) (push) Has been cancelled

This commit is contained in:
2026-06-14 15:35:07 +02:00
parent 1370d02c15
commit fb76d89204
11 changed files with 278 additions and 4 deletions

View File

@@ -240,6 +240,9 @@ async function showActuator(actuatorId) {
.join("");
const prediction = record.behavior.prediction;
const requiredUserActions = 3;
const learnedAutomationActions = record.behavior.patterns.filter(
pattern => pattern.source === "automation",
).length;
const missingUserActions = Math.max(
0,
requiredUserActions - record.behavior.high_confidence_sample_count,
@@ -266,6 +269,7 @@ async function showActuator(actuatorId) {
<p><strong>Betriebsart:</strong> ${escapeHtml(behaviorLabel(record))}</p>
<p><strong>Gelernte Handlungen:</strong> ${record.behavior.sample_count}</p>
<p><strong>Davon eindeutig Benutzer:</strong> ${record.behavior.high_confidence_sample_count}</p>
<p><strong>Davon erkannte HA-Automationen:</strong> ${learnedAutomationActions}</p>
<p><strong>Letztes Training:</strong> ${escapeHtml(record.behavior.last_trained_at || "noch nicht")}</p>
<p><strong>Was noch passiert:</strong> ${escapeHtml(record.behavior.reason)}</p>
${activationButton}