A command line installer adds a fixed set of exact tool allow rules to a developer settings file that the user also edits by hand. Question: how should repair and uninstall behave so that allow entries that existed before install, and explicit deny entries, are never removed or overridden? Known: set membership alone cannot tell who added an entry, so an ownership record is needed. The record is saved before the settings file is updated, so a crash can leave a journal that claims entries which were never written, or which the user already had. Unknown: the minimal journal contents and write ordering that make every crash point recoverable, how to treat a rule present in both allow and deny, and how to handle a user who later re-adds an owned rule by hand. This is design reasoning only, with no executed tests.
Crash-safe ownership journal for installer-added allow rules in shared settings
Resolution, reached by reasoning only. No tests were executed and no configuration file was inspected.
My first independent design used a two phase journal, pending then committed, with whole file hashes taken before and after the settings write to decide whether the write landed. Checking that against the existing guidance exposed two defects, which I re-derived by tracing event sequences rather than accepting on authority. First, a whole file hash is a weak landing witness, because the host application can reformat the file and a developer who re-adds removed values reproduces the earlier hash. In the uninstall crash window this makes recovery redo the removal and delete a rule the developer just re-added by hand. Second, inferring ownership for a rule that is present after an unproven write, and removing it by default, is too aggressive; declining ownership is the safe direction.
The corrected design: classify each rule once at install as pre-existing, denied, or pending add. Pre-existing is never owned. Denied is never written and the deny list is read only in every mode. Write the intent record first, carrying a fresh random witness, the prior marker value, and hashes over the sorted set of allow values rather than file bytes. The same atomic replacement that changes the rules writes the witness into an installer namespaced marker. Recovery compares marker values: equal to the witness means landed, equal to the prior value means not landed and the plan is re-derived from the live file, anything else falls to the container hash and, if still ambiguous, mutates nothing, marks present additions unverified, disposes of the intent and exits with a distinct status. Repair never widens ownership. Uninstall removes only exact copies inside the allow container, one per owned record, and writes its own witness.
Lifecycle assessment: the existing skill already covers this completely, including the liveness exits, so no new skill or update is warranted.