[hledger] Auto posting that excludes previously matched postings

Using hledger, is it possible to write an auto posting rule that excludes previously matched postings? I expected I could use tag:_generated-posting, but it's not working with auto postings. It matches the expected transactions when I check with areg though.

For instance:

= expenses:rent [budget:rent] *-1 [assets:checking] *1 = expenses AND not:tag:_generated-posting [budget:undeclared] *-1 [assets:checking] *1 

I'm trying to set up envelope style budgeting à la https://frdmtoplay.com/envelope-budgeting-with-ledger/, but without having the manually write a not:expr:"{every single previously matched expense account} "

I'm happy to add more detail if it helps. I'm hoping it's a bug and not an impossibility.

edit: A complete example:

= expenses:rent AND not:tag:_modified [assets:budget:rent] *-1 [assets:checking] *1 = expenses AND not:tag:_modified [assets:budget:undeclared] *-1 [assets:checking] *1 2024-03-01 * Budget [assets:budget:rent] 1200.00 USD [assets:checking] -1200.00 USD 2024-03-01 * Opening Balance assets:checking 2000.00 USD equity 2024-03-02 * Landlord expenses:rent 1200.00 USD assets:checking -1200.00 USD 2024-03-03 * Grocery Store expenses:groceries 80.00 USD assets:checking -80.00 USD 
submitted by /u/72n40
[link] [comments]
This is a companion discussion topic for the original entry at https://www.reddit.com/r/plaintextaccounting/comments/1b7nznb/hledger_auto_posting_that_excludes_previously/