docs: protocol scope + trace-format design spike - #19
Merged
Conversation
Resolve all foundational design decisions before core implementation (Milestone 0.5 — Protocol & Trace-Format Design Phase). Deliverables: - 9 Architecture Decision Records (docs/adr/): - ADR-0001: OCPP version scope (1.6 JSON primary) - ADR-0002: Input trace formats (JSON Object + JSONL) - ADR-0003: Canonical internal event model - ADR-0004: Message direction representation - ADR-0005: Timestamp normalization - ADR-0006: Session correlation strategy - ADR-0007: Malformed trace handling - ADR-0008: Browser-local processing & privacy - ADR-0009: Future protocol-version extensibility - Trace format specification (docs/trace-format-spec.md) - 3 synthetic trace fixtures (packages/core/src/__fixtures__/): - normal-session.json (complete session, no failures) - failed-auth.json (failed authorization) - connector-fault.json (connector fault during session) - Proposed canonical types (packages/core/src/types.ts) - 28 validation tests proving fixtures conform to the proposed event model - Updated AGENTS.md with design decisions summary - Updated CURRENT_STATE.md with M0.5 progress Closes #18
This was referenced Jul 7, 2026
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.
Summary
Resolves all foundational design decisions before core implementation (Milestone 0.5 — Protocol & Trace-Format Design Phase).
This is a research/spike phase — no published packages. Only design documents, ADRs, synthetic fixtures, and the proposed type definitions.
Closes #18
Deliverables
Architecture Decision Records (
docs/adr/)9 ADRs covering every design decision from the M0.5 checklist:
Trace Format Specification (
docs/trace-format-spec.md)Full specification of accepted trace formats (JSON Object, JSONL, bare array), OCPP 1.6 message structure, size/count limits, timestamp formats, and direction values.
Synthetic Trace Fixtures (
packages/core/src/__fixtures__/)3 fixtures — all fully synthetic (no real station IDs, transaction IDs, or idTags):
normal-session.json— complete charging session: boot → authorize → start transaction → meter values → stop transaction. No failures expected.failed-auth.json— failed authorization: idTag rejected 3×, connector transitions to Faulted. ExpectsFAILED_AUTHORIZATION.connector-fault.json— connector fault during active session:ConnectorLockFailuremid-charging, stop withFaultedreason. ExpectsCONNECTOR_FAULT.Proposed Canonical Types (
packages/core/src/types.ts)Type definitions for
Event,Trace,TraceEventInput,Session,Direction,MessageType,ParseResult,ParseWarning— the foundation for v0.1.0 implementation.Validation Tests (
packages/core/src/fixtures.test.ts)28 tests proving all 3 fixtures conform to the proposed event model:
Design Decisions Summary
Eventwithid,messageId,timestamp(epoch ms or null),direction,messageType,action,payload,rawMessagetransactionIdcorrelationVerification
pnpm lint— cleanpnpm typecheck— cleanpnpm test— 29 tests pass (1 smoke + 28 fixture validation)pnpm format:check— cleanSecurity Review
CS-SYNTHETIC-*,SYNTHETIC-TAG-*)eval(),Function(), or dynamic code execution.hermes/directory is gitignored and not committedChecklist
CURRENT_STATE.md,AGENTS.md)