Skip to content

feat(console): drill down from operations alert posture counts - #13

Draft
knowlet wants to merge 3 commits into
mainfrom
feat/operations-alert-posture-drilldown
Draft

knowlet wants to merge 3 commits into
mainfrom
feat/operations-alert-posture-drilldown

Conversation

@knowlet

@knowlet knowlet commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Make the SOC operations Alert posture counters and severity/status breakdowns open the matching alert grid. Keep drilldown filters consistent through chip removal, reloads and browser history, and prevent an automatic saved-view default from replacing an explicit drilldown.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change
  • Documentation update
  • Refactor / tech debt
  • CI / infra change

Related issues

No linked issue. This includes the review corrections for this feature branch.

Changes

  • Link Total, New (24h), Critical open, severity segments and disposition entries to the corresponding alert-grid filters. Unknown statuses keep their real labels.
  • Add opt-in unresolved_only and created_within_hours API filters, using the same unresolved predicate and created_at column as the statistics endpoint. Tenant scope remains bound to the authenticated principal.
  • Synchronize changed/cleared filters with the URL while preserving unrelated query values, fragments and local sort/page-size settings. Read URL-owned fields through the live router so cached server props cannot revive removed filters after Back/Forward.
  • Give explicit drilldowns, including Total, precedence over a default saved view. Manual preset selection remains available.
  • Preserve anchor attributes in the test's Link mock; compare SQLAlchemy's list/tuple expanding bind against the complete terminal-status set.
  • Test actual HTTP query names, including the responder queue's pageSize: 100 call, omission of unset values and explicit false.
  • Improve empty-state guidance and visible keyboard focus, add five browser journeys, update usage documentation/OpenAPI, and add the Unreleased changelog entry.
  • Rebase on upstream main at 143c706 (v23.5.3).

Testing

The web unit/coverage, web build, and web lint/type-check CI jobs are green for head a3f3a23. Remote Vitest confirms the same 1,303 passing tests and coverage percentages below. The complete Python test job is still running.

  • Unit tests added / updated
  • Focused integration tests pass locally
  • Manually tested in a real browser during this revision
Verification Result
Original dashboard regression Reproduced: 20 passed, 1 failed
Original tenant-isolation module Reproduced: 18 passed, 1 failed
Complete web Vitest suite + coverage 130 files, 1,303 tests passed
Web coverage Statements 60.90%, branches 56.76%, functions 53.09%, lines 62.81%; every existing threshold passed
ESLint / TypeScript 0 lint errors, no new warnings; type-check passed
Fixed tenant-isolation module 19 passed
Actual API + PostgreSQL integration 14 checks passed over real HTTP, authentication, SQLAlchemy and the restricted database role; fresh database with all 160 migrations
Python pre-push gates Ruff lint/format passed; mypy baseline unchanged at 986 existing findings
OpenAPI / repository policy checks Generated schema matches; attribution and naming gates passed
Negative controls Removing HTTP key mapping, URL synchronization or saved-default protection causes the corresponding regression tests to fail
Playwright in actual Chromium All five new journeys passed; complete journey suite: 20 passed, 1 pre-existing skipped

Web validation used Node 22.23.5 and pnpm 8.15.1. The successful full coverage run used --maxWorkers=2 after default-concurrency runs competed with other validation processes; no test timeout or coverage threshold was changed. The existing 95 ESLint warnings are unchanged.

The complete API suite ran with the CI command and locked service environment: 5,500 passed, 266 skipped, 1 xfailed, 18 failed. Every failure reproduces on pre-feature commit 7fcfa5d: eleven are caused by the inherited SOCKS proxy setting and seven by unavailable public DNS. All eleven proxy-related cases pass unchanged when only ALL_PROXY/all_proxy are unset. The DNS-dependent cases remain a local environment limitation; this is not a clean full local API run.

The real API/PostgreSQL checks cover statistics/list equivalence, unresolved and creation-time semantics, combined filters, pagination, time-bound validation, authentication and cross-tenant isolation. API lifespan workers and other microservices were not started, so this is focused integration, not a full-stack smoke run.

Browser verification steps
  1. Open the operations dashboard and follow Total, New (24h), Critical open, and severity/status links. Check the selected grid, rows and Escalated label.
  2. Remove each filter and reload; remove the final filter and confirm the alerts grid remains selected. Verify unrelated query parameters and fragments survive.
  3. Remove a filter, navigate away, and traverse Back, Forward and Back; confirm the old filter stays removed.
  4. Open a drilldown with a conflicting saved default. Confirm the URL wins, then manually select the preset and confirm it applies.
  5. Tab to a bar segment, inspect its visible unclipped outline, and press Enter to navigate.

These cases are encoded in apps/web/e2e/journeys/alerts-drilldown.spec.ts.

Screenshots

Not captured in this revision. The Buyer journey CI job passed on the PR merge for head a3f3a23, including all five new navigation/focus tests. Local Chromium startup was blocked by the execution policy's UNIX-socket restriction, so the browser assertions were executed in CI.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review
  • Regression tests prove the fixes and include negative controls
  • All new and existing unit tests pass locally — web and the focused API module pass; the complete API run has the environment limitations above
  • Documentation and CHANGELOG are updated
  • No new linter warnings
  • Diff checked for sensitive data and credentials

Eval harness

Before: Not applicable.

After: Not applicable.

  • Not applicable — this PR does not touch substrate, playbooks, detections, or eval inputs
  • No axis regressed
  • An axis regressed

@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@sourcery-ai

sourcery-ai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Extend the shared alert-filter type with opt-in unresolved-only and creation-time-window fields used by the client and API.

  • apps/web/src/lib/api.ts L2123-2126

API

Add optional alert-list predicates for canonical unresolved statuses and created_at windows while retaining the endpoint's authenticated tenant scope.

  • services/api/app/api/v1/endpoints/alerts.py L805-809, L886-892 (+2 small edits)

Document the new alert-list query parameters in the OpenAPI contract and advance its version.

  • docs/openapi.yaml L6, L779-797

Uses of the API

Translate the web alert-filter fields to the backend's query parameter names and omit fields that are not set.

  • apps/web/src/lib/api.ts L2170, L2180-2187

Implementation

Validate drill-down query values consistently and select Alerts mode when a valid filter or explicit Alerts view is present.

  • apps/web/src/lib/alertDrilldown.ts L1-25

UI

Read and validate alert drill-down parameters at the Alerts route, then initialize the grid with the requested filters and view.

  • apps/web/src/app/(app)/alerts/page.tsx L2, L8-34

Make posture KPIs, severity and status segments, and their legend entries accessible links to matching alert-grid filters.

  • apps/web/src/components/dashboard/operations/AlertPosturePanel.tsx L114-142, L196-207, L212-221 (+7 small edits)

Hydrate the alert grid from live URL state, synchronize filter changes with the URL, and expose removable drill-down filters and clearer empty-state guidance.

  • apps/web/src/components/alerts/AlertsView.tsx L252-281, L395-417, L441-458 (+9 small edits)

Prevent saved defaults from overriding an explicit drill-down while preserving manual preset selection and accessible selected-state signaling.

  • apps/web/src/components/saved-views/SavedViewsBar.tsx L61-276 (6 small edits)

Configuration

Advance the application version metadata and Helm chart version to the release carrying this feature.

  • VERSION L1
  • apps/web/package.json L3
  • infra/helm/aisoc/Chart.yaml L37, L43

Documentation

Document posture drill-down links, filter semantics, URL behavior, and tenant scoping for console users.

  • apps/docs/docs/console/operations-dashboard.md L47-58

Record the feature and navigation fixes in the unreleased changelog.

  • CHANGELOG.md L10-29

Refresh the release overview to describe the current release and retain the previous release notes.

  • RELEASES.md L5-7, L61-75

Update the README version badge for the release.

  • README.md L9

Tests

Verify the alert-list client sends the expected backend query names, preserves existing filters, and omits unset values.

  • apps/web/src/lib/api.alerts-list.test.ts L165-238

Check endpoint filter predicates, opt-in behavior, and tenant scoping for posture drill-down requests.

  • services/api/tests/test_alerts_tenant_isolation.py L38, L60, L353-403

Exercise the Alerts route and view across deep-link hydration, filter changes, history restoration, defaults, and unknown statuses.

  • apps/web/src/components/alerts/AlertsDrilldown.test.tsx L1-302

Verify every posture counter and breakdown link has the expected filtered Alerts destination.

  • apps/web/src/components/dashboard/operations/OperationsDashboard.test.tsx L43-44, L298-322

Check saved-view defaults are suppressed for explicit drill-downs without disabling manual preset selection.

  • apps/web/src/components/saved-views/SavedViewsBar.test.tsx L234-285

Refresh generated documentation data and language-model indexes for the release.

  • apps/docs/static/data/scoreboard.json L7-8
  • apps/docs/static/llms-full.txt L6, L130
  • apps/docs/static/llms.txt L9

Lock files and vendored code

Regenerate the web end-to-end browser coverage for alert posture drill-down navigation and filter persistence.

  • apps/web/e2e/journeys/alerts-drilldown.spec.ts L1-230

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@knowlet
knowlet force-pushed the feat/operations-alert-posture-drilldown branch 3 times, most recently from c941ad8 to aac95ec Compare November 19, 2026 06:41
beenuar and others added 3 commits November 19, 2026 22:41
## v23.5.3 — connector data completeness, community end to end

Both defects were reported with failing tests by @pavancharak **against
the shipped v23.5.2 tag**
([beenuar#1970](beenuar#1970),
[beenuar#1971](beenuar#1971)); both fixed by
first-time contributor @Varshith-Kali in
[beenuar#1973](beenuar#1973). Fixing `main` fixes
no tag — deployments pulling v23.5.2 keep silently losing rows on these
paths until a release carries the fix, which is the bar for this patch.

### What the tag gets
1. **Checkpoint cursors compare instants, not text** — `…10:00:00.500Z`
no longer drops against a `…10:00:00Z` cursor (`.` sorts before `Z`),
offset-written cursors no longer drop later rows, the staged cursor
names the newest instant with id tie-breaks, and an unparseable time
keeps its row rather than losing it.
2. **Huntress / Cisco Secure Endpoint / Sophos Central stop losing
scheduler-skipped intervals** — each persists an event-time cursor
(Huntress on `sent_at`, preserving raise-once), overlaps one poll
interval so a single skipped run is covered before any cursor exists,
and skips are logged (`connector.scheduler.poll_skipped`). Overlap
re-reads drop against the cursor: a re-request, never a duplicate or a
loss.

**Verified, not asserted:** 449 connector tests pass on the fix; the new
instant-ordering suite fails 5/8 against the pre-fix tree.

### Mechanics
`VERSION` 23.5.3 · CHANGELOG `[23.5.3]` cut (entries landed in beenuar#1974) ·
RELEASES.md TL;DR + What's-new · README badge · chart `7.24.3`/`v23.5.3`
· `apps/web/package.json` · scoreboard refreshed (0.97, pinned to
`420c707f`) · llms/openapi regenerated · changelog-frozen,
single-version, readme-gates, papers, competitor gates green locally.

**No breaking changes.** One observable note: the three converted
connectors emit batches oldest-first by event time rather than page
order. Tag goes on the merge commit; release.yml publishes; registry
verified after.

Co-authored-by: beenuar <beenuar@users.noreply.github.com>
Make Total, New (24h), Critical open, and severity/disposition counts
navigate to a filtered alert grid, with query-driven tab selection and
removable filter chips. Preserve canonical unresolved-status semantics
and filter creation-time windows using the same column as the KPI.

Add regression tests, OpenAPI schema updates, and documentation.
Preserve unknown backend statuses' true labels in filtered results.

Signed-off-by: Albert Hsieh <knowlet@users.noreply.github.com>
Synchronize filter changes with the URL and read validated live query parameters when history restores cached page props. Preserve explicit drilldowns over automatic saved-view defaults while allowing manual presets. Improve empty-state guidance and keyboard focus.

Fix the link mock and SQLAlchemy collection assertions, test the alerts HTTP parameter contract, and add reload/history and saved-view regressions with an Unreleased changelog entry.

Signed-off-by: Albert Hsieh <knowlet@users.noreply.github.com>
@knowlet
knowlet force-pushed the feat/operations-alert-posture-drilldown branch from aac95ec to a3f3a23 Compare November 19, 2026 14:38

This branch has not been deployed

No deployments
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