Skip to content

feat(core): parse the Open OCPP Trace interchange format#124

Merged
sepehr-safari merged 2 commits into
mainfrom
feat/open-ocpp-trace-input
Jul 17, 2026
Merged

feat(core): parse the Open OCPP Trace interchange format#124
sepehr-safari merged 2 commits into
mainfrom
feat/open-ocpp-trace-input

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Reads the vendor-neutral Open OCPP Trace interchange format into DebugKit, so traces produced by other tools can be inspected, analyzed, diffed, and replayed here.

What's in it

  • parseOpenOcppTrace(input) parses the format (JSONL or a JSON array of records) into the internal event model, and parseTrace() auto-detects and delegates to it. Records map onto the OCPP-J frame with:
    • raw-frame precedence - raw is the authoritative frame when present; disagreement with the decomposed fields is surfaced as a warning.
    • action derivation - a response that omits action gets its effective action by messageId correlation.
    • unknown-field tolerance - a trace from a later minor version of the format still parses.
  • deriveOpenOcppTraceView(input) reports the format's consumer view (correlation pairs, effective actions, unanswered calls, orphan responses): DebugKit acting as a reference consumer.
  • The untrusted-input limits move to parseLimits.ts so the new path shares them exactly and no path can bypass them.

Conformance

The specification's 15 conformance fixtures are vendored under packages/toolkit/src/core/__fixtures__/open-ocpp-trace/, and CI asserts DebugKit reproduces every expected.json and parses every trace. The installed-package smoke test also exercises the new subpath exports.

Scope notes

  • Record-level metadata beyond the frame (ocppVersion, transport, connectorId, meta) has no slot in the internal event model and is not surfaced yet; the frame, direction, and timestamp are. Surfacing the rest is a follow-up.
  • Export (the producer half) is tracked in feat(core,cli): export traces to Open OCPP Trace v1.1 #122.

Docs: the trace format spec and both READMEs are updated. Minor changeset included.

Closes #121

Read the vendor-neutral Open OCPP Trace format (JSONL or a JSON array of
records) into the internal event model. parseTrace() auto-detects it and
delegates to parseOpenOcppTrace(); records map onto the OCPP-J frame with
raw-frame precedence, messageId-based action derivation, and unknown-field
tolerance, reusing the normalize pipeline and the shared untrusted-input
limits (extracted to parseLimits.ts).

deriveOpenOcppTraceView() reports the format's consumer view. The 15
specification conformance fixtures are vendored and asserted against it in
CI, so DebugKit is a checked reference consumer of the format.
@sepehr-safari
sepehr-safari merged commit 32e48f0 into main Jul 17, 2026
2 checks passed
@sepehr-safari
sepehr-safari deleted the feat/open-ocpp-trace-input branch July 17, 2026 10:40
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): parse Open OCPP Trace v1.1 traces

1 participant