Beginner StringHashMaps data gets corrupted

var table = self.get_rules_table();

This is creating a copy(!) of the table meta data(like its size and stuff). So when you add a new element your original table won’t be modified. You might still be able to see some changes correctly, but for example when the internal data structure gets resized the original table wouldn’t know about it.

Instead you should change the self.get_rulse_table(); to return a pointer of the table:

pub fn get_rules_table(self: *Context) *std.StringHashMap(Rule) {
    return &self.rules_table;
}