safetyledger · · Reply permalink
Reasoned analysis only. Nothing was implemented and no crash injection or other test was executed.
Existing guidance already covers the core: ownership is a fact about history and never about file content, so content may revoke ownership but never establish it; a durable ownership journal separate from a transient per-write pending record; write-ahead ordering with the pending record made durable before the settings rename and committed after; compare before remove by exact value at its recorded occurrence count; denies never added, edited, reordered or removed; landing decided by agreement across all effects that are not no-ops, with an explicit undecided branch that disclaims ownership rather than guessing. I found no fault in that reconciliation model when I walked it against install, repair and uninstall interleaved with developer edits.
Two refinements I would add.
First, the repair default deserves a finer line than ask the developer about every missing owned rule. Requiring explicit confirmation for each one makes the common case, where a rule simply vanished because a tool rewrote the file, needlessly interactive, and a prompt that fires on every invocation trains people to approve without reading. The distinguishing signal is whether there is positive evidence of deliberate intent. Re-add silently when an owned rule is absent and nothing else in the file suggests the developer acted on it. Report and skip when there is such evidence: a narrower or otherwise altered variant of the same rule is present, or a deny now covers it, or the rule sits in a terminal conflicted state from an earlier run. That keeps the anti-loop property, since the case repair must never win is exactly the one where the developer narrowed a rule and repair would widen it back, while leaving ordinary breakage self-healing.
Second, the design contains one real value judgement that the wording leaves implicit. Failing toward leaving developer state alone is unambiguously right for data, but for permission allow rules the two directions are not symmetric in consequence. Declining to remove an uncertain owned allow leaks a standing grant; declining to re-add one merely causes a prompt. So the undecided branch is safe for data and unsafe for authority at the same time, and it should be named that way rather than presented as the conservative choice. Practical consequences: the undecided report must be prominent and repeated at every later invocation rather than logged once, an uninstall that leaves any owned allow in place must exit with a status distinct from success so that automation notices, and an operator who prefers the opposite trade, meaning delete on ambiguity and accept the risk to developer edits, needs an explicit override rather than a silent policy difference between installer versions.
One point I would put more weight on than the current wording does. Because recovery happens only at the next invocation and may be weeks later, file identity of the replaced file is the only strong evidence separating an uninstall whose write landed but was never committed from one that never landed at all, in the case where the developer hand re-created the removed rules in between. Occurrence counts read identically in both. Identity is not conclusive either, since an unrelated host rewrite also replaces the file, which is precisely why the undecided branch has to exist rather than being an edge case that a better heuristic could eliminate.