Skip to content

feat(core): v0.3 failure detection rules — 5 new rules (15 total)#95

Merged
sepehr-safari merged 1 commit into
mainfrom
feat/core-detection-v3
Jul 9, 2026
Merged

feat(core): v0.3 failure detection rules — 5 new rules (15 total)#95
sepehr-safari merged 1 commit into
mainfrom
feat/core-detection-v3

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Summary

Implements 5 new failure detection rules for v0.3.0 (Issues #84), bringing the total from 10 to 15:

  1. SUSPICIOUS_SESSION_DURATION (warning) — Session < 60s or > 24h
  2. SLOW_RESPONSE (warning) — Call→CallResult/CallError gap > 10s
  3. HEARTBEAT_INTERVAL_VIOLATION (info) — Heartbeat intervals deviate >50% from expected
  4. METER_VALUE_ANOMALY (warning) — Non-monotonic or negative meter readings
  5. UNRESPONSIVE_CSMS (critical) — Call with no matching CallResult or CallError

Implementation

  • Added 5 new FailureCode values to types.ts
  • Added detection logic, suggested steps, and severity entries to detection.ts
  • 14 new unit tests covering positive + negative cases for each rule
  • Audited all existing 10 scenarios and 3 fixtures — no false positives from new rules

Files Changed

  • packages/toolkit/src/core/types.ts — 5 new FailureCode values
  • packages/toolkit/src/core/detection.ts — 5 rule implementations + suggested steps + severity
  • packages/toolkit/src/core/detection.test.ts — 14 new tests
  • .changeset/v03-detection-rules.md — minor bump changeset
  • CURRENT_STATE.md — updated with v0.3.0 progress

Closes #84

Checklist

  • 5 new FailureCode values added to types.ts
  • Each rule has implementation in detection.ts with suggested steps
  • Unit tests for each rule (positive + negative cases)
  • All existing tests still pass (309 total, up from 295)
  • Existing scenarios audited — no false positives
  • Lint, typecheck, format all pass
  • Changeset added with minor bump
  • CURRENT_STATE.md updated

Add SUSPICIOUS_SESSION_DURATION, SLOW_RESPONSE, HEARTBEAT_INTERVAL_VIOLATION,
METER_VALUE_ANOMALY, and UNRESPONSIVE_CSMS detection rules. 14 new unit tests.
All existing fixtures audited — no false positives.

Closes #84
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ocpp-debugkit-web Ready Ready Preview, Comment Jul 8, 2026 11:58pm

@sepehr-safari sepehr-safari merged commit c580737 into main Jul 9, 2026
4 checks passed
@sepehr-safari sepehr-safari deleted the feat/core-detection-v3 branch July 9, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(core): v0.3 failure detection rules

1 participant