Skip to content

feat(scenarios): add meter-value-zero scenario - #169

Merged
sepehr-safari merged 2 commits into
ocpp-debugkit:mainfrom
YANGCHUNHONG3000:feat/meter-value-zero
Aug 10, 2026
Merged

feat(scenarios): add meter-value-zero scenario#169
sepehr-safari merged 2 commits into
ocpp-debugkit:mainfrom
YANGCHUNHONG3000:feat/meter-value-zero

Conversation

@YANGCHUNHONG3000

Copy link
Copy Markdown
Contributor

Closes #108

Adds the meter-value-zero negative-control scenario using CS-SYNTHETIC-021. The all-zero cumulative meter trace is expected to report no failures, guarding against regressions in METER_VALUE_ANOMALY.

Validation:

  • ocpp-debugkit scenario run meter-value-zero: 0 failures, PASS
  • lint, package typecheck, package build, and changed-file Prettier checks
  • unit suite: 549 tests passed; scripts/update-current-state.test.ts has a pre-existing Windows/Vitest import failure
  • packed-tarball consumer verification: 20 scenarios exported and installed CLI passes meter-value-zero

YANGCHUNHONG3000 and others added 2 commits August 8, 2026 22:48
The corpus numbers idTag and transactionId to match the station ID. This
scenario used SYNTHETIC-TAG-017 and 100017 against CS-SYNTHETIC-021, because
issue ocpp-debugkit#108 still carried the tag from before the station ID moved off the
collision with refused-authorization. Issue text corrected too.
@sepehr-safari

Copy link
Copy Markdown
Member

This is right, and it is the first negative control in the corpus. I ran the trace
through the engine and it reports nothing, which is exactly what the scenario is
for: it pins down that a flat zero register is not a fault, so a future change to
METER_VALUE_ANOMALY cannot start reporting it without a named test failure.
format:check, lint, typecheck and build pass, the suite is at 558, and the
external fixture test is at 56.

One small thing, and it was my fault rather than yours. The corpus numbers the
idTag and transactionId to match the station ID, so CS-SYNTHETIC-021 wants
SYNTHETIC-TAG-021 and 100021. The issue still said SYNTHETIC-TAG-017 and
100017, left over from when the scenario was going to be station 017 before
that number turned out to be taken. You followed the issue exactly. I have pushed
the rename to your branch and corrected the issue text so the next reader does not
inherit it.

Merging now. That takes the corpus to 20 and clears the 20+ target for v1.0, and it
is your third scenario.

@sepehr-safari
sepehr-safari merged commit ca2bb0e into ocpp-debugkit:main Aug 10, 2026
2 checks passed
sepehr-safari added a commit that referenced this pull request Aug 10, 2026
#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.
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.

Add a new scenario: meter-value-zero

2 participants