Skip to content

feat(engine): canonical types & value boundary#15

Merged
sepehr-safari merged 1 commit into
mainfrom
feat/engine-types
Jul 11, 2026
Merged

feat(engine): canonical types & value boundary#15
sepehr-safari merged 1 commit into
mainfrom
feat/engine-types

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

What & why

First slice of S1 — Engine core: the pure-Zig OCPP engine's foundational
data model under src/ocpp/. This is the headless, UI-free contract every later
engine module (normalizer, parser, timeline, detection) builds on.

It mirrors the toolkit's core/types.ts — the shared conformance contract
rather than reimplementing its prose: the shapes and enums match so Studio can
later prove byte-for-byte parity against the same fixtures.

Changes

  • src/ocpp/types.zigDirection / MessageType / Status enums (with
    wire-string ⇄ value and MessageTypeId conversions), plus Event,
    TraceEventInput, Trace (+ TraceMetadata), ParseWarning, ParseResult,
    and Session.
  • Value boundary (ADR-0005) — arbitrary OCPP payloads and raw message arrays
    are carried as std.json.Value over a single per-parse arena, behind a
    version-tagged decode seam so OCPP 2.0.1 is additive, not a rewrite.
  • src/ocpp/ocpp.zig — engine aggregate root; test discovery wired into the
    root test block so native test exercises engine tests.
  • Docs — ADR-0005 + index entry; CURRENT_STATE.md and AGENTS.md updated
    in-PR (S1 now in progress; src/ocpp/ added to the tree).

Scope boundaries

Detection types (Failure / FailureCode / FailureSeverity), SessionSummary,
and scenario/assertion types are intentionally deferred to the milestone that
produces them (detection is S2). S1 defines only the parse → normalize →
correlate model.

Testing

  • native test -Dplatform=null8/8 pass (4 new engine-type tests:
    enum encodings, and a parsed-message-through-Event end-to-end model test).
  • native check --strict → clean.
  • zig fmt --check → clean.
  • Engine modules import only std — no native_sdk / runner (verified pure).

Closes #11

Bring up the pure-Zig OCPP engine's foundational data model under
`src/ocpp/` — headless and UI-free, discovered by `native test`.

- `Direction` / `MessageType` / `Status` enums with wire-string and
  type-id conversions.
- `Event`, `TraceEventInput`, `Trace` (+ metadata), `ParseWarning`,
  `ParseResult`, and `Session`, mirroring the toolkit's conformance
  contract model (the shared behavior, not its source).
- A `std.json.Value` payload / raw-message boundary over a per-parse
  arena, behind a version-tagged decode seam (ADR-0005) so OCPP 2.0.1
  lands additively.
- Engine test discovery wired into the root test block.

Closes #11
@sepehr-safari sepehr-safari added this to the S1 — Engine core milestone Jul 11, 2026
@sepehr-safari sepehr-safari added type:feature New capability area:engine Pure Zig OCPP engine priority:high labels Jul 11, 2026
@sepehr-safari sepehr-safari merged commit 0905f8a into main Jul 11, 2026
3 checks passed
@sepehr-safari sepehr-safari deleted the feat/engine-types branch July 11, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:engine Pure Zig OCPP engine priority:high type:feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(engine): canonical types & value boundary

1 participant