Files
mxaccess/design
Joseph Doherty 95bd218183 [M2] mxaccess-rpc: NTLMv2 + DCE/RPC PDU + OBJREF parser (wave 1)
Lands M2 wave 1 — three pure-Rust modules under crates/mxaccess-rpc with
60 unit tests. Each is a 1:1 port of one .NET reference file:

- ntlm.rs (1137 LoC, 19 tests) — `ManagedNtlmClientContext.cs`. NTLMv2
  challenge/response, Type1/Type3 builders, sign() with RC4-sealed checksum
  and per-call sequence advance. Manual `Debug` impl that hides credentials;
  not Clone (rc4 0.2 cipher state is non-Clone). Pure-Rust crypto via
  hmac/md-5/md4/rc4 v0.2/rand v0.8 (rc4 0.2 chosen per design/review.md:78).
- pdu.rs (1573 LoC, 33 tests) — `DceRpcPdu.cs` + auth-trailer types from
  `DceRpcAuthentication.cs`. Bind/AlterContext/Auth3/Request/Response/Fault
  PDUs, NDR20 transfer syntax, auth_value with 4-byte alignment padding,
  preserved-byte fields per CLAUDE.md unknown-bytes rule.
- objref.rs (~470 LoC, 11 tests including a 366-byte captured OBJREF
  round-trip) — `ComObjRef.cs`. MEOW signature, OXID/OID/IPID, dual-string
  array with printable-ASCII escaping and security-binding boundary.
  ComObjRefProvider.cs deferred (windows-rs Win32 wrapper — see F6).

Every wire-byte claim cites src/MxNativeClient/<file>.cs:LINE per
CLAUDE.md "no fabricated protocol behaviour" rule.

Test count delta: 217 → 277 (+60)
Open followups touched: F1–F8 (new — see design/followups.md)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 06:54:39 -04:00
..

design/ — Rust port architectural plan

This folder is the design contract for the Rust replacement of AVEVA/Wonderware MXAccess. It is the gap between the .NET reference in src/ and the Rust crates that will be written under a sibling rust/ workspace (per CLAUDE.md).

The folder is structured as a small set of focused documents. Read in order; each builds on the previous.

File Purpose
00-overview.md Mission, two-layer goal, architectural principles, non-goals
10-raw-layer.md Byte-accurate raw MXAccess layer (codec + transport + session)
20-async-layer.md Idiomatic Tokio async layer on top of the raw layer
30-crate-topology.md Cargo workspace, crates, dependencies, build/test commands
40-protocol-invariants.md Bill of materials: IIDs, opnums, envelope/handle bytes
50-error-model.md MxStatus, error types, panic/cancellation policy
60-roadmap.md Milestones M0..M6, validation strategy
70-risks-and-open-questions.md Parity gaps, unproven flows, cross-platform constraints
dependencies.md Cross- and within-milestone parallelism map; agent budget per phase
review.md Adversarial review log (BLOCKER/MAJOR/MINOR/NIT findings, all resolved)
prompt.md /loop driver prompt for autonomous M2M6 execution
followups.md Open / resolved deferred work items; auto-triaged by prompt.md Step 0 (created on first /loop run if missing)

The design is grounded in the .NET reference at src/ and the protocol artifacts in docs/, analysis/, and captures/. Do not introduce protocol behavior in these documents that is not already proven in the reference. When adding a new claim about wire format, cite either:

  • a .cs file path in src/MxNativeCodec/, src/MxNativeClient/, or src/MxAsbClient/, or
  • a docs/*.md spec file, or
  • a captures/0NN-frida-* directory or analysis/frida/*.tsv row.

This folder is documentation, not code. When the Rust workspace is created, the design here is the contract it must satisfy. When evidence in captures/ invalidates a design decision here, update the design first, then the code.

Reading order

  • New contributor: 00 → 30 → 10 → 40 → 20 → 50 → 60 → 70.
  • Protocol question: 40 first, then the relevant section of 10.
  • API question: 20 first, then 50.
  • Planning a milestone: 60 first, cross-reference 70 for blockers.
  • Scheduling concurrent work: dependencies.md for the per-phase parallelism map.
  • Driving M2M6 autonomously via /loop: prompt.md (and the followups.md triage log it maintains).