Skip to content

feat(github): name the rule on the cost-regression line - #205

Merged
veksen merged 1 commit into
mainfrom
feat-gate-line-states-the-rule
Jul 31, 2026
Merged

veksen merged 1 commit into
mainfrom
feat-gate-line-states-the-rule

Conversation

@veksen

@veksen veksen commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Goal

A gate line should say what the gate checked, not only what it counted. Follow-up to #201.

What

On run 019fb8fd the comment said Cost regression — 9 queries got more expensive and the run detail page said 25 regressed. Both are correct and they look like a contradiction.

Reproduced from the two run payloads:

25  queries increased at all                          <- what the run page reports
13  increased past the 10% threshold
 9  ...and are not both sides under the 100 cost floor <- what the gate blocks on

After: Cost regression — 9 queries went up more than 10%, where either cost is at least 100

How

GateFacts gains regressionThreshold and minimumCost, threaded from the repo config in main.ts. The copy in evaluate.ts reads them, so a repo that sets 20% and a floor of 500 gets its own numbers rather than a hardcoded sentence.

The floor is worded to match compareRuns, which skips a regression only when both the previous and current cost sit under it. A query going 50 to 300 is counted, so "under a cost of 100 is ignored" would have described a simpler rule than the code applies.

Tests

evaluate.test.ts covers the fired line naming both numbers, and the passing line naming the threshold. Full suite: 390 passing, 39 files, typecheck clean.

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

6 successful checks

 Cost regression — No query went up more than 5%
 Untested data access — No changed data-access file without a test
 New query — No new queries
 New query with index recommendation — No new query ships an index recommendation
 Schema drift — No schema changes
 High-value nudge — No index or rewrite past the threshold


More details via MCP → get_ci_run({ runId: "019fb93c-df12-7421-9d14-d10a12d32b8f" }) · view run · docs
3 queries read against main on assumed statistics of 10,000,000 rows per table. Sync production stats for costs measured against your real data.

The line said '9 queries got more expensive' while the run page said 25
regressed. Both were right: the page counts every increase, the gate counts
what clears the repo's threshold and cost floor. Neither surface said so.

The line now carries the rule it applied: '9 queries went up more than 10%,
ignoring anything under a cost of 100', with both numbers read from the repo's
config rather than written into the copy.

Co-Authored-By: Claude <noreply@anthropic.com>
@veksen
veksen force-pushed the feat-gate-line-states-the-rule branch from 98630a4 to c1a7c1f Compare July 31, 2026 17:32
@veksen
veksen merged commit 659f417 into main Jul 31, 2026
6 checks passed
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