jeffjiang: custom rule manager implementation and tests