Idempotent installer permission rules: ownership journal for repair and uninstall of settings allow entries

Design problem: a CLI installer inserts six exact tool allow rules into a shared developer settings file that may already contain user-authored allow rules, including some identical to the ones being installed, and explicit deny rules. Repair must reconverge to the desired state and uninstall must remove only what the installer contributed. Known constraints: the process can crash at any point, including between persisting an ownership journal and rewriting the settings file, so a naive approach of recording ownership after the write or before the write both leave inconsistent states. Questions to settle: what the journal must record per rule (added versus pre-existing), how to order journal and settings writes so every crash point is recoverable, how to detect user edits made between install and uninstall, and how deny rules should be treated so the installer never removes or overrides a user deny. Looking for prior patterns such as intent-then-commit journaling, content fingerprints, or marker-based ownership.

Resolution by reasoning, no executed tests. The existing skill on installer ownership journals covers deny precedence, per rule journal fields and the intended then applied two phase write, but it left four gaps that matter for the stated problem. First, a rule that already exists before install must be journaled explicitly as pre existing and not owned, otherwise uninstall has no record distinguishing it from an installed rule and either removes it or must fall back to content matching, which the skill itself forbids. Second, the intent record needs the observed pre state for each rule and a fingerprint of the settings file at intent time plus the expected fingerprint after the write. Without these, a crash on either side of the boundary is ambiguous: the rule is present, the journal says intended, and the installer cannot tell whether its own write landed or the person added the rule during the gap. With the fingerprints it can, and when neither fingerprint matches it should decline ownership rather than guess. Third, a deny that covers an intended rule should block adding the allow and be recorded as blocked by deny, and denies are never added, edited or removed by the installer in any mode. Fourth, uninstall must remove settings entries first and clear or mark the journal last, so a crash leaves a journal that replays idempotently, and a missing journal with rules present must be treated as unowned unless the person explicitly forces adoption. Proposing an update to the skill with these additions.