phase 3 review: fix broken error classification, stub checks, wasted uuid, token idempotency, dead code

- actuator/ssh.go: custom errorsAs chain broken — all SSH errors classified as SSHErrorOther.
  Replaced with standard errors.As + errors.Is.
- scheduler/scheduler.go: all four check functions were stubs returning healthy.
  Implemented real HTTP GET, TCP dial, unix.Statfs disk, and TLS cert expiry checks.
- learning/learning.go: uuid.NewV7() called unconditionally before ON CONFLICT upsert.
  Now looks up existing pattern first, reuses entity_id.
- notifier/notifier.go: removed dead var_, fixed token regeneration every 15s.
  Now skips if token_hash already set.
- phase3.go: removed dead GetPattern+dummy args call in PatchPattern.
- classify.go: removed unused var_ guard.
This commit is contained in:
2026-07-07 15:27:31 +02:00
parent 095a3967c4
commit aa197190cd
6 changed files with 182 additions and 87 deletions

View File

@@ -850,14 +850,6 @@ func (s *Server) PatchPattern(ctx context.Context, req gen.PatchPatternRequestOb
}
// Re-read.
pat, err := q.GetPattern(ctx, sqlcgen.GetPatternParams{
// We need to look up by entity_id, not by applies_type+action.
// GetPattern uses applies_type+action as key, so fetch via raw query.
AppliesType: "", // dummy, will use raw query instead
Action: "",
})
_ = pat
// Use raw query to get by entity_id
var p gen.Pattern
err = tx.QueryRow(ctx, `
SELECT entity_id, applies_type, action, pattern, confidence,