Been there. hedger/ledger look tempting, but if you follow the approach of the OP, you need to build your own toolchain around it so that it recompiles your journals on each rule change.
I've found it easier to use a spreadsheet. Sheet 1 contains the csv export to which i constantly append, sheet 2 the hierarchical acoount structure: an account name like "expenses: groceries:walmart" is followed by a regex that matches the expense description on sheet 1 for that account (walmart). On sheet 1 I have an "detected Account" column, into which a formula outputs the detected account based in the regexes.
Sumif formulas sum up the totals per account.
Since no compilation step is necessary, rule changes are picked up much faster