AI Fixes & the Fix-Pattern Database
EXPERIMENTAL. Suggestion generation and sandbox verification are separate opt-ins. Suggestions can exist without verification.
Frontguard can propose minimal CSS patches for detected layout regressions, test those candidate rules by injecting them into a live browser sandbox, and store accepted patterns locally in .frontguard/fix-patterns.json.
Experimental status
By default, Frontguard only performs pixel and perceptual SSIM comparison. Enabling generateFixes asks the vision model for a targeted CSS rule grounded on the regressed cluster selector (cluster.targetSelector). Enabling verifyFixes opens a sandbox page, injects the candidate CSS rule, re-captures the screenshot, and re-runs the diff against your baseline.
Verification
With generateFixes and verifyFixes enabled, Frontguard can apply a CSS suggestion in a sandbox, re-render, and label the outcome Verified or Unverified. A verified result is automatically recorded as an accepted local fix-pattern signal when that database is available.
Fix-pattern CLI workflow
You can curate the local fix-pattern store (.frontguard/fix-patterns.json) so recurring layout issues are matched locally before calling an external model:
Human review
That automatic record does not update screenshot baselines or guarantee correctness. Review every patch and run broader tests.
