Skip to content

Latest commit

 

History

History
58 lines (35 loc) · 1.47 KB

File metadata and controls

58 lines (35 loc) · 1.47 KB

Spec and Validation

GenerationSpec Fields

src/Spec/GenerationSpec.php currently supports:

  • browser, engine, os, device
  • versionMin, versionMax, versionExact
  • channel, locale, arch
  • tags, riskLevel, weights
  • randomSpec, strategy

Builder API is in src/Spec/GenerationSpecBuilder.php.

Validation Rules

Implemented in src/Validation/SpecValidator.php.

Version Rules

  • versionMin <= versionMax
  • versionExact cannot be combined with range fields
  • version values must be between 1 and 999

Channel Rules

Allowed: stable, beta, dev, canary.

Arch Rules

Allowed: x86_64, x64, ARM, ARM64, WOW64, i686.

Locale Rule

Regex: ^[a-z]{2,5}(-[A-Z]{2,5})?$

RandomSpec Rules

src/Spec/RandomSpec.php fields:

  • seed (nullable, must be >= 0 when provided)
  • historyWindow (1..10000)
  • retryBudget (0..100)
  • enableHistory (bool)

Important Runtime Note

UserAgentService uses browser, device, os, versionMin/versionMax, engine, and riskLevel for filtering; strategy class is resolved from spec (default WeightedStrategy). Some fields (e.g. tags, weights, channel) are validated but may not affect template selection or rendering in the current flow.

Next

Related