My AI kept passing its own tests — because it was cheating. So I built hard-coded tools that don't let it lie to me anymore. This is the next step before training a real model: forcing the model to fail, catching exactly how it fails, and baking the fix directly into the code so it's physically impossible to skip. No more trusting the model's word for it. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🧠 WHAT YOU'LL LEARN ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ► Why AI models default to WPF syntax instead of real Avalonia XAML ► Building a Roslyn analyzer ("guard rail") that forcibly corrects broken output ► The exact bugs models keep making: bad grid rows, transparent-background + gradient conflicts, missing resources ► Why SVG support breaks almost every model — and how to force the fix at a code level instead of trusting the AI to follow instructions ► What changes when you swap a small model (Qwen 2B) for a much larger one (Qwen 27B) ► Why this "hard-coded enforcement" step has to happen before any real fine-tuning can work ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 CHAPTERS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0:00 The goal — guard rails before fine-tuning 0:30 First guard rail: blocking WPF-legacy grid syntax 1:45 Testing the small model against the rail 4:07 Layout holds — first guard rail proven 5:06 Second prompt: gradients, header bar, logo, fonts 6:38 Compilation errors, immediately 7:13 Fixing the transparent background + gradient conflict 8:40 Adding resource detection to the tool 9:02 The SVG problem — Avalonia has no native support 9:19 Forcing the correct SVG package install through code 10:49 Re-running the prompt with the updated guard rails 11:50 The model flailing and inventing its own fixes 13:43 Auto-applying the SVG rule so it can't be ignored 14:16 Switching to a bigger model — Qwen 27B 16:27 First real compile 17:28 What's actually working now 18:14 New gradient syntax bug uncovered Wrap up — what comes next ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔗 LINKS & RESOURCES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🌐 AngelSix: https://www.angelsix.com 📂 GitHub: https://github.com/angelsix 📋 Full Series Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQUEVov5qPNrLyaBAKDCNcPD ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #avalonia #avaloniaui #csharp #aiagent #machinelearning #softwaretutorial #dotnet
My AI kept passing its own tests — because it was cheating. So I built hard-coded tools that don't let it lie to me anymore.
This is the next step before training a real model: forcing the model to fail, catching exactly how it fails, and baking the fix directly into the code so it's physically impossible to skip. No more trusting the model's word for it.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
► Why AI models default to WPF syntax instead of real Avalonia XAML
► Building a Roslyn analyzer ("guard rail") that forcibly corrects broken output
► The exact bugs models keep making: bad grid rows, transparent-background + gradient conflicts, missing resources
► Why SVG support breaks almost every model — and how to force the fix at a code level instead of trusting the AI to follow instructions
► What changes when you swap a small model (Qwen 2B) for a much larger one (Qwen 27B)
► Why this "hard-coded enforcement" step has to happen before any real fine-tuning can work
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 CHAPTERS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0:00 The goal — guard rails before fine-tuning
0:30 First guard rail: blocking WPF-legacy grid syntax
1:45 Testing the small model against the rail
4:07 Layout holds — first guard rail proven
5:06 Second prompt: gradients, header bar, logo, fonts
6:38 Compilation errors, immediately
7:13 Fixing the transparent background + gradient conflict
8:40 Adding resource detection to the tool
9:02 The SVG problem — Avalonia has no native support
9:19 Forcing the correct SVG package install through code
10:49 Re-running the prompt with the updated guard rails
11:50 The model flailing and inventing its own fixes
13:43 Auto-applying the SVG rule so it can't be ignored
14:16 Switching to a bigger model — Qwen 27B
16:27 First real compile
17:28 What's actually working now
18:14 New gradient syntax bug uncovered
Wrap up — what comes next
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌐 AngelSix: https://www.angelsix.com
📂 GitHub: https://github.com/angelsix
📋 Full Series Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQUEVov5qPNrLyaBAKDCNcPD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#avalonia #avaloniaui #csharp #aiagent #machinelearning #softwaretutorial #dotnet