Skip to content

Enhance security, performance, and implement failure management features - #157

Open
debdevops wants to merge 17 commits into
developfrom
feature/failure-signature-lifecycle
Open

Enhance security, performance, and implement failure management features#157
debdevops wants to merge 17 commits into
developfrom
feature/failure-signature-lifecycle

Conversation

@debdevops

Copy link
Copy Markdown
Owner

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Other (describe above)

Checklist

  • dotnet build services/api/ServiceHub.sln --configuration Release passes with zero warnings
  • npm run -w apps/web build passes with zero warnings
  • Backend unit/integration tests pass (dotnet test)
  • Frontend tests pass (npm run -w apps/web test)
  • New/changed behavior has test coverage
  • No secrets, connection strings, or credentials added to source or logs
  • Docs updated if user-facing behavior changed (README, CHANGELOG, or docs/)

Screenshots (UI changes only)

Copilot AI review requested due to automatic review settings August 2, 2026 16:00

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 expands “Failure Signature Intelligence” across backend + frontend by adding signature lifecycle state, operational knowledge version history, and a cancellable “signature replay” job flow, along with UI pages to browse and manage signatures.

Changes:

  • Add signature lifecycle tracking (Active/Resolved/Reopened/Suppressed/Archived) and trend labeling (“New/Recurring/Escalating”).
  • Add operational knowledge editing enhancements: UpdatedBy plus persisted knowledge version history and history API.
  • Add signature replay preview/start + job polling/cancellation endpoints and corresponding UI hooks/pages/components.

Reviewed changes

Copilot reviewed 76 out of 135 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/api/tests/ServiceHub.UnitTests/Shared/Helpers/SignatureTrendHeuristicTests.cs Adds unit tests for signature trend heuristic labels.
services/api/tests/ServiceHub.UnitTests/Infrastructure/SignatureReplay/SignatureReplayExecutorTests.cs Adds executor tests for replay success/failure/skip/cancel scenarios.
services/api/tests/ServiceHub.UnitTests/Infrastructure/SignatureLifecycleServiceTests.cs Adds tests for lifecycle transitions, isolation, and batching.
services/api/tests/ServiceHub.UnitTests/Infrastructure/NamespaceSignatureLookupServiceTests.cs Adds tests for new GetByHashAsync read-only lookup.
services/api/tests/ServiceHub.UnitTests/FailureKnowledgeServiceTests.cs Updates tests for knowledge updates, UpdatedBy, and history snapshots.
services/api/tests/ServiceHub.UnitTests/Core/DTOs/UpsertKnowledgeRequestValidationTests.cs Adds validation tests for new upsert knowledge request DTO.
services/api/tests/ServiceHub.UnitTests/Api/Controllers/V1/SignatureReplayControllerTests.cs Adds controller tests for intent headers + job endpoints.
services/api/src/ServiceHub.Shared/Helpers/SignatureTrendHeuristic.cs Introduces deterministic “trend” heuristic computation.
services/api/src/ServiceHub.Shared/Constants/ApiRoutes.cs Adds routes for signature detail/timeline/status/knowledge/history/replay + job polling.
services/api/src/ServiceHub.Infrastructure/SignatureReplay/SignatureReplayJobStore.cs Implements in-memory job storage + cancellation.
services/api/src/ServiceHub.Infrastructure/SignatureReplay/SignatureReplayExecutor.cs Implements sequential replay execution with progress + failure sampling.
services/api/src/ServiceHub.Infrastructure/SignatureLifecycleService.cs Adds in-memory lifecycle state store + transition validation.
services/api/src/ServiceHub.Infrastructure/Persistence/Migrations/DlqDbContextModelSnapshot.cs Updates EF snapshot for knowledge UpdatedBy + new history table.
services/api/src/ServiceHub.Infrastructure/Persistence/Migrations/20260802145305_AddFailureKnowledgeHistory.cs Adds migration for FailureKnowledgeHistory + UpdatedBy column.
services/api/src/ServiceHub.Infrastructure/Persistence/DlqDbContext.cs Registers FailureKnowledgeHistory entity mapping + UpdatedBy constraints.
services/api/src/ServiceHub.Infrastructure/NamespaceSignatureLookupService.cs Adds read-only GetByHashAsync implementation.
services/api/src/ServiceHub.Infrastructure/FailureKnowledgeService.cs Adds knowledge history snapshotting + history retrieval; adds UpdatedBy.
services/api/src/ServiceHub.Infrastructure/DlqHistoryService.cs Adds GetByIdsAsync multi-fetch helper for signature-related messages.
services/api/src/ServiceHub.Infrastructure/DependencyInjection.cs Wires new services (lifecycle singleton, signature replay services/job store).
services/api/src/ServiceHub.Infrastructure/BulkOperations/BulkOperationExecutor.cs Exposes entity/subscription resolver for signature replay reuse.
services/api/src/ServiceHub.Core/Models/SignatureLifecycle.cs Adds lifecycle snapshot + event models.
services/api/src/ServiceHub.Core/Models/FailureKnowledgeHistoryEntry.cs Adds API-facing model for knowledge version history entries.
services/api/src/ServiceHub.Core/Models/FailureKnowledge.cs Extends knowledge model with optional UpdatedBy.
services/api/src/ServiceHub.Core/Interfaces/ISignatureReplayService.cs Adds interface for preview/start/get/cancel signature replay jobs.
services/api/src/ServiceHub.Core/Interfaces/ISignatureReplayJobStore.cs Adds in-memory job store contract + mutable job state model.
services/api/src/ServiceHub.Core/Interfaces/ISignatureReplayExecutor.cs Adds executor contract for background job processing.
services/api/src/ServiceHub.Core/Interfaces/ISignatureLifecycleService.cs Adds lifecycle service contract.
services/api/src/ServiceHub.Core/Interfaces/INamespaceSignatureLookupService.cs Adds GetByHashAsync to read signatures without mutating counts/timestamps.
services/api/src/ServiceHub.Core/Interfaces/IFailureKnowledgeService.cs Adds knowledge history retrieval API.
services/api/src/ServiceHub.Core/Interfaces/IDlqHistoryService.cs Adds GetByIdsAsync contract for resolving related messages.
services/api/src/ServiceHub.Core/Enums/SignatureLifecycleStatus.cs Introduces lifecycle status enum.
services/api/src/ServiceHub.Core/Entities/FailureKnowledgeHistoryEntity.cs Adds EF entity for persisted knowledge version snapshots.
services/api/src/ServiceHub.Core/Entities/FailureKnowledgeEntity.cs Adds UpdatedBy and updates tags delimiter documentation.
services/api/src/ServiceHub.Core/DTOs/Responses/DlqSignatureResponses.cs Expands signature responses; adds knowledge history + lifecycle response shapes.
services/api/src/ServiceHub.Core/DTOs/Responses/DlqResponses.cs Adds string-length validation for notes fields.
services/api/src/ServiceHub.Core/DTOs/Requests/UpsertKnowledgeRequest.cs Adds request DTO with validation annotations.
services/api/src/ServiceHub.Core/DTOs/Requests/SignatureReplayRequests.cs Adds request DTOs for signature replay preview/start scopes.
services/api/src/ServiceHub.Core/DTOs/Requests/MarkForReviewRequest.cs Adds request DTO for knowledge review due date.
services/api/src/ServiceHub.Api/wwwroot/index.html Updates referenced hashed asset filenames.
services/api/src/ServiceHub.Api/wwwroot/assets/useSubscriptions-Baw_o8yr.js Updates bundled subscription hook asset references.
services/api/src/ServiceHub.Api/wwwroot/assets/useMessages-CEj5z1Fk.js Adds new bundled messages hook asset.
services/api/src/ServiceHub.Api/wwwroot/assets/useMessages-BSnAvIl-.js Removes old bundled messages hook asset.
services/api/src/ServiceHub.Api/wwwroot/assets/useHealth-D9C9NyDC.js Updates bundled health hook asset references.
services/api/src/ServiceHub.Api/wwwroot/assets/SignatureListPage-JU7m1UD8.js Adds bundled signatures list page asset.
services/api/src/ServiceHub.Api/wwwroot/assets/SignatureDetailsPage-DaHdqddp.js Adds bundled signature details page asset.
services/api/src/ServiceHub.Api/wwwroot/assets/CopyButton-CjfK2dyd.js Removes old bundled copy button asset.
services/api/src/ServiceHub.Api/wwwroot/assets/CopyButton-BlTwaWwU.js Adds new bundled copy button asset.
services/api/src/ServiceHub.Api/wwwroot/assets/ConfirmDialog-6QYJwtdw.js Updates bundled confirm dialog asset references.
services/api/src/ServiceHub.Api/Security/IntentHeaders.cs Adds explicit intent value for signature replay.
services/api/src/ServiceHub.Api/Controllers/V1/SignatureReplayController.cs Adds replay preview/start + job get/cancel endpoints with intent guard + audit logs.
services/api/README.md Updates Docker section heading.
SECURITY.md Replaces “Unreleased” entry with versioned release entry.
README.md Updates product roadmap copy to include Failure Signature Intelligence.
packages/servicehub-ui-shared/src/lib/api/signatureReplay.ts Adds UI-shared client for signature replay endpoints + types.
packages/servicehub-ui-shared/src/lib/api/intentHeaders.ts Adds signature:replay intent header constant.
packages/servicehub-ui-shared/src/lib/api/dlqSignatures.ts Expands DLQ signatures API/types: detail/timeline/status/knowledge/history.
packages/servicehub-ui-shared/src/hooks/useSignatureReplay.ts Adds React Query hooks for preview/start/poll/cancel signature replay jobs.
packages/servicehub-ui-shared/src/tests/lib/api/signatureReplay.test.ts Adds unit tests for signature replay API client mapping + headers.
packages/servicehub-ui-shared/src/tests/lib/api/dlqSignatures.test.ts Updates/extends tests for expanded signatures API methods.
packages/servicehub-ui-shared/src/tests/hooks/useSignatureReplay.test.tsx Adds tests for signature replay hooks (polling/invalidation/cancel).
apps/web/src/router.tsx Adds routes for signature list + signature details pages.
apps/web/src/pages/SignatureDetailsPage.tsx Adds signature details UI page (timeline, lifecycle actions, replay, related msgs).
apps/web/src/pages/DlqHistoryPage.tsx Minor UI copy update (“Clear filters”).
apps/web/src/pages/ConnectPage.tsx Improves form accessibility via htmlFor + id wiring.
apps/web/src/pages/AuditPage.tsx Improves accessibility/keyboard interaction for audit list + clear search aria label.
apps/web/src/components/messages/RefreshIndicator.tsx Removes refresh indicator component.
apps/web/src/components/layout/Footer.tsx Switches Help link to client-side route.
apps/web/src/components/fab/MessageSendFAB.tsx Removes old mock FAB implementation.
apps/web/src/components/fab/index.ts Updates FAB exports after removals.
apps/web/src/components/dlq/StatusBadge.tsx Adds lifecycle status styles and introduces TrendBadge.
apps/web/src/components/dlq/SignatureTimelinePanel.tsx Adds UI timeline rendering for signature timeline events.
apps/web/src/components/dlq/SignatureReplayProgressPanel.tsx Adds floating progress card for signature replay jobs.
apps/web/src/components/dlq/SignatureLifecycleActions.tsx Adds lifecycle transition action buttons (client-side matrix mirror).
apps/web/src/components/dlq/KnowledgeHistoryPanel.tsx Adds UI panel for viewing knowledge version history.
apps/web/src/components/dlq/index.ts Exports new signature-related DLQ components.
apps/web/src/components/dlq/DlqSignaturesPanel.tsx Adds “View details” link + passes namespace to investigation panel.
apps/web/src/components/ai/AIFindingsDropdown.tsx Improves responsiveness via max-width constraint.
apps/web/src/tests/pages/SignatureListPage.test.tsx Adds unit tests for signatures list page filtering/rendering.
apps/web/src/tests/pages/SignatureDetailsPage.test.tsx Adds unit tests for signature details page behavior + replay flow.
apps/web/src/tests/components/messages/RefreshIndicator.test.tsx Removes tests for removed refresh indicator component.
apps/web/src/tests/components/dlq/StatusBadge.test.tsx Updates tests for new statuses and TrendBadge.
apps/web/src/tests/components/dlq/SignatureTimelinePanel.test.tsx Adds tests for timeline panel rendering + details chips.
apps/web/src/tests/components/dlq/SignatureReplayProgressPanel.test.tsx Adds tests for replay progress panel behavior.
apps/web/src/tests/components/dlq/SignatureReplayPreviewModal.test.tsx Adds tests for replay preview modal behavior.
apps/web/src/tests/components/dlq/SignatureLifecycleActions.test.tsx Adds tests for lifecycle actions visibility/behavior.
apps/web/src/tests/components/dlq/KnowledgeHistoryPanel.test.tsx Adds tests for knowledge history UI (demo mode/loading/empty/data).
apps/web/src/tests/components/dlq/KnowledgeEditDialog.test.tsx Adds tests for knowledge editor dialog validation/submit/demo-mode.
apps/web/src/tests/components/dlq/DlqSignaturesPanel.test.tsx Updates tests for details link + router wrapping.
apps/web/README.md Updates docs for new pages and refreshes last-updated text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +98 to +101
var messages = await _dbContext.DlqMessages
.Where(m => job.MessageIds.Contains(m.Id))
.OrderBy(m => m.DetectedAtUtc)
.ToListAsync(cancellationToken);
Tags = entity.Tags,
ReviewDueAt = entity.ReviewDueAt,
UpdatedBy = entity.UpdatedBy,
UpdatedAt = entity.LastUpdatedAt ?? entity.CreatedAt,
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