From the API point of view of a cookbook using dbctl it would be really useful to be able to access the diff in a more structured way in addition to the list of lines of diff already formatted by the diff library.
A practical example is the depool/pool cookbook that wants to check that no spurious dbctl changes gets committed with the depool/pool action.
It currently has some heuristic to do so here but it doesn't catch all the cases.
In particular the ones where an instance is the only one part of a group (e.g. vslow) and hence the whole block is removed/created upon depool/repool. Also being the last item of a JSON list creates issues with the diff for the comma on the previous line. Some cases are catched by the current heuristic but is far from optimal and also doesn't cover them all.
Ideally dbctl should expose from the dbctl.config.diff() method also some more structured data about the diff so that a client could more easily check the diff.
Spicerack locks here can't help as dbctl is expected to also be run via CLI directly.