feat(core): parse the Open OCPP Trace interchange format#124
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andparseTrace()auto-detects and delegates to it. Records map onto the OCPP-J frame with:rawis the authoritative frame when present; disagreement with the decomposed fields is surfaced as a warning.actiongets its effective action bymessageIdcorrelation.deriveOpenOcppTraceView(input)reports the format's consumer view (correlation pairs, effective actions, unanswered calls, orphan responses): DebugKit acting as a reference consumer.parseLimits.tsso 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 everyexpected.jsonand parses every trace. The installed-package smoke test also exercises the new subpath exports.Scope notes
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.Docs: the trace format spec and both READMEs are updated. Minor changeset included.
Closes #121