Given a Mustache template that is being rendered via a files promise, the result is not propagated correctly in case where the files promise is part of an agent bundle called via a methods promise. E.g.:
If the promise is being repaired, then it will report "Template repaired", but not "Template repaired via method".
Judging from the code, the culprit here is `FinishEditContext` in "cf-agent/files_edit.c". It tries to deduce whether a given change was a real change or not by taking a look at the edit context. As `RenderTemplateMustache` will never increment `ec->num_edits`, we wrongly end up in the last `else if (ec)` branch and report that no edit change has been performed.
Simply fixing this by incrementing `num_edits` doesn't work, though, as in this case cf-agent will try to re-safe the edits via `SaveItemListAsFile`, which results in an empty target file. The following patch fixes both the empty target file as well as the missing class propagation, but it's at least only one part of solving the problem, if not outright wrong: