Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .flow/tasks/fn-16.13.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"assignee": "bordumbb@gmail.com",
"claim_note": "",
"claimed_at": "2026-09-26T02:11:50.122844Z",
"created_at": "2026-09-26T02:08:42.244248Z",
"depends_on": [],
"epic": "fn-16",
"evidence": {
"commits": [],
"prs": [],
"tests": [
"DATABASE_URL=... uv run --no-sync pytest python-packages/dataing/tests/integration/api/test_investigation_snapshot_import.py -m integration --no-cov"
]
},
"id": "fn-16.13",
"priority": null,
"spec_path": ".flow/tasks/fn-16.13.md",
"status": "done",
"title": "Snapshot import: stop inserting generated investigations.status",
"updated_at": "2026-09-26T02:18:24.729448Z"
}
19 changes: 19 additions & 0 deletions .flow/tasks/fn-16.13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# fn-16.13 Snapshot import: stop inserting generated investigations.status

## Description
TBD

## Acceptance
## Acceptance
- POST /investigations/import no longer writes the generated `status` column
- Integration test (migrated schema) imports a valid archive: 200, row stored with replay outcome, status derived as 'completed'


## Done summary
Dropped the generated `status` column (and its "imported" value) from the snapshot import INSERT; status now derives from `outcome` ('completed').
Test: tests/integration/api/test_investigation_snapshot_import.py builds a real archive with SnapshotBuilder and imports it against the migrated schema (RED: GeneratedAlwaysError, GREEN after fix).
Also added shared `fixtures/database.py` (migrated_dsn/migrated_db) re-exported by CE and EE integration conftests.
## Evidence
- Commits:
- Tests: DATABASE_URL=... uv run --no-sync pytest python-packages/dataing/tests/integration/api/test_investigation_snapshot_import.py -m integration --no-cov
- PRs:
21 changes: 21 additions & 0 deletions .flow/tasks/fn-16.14.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"assignee": "bordumbb@gmail.com",
"claim_note": "",
"claimed_at": "2026-09-26T02:18:24.996044Z",
"created_at": "2026-09-26T02:08:42.507450Z",
"depends_on": [],
"epic": "fn-16",
"evidence": {
"commits": [],
"prs": [],
"tests": [
"DATABASE_URL=... uv run --no-sync pytest python-packages/dataing-ee/tests/integration/core/automation/test_spawn_investigation.py -m integration --no-cov"
]
},
"id": "fn-16.14",
"priority": null,
"spec_path": ".flow/tasks/fn-16.14.md",
"status": "done",
"title": "Automation spawn_investigation: valid AnomalyAlert via InvestigationStarterService",
"updated_at": "2026-09-26T02:29:51.445475Z"
}
22 changes: 22 additions & 0 deletions .flow/tasks/fn-16.14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# fn-16.14 Automation spawn_investigation: valid AnomalyAlert via InvestigationStarterService

## Description
TBD

## Acceptance
## Acceptance
- `ActionExecutor._spawn_investigation` stores `alert` as a valid AnomalyAlert dump + `datasource_id`, via InvestigationStarterService (row + Temporal workflow)
- Issue linked through `issue_investigation_runs` (trigger_type 'rule'); re-running returns the existing investigation
- Fails cleanly (ActionResult.success False) when the issue has no dataset or no datasource resolves
- Integration tests against the migrated schema


## Done summary
`_spawn_investigation` now builds an AnomalyAlert from the issue row (description-type metric, dataset from the issue, date from created_at, source_* from the issue) and starts it through InvestigationStarterService (alert JSONB = AnomalyAlert dump + datasource_id, Temporal workflow started).
ExecutionContext gains a required `investigation_starter`. Datasource: `datasource_id` action param (must belong to the tenant), else the tenant's only active datasource, else a failed ActionResult.
Issue link + dedupe via issue_investigation_runs (trigger_type 'rule', trigger_ref {rule_id}, execution_profile = profile).
Tests: dataing-ee/tests/integration/core/automation/test_spawn_investigation.py (6 cases; RED: `column "issue_id" does not exist`).
## Evidence
- Commits:
- Tests: DATABASE_URL=... uv run --no-sync pytest python-packages/dataing-ee/tests/integration/core/automation/test_spawn_investigation.py -m integration --no-cov
- PRs:
22 changes: 22 additions & 0 deletions .flow/tasks/fn-16.15.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"assignee": "bordumbb@gmail.com",
"claim_note": "",
"claimed_at": "2026-09-26T02:29:52.197558Z",
"created_at": "2026-09-26T02:08:42.791298Z",
"depends_on": [],
"epic": "fn-16",
"evidence": {
"commits": [],
"prs": [],
"tests": [
"uv run --no-sync mypy python-packages/dataing/src python-packages/dataing-ee/src",
"uv run --no-sync pytest python-packages/dataing/tests --no-cov"
]
},
"id": "fn-16.15",
"priority": null,
"spec_path": ".flow/tasks/fn-16.15.md",
"status": "done",
"title": "Delete dead AppDatabase.create_investigation",
"updated_at": "2026-09-26T02:58:33.360753Z"
}
17 changes: 17 additions & 0 deletions .flow/tasks/fn-16.15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# fn-16.15 Delete dead AppDatabase.create_investigation

## Description
TBD

## Acceptance
## Acceptance
- `AppDatabase.create_investigation` (old-schema insert, no callers) deleted


## Done summary
Deleted `AppDatabase.create_investigation` (pre-013 column insert). No callers: the other `create_investigation` hits are PostgresInvestigationRepository / the repository protocol / an entitlements test route.
Verified: grep, mypy clean, CE 2044 passed / EE 458 passed.
## Evidence
- Commits:
- Tests: uv run --no-sync mypy python-packages/dataing/src python-packages/dataing-ee/src, uv run --no-sync pytest python-packages/dataing/tests --no-cov
- PRs:
23 changes: 23 additions & 0 deletions .flow/tasks/fn-16.16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"assignee": "bordumbb@gmail.com",
"claim_note": "",
"claimed_at": "2026-09-26T02:33:18.975571Z",
"created_at": "2026-09-26T02:08:43.082252Z",
"depends_on": [],
"epic": "fn-16",
"evidence": {
"commits": [],
"prs": [],
"tests": [
"uv run --no-sync pytest python-packages/dataing/tests --no-cov",
"uv run --no-sync pytest python-packages/dataing-ee/tests --no-cov",
"pnpm typecheck && pnpm lint && pnpm test"
]
},
"id": "fn-16.16",
"priority": null,
"spec_path": ".flow/tasks/fn-16.16.md",
"status": "done",
"title": "Delete approvals stack (pre-013 approval_requests)",
"updated_at": "2026-09-26T02:58:33.643752Z"
}
21 changes: 21 additions & 0 deletions .flow/tasks/fn-16.16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# fn-16.16 Delete approvals stack (pre-013 approval_requests)

## Description
TBD

## Acceptance
## Acceptance
- /approvals route, AppDatabase approval methods and `update_investigation_status` deleted (pre-013 approval_requests schema; no producer; Temporal HITL uses POST /investigations/{id}/input)
- Frontend ContextReviewPage, its route and the approval notification link removed; client regenerated
- ruff, ruff format --check, mypy, CE/EE unit tests and frontend checks pass


## Done summary
Deleted the approvals stack (user decision): routes/approvals.py + registration; AppDatabase create_approval_request / get_pending_approvals / make_approval_decision / update_investigation_status; dashboard pendingApprovals KPI (API field + card); dead producers notify_approval_required, EmailNotifier.send_approval_required, Slack approval.required formatting (+ their unit tests); frontend ContextReviewPage + context-review, /approvals route, notification-card approval branch, notification/webhook settings entries, query-keys.
OpenAPI: removed the 7 approvals paths + 7 approval-only schemas + DashboardStats.pending_approvals from the committed spec (full regen adds +3222/-2087 unrelated drift); orval regenerated; 23 stale generated approval files + 22 index exports removed by hand (orval does not clean).
Left + flagged: EE require_approval_for_queries setting (unenforced), domain_types Approval* models (unused), dashboard other old-schema queries.
Verified: CE 2044 passed, EE 458 passed, mypy clean, ruff clean, frontend tsc/eslint/prettier/vitest (12) clean.
## Evidence
- Commits:
- Tests: uv run --no-sync pytest python-packages/dataing/tests --no-cov, uv run --no-sync pytest python-packages/dataing-ee/tests --no-cov, pnpm typecheck && pnpm lint && pnpm test
- PRs:
9 changes: 0 additions & 9 deletions frontend/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { DashboardPage } from "@/features/dashboard/dashboard-page";
import { InvestigationList } from "@/features/investigation/InvestigationList";
import { InvestigationDetail } from "@/features/investigation/InvestigationDetail";
import { NewInvestigation } from "@/features/investigation/NewInvestigation";
import { ContextReviewPage } from "@/features/investigation/ContextReviewPage";
import { DataSourcePage } from "@/features/datasources/datasource-page";
import { DatasetListPage, DatasetDetailPage } from "@/features/datasets";
import { SettingsPage } from "@/features/settings/settings-page";
Expand Down Expand Up @@ -167,14 +166,6 @@ function AppWithEntitlements() {
</FeatureErrorBoundary>
}
/>
<Route
path="approvals/:approvalId"
element={
<FeatureErrorBoundary feature="context review">
<ContextReviewPage />
</FeatureErrorBoundary>
}
/>
<Route
path="issues"
element={
Expand Down
37 changes: 2 additions & 35 deletions frontend/app/src/features/dashboard/dashboard-page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { useQuery } from "@tanstack/react-query";
import { Link } from "react-router-dom";
import {
Search,
Database,
CheckCircle2,
Clock,
AlertTriangle,
Plus,
} from "lucide-react";
import { Search, Database, CheckCircle2, Plus } from "lucide-react";

import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card";
import { Button } from "@/components/ui/Button";
Expand Down Expand Up @@ -41,7 +34,7 @@ export function DashboardPage() {
/>

{/* Stats Grid */}
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Expand Down Expand Up @@ -93,32 +86,6 @@ export function DashboardPage() {
)}
</CardContent>
</Card>

<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Pending Approvals
</CardTitle>
<Clock className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
{isLoading ? (
<Skeleton className="h-8 w-16" />
) : (
<>
<div className="text-2xl font-bold">
{stats?.pendingApprovals ?? 0}
</div>
{(stats?.pendingApprovals ?? 0) > 0 && (
<p className="text-xs text-muted-foreground">
<AlertTriangle className="inline h-3 w-3 mr-1 text-yellow-500" />
Requires attention
</p>
)}
</>
)}
</CardContent>
</Card>
</div>

{/* Recent Investigations */}
Expand Down
Loading
Loading