Skip to content

Refactor Control Plane communication and enhance event handling#131

Open
MrHinsh wants to merge 22 commits into
mainfrom
update-for-comms
Open

Refactor Control Plane communication and enhance event handling#131
MrHinsh wants to merge 22 commits into
mainfrom
update-for-comms

Conversation

@MrHinsh

@MrHinsh MrHinsh commented Jun 30, 2026

Copy link
Copy Markdown
Member

Unified Agent ↔ ControlPlane ↔ CLI communications ("iron comms", Phases A–E)

Replaces the fragile multi-channel comms fan-out with a single, acknowledged, replay-safe channel in each direction, then removes every legacy path outright (no shims, no backwards compatibility).

Agent → ControlPlane

  • UnifiedWorkerEventWriter — one unbounded channel + background flush; batches up to 50 events / 500 ms into POST /workers/{workerId}/events; 5-attempt exponential backoff with 429 handling; Terminal events flush immediately. All kinds flow through it: Progress, Diagnostics, Metrics, Snapshots, Task lists (both net10 and net481 agents), Terminal (complete/fail).
  • Lease heartbeat: POST /agents/lease/{leaseId}/heartbeat every 15 s.
  • Deleted: ControlPlaneProgressSink, ControlPlaneTelemetryClient, IControlPlaneTelemetryClient, the logger-provider HTTP fallback, and all seven legacy per-signal CP endpoints (/agents/lease/{leaseId}/progress|complete|fail|metrics|snapshot|tasks|diagnostics).

ControlPlane stores

  • JobProgressStore / DiagnosticLogStore are append-only logs (full replay for reconnecting clients) with safety caps (MaxEventsPerJob / MaxRecordsPerJob, default 50k, discard-with-warning at cap). Dead ring-buffer Capacity options removed.

ControlPlane → CLI

  • Unified SSE stream GET /jobs/{jobId}/stream?from={seq} multiplexing progress + diagnostics with replay; the CLI auto-reconnects on transport drops, resuming from the last sequence. Task lists/metrics fetched via /jobs/{id}/bootstrap (on Job.Ready, 5 s poll, and at terminal).

Also fixed en route

  • Enum serialization mismatch that 400'd every event batch (CP MVC options lacked JsonStringEnumConverter)
  • SSE abort race at job termination (Task.FromCanceled with un-cancelled token)
  • Two store tests asserting the removed ring-buffer eviction contract (failed deterministically; previously mislabelled flaky)
  • A test file silently excluded from compilation via stale <Compile Remove>

Verification

Full suite green: 1650/1650 across all 10 test projects (Debug + Release binaries rebuilt; CLI subprocess tests stage Release).

🤖 Generated with Claude Code

MrHinsh and others added 2 commits June 30, 2026 15:39
… (Phases A-E)

Phase A: Switch ControlPlaneProgressSink and subscriber channels from DropOldest
to unbounded/DropOldest-with-5k-cap to eliminate silent event loss under backpressure.

Phase B: Add POST /agents/lease/{id}/heartbeat endpoint; wire a 15-second PeriodicTimer
(Task.Delay on net481) in AgentWorkerBase so the CP can distinguish live from stale agents.

Phase C: Introduce UnifiedWorkerEventWriter — a single unbounded channel + BackgroundService
that batches ≤50 events or 500 ms and POSTs to POST /workers/{id}/events. Routes
ControlPlaneLoggerProvider diagnostics and JobAgentWorker task-list pushes through it instead
of the previous 5 separate fire-and-forget HTTP paths. WorkerEventsController on the CP side
dispatches each event kind to the appropriate store. 429 retries 2 s; other failures
exponential backoff up to 5 attempts.

Phase D: Replace ConcurrentQueue ring buffers in JobProgressStore and DiagnosticLogStore with
append-only List<T> protected by ReaderWriterLockSlim, enabling full-history replay for
reconnecting clients. GetSnapshot(jobId, fromSeq) and MaxEventsPerJob/MaxRecordsPerJob caps
(default 50 k) replace silent ring-drop.

Phase E: Add GET /jobs/{id}/stream unified SSE endpoint (JobStreamController) that replays
stored events from fromSeq and then multiplexes live progress + diagnostic channels with a
15-second heartbeat. CLI ControlPlaneClient gains StreamJobAsync; ExecuteAdoExportAsync
replaces its 4-task fan-out (2 SSE + 2 poll) with a single await foreach, eliminating the
bootstrap/terminal race and the WaitAsync(5s) workarounds.

Also fixes pre-existing bug in FileDiagnosticsExtensions where missing config fell back to
.otel-diagnostics instead of returning null.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MrHinsh MrHinsh self-assigned this Jun 30, 2026
Copilot AI review requested due to automatic review settings June 30, 2026 16:08
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 226 files, which is 76 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4869ce0e-fd17-43a4-92a8-40f491a1b8f1

📥 Commits

Reviewing files that changed from the base of the PR and between 985b3ff and acc215c.

📒 Files selected for processing (226)
  • .agents/10-contracts/specs/lease-coordination-contract.md
  • .agents/10-contracts/specs/observability-transport-contract.md
  • .agents/10-contracts/specs/task-plan-contract.md
  • .agents/10-contracts/specs/validation-safety-contract.md
  • .agents/20-guardrails/workflow/definition-of-done.md
  • .agents/20-guardrails/workflow/spec-coverage-completeness.md
  • .output/nkda-testdsl/agent-job-context/01-feature-assessment.md
  • .output/nkda-testdsl/agent-job-context/02-dsl-design.md
  • .output/nkda-testdsl/agent-job-context/03-extraction-summary.md
  • .output/nkda-testdsl/agent-job-context/04-conversion-summary.md
  • .output/nkda-testdsl/agent-job-context/05-refactor-summary.md
  • .output/nkda-testdsl/agent-job-context/06-verification.md
  • .output/nkda-testdsl/config-polymorphic-endpoint-config/01-feature-assessment.md
  • .output/nkda-testdsl/config-polymorphic-endpoint-config/02-dsl-design.md
  • .output/nkda-testdsl/config-polymorphic-endpoint-config/03-extraction-summary.md
  • .output/nkda-testdsl/config-polymorphic-endpoint-config/04-conversion-summary.md
  • .output/nkda-testdsl/config-polymorphic-endpoint-config/05-refactor-summary.md
  • .output/nkda-testdsl/config-polymorphic-endpoint-config/06-verification.md
  • .output/nkda-testdsl/discover-work-items/06-verification.md
  • .output/nkda-testdsl/field-transform-field-transform-pipeline/01-feature-assessment.md
  • .output/nkda-testdsl/field-transform-field-transform-pipeline/02-dsl-design.md
  • .output/nkda-testdsl/field-transform-field-transform-pipeline/03-extraction-summary.md
  • .output/nkda-testdsl/field-transform-field-transform-pipeline/04-conversion-summary.md
  • .output/nkda-testdsl/field-transform-field-transform-pipeline/05-refactor-summary.md
  • .output/nkda-testdsl/field-transform-field-transform-pipeline/06-verification.md
  • .output/nkda-testdsl/filter-scope-inventory/06-verification.md
  • .output/nkda-testdsl/host-builder-architecture/06-verification.md
  • .output/nkda-testdsl/import-default-team-detection/06-verification.md
  • .output/nkda-testdsl/inventory-modules/06-verification.md
  • .output/nkda-testdsl/inventory-multi-org/00-scenario-test-inventory.md
  • .output/nkda-testdsl/inventory-multi-org/01-feature-assessment.md
  • .output/nkda-testdsl/inventory-multi-org/02-dsl-design.md
  • .output/nkda-testdsl/inventory-multi-org/03-extraction-summary.md
  • .output/nkda-testdsl/inventory-multi-org/04-conversion-summary.md
  • .output/nkda-testdsl/inventory-multi-org/05-refactor-summary.md
  • .output/nkda-testdsl/inventory-multi-org/06-verification.md
  • .output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/01-feature-assessment.md
  • .output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/02-dsl-design.md
  • .output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/03-extraction-summary.md
  • .output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/04-conversion-summary.md
  • .output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/05-refactor-summary.md
  • .output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/06-verification.md
  • .output/nkda-testdsl/job-execution-plan/01-feature-assessment.md
  • .output/nkda-testdsl/job-execution-plan/02-dsl-design.md
  • .output/nkda-testdsl/job-execution-plan/03-extraction-summary.md
  • .output/nkda-testdsl/job-execution-plan/04-conversion-summary.md
  • .output/nkda-testdsl/job-execution-plan/05-refactor-summary.md
  • .output/nkda-testdsl/job-execution-plan/06-verification.md
  • .output/nkda-testdsl/jobs-job-lifecycle/01-feature-assessment.md
  • .output/nkda-testdsl/jobs-job-lifecycle/02-dsl-design.md
  • .output/nkda-testdsl/jobs-job-lifecycle/03-extraction-summary.md
  • .output/nkda-testdsl/jobs-job-lifecycle/04-conversion-summary.md
  • .output/nkda-testdsl/jobs-job-lifecycle/05-refactor-summary.md
  • .output/nkda-testdsl/jobs-job-lifecycle/06-verification.md
  • .output/nkda-testdsl/jobs-job-submission/01-feature-assessment.md
  • .output/nkda-testdsl/jobs-job-submission/02-dsl-design.md
  • .output/nkda-testdsl/jobs-job-submission/03-extraction-summary.md
  • .output/nkda-testdsl/jobs-job-submission/04-conversion-summary.md
  • .output/nkda-testdsl/jobs-job-submission/05-refactor-summary.md
  • .output/nkda-testdsl/jobs-job-submission/06-verification.md
  • .output/nkda-testdsl/module-isolation/01-feature-assessment.md
  • .output/nkda-testdsl/module-isolation/02-dsl-design.md
  • .output/nkda-testdsl/module-isolation/03-extraction-summary.md
  • .output/nkda-testdsl/module-isolation/04-conversion-summary.md
  • .output/nkda-testdsl/module-isolation/05-refactor-summary.md
  • .output/nkda-testdsl/module-isolation/06-verification.md
  • .output/nkda-testdsl/observability-tiered-log-levels/01-feature-assessment.md
  • .output/nkda-testdsl/observability-tiered-log-levels/02-dsl-design.md
  • .output/nkda-testdsl/observability-tiered-log-levels/03-extraction-summary.md
  • .output/nkda-testdsl/observability-tiered-log-levels/04-conversion-summary.md
  • .output/nkda-testdsl/observability-tiered-log-levels/05-refactor-summary.md
  • .output/nkda-testdsl/observability-tiered-log-levels/06-verification.md
  • .output/nkda-testdsl/package-lock-exclusive-package-lock/01-feature-assessment.md
  • .output/nkda-testdsl/package-lock-exclusive-package-lock/02-dsl-design.md
  • .output/nkda-testdsl/package-lock-exclusive-package-lock/03-extraction-summary.md
  • .output/nkda-testdsl/package-lock-exclusive-package-lock/04-conversion-summary.md
  • .output/nkda-testdsl/package-lock-exclusive-package-lock/05-refactor-summary.md
  • .output/nkda-testdsl/package-lock-exclusive-package-lock/06-verification.md
  • .output/nkda-testdsl/parallel-module-execution/01-feature-assessment.md
  • .output/nkda-testdsl/parallel-module-execution/02-dsl-design.md
  • .output/nkda-testdsl/parallel-module-execution/03-extraction-summary.md
  • .output/nkda-testdsl/parallel-module-execution/04-conversion-summary.md
  • .output/nkda-testdsl/parallel-module-execution/05-refactor-summary.md
  • .output/nkda-testdsl/parallel-module-execution/06-verification.md
  • .output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/01-feature-assessment.md
  • .output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/02-dsl-design.md
  • .output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/03-extraction-summary.md
  • .output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/04-conversion-summary.md
  • .output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/05-refactor-summary.md
  • .output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/06-verification.md
  • .output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/01-feature-assessment.md
  • .output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/02-dsl-design.md
  • .output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/03-extraction-summary.md
  • .output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/04-conversion-summary.md
  • .output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/05-refactor-summary.md
  • .output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/06-verification.md
  • .output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/01-feature-assessment.md
  • .output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/02-dsl-design.md
  • .output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/03-extraction-summary.md
  • .output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/04-conversion-summary.md
  • .output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/05-refactor-summary.md
  • .output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/06-verification.md
  • .output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/01-feature-assessment.md
  • .output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/02-dsl-design.md
  • .output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/03-extraction-summary.md
  • .output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/04-conversion-summary.md
  • .output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/05-refactor-summary.md
  • .output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/06-verification.md
  • .output/nkda-testdsl/system-test-ci-execution/00-scenario-test-inventory.md
  • .output/nkda-testdsl/system-test-ci-execution/06-verification.md
  • .output/nkda-testdsl/task-attribution/01-feature-assessment.md
  • .output/nkda-testdsl/task-attribution/02-dsl-design.md
  • .output/nkda-testdsl/task-attribution/03-extraction-summary.md
  • .output/nkda-testdsl/task-attribution/04-conversion-summary.md
  • .output/nkda-testdsl/task-attribution/05-refactor-summary.md
  • .output/nkda-testdsl/task-attribution/06-verification.md
  • .output/nkda-testdsl/telemetry-idempotency-metric-registration/01-feature-assessment.md
  • .output/nkda-testdsl/telemetry-idempotency-metric-registration/02-dsl-design.md
  • .output/nkda-testdsl/telemetry-idempotency-metric-registration/03-extraction-summary.md
  • .output/nkda-testdsl/telemetry-idempotency-metric-registration/04-conversion-summary.md
  • .output/nkda-testdsl/telemetry-idempotency-metric-registration/05-refactor-summary.md
  • .output/nkda-testdsl/telemetry-idempotency-metric-registration/06-verification.md
  • .output/nkda-testdsl/telemetry-otel-cloud-export/01-feature-assessment.md
  • .output/nkda-testdsl/telemetry-otel-cloud-export/02-dsl-design.md
  • .output/nkda-testdsl/telemetry-otel-cloud-export/03-extraction-summary.md
  • .output/nkda-testdsl/telemetry-otel-cloud-export/04-conversion-summary.md
  • .output/nkda-testdsl/telemetry-otel-cloud-export/05-refactor-summary.md
  • .output/nkda-testdsl/telemetry-otel-cloud-export/06-verification.md
  • .output/nkda-testdsl/telemetry-progress-sink/01-feature-assessment.md
  • .output/nkda-testdsl/telemetry-progress-sink/02-dsl-design.md
  • .output/nkda-testdsl/telemetry-progress-sink/03-extraction-summary.md
  • .output/nkda-testdsl/telemetry-progress-sink/04-conversion-summary.md
  • .output/nkda-testdsl/telemetry-progress-sink/05-refactor-summary.md
  • .output/nkda-testdsl/telemetry-progress-sink/06-verification.md
  • .output/nkda-testdsl/telemetry-tui-metrics-panel/06-verification.md
  • .output/nkda-testdsl/tui-diagnostics-panel/06-verification.md
  • .output/nkda-testdsl/tui-job-detail/06-verification.md
  • .output/nkda-testdsl/tui-job-submission-output/06-verification.md
  • .output/nkda-testdsl/validation-post-flight-correctness-metrics/01-feature-assessment.md
  • .output/nkda-testdsl/validation-post-flight-correctness-metrics/02-dsl-design.md
  • .output/nkda-testdsl/validation-post-flight-correctness-metrics/03-extraction-summary.md
  • .output/nkda-testdsl/validation-post-flight-correctness-metrics/04-conversion-summary.md
  • .output/nkda-testdsl/validation-post-flight-correctness-metrics/05-refactor-summary.md
  • docs/adr/0006-three-channel-observability.md
  • docs/adr/0010-plan-driven-dag-execution.md
  • docs/agent-hosting.md
  • docs/architecture.md
  • docs/control-plane.md
  • docs/migration-process-guide.md
  • docs/observability.md
  • docs/superpowers/plans/2026-07-01-comms-phase-c-completion.md
  • docs/tui-guide.md
  • specs/002-otel-observability-phase2/contracts/progress-api.md
  • src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/IControlPlaneClient.cs
  • src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/IControlPlaneTelemetryClient.cs
  • src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/JobStreamEvent.cs
  • src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/JobTaskList.cs
  • src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/WorkerEvent.cs
  • src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/WorkerEventBatch.cs
  • src/DevOpsMigrationPlatform.Abstractions/Jobs/IJobSubmissionClient.cs
  • src/DevOpsMigrationPlatform.Abstractions/Telemetry/IJobSnapshotStore.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/Commands/ControlPlaneCommandBase.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/Commands/LogsCommand.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/Commands/PrepareCommand.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/Commands/QueueCommand.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/JobRunners/ControlPlaneClient.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/JobRunners/ILogsClient.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/Settings/ControlPlaneBaseCommandSettings.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/Views/TuiLogView.cs
  • src/DevOpsMigrationPlatform.CLI.Migration/Views/TuiMainView.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Controllers/DiagnosticsController.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Controllers/JobStreamController.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Controllers/ProgressController.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Controllers/TelemetryController.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Controllers/WorkerEventsController.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/DiagnosticLogStore.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/DiagnosticLogStoreOptions.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/ILeaseJobResolver.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/InMemoryJobTaskStore.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/JobMetricsStore.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/JobProgressOptions.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/JobProgressStore.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/JobSnapshotStore.cs
  • src/DevOpsMigrationPlatform.ControlPlane/Jobs/StubLeaseJobResolver.cs
  • src/DevOpsMigrationPlatform.ControlPlaneHost/Program.cs
  • src/DevOpsMigrationPlatform.ControlPlaneHost/appsettings.json
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/AgentWorkerBase.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/CoreAgentServiceExtensions.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/ModulePipelineWorkerBase.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/ControlPlaneLoggerProvider.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/ControlPlaneProgressSink.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/ControlPlaneTelemetryClient.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/ControlPlaneTelemetryTimer.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/DiagnosticsServiceExtensions.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/PackageProgressSink.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/TelemetryServiceExtensions.cs
  • src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/UnifiedWorkerEventWriter.cs
  • src/DevOpsMigrationPlatform.MigrationAgent/JobAgentWorker.cs
  • src/DevOpsMigrationPlatform.ServiceDefaults/Diagnostics/FileDiagnosticsExtensions.cs
  • src/DevOpsMigrationPlatform.TfsMigrationAgent/TfsJobAgentWorker.cs
  • tests/DevOpsMigrationPlatform.Abstractions.Tests/Jobs/IJobSubmissionClientContractTests.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/Cli/MigrateLogsDslTests.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/Commands/ControlPlaneClientDiagnosticsTests.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/Commands/ExportRemoteNoFollowTests.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/TUI/DirectJump/TuiDirectJump_DslTests.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/TUI/JobDetail/FakeControlPlaneClient.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/TUI/JobDetail/FakeSseServer.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/TUI/JobDetail/TuiJobDetail_LiveDataStreaming_DslTests.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/TUI/JobDetail/TuiJobDetail_PanelPopulation_DslTests.cs
  • tests/DevOpsMigrationPlatform.CLI.Migration.Tests/TUI/JobList/FaultingControlPlaneClient.cs
  • tests/DevOpsMigrationPlatform.ControlPlane.Tests/Diagnostics/DiagnosticLogStoreTests.cs
  • tests/DevOpsMigrationPlatform.ControlPlane.Tests/Jobs/JobExecutionPlanDslTests.cs
  • tests/DevOpsMigrationPlatform.ControlPlane.Tests/Progress/JobProgressStoreDslTests.cs
  • tests/DevOpsMigrationPlatform.ControlPlane.Tests/Progress/ProgressControllerContext.cs
  • tests/DevOpsMigrationPlatform.ControlPlane.Tests/Progress/ProgressControllerDslTests.cs
  • tests/DevOpsMigrationPlatform.ControlPlane.Tests/Progress/TaskAttributionDslTests.cs
  • tests/DevOpsMigrationPlatform.ControlPlane.Tests/Telemetry/TelemetryControllerDslTests.cs
  • tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/Context/AgentWorkerBaseLeaseCoordinationTests.cs
  • tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/Context/JobAgentWorkerDispatchTests.cs
  • tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests.csproj
  • tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/Telemetry/ControlPlaneProgressSinkContext.cs
  • tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/Telemetry/ControlPlaneProgressSinkTests.cs
  • tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/Telemetry/ControlPlaneTelemetryClientTests.cs
  • tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/Telemetry/ControlPlaneTelemetryTimerTests.cs
  • tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/Telemetry/MockHttpMessageHandler.cs
  • tests/DevOpsMigrationPlatform.TfsMigrationAgent.Tests/TfsJobAgentWorkerTests.cs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-for-comms

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Seven documentation files updated to reflect the unified agent→CP
transport (UnifiedWorkerEventWriter / POST /workers/{id}/events) and
the unified CLI stream (GET /jobs/{id}/stream) that replaced the prior
five separate HTTP paths and four-task CLI fan-out.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03a8523187

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/DevOpsMigrationPlatform.CLI.Migration/Commands/QueueCommand.cs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a unified agent↔control-plane event channel (batched HTTP + unified SSE streaming) and refactors several telemetry/progress storage components, alongside removing a large set of nkda-testdsl generated verification artefacts.

Changes:

  • Added a unified worker event batching pipeline (agent UnifiedWorkerEventWriter → control plane WorkerEventsController) and updated agent-side dispatch to use it.
  • Added a unified job SSE stream endpoint (/jobs/{jobId}/stream) and updated CLI follow-mode to consume it.
  • Refactored control-plane progress/diagnostic in-memory stores to append-only logs with configurable caps; added agent lease heartbeat tracking.

Reviewed changes

Copilot reviewed 159 out of 159 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/DevOpsMigrationPlatform.Infrastructure.Agent.Tests/Context/JobAgentWorkerDispatchTests.cs Updates test wiring to use UnifiedWorkerEventWriter instead of the legacy telemetry client.
src/DevOpsMigrationPlatform.ServiceDefaults/Diagnostics/FileDiagnosticsExtensions.cs Changes diagnostics path resolution behavior (now returns null if not configured).
src/DevOpsMigrationPlatform.MigrationAgent/JobAgentWorker.cs Switches execution-plan push from legacy telemetry client to unified event writer enqueue.
src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/UnifiedWorkerEventWriter.cs New background service that batches and POSTs worker events to the control plane.
src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/TelemetryServiceExtensions.cs Adds DI registration for unified writer; updates composite sink composition to use it.
src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/ControlPlaneProgressSink.cs Changes progress sink buffering from bounded to unbounded channel.
src/DevOpsMigrationPlatform.Infrastructure.Agent/Telemetry/ControlPlaneLoggerProvider.cs Routes diagnostics via unified writer when available; changes channel to unbounded.
src/DevOpsMigrationPlatform.Infrastructure.Agent/AgentWorkerBase.cs Adds periodic lease heartbeat POSTs during job execution.
src/DevOpsMigrationPlatform.ControlPlane/Jobs/StubLeaseJobResolver.cs Extends lease resolver to track last heartbeat timestamps.
src/DevOpsMigrationPlatform.ControlPlane/Jobs/JobProgressStore.cs Replaces ring buffer with append-only log + replay support and max-events safety cap.
src/DevOpsMigrationPlatform.ControlPlane/Jobs/JobProgressOptions.cs Adds MaxEventsPerJob option.
src/DevOpsMigrationPlatform.ControlPlane/Jobs/ILeaseJobResolver.cs Adds heartbeat recording/query API to lease resolver contract.
src/DevOpsMigrationPlatform.ControlPlane/Jobs/DiagnosticLogStoreOptions.cs Adds MaxRecordsPerJob option.
src/DevOpsMigrationPlatform.ControlPlane/Jobs/DiagnosticLogStore.cs Replaces diagnostic ring buffer with append-only log + cap and snapshot filtering.
src/DevOpsMigrationPlatform.ControlPlane/Controllers/WorkerEventsController.cs New batched worker-events ingestion endpoint and dispatch to stores.
src/DevOpsMigrationPlatform.ControlPlane/Controllers/ProgressController.cs Adds heartbeat endpoint (POST /agents/lease/{leaseId}/heartbeat).
src/DevOpsMigrationPlatform.ControlPlane/Controllers/JobStreamController.cs New unified SSE stream that multiplexes progress + diagnostics and replays history.
src/DevOpsMigrationPlatform.CLI.Migration/JobRunners/ControlPlaneClient.cs Adds unified SSE client stream parser returning JobStreamEvent records.
src/DevOpsMigrationPlatform.CLI.Migration/Commands/QueueCommand.cs Refactors follow-mode to consume the unified SSE stream and map to existing UI updates.
src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/WorkerEventBatch.cs New shared DTOs for batched worker events + acknowledgements.
src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/WorkerEvent.cs New shared DTO + enum for worker event types.
src/DevOpsMigrationPlatform.Abstractions/ControlPlaneApi/JobStreamEvent.cs New shared DTO + enum for unified SSE stream events.
.output/nkda-testdsl/validation-post-flight-correctness-metrics/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/validation-post-flight-correctness-metrics/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/validation-post-flight-correctness-metrics/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/validation-post-flight-correctness-metrics/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/validation-post-flight-correctness-metrics/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/tui-job-submission-output/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/tui-job-detail/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/tui-diagnostics-panel/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-tui-metrics-panel/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-progress-sink/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-progress-sink/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-progress-sink/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-progress-sink/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-progress-sink/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-progress-sink/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-otel-cloud-export/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-otel-cloud-export/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-otel-cloud-export/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-otel-cloud-export/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-otel-cloud-export/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-otel-cloud-export/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-idempotency-metric-registration/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-idempotency-metric-registration/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-idempotency-metric-registration/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-idempotency-metric-registration/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-idempotency-metric-registration/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/telemetry-idempotency-metric-registration/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/task-attribution/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/task-attribution/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/task-attribution/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/task-attribution/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/task-attribution/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/task-attribution/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/system-test-ci-execution/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/system-test-ci-execution/00-scenario-test-inventory.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-identity-US2-action-qualified-cursors/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-cadence-US3-fine-grained-progress-save-cadence/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/runtime-state-authority-US1-authoritative-state-scopes/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/project-lifecycle-ephemeral-project-lifecycle/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/parallel-module-execution/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/parallel-module-execution/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/parallel-module-execution/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/parallel-module-execution/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/parallel-module-execution/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/parallel-module-execution/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/package-lock-exclusive-package-lock/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/package-lock-exclusive-package-lock/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/package-lock-exclusive-package-lock/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/package-lock-exclusive-package-lock/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/package-lock-exclusive-package-lock/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/package-lock-exclusive-package-lock/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/observability-tiered-log-levels/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/observability-tiered-log-levels/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/observability-tiered-log-levels/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/observability-tiered-log-levels/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/observability-tiered-log-levels/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/observability-tiered-log-levels/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/module-isolation/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/module-isolation/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/module-isolation/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/module-isolation/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/module-isolation/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/module-isolation/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-submission/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-submission/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-submission/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-submission/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-submission/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-submission/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-lifecycle/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-lifecycle/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-lifecycle/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-lifecycle/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-lifecycle/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/jobs-job-lifecycle/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/job-execution-plan/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/job-execution-plan/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/job-execution-plan/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/job-execution-plan/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/job-execution-plan/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/job-execution-plan/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/iproject-analyser-removal-US3-iproject-analyser-removed/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/inventory-multi-org/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/inventory-multi-org/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/inventory-multi-org/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/inventory-multi-org/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/inventory-multi-org/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/inventory-multi-org/00-scenario-test-inventory.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/inventory-modules/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/import-default-team-detection/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/host-builder-architecture/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/filter-scope-inventory/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/field-transform-field-transform-pipeline/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/field-transform-field-transform-pipeline/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/field-transform-field-transform-pipeline/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/field-transform-field-transform-pipeline/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/field-transform-field-transform-pipeline/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/field-transform-field-transform-pipeline/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/discover-work-items/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/config-polymorphic-endpoint-config/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/config-polymorphic-endpoint-config/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/config-polymorphic-endpoint-config/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/config-polymorphic-endpoint-config/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/config-polymorphic-endpoint-config/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/config-polymorphic-endpoint-config/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/agent-job-context/06-verification.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/agent-job-context/05-refactor-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/agent-job-context/04-conversion-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/agent-job-context/03-extraction-summary.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/agent-job-context/02-dsl-design.md Removes generated nkda-testdsl artefact (cleanup).
.output/nkda-testdsl/agent-job-context/01-feature-assessment.md Removes generated nkda-testdsl artefact (cleanup).
Comments suppressed due to low confidence (1)

src/DevOpsMigrationPlatform.MigrationAgent/JobAgentWorker.cs:579

  • Job.Ready is emitted immediately after EnqueueTasks. Since EnqueueTasks is fire-and-forget (and the writer batches on a timer), the control plane may not have the task list yet when clients react to Job.Ready (previously PushTaskListAsync was awaited). If Job.Ready is meant to guarantee plan availability, this reintroduces a race.

Comment thread src/DevOpsMigrationPlatform.CLI.Migration/Commands/QueueCommand.cs
Comment thread src/DevOpsMigrationPlatform.CLI.Migration/Commands/QueueCommand.cs
Comment thread src/DevOpsMigrationPlatform.CLI.Migration/Commands/QueueCommand.cs
Comment thread src/DevOpsMigrationPlatform.Infrastructure.Agent/AgentWorkerBase.cs Outdated
Comment thread src/DevOpsMigrationPlatform.MigrationAgent/JobAgentWorker.cs
MrHinsh and others added 18 commits June 30, 2026 19:50
…hannel

Three root causes fixed that caused all 7 failing integration tests:

1. WorkerEventKind serialised as string by agent (JsonStringEnumConverter)
   but CP deserialised without it — every event batch returned 400, silently
   discarding all progress events.  Fix: add JsonStringEnumConverter to the
   global AddJsonOptions in ControlPlaneHost/Program.cs.

2. UnifiedWorkerEventWriter flush race — background loop dequeued events into
   a local batch before setting _currentFlush, so FlushAsync() could see an
   empty channel and a completed task and return before the batch was POST'd.
   Fix: replace _currentFlush with a SemaphoreSlim(_cycleLock) held for the
   entire read+flush cycle so FlushAsync() is forced to wait for any
   in-progress batch.

3. ProgressEvent.EventSequence was always 0 when flowing through the unified
   channel; JobStreamController seq tracking and post-completion replay added;
   IFlushable registration for UnifiedWorkerEventWriter added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ignalTerminalAsync refactor

Tests invoked OnJobAsync/OnDiscoveryJobAsync directly via reflection, bypassing the
poll loop that sets ActiveLeaseState.CurrentLeaseId, so terminal events were silently
dropped by UnifiedWorkerEventWriter before ever reaching the mock HTTP handler. Wire
the UnifiedWorkerEventWriter HTTP client into the shared mock handler, set the active
lease before invoking, and assert on the new /workers/{id}/events Terminal payload
shape instead of the removed legacy /fail and /complete endpoints.
…d re-enable compilation

Test file was excluded from the project via a stale <Compile Remove> and missing
a project reference to MigrationAgent, and asserted the legacy /fail HTTP path
that SignalTerminalAsync no longer uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
UnifiedWorkerEventWriter is always registered now, so the fallback POST to
/agents/lease/{leaseId}/diagnostics was unreachable dead code.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…elemetryClient

The net10.0 JobAgentWorker was already using UnifiedWorkerEventWriter.EnqueueTasks
for this; TfsJobAgentWorker (net481) was missed, leaving the last live consumer
of IControlPlaneTelemetryClient. Fixing this unblocks deleting that legacy client.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tryClient

Both superseded by UnifiedWorkerEventWriter. Removes their DI registration
helpers, the AddControlPlaneTelemetryClient call site, and their dedicated
tests; the shared MockHttpMessageHandler moves to its own file since
surviving tests still use it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…erences

Interface had no implementation or consumers left. Doc comments in
DiagnosticsServiceExtensions, PackageProgressSink, UnifiedWorkerEventWriter,
and CoreAgentServiceExtensions updated to describe the unified event channel.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Export --follow: restore task-list and metrics flow (bootstrap on Job.Ready,
  final fetch at terminal for fast jobs, 5s metrics poll) — display no longer
  sticks on Initialising after the Phase E fan-out removal
- WorkerEventsController: reject batches whose WorkerId doesn't match the route
- AgentWorkerBase: log non-success heartbeat responses (stale/unknown lease)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
When the diagnostic channel completed before the progress channel,
Task.FromCanceled was called with an un-cancelled token, throwing
ArgumentOutOfRangeException and aborting the response before job-ended
was written — clients saw "response ended prematurely" and exited 1.
Park the completed channel on a never-completing task instead.

Also derive the already-complete check from the progress store's own
Completed flag rather than the diagnostic store's.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The two "ring buffer eviction" tests failed deterministically in every run
(mislabelled as flake): they set the dead legacy Capacity option and asserted
evict-oldest semantics that Phase D intentionally replaced with append-only +
discard-new-at-cap. Tests now assert the real contract via MaxEventsPerJob /
MaxRecordsPerJob; the dead Capacity properties and stale appsettings entry
are removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nnel

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…uence

Transport drops now resume from the last observed progress sequence via the
stream's ?from= replay (up to 5 attempts, then a synthetic failed terminal
with an actionable message) instead of surfacing a raw transport exception.
JobStreamController logs any exception that aborts an in-flight stream so
server-side aborts are diagnosable.

Note: CLI subprocess tests stage bin/Release binaries — the recurring
"response ended prematurely" failures were stale Release builds predating
the comms fixes; 6/6 green after a Release rebuild.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants