## TL;DR
Auto-match rules reference accounts in two ways: by internal id, which survives renumbering, and by code string, which does not. The failed rules are the string-referencing ones, now pointing at codes that no longer exist or, worse, at codes reused for different accounts. Inventory the rules, repoint every code reference to the new chart, check for code reuse collisions, and run each rule family against a known transaction set before trusting auto-match again.

```text
auto-match rules stopped working after the chart of accounts renumbering: "rule failed" error
```

## Use this when
- Auto-match stopped or errors with rule failed right after a chart renumbering project.
- Manual matching still works, so the data and accounts themselves are fine.
- Some rules still run, suggesting only some reference styles broke.

## Not for this skill when
- Rules failed before the renumbering too. This is a standing rule quality issue, not a renumbering casualty.
- Matching fails because bank data changed format. Check the feed before rewriting rules.

## Steps
1. List all auto-match rules with their conditions, especially any condition naming an account code, a range of codes, or a default posting account. Verify: every rule's account references are inventoried
2. Map each referenced old code to its new code from the renumbering crosswalk, and flag any old code that now belongs to a different account. Verify: collisions where a code was reused are explicitly flagged
3. Update the rules to the new codes, prioritising rules whose old code was reused, since those may mispost rather than fail. Verify: updated rules reference only current codes
4. Check postings made by auto-match between the renumbering and the failure for misrouted items under reused codes. Verify: any mispostings in the gap window are found and reclassed
5. Run each rule family against a sample of known transactions and confirm expected matches and postings. Verify: every rule family passes its sample before auto-match is re-enabled fully

## Variant phrasings
### auto match rules broken chart of accounts renumbered
The renumbering casualty phrasing.
### bank rules rule failed after account code changes
Searching by the rule failure timing.

Compatibility: Auto-match and bank rule engines in QuickBooks, Xero, NetSuite, and Sage after chart changes.

## Why it happens
Renumbering projects plan for reports, mappings, and integrations, but rule engines hide their account references inside condition builders that few inventories capture. Rules referencing codes by string break loudly when codes vanish and dangerously when codes are reused: the rule still fires, posting to a live but wrong account. The dangerous window is between renumbering and discovery, which is why checking gap postings matters as much as fixing the rules.

## Edge cases / pitfalls
- Prefer rule references by account id or by account name tokens that do not change with numbering, where the platform allows.
- Add rule engines and feed mappings to the chart-change checklist permanently; they are the two places code strings hide.
- Code reuse in the same fiscal year is the root hazard. If governance allows, retire codes for a year before reusing them.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_RxJ6fmoWxPSxvx86liyntA
