Skip to content

feat(insights): ship durable agent investigations#566

Merged
izadoesdev merged 24 commits into
stagingfrom
codex/insights-agent-simplification
Jul 20, 2026
Merged

feat(insights): ship durable agent investigations#566
izadoesdev merged 24 commits into
stagingfrom
codex/insights-agent-simplification

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Jul 15, 2026

Copy link
Copy Markdown
Member

What changed

  • Replaced the parallel insight/digest pipeline with one durable investigation case per subject and a chronological observation/reply timeline.
  • Let the agent investigate with live analytics, named goals and funnels, website context, and bound GitHub/deploy context.
  • Exposed the same investigation lifecycle through the dashboard, MCP, and Slack; a Slack reply resumes the original case.
  • Reduced organization configuration to Off, Daily, or Weekly plus an optional Slack channel.
  • Removed duplicate evidence readers, formatter layers, prompt rails, feature gates, the synthetic eval package, and the manifest updater.
  • Updated SPEC.md, ROADMAP.md, dashboard copy, and public docs around actionable investigations.
  • Hardened production-shadow dry runs so anomaly detection is blocked and page scraping cannot write cache entries.
  • Declared the docs tracker dependency so Turbo builds the tracker before docs copy tests.
  • Made package-global AI mocks order-safe so CI cannot hide missing Redis or tracing exports.

The total branch diff is 257 files with 11,845 additions and 32,278 deletions.

Why

Databuddy should explain a concrete business or product problem, show the evidence, ask for missing context when it matters, and continue working toward a fix. It should not emit anonymous metric cards or narrate internal agent behavior.

Rollout

  • The legacy generation-config columns are intentionally removed; the maintainer has already run the schema push for the current environment.
  • Deploy API, Insights, Dashboard, and Slack from the same revision.
  • The Slack manifest has already been deployed manually. No manifest updater script remains.

Validation

  • bun install --frozen-lockfile --ignore-scripts
  • bun run lint
  • bun run check-types
  • bun run test (including 3,512 AI tests)
  • bun run build
  • Insights integration: 28/28
  • API insights integration: 5/5
  • Dashboard Playwright PR suite: 7/7
  • ClickHouse schema check
  • Docs link check
  • API, Insights, and Slack production Docker builds for linux/amd64
  • Dry-run mutation/cache regression tests
  • Randomized Bun mock-order regressions
  • git diff --check

AI-assisted with Codex; the branch has been locally verified.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
databuddy-status Ready Ready Preview, Comment Jul 20, 2026 2:16pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
dashboard Skipped Skipped Jul 20, 2026 2:16pm
documentation Skipped Skipped Jul 20, 2026 2:16pm

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 45e1d6ca-eee1-4d08-8b05-1f0eb0e7928d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/insights-agent-simplification

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

Comment @coderabbitai help to get the list of available commands.

@unkey-deploy

unkey-deploy Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
api (preview) Ready Visit Preview Inspect Jul 20, 2026 2:17pm

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces deterministic insight decisions with a bounded investigation agent. The main changes are:

  • Adds model-selected evidence reads and decision submission.
  • Keeps persistence, repair authorization, and lifecycle handling in the backend.
  • Updates insight evaluation and production-shadow flows.
  • Renames the dashboard copy section to “What changed.”

Confidence Score: 4/5

The production read-only investigation path can invoke live anomaly detection.

  • Candidate selection and evidence citations are scoped to one signal.
  • Invalid agent runs throw instead of persisting a fallback decision.
  • The production reader must disable live anomaly detection before merging.

apps/insights/src/generation.ts

Security Review

The new evidence reader keeps website, date, and signal scope server-controlled. The production investigation path still permits live anomaly detection while running in dry-run mode.

Important Files Changed

Filename Overview
apps/insights/src/agent.ts Adds bounded candidate selection, evidence reads, and validated finding materialization.
apps/insights/src/generation.ts Integrates the agent into generation, billing, persistence, and observation handling; the evidence-reader setup leaves live anomaly detection enabled.
packages/ai/src/ai/tools/insights-agent-tools.ts Adds strict request schemas and signal-bound evidence reads.
packages/ai/src/ai/insights/ops-context.ts Adds a live anomaly-detection switch that defaults to enabled.
packages/shared/src/insights.ts Simplifies the needs-context decision shape.
packages/evals/src/insight-production-shadow.ts Updates historical shadow evaluation to use the bounded agent and disables live anomaly detection there.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Detected regressions] --> B[Eligible candidate shortlist]
  B --> C[Bounded investigation agent]
  C --> D[Signal-scoped evidence reader]
  D --> E[Validated decision]
  E --> F[Persist insight and observation]
  F --> G[Resolve prior insights and effects]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
  A[Detected regressions] --> B[Eligible candidate shortlist]
  B --> C[Bounded investigation agent]
  C --> D[Signal-scoped evidence reader]
  D --> E[Validated decision]
  E --> F[Persist insight and observation]
  F --> G[Resolve prior insights and effects]
Loading

Reviews (1): Last reviewed commit: "feat(insights): restore bounded investig..." | Re-trigger Greptile

Comment thread apps/insights/src/generation.ts Outdated
@vercel
vercel Bot temporarily deployed to Preview – documentation July 20, 2026 14:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – dashboard July 20, 2026 14:16 Inactive
@izadoesdev
izadoesdev merged commit fcc81d2 into staging Jul 20, 2026
18 checks passed
@izadoesdev
izadoesdev deleted the codex/insights-agent-simplification branch July 20, 2026 21:40
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