Skip to content

fix(devtools): reject stale testmon verify seeds - #2103

Merged
Sinity merged 1 commit into
masterfrom
feature/fix/testmon-seed-freshness
Jun 18, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/fix/testmon-seed-freshness

Conversation

@Sinity

@Sinity Sinity commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Make the default devtools verify pytest-testmon path validate the seed stamp before it starts pytest. The preflight now rejects missing, unreadable, wrong-head, and fingerprint-drifted .cache/testmon/seed.json state instead of accepting any old .testmondata file.

Problem

A diagnostic default verify run accepted a seed from a1a4f9f recorded on 2026-06-06, while current master was 28e95ab after 245 first-parent commits. That stale seed selected a very broad pseudo-full run: the bounded diagnostic reached 900s, emitted 1,406 test starts, and was still progressing through MCP archive-surface tests. The harness was observable after #2100, but the preflight still allowed stale affected-test metadata to waste the gate.

Solution

_testmon_preflight now reads .cache/testmon/seed.json, compares its git_head to the current checkout, and compares its recorded .testmondata fingerprint to the current file. If either check fails, default verify exits immediately with reseed instructions. --seed-testmon, --all, --quick, and commit/pre-push quick paths remain unaffected.

Verification

  • nix develop --command devtools test tests/unit/devtools/test_verify.py -k 'testmon_preflight' → 6 passed, 42 deselected
  • nix develop --command ruff check --fix devtools/verify.py tests/unit/devtools/test_verify.py → fixed import order, 0 remaining
  • nix develop --command ruff format --check devtools/verify.py tests/unit/devtools/test_verify.py → 2 files already formatted
  • nix develop --command devtools verify --quick → exit_code 0
  • nix develop --command devtools verify with stale local seed → exits in ~1s with: pytest-testmon seed was recorded for a different git head

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 43 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 82d0ed54-8f8a-4b96-84b2-acc033beb3d3

📥 Commits

Reviewing files that changed from the base of the PR and between 28e95ab and 2db909c.

📒 Files selected for processing (2)
  • devtools/verify.py
  • tests/unit/devtools/test_verify.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/testmon-seed-freshness

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 and usage tips.

@Sinity
Sinity merged commit 6b117cb into master Jun 18, 2026
11 checks passed
@Sinity
Sinity deleted the feature/fix/testmon-seed-freshness branch June 18, 2026 12:33

@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: 2db909c2a6

ℹ️ 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.py Resolved
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 54.F056 / P1: stale at the checked revision: The seed.json database-fingerprint gate has been removed. Both complete and affected verification now advance the native testmon datafile directly (devtools/verify.py:296), so a successful affected write is not compared with an obsolete seed stamp.

Only the rows listed above are dispositioned. Held findings remain open.

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