feat(scenarios): add heartbeat-timeout scenario for TIMEOUT_NO_HEARTBEAT - #161
Conversation
|
Thanks for this, and welcome. The trace is right, the shape follows I ran the full local check on your head commit, in CI order: Two changes and it can go in. 1. The changeset should be I have fixed the wording in #137 and #139 so the next person does not hit it. 2. { connector: 1, status: 'Available', errorCode: 'NoError' }OCPP 1.6 section 4.9 names that field Nothing else. Once those two are pushed I will run the checks again and merge. One process note, not a change request: your first CI run sat waiting rather than |
|
Sorry for the wait on this, and thank you for the clean turnaround. Both changes are in and correct: the changeset reads The stall was mine and it was my mistake, not a problem with your push. I told you Merging once the run is green. |
…ocation (#165) Brings the narrative half of CURRENT_STATE.md forward after #161. The automated half needed nothing: #152 logged 0.4.5 and moved the Package Status Table on its own. The station ID allocation line claimed 017 was reserved for #108. It was not. refused-authorization.ts took CS-SYNTHETIC-017 when it shipped in 0.4.5, after that line was written, so anyone picking up #108 would have created the same collision #133 did. #108 now reserves 021, and the line records live allocation plus the next free number. Corrects rule coverage from two uncovered rules to one, verified by iterating the registry rather than by reading: 15 of the 16 codes appear in some scenario's expectedFailures and REPEATED_BOOT_NOTIFICATION is the only gap. Corrects the corpus arithmetic from 17 to 19. Records #161 merging as the third external contributor's first merge, both remaining scenario issues being assigned, the #108 trap caught before the contributor started, and #163 opened for the assertions-coverage gap. Closes #164
Publishing 0.4.6 left the hand-written "Current Version" paragraph at 0.4.4. The Release Log and the Package Status Table were already correct, because #152 maintains those automatically; the narrative sentence is deliberately human and has to be moved by hand. Also corrects the contribution count. With #161 shipping in 0.4.6 there are four external good-first contributions rather than three, from three different people, and the paragraph now names the three that landed in the 0.4.x line: 0.4.3 (#104, PR #133), 0.4.4 (#138, PR #147) and 0.4.6 (#137, PR #161). Closes #167
Resolves the conflict from branching before ocpp-debugkit#161. The previous resolution left three stray '>' markers (index.ts and index.test.ts) and deleted heartbeat-timeout.ts, which reverted ocpp-debugkit#161 and broke typecheck and build. Restores heartbeat-timeout.ts, drops the markers, rebuilds the registry wiring on current main, and moves the scenario count to 21 across all four sites. The scenario file and changeset are unchanged from this branch.
#169 and #170 landed together, so this folds both forward. Rule coverage is complete: all 16 detection rules now have a scenario exercising them, the invariant #140 wrote into CONTRIBUTING. Verified by iterating the registry rather than by reading, 16 of 16 codes appear in some scenario's expectedFailures. The corpus is at 21, clearing the 20+ scenario exit criterion in the v1.0 milestone. Records the fifth and sixth good-first-issue completions (#108 by YANGCHUNHONG3000, #139 by MayurK-cmd), why #170 needed its branch repaired (cut before #161, its conflict resolution deleted heartbeat-timeout.ts and left stray markers that broke typecheck and build), and the station ID allocation now that 020 and 021 have shipped and 022 is next free.
Summary
Add a
heartbeat-timeoutscenario covering theTIMEOUT_NO_HEARTBEATdetection rule, which previously had zero scenario coverage. The synthetic trace boots a station withinterval=300, then sends aStatusNotificationpast the 2× interval threshold with noHeartbeatanywhere in the trace.Related Issue
Closes #137
Changes
packages/toolkit/src/scenarios/__scenarios__/heartbeat-timeout.ts— synthetic trace withBootNotification,StatusNotificationat06:12:00.000Z, and noHeartbeatpackages/toolkit/src/scenarios/index.ts— import, registry,scenarioNames, exportspackages/toolkit/src/scenarios/index.test.ts— count, name list,getScenario, engine integration testtests/external-fixture/test.mjs— scenario count 18→19README.mdandpackages/toolkit/README.md— scenario count 18→19.changeset/heartbeat-timeout-scenario.md— minor bump for@ocpp-debugkit/toolkitChecklist
pnpm lint)pnpm typecheck)pnpm test)pnpm build)CURRENT_STATE.mdupdated (if applicable)AGENTS.mdupdated (if architecture or build commands changed)Notes for Reviewer
The scenario uses the reserved station ID
CS-SYNTHETIC-018. Verified viaocpp-debugkit scenario run heartbeat-timeoutthatTIMEOUT_NO_HEARTBEATis the only failure reported — no other detection rules fire on this trace.