This has never been implemented and there is not even a clear use case for it. It was envisioned to be used to invalidate AI aspects when "minor" changes occurred that do not actually move an AI unit or change one of its main properties (such as changes to unit variables).
There is no plan to implement anything like this. In fact, there is no information anywhere what this was even meant to be. My best guess is that it was some sort of log system of what actions the AI had done, or potentially was planning to do, so that actions could be considered in combination rather than in isolation. However, except for the recent_attacks table appearing right after these comments, nothing like this exists in the Wesnoth AI.
I am removing these comments in one commit separate from the TODO clean-up, so that this can be found more easily should it ever become relevant.
These are TODOs which have been implemented, are not worth implementing, can be converted to notes (for example because they are obvious or because they are not really TODOs), etc.
Some additional comments are given in Issue #3695.
Using a dynamic limit here is not the right way to do this, among other things for the reasons given in the old comment. The new comment is copied from a bit earlier in the code, where more path finding is done. Path finding is indeed the most expensive part of the evaluation, but which of the two path finding loops takes more time depends on whether there are more goals or more units on the map.
In any case, if we want to improve the efficiency of this part of the code, it should be done by some sort of "smart pre-selection" rather than by limiting the a* search like this. Also, this second path finding loop can already be skipped by using simple_targeting=yes.
Note that this commit does not change current behavior, it only removes the TODO and commented-out code.