mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-23 12:15:42 +00:00
ab9552716c
The finding lifecycle was asymmetric around the deterministic-resolve gate: the gate correctly blocks LLM resolves of event/persistent findings (backup, reliability, security, general) when the verifier still detects the signal, but nothing ever cleared such a finding when the underlying issue WAS fixed — absence-based stale auto-resolve only covers performance/capacity, so a fixed backup stayed an active finding indefinitely unless the LLM happened to call patrol_resolve_finding. reconcileStaleFindings now runs the deterministic verifier for seeded, unreported event/persistent findings whose key has one, and resolves ONLY on an affirmative "signal gone" verification. Still-present or inconclusive results fail closed (same standard as the resolve gate); verifications are capped per run (3) with deferred candidates logged and retried next run. Test seam: PatrolService.verifyFixResolvedFn. Two enabling repairs found during verification: - hasDeterministicVerifierForKey listed 2 of the 7 keys the verifyFixDeterministically dispatch handles, so the LLM-resolve gate silently skipped existing verifiers for backup-stale and guest-unreachable findings. Now aligned; documented as the single source of truth for both consumers. - The finding-key vocabulary was forked: the patrol_report_finding tool suggested keys (high-cpu, ...) the verifier switch never matched, so verification rarely engaged for new findings. normalizeFindingKey now aliases unambiguous directional synonyms onto the canonical verifier vocabulary (high-cpu -> cpu-high etc.; pbs-job-failed and node-offline deliberately NOT aliased — different resource models), and the tool description teaches the canonical keys. NOT changed: the synthetic ai-patrol-error finding — verification showed the reported "accumulation" is a non-problem (deterministic ID, store merges repeats as heartbeats, successful runs auto-resolve it). Teeth: 8 new tests in patrol_reconcile_test.go including the idempotence invariant (repeat reconcile over unchanged state produces zero resolves and zero lifecycle growth) and the cap-defers case. Contract: verified stale-resolve clause added beside the deterministic-resolve-gate in ai-runtime.md. Full internal/ai tree green.