Skip to content

feat(insights): retain business changes and improve capability discovery - #759

Merged
izadoesdev merged 3 commits into
stagingfrom
codex/intelligence-depth
Sep 8, 2026
Merged

feat(insights): retain business changes and improve capability discovery#759
izadoesdev merged 3 commits into
stagingfrom
codex/intelligence-depth

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 8, 2026

Copy link
Copy Markdown
Member

Investigations could drop a measured attribution decline after seeing stable sales and higher refunds. Preserve independent changes and controls from the same subject, and distinguish those comparisons from unrelated sibling findings. Keep unavailable diagnostics as investigation limits.

Discovery accepts an explicit all-category search and returns a compact full catalog; targeted lookups still return complete query contracts. Goal and funnel descriptions distinguish saved configuration from cohort-filtered measurements. Four synthetic holdouts cover competing revenue facts, field order, and capability discovery outside an initially guessed category.

Validation: repository lint, all 33 typecheck/build tasks, 510 Insights tests (6 live tests skipped), and 9 discovery/cohort tests passed. Fresh native-model comparisons retained all three material revenue comparisons in 2/2 corrected core runs where baseline omitted attribution in 2/2. Unfiltered catalog output is approximately 77% smaller. The final combined Terra batch passed 13/13 automated checks with no rejected finishes. Separate semantic review still found uneven wording and unnecessary reads when a capability is absent; automated checks are not a complete quality score.

Independent code review found and resolved two fixture-contract issues: compact discovery parity and source-window bounds. A follow-up review of the rebased changes found no blockers. The existing Terra model remains unchanged: neither a broader prompt rewrite nor a more expensive default demonstrated a sufficient overall benefit.

Scope: investigation instructions, discovery output, tool descriptions, and synthetic evaluation coverage. The separately reviewed recovery-verification fix is already in staging via #760; this branch is rebased onto it. No schema changes or dependency on #751.

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
dashboard Ready Ready Preview Sep 8, 2026 2:50pm UTC
databuddy-status Ready Ready Preview Sep 8, 2026 2:50pm UTC
documentation Ready Ready Preview Sep 8, 2026 2:50pm UTC

@coderabbitai

coderabbitai Bot commented Sep 8, 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: Advanced

Run ID: 805b838e-a3f0-4a3d-9a83-90e99d406272

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

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 Sep 8, 2026

Copy link
Copy Markdown

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

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Sep 8, 2026 2:49pm

@izadoesdev
izadoesdev marked this pull request as ready for review September 8, 2026 14:51
@izadoesdev
izadoesdev merged commit 4e5de43 into staging Sep 8, 2026
21 checks passed
@izadoesdev
izadoesdev deleted the codex/intelligence-depth branch September 8, 2026 14:53
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates Insights investigation guidance to retain independent business comparisons and distinguish unavailable diagnostics from findings. It also introduces compact cross-category query discovery, clarifies saved versus cohort-filtered goal and funnel definitions, and expands synthetic evaluation coverage.

  • Preserves stable gross revenue, declining attribution, and rising refunds as distinct evidence.
  • Adds compact full-catalog discovery with detailed targeted contract lookup.
  • Adds reordered-field and cross-category capability holdouts.
  • Clarifies goal and funnel analytics descriptions.

Confidence Score: 4/5

The behavioral changes appear sound, but the explicit repository typing requirement must be satisfied before merging.

No correctness or security failure remains; the only accepted issue is the newly introduced use of prohibited unknown types in the evaluation code.

Files Needing Attention: apps/insights/src/evals/quality.ts

Important Files Changed

Filename Overview
apps/insights/src/agent.ts Refines investigation guidance around independent revenue facts, discovery scope, and diagnostic limitations.
packages/ai/src/ai/tools/discover-query-types.ts Adds nullable all-category discovery and compact unfiltered catalog responses while preserving detailed targeted results.
apps/insights/src/evals/quality.ts Adds revenue and cross-category discovery holdouts, but new evaluation boundaries violate the repository's explicit-type requirement.
apps/insights/src/evals/quality.test.ts Tests revenue evidence field binding, reordered result fields, and widened capability discovery.
packages/ai/src/ai/tools/goals.ts Clarifies that saved configuration is distinct from cohort-filtered measurement definitions.
packages/ai/src/ai/tools/funnels.ts Clarifies that saved funnel configuration is distinct from cohort-filtered measurement definitions.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Unknown analytics capability] --> B[Request compact full catalog]
  B --> C[Select relevant builder name]
  C --> D[Targeted discovery lookup]
  D --> E[Receive complete query contract]
  E --> F[Execute get_data query]
  F --> G[Retain independent measured comparisons]
  F --> H[Record unavailable diagnostics as investigation limits]
Loading

Reviews (1): Last reviewed commit: "fix(ai): distinguish saved definitions f..." | Re-trigger Greptile

function depthRevenueTool(reordered: boolean, available = true) {
return {
...analyticsTools.get_data,
execute: (value: unknown) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Prohibited unknown types

The new evaluation code uses unknown for the synthetic revenue input. The same added pattern appears in the discovery executor and accepted-finish state. This violates the repository directive to use proper explicit types instead of any, unknown, or never, so it must be corrected before merging.

Context Used: Basic guidelines for the project so vibe coders do... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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