feat(export): contract-conformant event_logs event_time and is_active

Reanimator contract v2.13 makes event_logs[].event_time optional
(Reanimator falls back to collection/ingest time) and defines is_active
("still active / not cleared").

- Omit event_time when the event has no source time instead of passing
  collected_at off as the event time.
- is_active=true only from an authoritative active-alarm snapshot: Inspur
  dev_status.log (IDL event ID / SEL sensor at the same instant) and
  component.log fan state (new models.Event.Active). false for Deasserts,
  superseded Asserts in a real Assert/Deassert lifecycle and Inspur
  Warning/Critical Asserts missing from dev_status.log; unset otherwise.
  A missing Deassert is not treated as active: AC loss and BMC resets drop
  them (24C319575: PSU1 predictive failure).
- component.log fan events use source BMC instead of host.
- Request installed_at in the Reanimator contract to date component
  installs from maintenance.log; follow-up in BACKLOG [installed_at].

ADL-072.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mikhail ChusavitinandClaude Opus 5.5 committed 2026-09-28 13:01:46 +03:00
1 parent 693906ceba
commit 2ce60280c3
10 files changed
+423 -11

No files matched your search

+5 -3
View File
@@ -48,8 +48,8 @@ func ParseComponentLog(content []byte, hw *models.HardwareConfig) {
// ParseComponentLogEvents extracts fan state reported in component.log.
// It is a snapshot at log collection, not a journal entry: events carry no
// timestamp. DIMM state is not emitted here: it lives on the DIMM itself
// (see applyMemoryStatusFromEvents).
// timestamp and are marked active. DIMM state is not emitted here: it lives
// on the DIMM itself (see applyMemoryStatusFromEvents).
func ParseComponentLogEvents(content []byte) []models.Event {
return parseFanEvents(string(content))
}
@@ -1073,15 +1073,17 @@ func parseFanEvents(text string) []models.Event {
severity = models.SeverityCritical
}
active := true
events = append(events, models.Event{
ID: fmt.Sprintf("fan_%d_status", fan.ID),
Source: "Fan",
Source: "BMC",
SensorType: "fan",
SensorName: name,
EventType: "Fan Status",
Severity: severity,
Description: fmt.Sprintf("%s reports %s", name, status),
RawData: fmt.Sprintf("rpm=%d pct=%d model=%s", fan.SpeedRPM, fan.SpeedPercent, fan.FanModel),
Active: &active,
})
}