Refactor Control Plane communication and enhance event handling#131
Refactor Control Plane communication and enhance event handling#131MrHinsh wants to merge 22 commits into
Conversation
… (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>
|
Important Review skippedToo many files! This PR contains 226 files, which is 76 over the limit of 150. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (226)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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>
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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 planeWorkerEventsController) 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.
…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>
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 intoPOST /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).POST /agents/lease/{leaseId}/heartbeatevery 15 s.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/DiagnosticLogStoreare append-only logs (full replay for reconnecting clients) with safety caps (MaxEventsPerJob/MaxRecordsPerJob, default 50k, discard-with-warning at cap). Dead ring-bufferCapacityoptions removed.ControlPlane → CLI
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
JsonStringEnumConverter)Task.FromCanceledwith un-cancelled token)<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