Repository navigation
v0.0.4 — fenced checkpoint deletion, and a sentinel that pointed at data loss
Two new exported identifiers, nothing removed, nothing changed. No behaviour change to any existing implementation.
go get github.com/antst/go-yjs@v0.0.4
The coverage gap
PersistenceDeletionFencing covered the log profile from the start and nothing covered the checkpoint profile — an oversight in v0.0.3, not a decision. A checkpoint store could pass every shipped suite while letting a superseded owner erase the document its replacement was serving.
CheckpointPersistenceDeletionFencing asserts the ordinary rejection pair, plus the two that get missed:
- Both rejections must leave the state intact. Returning the right error is not enough — validating the fence and removing state in the same block passes an error-only check with the damage already done. That is what the reporter wrote on their first attempt, before their own test caught it.
- Deletion must not reset the fence high-water mark. A store that forgets the epoch when it forgets the state lets a superseded owner write again at exactly the moment a cascade is running and a stale node is most likely still trying.
Twelve deliberately broken stores now run against the conformance suites in child processes, each of which must fail.
The documentation defect — the more valuable half
An implementer resolving documents through a pointer asked which sentinel a resolved-but-missing target should use.
| said | so a literal reader concludes | |
|---|---|---|
ErrCorrupt |
"durable bytes that cannot form the history" | does not apply — there are no bytes |
ErrNotFound |
"no durable history exists" | this matches |
The wording steered toward the answer that loses data. ErrNotFound makes the caller treat a document that had content as new, seed it with create-time content, and overwrite the last good state on the next save — silently, arriving through the error type.
ErrCorrupt now covers state that is referenced but absent, not only malformed bytes. ErrNotFound now states that it means the store holds nothing — never saved, or deleted — and must not be used for state the store knows about and cannot produce.
Status
The backend layer has now been through a complete real port. Four contract gaps were found and closed, and then the same port completed its remaining work without finding a fifth — which distinguishes an incomplete contract from one nobody was still testing.
crdt/ and protocol/ remain ready to build on: differential oracle across 13 surfaces in both directions on every push, both codecs byte-exact, 20 fuzz targets over the untrusted-byte surface.
It has still not run for a week.