Skip to content

Follow up files to #79#81

Merged
bordumb merged 13 commits intomainfrom
dev-launchPlan1
Jan 22, 2026
Merged

Follow up files to #79#81
bordumb merged 13 commits intomainfrom
dev-launchPlan1

Conversation

@bordumb
Copy link
Copy Markdown
Owner

@bordumb bordumb commented Jan 22, 2026

No description provided.

bordumb and others added 12 commits January 22, 2026 19:08
- 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>
@bordumb bordumb self-assigned this Jan 22, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dataing Ready Ready Preview, Comment Jan 22, 2026 8:38pm
dataing-app Ready Ready Preview, Comment Jan 22, 2026 8:38pm
dataing-docs Ready Ready Preview, Comment Jan 22, 2026 8:38pm

Resolve merge conflict in openapi.json by accepting main's version.

Co-Authored-By: Claude Opus 4.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.

1 participant