mbproxy: initial commit through Phase 9 (TxId multiplexing)

Adds the mbproxy service end-to-end. Phases 00-08 implement the
production-ready single-listener / 1:1-backend transparent Modbus TCP
proxy with bidirectional BCD rewriting for the ~54-PLC DL205/DL260
fleet. Phase 9 replaces the connection layer with a single backend
socket per PLC plus MBAP TxId rewriting, lifting the H2-ECOM100's
4-concurrent-client cap as an operational ceiling.

Phase 9 additions of note:
- PlcMultiplexer + UpstreamPipe + TxIdAllocator + CorrelationMap
- InFlightRequest with IReadOnlyList<InterestedParty> (load-bearing
  for Phase 10 read coalescing — do not collapse to a single field)
- Per-request watchdog: surfaces Modbus exception 0x0B to upstream
  on BackendRequestTimeoutMs, defending against lost responses,
  dead-PLC paths, and pymodbus 3.13.0's concurrent-multiplexed-
  request bug (its ServerRequestHandler.last_pdu state race)
- Status DTO + HTML gain inFlight / maxInFlight / txIdWraps /
  disconnectCascades / queueDepth (Tier 1.6 in docs/kpi.md)

Tests: 263 unit + 38 E2E. Multiplexer correctness under truly
concurrent backend traffic is proved against a stub backend in
PlcMultiplexerTests; MultiplexerE2ETests paces requests so pymodbus
3.13's single-PDU framer stays in known-good mode.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-05-14 01:49:35 -04:00
parent 2e937228a0
commit 56eee3c563
105 changed files with 18430 additions and 0 deletions
+4
View File
@@ -23,7 +23,9 @@ When in doubt about where content belongs, default to pushing it deeper. `DOCS-G
- [`graccesscli/`](graccesscli/README.md) — `.NET Framework 4.8 / x86` CliFx-based CLI for automating Galaxy configuration through the ArchestrA GRAccess COM interop.
- [`grdb/`](grdb/README.md) — SQL/DDL exploration of the Galaxy Repository SQL database (queries, schema, hierarchy/tag-name translation).
- [`histdb/`](histdb/README.md) — LLM-oriented reference for AVEVA Historian retrieval (extension tables, `wwXxx` time-domain extensions, retrieval modes/options, alarm-event SQL, REST API). Distilled from the official Historian Retrieval Guide.
- [`mbproxy/`](mbproxy/README.md) — `.NET 10` Windows Service that proxies Modbus TCP inline and rewrites BCD-encoded registers bidirectionally for a fleet of ~54 DL205/DL260 PLCs.
- [`mxaccesscli/`](mxaccesscli/README.md) — `.NET Framework 4.8 / x86` CliFx-based CLI for reading, writing, and subscribing to System Platform tags via the **MxAccess** COM proxy (`LMXProxyServerClass`).
- [`secrets/`](secrets/README.md) — Self-hosted Infisical CLI + `secret` PowerShell helper for fetching credentials from `https://infisical.dohertylan.com` instead of inlining plaintext.
## Tool / resource index
@@ -34,7 +36,9 @@ When in doubt about where content belongs, default to pushing it deeper. `DOCS-G
| Automate Galaxy configuration via GRAccess COM (CLI usage, session daemon, mutations, LLM integration) | [`graccesscli/README.md`](graccesscli/README.md) |
| Galaxy Repository SQL — connect, schema, hierarchy queries, contained-name ↔ tag-name translation | [`grdb/README.md`](grdb/README.md) |
| AVEVA Historian retrieval — SQL via `INSQL`, `wwXxx` extensions, retrieval modes/options, alarm/event SQL, REST API | [`histdb/README.md`](histdb/README.md) |
| Proxy Modbus TCP inline with bidirectional BCD rewriting for DL205/DL260 fleet (install, ops, status page) | [`mbproxy/README.md`](mbproxy/README.md) |
| Read / write / subscribe to System Platform tags via MxAccess (timeouts, error categories, JSON envelope) | [`mxaccesscli/README.md`](mxaccesscli/README.md) |
| Fetch credentials from Infisical instead of using plaintext (`secret <KEY>` helper, env vars, identity reuse) | [`secrets/README.md`](secrets/README.md) |
## Maintaining this index