Skip to content

ref(lint): Fail when a check baseline grows, and pair each rule with its check - #3612

Merged
BYK merged 5 commits into
mainfrom
improve-repo/baseline-growth
Nov 21, 2026
Merged

BYK merged 5 commits into
mainfrom
improve-repo/baseline-growth

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Baselines can only shrink

The ratchet baselines (type-assertions, await-in-loop, test-architecture, typecheck-coverage, migration-locks, tool-descriptions, file-length-exceptions) already say "do not add entries". But when a check trips, an agent can still add an entry and the check passes. Review caught this on #3564 and #3035, both from @BYK. It merged without review in #3460, #3226, and #3206.

pnpm baseline-growth:check is now part of pnpm lint. It compares each baseline to the merge base with origin/main and fails when a rule's total goes up. The error names the baseline, the rule, and the entries that caused it. Totals are counted per rule, so a file that moves or splits still passes. A rule or baseline that is new in the change is skipped, because that is how a new check gets adopted. The CI lint job now uses fetch-depth: 0 so it has a merge base.

tool-error-classification-baseline.txt is left out because it is an allowlist of approved system errors and grows on purpose.

Use data the system already has before you add plumbing

Agents fix missing information with new hooks, resolvers, and lookups instead of using data the system already stores, as in #3610, #3404, and #3457. No check can tell a needed abstraction from a speculative one, so policies/correctness-complexity.md now names this case.

Generate deterministic output in code, not prompt text

Agents fix deterministic behavior with prompt or policy text. #3610 first tried to fix PR links with a GitHub system prompt change, and @dcramer rejected it: "We know if it's a pull request or an issue. We should just be generating the right link." The bot name in prompts (#3404) had to become a check, and #3438 was told not to add policy text when a rule can enforce it. policies/agent-steering.md now says to generate links, IDs, and formats in code.

Rule table

The AGENTS.md rules are now a table that says what enforces each rule. A correction for a rule marked "Review" shows that the rule is a repeat and needs a higher-level fix.

Open decision

  • There is no override for baseline growth. If a reviewer approves a growth, they have to change the check. Should there be an approved override, such as a PR label?

via @dcramer.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 21, 2026 6:59pm UTC

Request Review

sentry-junior Bot and others added 3 commits November 17, 2026 20:46
Agents that trip a ratchet check add a baseline entry and the check passes.
Review caught this in #3035 and #3564, and it
merged in #3460, #3226, and #3206.

baseline-growth:check compares each debt baseline to the merge base with
origin/main and fails when a rule's total rises. Totals per rule let a file
move or split without failing.

Co-Authored-By: David Cramer <[email protected]>
AGENTS.md rules now say which check enforces each one, so a correction for a
rule that only review enforces shows up as a repeat.

Agents keep fixing missing information with new hooks, resolvers, and
lookups instead of fixing the source, as in #3610,
#3404, and #3457. No check can tell a needed
abstraction from a speculative one, so correctness-complexity.md names the
case.

Co-Authored-By: David Cramer <[email protected]>
Agents fix deterministic behavior with prompt or policy text. #3610
first changed the GitHub system prompt to fix PR links, and the fix was
rejected: the system already knows whether a link is a pull request. On
#3404 the bot name in prompts had to become a check because
the mistake kept coming back, and #3438 was told not to
add policy text when a rule can enforce it.

No check can tell deterministic output from judgment in a prompt diff, so
agent-steering.md names the rule and AGENTS.md lists it.

Co-Authored-By: David Cramer <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

This PR has had no activity for 3 days. It closes in 2 days unless someone pushes, comments, or adds the WIP label.

@github-actions github-actions Bot added the Stale label Nov 21, 2026
@BYK
BYK marked this pull request as ready for review November 21, 2026 18:43
@sentry-junior
sentry-junior Bot requested a review from dcramer November 21, 2026 18:43
@BYK
BYK enabled auto-merge (squash) November 21, 2026 18:43
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 21, 2026
…-growth

# Conflicts:
#	AGENTS.md
#	package.json
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

7 screenshot changes — 7 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Skill Editor · Desktop
Automation Skill Editor · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Event Log Virtual · Mobile
Conversation Event Log Virtual · Mobile
Changed
Conversation Question Form · Desktop
Conversation Question Form · Desktop
Changed
Conversation Unsent Answers · Desktop
Conversation Unsent Answers · Desktop
Changed
System Cache Health 24h · Desktop
System Cache Health 24h · Desktop
Changed
Show 1 more changed screenshot
System Cache Warming Refill · Desktop
System Cache Warming Refill · Desktop
Changed

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1384e03. Configure here.

Comment thread scripts/check-baseline-growth.mjs Resolved
The hand-written list missed scripts/nav-request-budget-exceptions.mjs.
Match *-baseline.{json,txt} and *-exceptions.mjs instead, and list only the
files that may grow.
@BYK
BYK merged commit 355139b into main Nov 21, 2026
57 checks passed
@BYK
BYK deleted the improve-repo/baseline-growth branch November 21, 2026 19:08
BYK pushed a commit that referenced this pull request Nov 21, 2026
Each root check script had its own `node --test … && node …` chain in
`package.json`, and `pnpm lint` listed a dozen of them one by one. Every
new check added more of the same wiring.

`scripts/check.mjs` now owns that wiring:

- `node scripts/check.mjs <name>…` runs each named check: first its
`scripts/check-<file>.test.mjs` tests, then its
`scripts/check-<file>.mjs` script. It stops at the first failure.
- With no name, it runs every check that `pnpm lint` needs, with their
tests in one `node --test` run.
- `migration-locks` still runs `squawk` after its script.
- It fails when a `scripts/check-*.mjs` file has no entry, so a new
check gets wired here or not at all.
- It ignores file-path arguments, because lint-staged appends the staged
paths.

Every `pnpm <name>:check` entry stays and calls the runner, so the check
names in `AGENTS.md`, lint-staged, and CI still work. `pnpm lint` starts
with `node scripts/check.mjs`, and `ast-grep:lint` ends with `node
scripts/check.mjs ast-grep-ignores`. The CI release paths include the
runner, because `release:check` now goes through it.

No check script or its logic changes. The `packages/junior` check
scripts keep their own `package.json` entries.

Related: #3680, #3612.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Acdada5c589dc375265165b968649b09b -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Acdada5c589dc375265165b968649b09b)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Acdada5c589dc375265165b968649b09b/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 7df6929a Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants