Skip to content

fix(devtools): trust every merge parent's pattern baseline - #5755

Merged
Sinity merged 2 commits into
masterfrom
claude/patterns-merge-parents
Sep 28, 2026
Merged

Sinity merged 2 commits into
masterfrom
claude/patterns-merge-parents

Conversation

@Sinity

@Sinity Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

The patterns gate trusts an exemption that any parent of HEAD already carried, so a PR whose tip merges master no longer fails for master's own baseline additions.

Problem

_trusted_baseline read the committed baseline from HEAD^ only. On a PR whose head is a merge of master, HEAD^ is the PR's previous tip, so every exemption master added since the PR last merged it counts as growth. The quick-gate of #5739 (a one-line hook change merged with master at f2562c3) failed with patterns: committed baseline grew over dozens of master's own entries (diagnosis=gate_input_error); #5643, #5696 and #5704 fail the same way.

Solution

Read the baseline at every parent (git rev-parse HEAD^@) and trust each entry at the largest count any parent carried. A merge resolution that adds an entry present in neither parent is still growth.

Verification

devtools test tests/unit/devtools/test_verify_patterns.py on a checkout of origin/master 82e84ec with this change: 9 passed, 1 failed. The new test_merging_the_base_branch_does_not_count_its_exemptions_as_growth passes; it fails with first-parent-only trust. The failing test_displacing_a_baselined_match_does_not_trip_the_gate fails the same way on unpatched master (IndentationError in its synthetic file) and is recorded in polylogue-rb7tx.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

@Sinity
Sinity enabled auto-merge (squash) September 28, 2026 21:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T22:38:10.662903Z 83570b5 New commits
🔒 Security Review ✅ Completed 2026-09-28T21:23:41.540653Z 257711b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 257711bc94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_patterns.py Resolved
@Sinity
Sinity merged commit 85d13e9 into master Sep 28, 2026
3 of 4 checks passed
@Sinity
Sinity deleted the claude/patterns-merge-parents branch September 28, 2026 22:42
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