feat(ui): add datasource/dataset picker to policy override dialog#79
Merged
feat(ui): add datasource/dataset picker to policy override dialog#79
Conversation
- Add migration 028_team_policies.sql with tables: - team_policies: Team default policy configuration - team_policy_overrides: Dataset/tag-specific overrides - team_queue_limits: Per-team rate limits and concurrency - dataset_tags: Dataset-to-tag mapping for policy selectors - Add TeamPolicyRepository with CRUD operations for all entities - Add PolicyAction enum (auto, review, issue_only) - Add dataclasses: TeamPolicy, TeamPolicyOverride, TeamQueueLimits - Add comprehensive unit tests (28 tests, all passing) Part of fn-24: Month 0-2: Triage + Policy Engine Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add PolicyService with precedence-based evaluation: - Dataset overrides > Tag overrides > Team default > System defaults - Add severity-based action resolution: - Auto-investigate above min severity threshold - Require review below max severity threshold - Add QueueConfig dataclass for rate limiting settings - Add IssueContext and PolicyResult for API integration - Add evaluate_policy_for_issue convenience function - Add comprehensive unit tests (19 tests, all passing) Part of fn-24.2: Policy engine: evaluate team + dataset rules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Integrate policy evaluation after issue creation from webhooks - AUTO action starts investigation via Temporal (if configured) - REVIEW action sends notification for manual review - ISSUE_ONLY action creates issue without additional action - Add policy_action and investigation_id to WebhookIssueResponse - Add get_default_team_for_tenant helper to TeamPolicyRepository - Add 6 new unit tests for policy-driven integration actions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…limits - Add InvestigationQueue with per-team job routing and priority support - Add RedisRateLimiter using sliding window algorithm (Lua script) - Add InvestigationWorker to process jobs and start Temporal workflows - Support retry with exponential backoff for failed jobs - Jobs isolated per team - failures don't block other teams - Add 25 unit tests for queue and rate limiter - Add redis>=5.0.0 dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add RedisSSEEventStore for persistent run event storage - Events survive process restart with configurable TTL - Replay window reads from Redis instead of in-memory dicts - Add RedisRateLimitMiddleware with sliding window algorithm - Rate limiting uses per-tenant identifiers (tenant > API key > IP) - Both components fail open on Redis errors for reliability - Include InMemoryFallbackSSEEventStore for local development Components: - adapters/sse/redis_event_store.py: Event store with sequencing and TTL - middleware/redis_rate_limit.py: Distributed rate limiting Tests: 41 unit tests for event store and rate limit middleware Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create TeamPolicyEditor component with policy management: - Default policy configuration (action, severity thresholds) - Dataset/tag override management with CRUD operations - Queue limits configuration (rate limits, burst, concurrency) - Integrate policy editor into teams-settings.tsx with settings button - Update teams API routes with policy management endpoints - Regenerate frontend API client with new policy types and hooks fn-24.6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add migration for analytics_events table with tenant_activation tracking - Create materialized view for weekly usage aggregates - Add AnalyticsService with event recording and aggregation methods - Create /api/v1/analytics endpoints: - GET /weekly-usage: Weekly metrics with resolution rates - GET /activation: Tenant activation status - GET /activation/funnel: Cross-tenant funnel metrics - POST /refresh: Refresh materialized view - Add comprehensive unit tests (16 tests) - Document how to query metrics via API and SQL fn-24.7 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 028_team_policies.sql and 029_analytics_events.sql to the explicit migration list in the demo command. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The teams router already has prefix="/teams" defined, so including it with an additional prefix="/teams" created duplicate routes at /api/v1/teams/teams/. Remove the duplicate registration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Radix UI Select doesn't allow empty string values for SelectItem. Use '__none__' as a placeholder value and convert to/from empty string when reading/writing the state. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace the simple text input for dataset ID with a proper datasource dropdown and dataset search autocomplete, matching the UX pattern from the New Investigation page. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
bordumb
added a commit
that referenced
this pull request
Jan 22, 2026
* feat(policy): add team policies data model and migrations - Add migration 028_team_policies.sql with tables: - team_policies: Team default policy configuration - team_policy_overrides: Dataset/tag-specific overrides - team_queue_limits: Per-team rate limits and concurrency - dataset_tags: Dataset-to-tag mapping for policy selectors - Add TeamPolicyRepository with CRUD operations for all entities - Add PolicyAction enum (auto, review, issue_only) - Add dataclasses: TeamPolicy, TeamPolicyOverride, TeamQueueLimits - Add comprehensive unit tests (28 tests, all passing) Part of fn-24: Month 0-2: Triage + Policy Engine Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(policy): add policy evaluation service - Add PolicyService with precedence-based evaluation: - Dataset overrides > Tag overrides > Team default > System defaults - Add severity-based action resolution: - Auto-investigate above min severity threshold - Require review below max severity threshold - Add QueueConfig dataclass for rate limiting settings - Add IssueContext and PolicyResult for API integration - Add evaluate_policy_for_issue convenience function - Add comprehensive unit tests (19 tests, all passing) Part of fn-24.2: Policy engine: evaluate team + dataset rules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(integrations): add policy-driven actions for webhook issues - Integrate policy evaluation after issue creation from webhooks - AUTO action starts investigation via Temporal (if configured) - REVIEW action sends notification for manual review - ISSUE_ONLY action creates issue without additional action - Add policy_action and investigation_id to WebhookIssueResponse - Add get_default_team_for_tenant helper to TeamPolicyRepository - Add 6 new unit tests for policy-driven integration actions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(queue): add Redis-backed investigation queue with per-team rate limits - Add InvestigationQueue with per-team job routing and priority support - Add RedisRateLimiter using sliding window algorithm (Lua script) - Add InvestigationWorker to process jobs and start Temporal workflows - Support retry with exponential backoff for failed jobs - Jobs isolated per team - failures don't block other teams - Add 25 unit tests for queue and rate limiter - Add redis>=5.0.0 dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(sse): add Redis-backed SSE event store and API rate limiting - Add RedisSSEEventStore for persistent run event storage - Events survive process restart with configurable TTL - Replay window reads from Redis instead of in-memory dicts - Add RedisRateLimitMiddleware with sliding window algorithm - Rate limiting uses per-tenant identifiers (tenant > API key > IP) - Both components fail open on Redis errors for reliability - Include InMemoryFallbackSSEEventStore for local development Components: - adapters/sse/redis_event_store.py: Event store with sequencing and TTL - middleware/redis_rate_limit.py: Distributed rate limiting Tests: 41 unit tests for event store and rate limit middleware Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(ui): add team policy editor in Settings > Teams - Create TeamPolicyEditor component with policy management: - Default policy configuration (action, severity thresholds) - Dataset/tag override management with CRUD operations - Queue limits configuration (rate limits, burst, concurrency) - Integrate policy editor into teams-settings.tsx with settings button - Update teams API routes with policy management endpoints - Regenerate frontend API client with new policy types and hooks fn-24.6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(analytics): add activation and weekly usage analytics - Add migration for analytics_events table with tenant_activation tracking - Create materialized view for weekly usage aggregates - Add AnalyticsService with event recording and aggregation methods - Create /api/v1/analytics endpoints: - GET /weekly-usage: Weekly metrics with resolution rates - GET /activation: Tenant activation status - GET /activation/funnel: Cross-tenant funnel metrics - POST /refresh: Refresh materialized view - Add comprehensive unit tests (16 tests) - Document how to query metrics via API and SQL fn-24.7 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(demo): add missing migrations to justfile demo command Add 028_team_policies.sql and 029_analytics_events.sql to the explicit migration list in the demo command. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(api): remove duplicate teams router registration The teams router already has prefix="/teams" defined, so including it with an additional prefix="/teams" created duplicate routes at /api/v1/teams/teams/. Remove the duplicate registration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(ui): use placeholder values instead of empty strings in Select Radix UI Select doesn't allow empty string values for SelectItem. Use '__none__' as a placeholder value and convert to/from empty string when reading/writing the state. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(ui): add datasource/dataset picker to policy override dialog Replace the simple text input for dataset ID with a proper datasource dropdown and dataset search autocomplete, matching the UX pattern from the New Investigation page. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
bordumb
pushed a commit
that referenced
this pull request
Jan 22, 2026
# [1.4.0](v1.3.0...v1.4.0) (2026-01-22) ### Features * **ui:** add datasource/dataset picker to policy override dialog ([#79](#79)) ([2856769](2856769))
bordumb
added a commit
that referenced
this pull request
Jan 22, 2026
* feat(policy): add team policies data model and migrations - Add migration 028_team_policies.sql with tables: - team_policies: Team default policy configuration - team_policy_overrides: Dataset/tag-specific overrides - team_queue_limits: Per-team rate limits and concurrency - dataset_tags: Dataset-to-tag mapping for policy selectors - Add TeamPolicyRepository with CRUD operations for all entities - Add PolicyAction enum (auto, review, issue_only) - Add dataclasses: TeamPolicy, TeamPolicyOverride, TeamQueueLimits - Add comprehensive unit tests (28 tests, all passing) Part of fn-24: Month 0-2: Triage + Policy Engine Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(policy): add policy evaluation service - Add PolicyService with precedence-based evaluation: - Dataset overrides > Tag overrides > Team default > System defaults - Add severity-based action resolution: - Auto-investigate above min severity threshold - Require review below max severity threshold - Add QueueConfig dataclass for rate limiting settings - Add IssueContext and PolicyResult for API integration - Add evaluate_policy_for_issue convenience function - Add comprehensive unit tests (19 tests, all passing) Part of fn-24.2: Policy engine: evaluate team + dataset rules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(integrations): add policy-driven actions for webhook issues - Integrate policy evaluation after issue creation from webhooks - AUTO action starts investigation via Temporal (if configured) - REVIEW action sends notification for manual review - ISSUE_ONLY action creates issue without additional action - Add policy_action and investigation_id to WebhookIssueResponse - Add get_default_team_for_tenant helper to TeamPolicyRepository - Add 6 new unit tests for policy-driven integration actions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(queue): add Redis-backed investigation queue with per-team rate limits - Add InvestigationQueue with per-team job routing and priority support - Add RedisRateLimiter using sliding window algorithm (Lua script) - Add InvestigationWorker to process jobs and start Temporal workflows - Support retry with exponential backoff for failed jobs - Jobs isolated per team - failures don't block other teams - Add 25 unit tests for queue and rate limiter - Add redis>=5.0.0 dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(sse): add Redis-backed SSE event store and API rate limiting - Add RedisSSEEventStore for persistent run event storage - Events survive process restart with configurable TTL - Replay window reads from Redis instead of in-memory dicts - Add RedisRateLimitMiddleware with sliding window algorithm - Rate limiting uses per-tenant identifiers (tenant > API key > IP) - Both components fail open on Redis errors for reliability - Include InMemoryFallbackSSEEventStore for local development Components: - adapters/sse/redis_event_store.py: Event store with sequencing and TTL - middleware/redis_rate_limit.py: Distributed rate limiting Tests: 41 unit tests for event store and rate limit middleware Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(ui): add team policy editor in Settings > Teams - Create TeamPolicyEditor component with policy management: - Default policy configuration (action, severity thresholds) - Dataset/tag override management with CRUD operations - Queue limits configuration (rate limits, burst, concurrency) - Integrate policy editor into teams-settings.tsx with settings button - Update teams API routes with policy management endpoints - Regenerate frontend API client with new policy types and hooks fn-24.6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(analytics): add activation and weekly usage analytics - Add migration for analytics_events table with tenant_activation tracking - Create materialized view for weekly usage aggregates - Add AnalyticsService with event recording and aggregation methods - Create /api/v1/analytics endpoints: - GET /weekly-usage: Weekly metrics with resolution rates - GET /activation: Tenant activation status - GET /activation/funnel: Cross-tenant funnel metrics - POST /refresh: Refresh materialized view - Add comprehensive unit tests (16 tests) - Document how to query metrics via API and SQL fn-24.7 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(demo): add missing migrations to justfile demo command Add 028_team_policies.sql and 029_analytics_events.sql to the explicit migration list in the demo command. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(api): remove duplicate teams router registration The teams router already has prefix="/teams" defined, so including it with an additional prefix="/teams" created duplicate routes at /api/v1/teams/teams/. Remove the duplicate registration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(ui): use placeholder values instead of empty strings in Select Radix UI Select doesn't allow empty string values for SelectItem. Use '__none__' as a placeholder value and convert to/from empty string when reading/writing the state. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(ui): add datasource/dataset picker to policy override dialog Replace the simple text input for dataset ID with a proper datasource dropdown and dataset search autocomplete, matching the UX pattern from the New Investigation page. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * add frontend files --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/investigations/new)Test plan
/admin→ Teams tab → Click gear icon on any team to open Policy Editor🤖 Generated with Claude Code