FOCAS Tier-C PR A � Driver.FOCAS.Shared MessagePack contracts #169

Merged
dohertj2 merged 1 commits from focas-tier-c-pr-a-shared into v2 2026-04-20 13:57:47 -04:00
Owner

First of 5 PRs splitting #220 per docs/v2/implementation/focas-isolation-plan.md.

What lands

  • New Driver.FOCAS.Shared project (netstandard2.0) with MessagePack IPC DTOs for every FOCAS Proxy?Host interaction
  • Framing ([4-byte BE length][1-byte kind][body], 16 MiB cap) matching Galaxy.Shared so hex dumps are cross-readable
  • FrameReader + FrameWriter ported from Galaxy.Shared with thread-safe concurrent-write serialization
  • 24 new unit tests � 18 per-DTO round-trip + 6 framing (concurrent-write, oversized-length, EOF handling, wire-byte stability)

DTOs added

  • Session: Hello/HelloAck, Heartbeat/HeartbeatAck, ErrorResponse
  • OpenSessionRequest/Response (carries declared FocasCncSeries), CloseSessionRequest
  • FocasAddressDto + FocasDataTypeCode (wire-compatible serialization)
  • ReadRequest/Response, WriteRequest/Response, PmcBitWriteRequest/Response (first-class RMW)
  • Subscribe/Unsubscribe/OnDataChangeNotification (poll-pushes-deltas model)
  • ProbeRequest/Response, RuntimeStatusChangeNotification, RecycleHostRequest/Response

Not changed

  • No driver behavior change � 165/165 existing FOCAS unit tests still pass
  • Proxy forwarding + real Fwlib32 move lives in PR C
  • Supervisor + respawn logic lives in PR D

Next

PR B: Driver.FOCAS.Host net48 x86 skeleton + pipe server scaffold (returns NotImplemented for real FOCAS calls).

First of 5 PRs splitting #220 per docs/v2/implementation/focas-isolation-plan.md. ## What lands - New `Driver.FOCAS.Shared` project (netstandard2.0) with MessagePack IPC DTOs for every FOCAS Proxy?Host interaction - Framing (`[4-byte BE length][1-byte kind][body]`, 16 MiB cap) matching Galaxy.Shared so hex dumps are cross-readable - `FrameReader` + `FrameWriter` ported from Galaxy.Shared with thread-safe concurrent-write serialization - 24 new unit tests � 18 per-DTO round-trip + 6 framing (concurrent-write, oversized-length, EOF handling, wire-byte stability) ## DTOs added - Session: Hello/HelloAck, Heartbeat/HeartbeatAck, ErrorResponse - OpenSessionRequest/Response (carries declared FocasCncSeries), CloseSessionRequest - FocasAddressDto + FocasDataTypeCode (wire-compatible serialization) - ReadRequest/Response, WriteRequest/Response, PmcBitWriteRequest/Response (first-class RMW) - Subscribe/Unsubscribe/OnDataChangeNotification (poll-pushes-deltas model) - ProbeRequest/Response, RuntimeStatusChangeNotification, RecycleHostRequest/Response ## Not changed - No driver behavior change � 165/165 existing FOCAS unit tests still pass - Proxy forwarding + real Fwlib32 move lives in PR C - Supervisor + respawn logic lives in PR D ## Next PR B: `Driver.FOCAS.Host` net48 x86 skeleton + pipe server scaffold (returns NotImplemented for real FOCAS calls).
dohertj2 added 1 commit 2026-04-20 13:57:38 -04:00
FOCAS Tier-C PR A — Driver.FOCAS.Shared MessagePack IPC contracts. First PR of the 5-PR #220 split (isolation plan at docs/v2/implementation/focas-isolation-plan.md). Adds a new netstandard2.0 project consumable by both the .NET 10 Proxy and the future .NET 4.8 x86 Host, carrying every wire DTO the Proxy <-> Host pair will exchange: Hello/HelloAck + Heartbeat/HeartbeatAck + ErrorResponse for session negotiation (shared-secret + protocol major/minor mirroring Galaxy.Shared); OpenSessionRequest/Response + CloseSessionRequest carrying the declared FocasCncSeries so the Host picks up the pre-flight matrix; FocasAddressDto + FocasDataTypeCode for wire-compatible serialization of parsed addresses (0=Pmc/1=Param/2=Macro matches FocasAreaKind enum order so both sides cast (int)); ReadRequest/Response + WriteRequest/Response with MessagePack-serialized boxed values tagged by FocasDataTypeCode; PmcBitWriteRequest/Response as a first-class RMW operation so the critical section stays Host-side; Subscribe/Unsubscribe/OnDataChangeNotification for poll-loop-pushes-deltas model (FOCAS has no CNC-initiated callbacks); Probe + RuntimeStatusChange + Recycle surface for Tier-C supervision. Framing is [4-byte BE length][1-byte kind][body] with 16 MiB body cap matching Galaxy; FocasMessageKind byte values align with Galaxy ranges so an operator reading a hex dump doesn't have to context-switch. FrameReader/FrameWriter ported from Galaxy.Shared with thread-safe concurrent-write serialization. 24 new unit tests: 18 per-DTO round-trip tests covering every field + 6 framing tests (single-frame round-trip, clean-EOF returns null, oversized-length rejection, mid-frame EOF throws, 20-way concurrent-write ordering preserved, MessageKind byte values locked as wire-stable). No driver changes; existing 165 FOCAS unit tests still pass unchanged. PR B (Host skeleton) goes next. e6ff39148b
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit b968496471 into v2 2026-04-20 13:57:47 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#169