Skip to content
.md

Freshness Policies

The strictest policy requires every PR to be tested against the exact current state of main. But this isn’t always necessary.

Freshness PolicyDescriptionUse Case
StrictMust be tested against current HEADCritical systems, regulated industries
Within N commitsCan be up to N commits behindBalance between safety and throughput
Within scopeOnly up-to-date within its partitionMonorepos with independent components
Time-basedValid for N minutes after queue CI passesHigh-velocity teams with fast CI

Strict freshness means every merge invalidates all in-flight queue tests. With high PR volume, this creates a race condition where PRs struggle to merge.

Example:

  • PR #1 passes queue CI at 10:00
  • PR #2 merges at 10:01
  • PR #1’s test is now “stale” and must re-run

With relaxed freshness (e.g., “within 2 commits”), PR #1 can still merge if it’s only 1 commit behind.

Strict Freshness

Lower Throughput

Maximum Safety

Relaxed Freshness

Higher Throughput

Theoretical Risk

The risk is usually theoretical because:

  • Most PRs don’t conflict semantically
  • Type systems catch many integration issues
  • Runtime failures are rare for unrelated changes
Team ProfileRecommended Policy
Regulated/complianceStrict
High-velocity startupTime-based (5-10 min)
Monorepo with scopesWithin scope
Medium velocityWithin 2-3 commits

Freshness policies work well with: