Problem
Append-only state files are central to the protocol, but the implementation should better protect them from accidental conflict markers, header rewrites, missing final newlines, and unsafe git merges.
Proposed change
Add protocol-level append-only invariants, git-substrate guidance for merge behavior, and validator checks for common corruption patterns.
Acceptance criteria
- Kernel wording explains append-only correction by adding new entries, not rewriting history.
- Git-substrate guidance covers safe merge behavior for append-only logs.
- Validator tests catch conflict markers, duplicate top-level headers where relevant, and missing final newlines.
- Documentation explains limitations and when human review is still required.
Problem
Append-only state files are central to the protocol, but the implementation should better protect them from accidental conflict markers, header rewrites, missing final newlines, and unsafe git merges.
Proposed change
Add protocol-level append-only invariants, git-substrate guidance for merge behavior, and validator checks for common corruption patterns.
Acceptance criteria