Alarm pipeline wiring + full code-review backlog resolution #119
Open
dohertj2
wants to merge 51 commits from
docs/alarm-client-wm-app-finding into main
pull from: docs/alarm-client-wm-app-finding
merge into: dohertj2:main
dohertj2:main
dohertj2:docs/prose-audit
dohertj2:docs/xml-doc-comments
dohertj2:feat/adopt-zb-health
dohertj2:feat/adopt-zb-telemetry-serilog
dohertj2:feat/tls-cert-autogen
dohertj2:feat/lazy-browse-children
dohertj2:test/client-e2e-coverage
dohertj2:codex/fix-runtime-review-findings
dohertj2:agent-2/issue-50-client-packaging-documentation
dohertj2:agent-1/issue-49-cross-language-smoke-test-matrix
dohertj2:agent-1/issue-48-implement-java-client-session-values-errors-and-cli
dohertj2:agent-2/issue-35-parity-fixture-matrix
dohertj2:agent-3/issue-46-implement-python-async-client-values-errors-and-cli
dohertj2:agent-1/issue-47-scaffold-java-gradle-build
dohertj2:agent-2/issue-44-implement-rust-client-session-values-errors-and-cli
dohertj2:agent-3/issue-45-scaffold-python-package
dohertj2:agent-1/issue-40-implement-dotnet-values-status-errors-and-cli
dohertj2:agent-3/issue-42-implement-go-client-session-values-errors-and-cli
dohertj2:agent-2/issue-34-worker-live-mxaccess-smoke-test
dohertj2:agent-3/issue-43-scaffold-rust-workspace
dohertj2:agent-1/issue-39-implement-dotnet-gatewayclient-and-session
dohertj2:agent-2/issue-33-implement-graceful-shutdown
dohertj2:agent-3/issue-41-scaffold-go-module
dohertj2:agent-1/issue-38-scaffold-dotnet-client-projects
dohertj2:agent-3/issue-32-implement-heartbeat-and-watchdog
dohertj2:agent-1/issue-37-create-cross-language-client-behavior-fixtures
dohertj2:agent-2/issue-29-implement-event-sink-and-event-queue
dohertj2:agent-1/issue-36-publish-stable-client-proto-generation-inputs
dohertj2:agent-2/issue-28-implement-advise-unadvise-advisesupervisory
dohertj2:agent-1/issue-16-implement-blazor-server-dashboard
dohertj2:agent-3/issue-19-gateway-e2e-smoke-with-fake-worker
dohertj2:agent-2/issue-27-implement-additem-additem2-removeitem
dohertj2:agent-3/issue-18-build-fake-worker-test-harness
dohertj2:agent-1/issue-17-implement-dashboard-authentication
dohertj2:agent-2/issue-26-implement-register-and-unregister
dohertj2:agent-3/issue-14-implement-event-streaming-and-backpressure
dohertj2:agent-1/issue-15-implement-dashboard-snapshot-service
dohertj2:agent-2/issue-25-implement-sta-command-dispatcher
dohertj2:agent-3/issue-13-implement-public-grpc-service
dohertj2:agent-2/issue-31-implement-mxstatus-proxy-and-hresult-conversion
dohertj2:agent-1/issue-24-create-mxaccess-com-object-on-sta
dohertj2:agent-3/issue-12-implement-session-manager-and-registry
dohertj2:agent-2/issue-30-implement-value-conversion
dohertj2:agent-1/issue-23-implement-sta-runtime-and-message-pump
dohertj2:agent-2/issue-22-implement-pipe-client-and-frame-protocol
dohertj2:agent-3/issue-11-implement-gateway-workerclient
dohertj2:agent-1/issue-8-add-grpc-authentication-and-scope-authorization
dohertj2:agent-2/issue-7-implement-local-api-key-admin-cli
dohertj2:agent-3/issue-21-implement-worker-bootstrap-and-options
dohertj2:agent-1/issue-10-implement-worker-process-launcher
dohertj2:agent-2/issue-6-implement-api-key-hashing-and-verification
dohertj2:agent-3/issue-20-scaffold-worker-project
dohertj2:agent-2/issue-5-implement-sqlite-auth-store-and-migrations
dohertj2:agent-1/issue-9-implement-worker-frame-protocol
dohertj2:agent-3/issue-4-add-structured-logging-and-metrics-foundation
dohertj2:agent-2/issue-3-add-gateway-configuration-and-validation
dohertj2:agent-1/issue-2-define-protobuf-contracts
dohertj2:agent-1/issue-1-scaffold-gateway-solution-and-projects
No Reviewers
Labels
Clear labels
area:auth
area:client-dotnet
area:client-go
area:client-java
area:client-python
area:client-rust
area:contracts
area:dashboard
area:docs
area:gateway
area:tests
area:worker
blocked
priority:p0
priority:p1
priority:p2
type:docs
type:feature
type:infra
type:test
Authentication and authorization
.NET client library
Go client library
Java client library
Python client library
Rust client library
Protocol and generated contract work
Blazor dashboard work
Documentation
Gateway server work
Automated and live tests
MXAccess worker process work
Blocked by dependency
Must-have / blocking
High priority
Normal priority
Documentation work
Feature implementation
Infrastructure and scaffolding
Test work
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
dohertj2 (dohertj2)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: dohertj2/mxaccessgw#119
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "docs/alarm-client-wm-app-finding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This branch carries two bodies of work.
1. Alarm pipeline (
docs/alarm-client-wm-app-finding)commands,
WorkerAlarmRpcDispatcher, session auto-subscribe, ack-by-name(
Provider!Group.Tag), and end-to-end live smoke verification.2. Full code-review resolution
A tracked, per-module code review under
code-reviews/, then resolution ofall 128 findings across 11 modules.
findings.md+ generatedREADME.mdindex,regen-readme.pytooling, and
REVIEW-PROCESS.md.every module.
(Critical); worker poll-timer STA safety, immediate first heartbeat, and
dropped-reply diagnostics (High); orphan-worker termination, API-key scope
validation, Galaxy-refresh resilience (Medium); plus Low-severity
performance, documentation, and convention fixes across the gateway,
worker, contracts, and all five language clients.
GalaxyHierarchyRefreshServiceTeststiming race, astale
WorkerProjectReferenceTestsassertion, and regenerated theout-of-sync Java client protobuf code.
Verification
MxGateway.slnbuilds clean — 0 warnings (TreatWarningsAsErrorson).MxGateway.Tests408/408 ·MxGateway.Worker.Testsx86231/231 ·
MxGateway.Client(.NET) 73 ·Client.Python68 · Go/Java/Rusttoolchains clean.
🤖 Generated with Claude Code
Gap 1 — WorkerPipeSession now passes `eq => new AlarmCommandHandler(eq)` as the alarmCommandHandlerFactory in all three places it constructs MxAccessStaSession (two convenience constructors and InitializeMxAccessAsync). Previously the parameterless MxAccessStaSession() set the factory to null, so every SubscribeAlarms / AcknowledgeAlarm / QueryActiveAlarms command returned "alarm consumer not configured" in a deployed worker. - Added internal `MxAccessStaSession(Func<MxAccessEventQueue, IAlarmCommandHandler>?)` constructor that builds all defaults but accepts a factory. - Added public `MxAccessStaSession(StaRuntime, factory, eventQueue, alarmFactory?)` 4-arg overload to complete the constructor chain. Gap 2 — WnWrapAlarmConsumer now disables its internal threadpool Timer (pollIntervalMilliseconds=0 in the default constructor). MxAccessStaSession starts a `RunAlarmPollLoopAsync` background task that sleeps off-STA then calls `staRuntime.InvokeAsync(() => handler.PollOnce())` at 500ms intervals. This satisfies the ThreadingModel=Apartment requirement of wwAlarmConsumerClass: every GetXmlCurrentAlarms2 call now runs on the worker's STA. - Added `PollOnce()` to `IMxAccessAlarmConsumer`, `AlarmDispatcher`, `IAlarmCommandHandler`, and `AlarmCommandHandler`. - Poll loop cancelled and awaited before alarm handler disposal in both ShutdownGracefullyAsync and Dispose. Tests: 4 new tests in MxAccessStaSessionTests verify that - SubscribeAlarms reaches the handler when the factory is wired (Gap 1) - SubscribeAlarms returns InvalidRequest without a factory (regression guard) - PollOnce is called on the STA thread within 3s (Gap 2) - The poll loop stops after Dispose (Gap 2 lifecycle) All fake IMxAccessAlarmConsumer / IAlarmCommandHandler test implementations updated with no-op PollOnce() to satisfy the new interface member. Worker tests: 199 passed / 1 pre-existing failure / 4 skipped (was 195/1/4). Server tests: 308 passed / 0 failures (unchanged). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Resolves Client.Rust-001 through Client.Rust-011. Build/test/clippy gate (Client.Rust-001/002/003): - options.rs: doc comments on with_max_grpc_message_bytes / max_grpc_message_bytes (#![warn(missing_docs)]) - session.rs: rename BulkReplyKind variants to drop the shared `Bulk` suffix (clippy::enum_variant_names) - galaxy.rs: deref instead of clone on Option<Timestamp> (clippy::clone_on_copy — an extra violation the gate also hit) - mxgw-cli: assert version_json against GATEWAY/WORKER_PROTOCOL_VERSION constants instead of the stale literal 2 `cargo clippy --workspace --all-targets -- -D warnings` now passes. Correctness / error handling: - version.rs: CLIENT_VERSION = env!("CARGO_PKG_VERSION") (Client.Rust-004) - session.rs: register/add_item/add_item2 handle extractors and bulk_results now return Err(Error::MalformedReply) instead of a silent 0 / empty vec on a shapeless OK reply (Client.Rust-005/006) - error.rs: new Error::Unavailable classifies Code::Unavailable / ResourceExhausted as transient (Client.Rust-010) - session.rs: per-call unique correlation ids via an atomic counter (Client.Rust-011) Other: - value.rs: MxValue/MxArrayValue compute the projection on demand instead of caching it, so a wire-only value pays no projection cost (Client.Rust-008) - RustClientDesign.md: correct the crate layout, drop the unused `tracing` dependency (Client.Rust-007) - client_behavior.rs: tests for the bulk-size cap, a mid-stream status fault, and the unreadable-CA-file path (Client.Rust-009) cargo fmt / test --workspace (27 tests) / clippy all pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Contracts-001: docs/Grpc.md still described "four MxAccessGateway RPCs" — updated to the actual six (adding AcknowledgeAlarm and QueryActiveAlarms to the handler and validation-rule sections). Contracts-003 (Won't Fix): the finding is factually wrong — the <Protobuf> item for mxaccess_worker.proto already sets ProtoRoot="Protos"; all three items are consistent (confirmed back to the reviewed commit). Contracts-004: corrected the stale GatewayContractInfo XML summary ("before generated protobuf contracts are introduced"). Contracts-005: no proto field/enum value was ever removed, so no reserved ranges were invented. Added a wire-compatibility policy comment to all three .proto files instructing future editors to reserve removed numbers. Contracts-006: documented MxStatusProxy.success — it mirrors the COM MXSTATUS_PROXY numeric success member, is not a boolean, and clients should branch on category. Contracts-007: added 13 round-trip tests covering galaxy_repository.proto messages, bulk-subscribe payloads, and raw-value/IPC worker bodies. Contracts-008: WorkerAlarmRpcDispatcher never assigns AcknowledgeAlarmReply. status, so the old "native status" proto comment was misleading. Corrected the hresult/status proto comments and documented the worker native_status → public reply mapping in AlarmClientDiscovery.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.