Where rules come from
Read from code
Most rules come straight from your codebase - found during a code scan and anchored to the file and symbol that enforces them, with the enforcing snippet attached so you can see the ground truth.
Promoted from a deviation
A confirmed deviation that isn’t grounded in code yet can be promoted into a rule of its own - so Glassray starts watching for it even before the code catches up. A promoted rule is marked “not in code” until a later scan finds the matching code, or you merge it into one that already exists.
Watched vs. archived
A rule is either watched or archived:- Watched - judged on every trace. A trace that breaks it surfaces as a deviation.
- Archived - retired. No longer judged, and its backing deviations return to the unmatched pool.
Keeping rules and deviations in sync
A deviation is always found against a rule, but the two can drift apart - a deviation Glassray couldn’t confidently match to one of your existing rules shows up as unmatched. From there you can:- Link it to an existing rule it actually violates, instead of leaving it stranded.
- Promote it into a new rule, if it’s a real behaviour nothing currently covers.
- Dismiss it as noise, if it isn’t a real behaviour at all.