Design doc covers architecture, v2 protocol (TypedValue/QualityCode), COM threading model, session lifecycle, subscription semantics, error model, and guardrails. Implementation plans are detailed enough for autonomous Claude Code execution. Verified all dev tooling on windev (Grpc.Tools, protobuf-net.Grpc, Polly v8, xUnit).
5.2 KiB
5.2 KiB
LmxProxy v2 Rebuild — Execution Prompt
Run this prompt with Claude Code from the lmxproxy/ directory to execute all 7 phases of the rebuild autonomously.
Prompt
You are executing a pre-approved implementation plan for rebuilding the LmxProxy gRPC proxy service. All design decisions have been made and documented. You do NOT need to ask for approval — execute each phase completely, then move to the next.
Context
Read these documents in order before starting:
docs/plans/2026-03-21-lmxproxy-v2-rebuild-design.md— the approved designCLAUDE.md— project-level instructionsdocs/requirements/HighLevelReqs.md— high-level requirementsdocs/requirements/Component-*.md— all component requirements (10 files)docs/lmxproxy_updates.md— authoritative v2 protocol specification
Execution Order
Execute phases in this exact order. Each phase has a detailed plan in docs/plans/:
- Phase 1:
docs/plans/phase-1-protocol-domain-types.md - Phase 2:
docs/plans/phase-2-host-core.md - Phase 3:
docs/plans/phase-3-host-grpc-security-config.md - Phase 4:
docs/plans/phase-4-host-health-metrics.md - Phase 5:
docs/plans/phase-5-client-core.md - Phase 6:
docs/plans/phase-6-client-extras.md - Phase 7:
docs/plans/phase-7-integration-deployment.md
How to Execute Each Phase
For each phase:
- Read the phase plan document completely before writing any code.
- Read any referenced requirements documents for that phase.
- Execute each step in the plan in order.
- After all steps, run
dotnet buildanddotnet testto verify. - If build or tests fail, fix the issues before proceeding.
- Commit the phase with message:
feat(lmxproxy): phase N — <description> - Push to remote:
git push - Move to the next phase.
Guardrails (MUST follow)
- Proto is the source of truth — any wire format question is resolved by reading
src/ZB.MOM.WW.LmxProxy.Host/Grpc/Protos/scada.proto, not the code-first contracts. - No v1 code in the new build — the
src-reference/directory is for reading only. Do not copy-paste and modify; write fresh code guided by the plan. - Cross-stack tests in Phase 1 — Host proto serialize to Client code-first deserialize (and vice versa) must pass before any business logic.
- COM calls only on STA dispatch thread — no
Task.Runfor COM operations. All go through theStaDispatchThreaddispatch queue. - status_code is canonical for quality —
symbolic_nameis always derived from lookup, never independently set. - Unit tests before integration — every phase includes unit tests. Integration tests are Phase 7 only.
- Each phase must compile and pass tests before the next phase begins. Do not skip failing tests.
- No string serialization heuristics — v2 uses native TypedValue. No
double.TryParseorbool.TryParseon values. - Do not modify requirements or design docs — if you find a conflict, follow the design doc's resolution (section 11).
- Do not ask for user approval — all decisions are pre-approved in the design document.
Error Recovery
- If a build fails, read the error messages carefully, fix the code, and rebuild.
- If a test fails, fix the implementation (not the test) unless the test has a clear bug.
- If a step in the plan is ambiguous, consult the requirements document for that component.
- If the requirements are ambiguous, consult the design document's resolution table (section 11).
- If you cannot resolve an issue after 3 attempts, skip that step, leave a
// TODO: <description>comment, and continue.
Phase 7 Special Instructions
Phase 7 requires SSH access to windev (10.100.0.48). See windev.md in the repo root for connection details:
- SSH:
ssh windev(passwordless) - Default shell: cmd.exe, use
powershell -Commandfor PowerShell - Git and .NET SDK 10 are installed
- The existing v1 LmxProxy service is at
C:\publish\on port 50051
For Veeam backups, SSH to the Veeam server:
- SSH:
ssh dohertj2@10.100.0.30(passwordless) - Use
Add-PSSnapin VeeamPSSnapinfor Veeam PowerShell
Commit Messages
Use this format for each phase commit:
- Phase 1:
feat(lmxproxy): phase 1 — v2 protocol types and domain model - Phase 2:
feat(lmxproxy): phase 2 — host core (MxAccessClient, SessionManager, SubscriptionManager) - Phase 3:
feat(lmxproxy): phase 3 — host gRPC server, security, configuration, service hosting - Phase 4:
feat(lmxproxy): phase 4 — host health monitoring, metrics, status web server - Phase 5:
feat(lmxproxy): phase 5 — client core (ILmxProxyClient, connection, read/write/subscribe) - Phase 6:
feat(lmxproxy): phase 6 — client extras (builder, factory, DI, streaming extensions) - Phase 7:
feat(lmxproxy): phase 7 — integration tests, deployment to windev, v1 cutover
After All Phases
When all 7 phases are complete:
- Run
dotnet build ZB.MOM.WW.LmxProxy.slnxto verify the full solution builds. - Run
dotnet testto verify all unit tests pass. - Verify the integration tests passed in Phase 7.
- Create a final commit if any cleanup was needed.
- Push all changes.
- Report: total files created, total tests, build status, integration test results.