Repository navigation
Conversation
Replace the proposed-only and drifted cases in the governed-metrics suite with two pairs. In each pair the prompt and the catalog row are the same, and only the stored SQL differs: - governed_metric_proposed_fits / governed_metric_proposed_mismatch - governed_metric_drifted_fits / governed_metric_drifted_mismatch When the SQL fits, the agent must run the metric and open with its warning badge. When the SQL measures something else, the agent must derive the number. Both cases require a warning about the status. Add a drifted_badge scorer that shares the proposed badge check. It reports to Braintrust only, because PostHog upload needs a scorer version in project 2 first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
🤖 CI report
|
| File | Comment lines | Added lines |
|---|---|---|
products/data_catalog/evals/constants.py |
8 | 38 |
products/data_catalog/evals/eval_governed_metrics.py |
5 | 86 |
This check does not block merging. It updates on every push and clears when the share drops.
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 4bbfb88: 2 Should fix.
This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
| "which is what the user asked, and ran it with data-catalog-metric-run. The answer reports " | ||
| "the number and warns the user in words that the metric is only proposed, not approved. " | ||
| "Deriving the number by hand while a fitting proposed metric exists, omitting the warning, " | ||
| "or presenting the number as approved or official is a failure." |
There was a problem hiding this comment.
P2 · Align the shared judge policy with the new fits cases
For both new fits cases, GovernedBehaviorCorrectness still receives GOVERNED_BEHAVIOR_PROMPT, which says a proposed or drifted metric requires deriving the number independently. These expectations require the opposite, so the judge receives contradictory grading instructions and penalizes valid behavior. Update the shared judge policy alongside these cases.
| # Not enrolled in the offline suite above: PostHog upload needs a scorer version created | ||
| # in project 2 first, so this score reaches Braintrust only. | ||
| DriftedBadgeShown(), |
There was a problem hiding this comment.
P2 · Reconcile the new scorer with reporting enrollment
Adding DriftedBadgeShown() without enrolling drifted_badge breaks test_discovered_suites_match_reporting_enrollment: it requires the configured scorer names to equal every active scorer name. The comment does not establish an exception, so the existing test fails for this suite. Register and enroll the scorer, or implement and test support for partial enrollment.
|
Risk: No findings This PR reworks two governed-metrics eval cases into four "fits vs mismatch" pairs that grade whether an agent runs a proposed/drifted metric when its saved SQL matches the question, and a shared Sentinel reviewed |
|
Problem
Note
Merge after #122670. Against master's current instructions, the two "fits" cases fail by design.
Changes
governed_metric_proposed_onlyandgoverned_metric_driftedin theeval_governed_metricssuite:governed_metric_proposed_fitsuploaded_fileusers in 7 daysgoverned_metric_proposed_mismatchdownloaded_fileuploaded_file, warn it counts downloadsgoverned_metric_drifted_fitsgoverned_metric_drifted_mismatchsigned_updrifted_badgescorer checks thedrifted_badgeshares its check withproposed_badge. It reports to Braintrust only. Upload to PostHog needs a scorer version created in project 2 first.governed_metric_proposed_with_approved_siblingstays as it is. It still checks that an approved metric outranks a proposed one.How did you test this code?
Test rationale:⚠️ warning. It extends the badge tests in
test_drifted_badge_shownfails if the drifted scorer accepts the 📝 proposed badge in place of thetest_data_catalog_scorers.py, and the self-skip test now coversdrifted_badge.test_data_catalog_scorers.pyand an import check of the suite with Django set up.governed_metric_proposed_fitsgoverned_metric_proposed_mismatchuploaded_file, and warned that the proposed metric counts downloads and is not approvedgoverned_metric_drifted_fitsgoverned_metric_drifted_mismatchsigned_uponlygoverned_metric_drifted_fitsattempt failed on infrastructure: the sandbox's MCP connection timed out, so the agent never reached the catalog. A rerun of that case alone passed.Release status
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (
claude-opus-5-5)/writing-evals,/writing-tests,/writing-code-comments,/writing-pr-descriptions,/reviewing-with-coderabbit.products/data_catalog/evals/. The edits are in different places, so a conflict is unlikely.🤖 Generated with Claude Code