WIP rules as js functions