I think it's possible as long as you define the work very generically.
For example, replace "finish task X" with "participate in more code reviews" or "improve documentation". Sure it may water down the review, but at least at the end of the year you can reflect back on your general performance and measure it in some way.
If I tell someone "if you improve documentation, you will get a $10k raise", then I am tying a very well defined reward a very poorly defined task.
"Improve documentation" could mean fixing some typos. Or it could mean documenting every un-documented public class and method. Or it could mean refactoring code to make it easier to use so less documentation is needed.
These all have very different value. In a year's time, I'd have to justify why only one of them actually might warrant the 10k raise. It is *much* worse to tell someone "you were promised a raise... now you aren't getting it", than to never offer or give the raise in the first place.
> As engineers we want everything to be black and white
should not be true of "us engineers". Engineering is balancing trade-offs, and any moderately complex system is a big hairy ball of tradeoffs, some of them (in the best case) unarticulated. I get suspicious of boolean logic applied to real world, especially after working in AI for a long while.
That black and white thinking is characteristic of juniors, and some mathematicians dealing with models disconnected from the real world.
> drew a straight line between here's what you need to do to get this much of a raise or this much of a bonus
This is really really hard to do. It's not a good idea (or even a practical idea) to plot out all the work that you want an employee to do in a year, or even in a quarter.
You can prove this to yourself. Try and write down all the things you would like to get done over the next year and how much of a bonus you think you should earn for each thing. If you're in sales this is easy - it's a sliding scale ratio between revenue won and bonus. If you're in product or engineering I suspect you will not find it so simple.
If you've read posts like "Being Glue" (https://noidea.dog/glue), they talk the importance of work that's impactful within the team but very difficult to measure. If companies tried to draw a straight line between visible work and raise/bonus, nobody would ever choose to be glue.
This isn't to say that everyone is happy with how annual reviews work. As engineers we want everything to be black and white. If I pass this unit test, I get a pay rise. As managers who used to be engineers, we'd love to be able to give engineers that clarity, because you're right, they would get hyperfocused on it and we'd get a lot more out of them. But nobody's worked out a way to make it work.
Believe me: if you can invent a technique (and make a product around it) that enables this, you'll make a lot of money selling it to every single software company.