I've recently dealt with this, and agree that this is largely subjective. Your proposal, to implement clear rules at the start, is highly recommended. I tend to do an "initial consultation" for free: an hour where we just sit and have coffee. If I'm interested, and have time, I'll suggest that I'd love to participate, but have to make sure that participation is respectful to myself and my other responsibilities. For example (as a professor), I'll fall back on something like "I'd love to contribute, but I need to justify the time expenditure to my department chair/dean/tenure committee/spouse/dog. Would you be comfortable treating my help as a collaboration that leads to authorship?" I tend to expound on a "minimum" contribution needed for that, write an e-mail summing up our conversation, and go from there.
One other thing to consider in these conversations are standards of ethics put forth by different professional organizations. I often work with psychologists, so I tend to lean on the APA standards (which I'll base the rest of my response on). A quote from the main page:
Authorship credit should reflect the individual's contribution to the study. An author is considered anyone involved with initial research design, data collection and analysis, manuscript drafting, and final approval.
On the website, this is directly contrasted with: funding, mentorship, and not participating in the actual publication. The last one is tricky, and how I interpret it is: if you aren't using analysis that I ran/interpreted, my statistical tables, any graphics I made, or any of my writing (obviously), then I'm not contributing. From my perspective, though, if you use even one of those things in the manuscript/presentation, I have contributed to the manuscript in a tangible way, and should be included. I feel obligated to mention (as this has happened) that, from my perspective, if you take my code and change the color of the plot and include it, you're still presenting a product of someone else (and need to provide credit for that).
I believe the need to provide credit is the primary consideration. If you have a published software, you shouldn't be given authorship as credit for its use (as a citation to the software is sufficient). If you have a paper on a unique method, you shouldn't be given authorship as credit for its use. Now, if you designed a program or statistic, you probably should be given authorship, as there isn't another appropriate way to provide credit (an acknowledgement doesn't count for that, in my opinion).
Speaking of that, I believe acknowledgements should come in for a small contribution that doesn't result in authorship (maybe data cleaning, data collection, etc). Notice that these have no writing and no tangibles of this will be used directly in the manuscript. If someone does something "monotonous" and writes, though (say, a lit review), they should absolutely be included as an author.
All said and done, having the conversation up front should indicate the type of compensation you get (and if you don't feel comfortable building a custom database from scratch for an acknowledgement, it is better to know that up front). Establishing a minimum, tangible contribution for that compensation can provide establishes clarity for all researchers.