"failed"
codeFor (internal/server/server.go:1104) maps 21 errors to
the code a client receives. store.ErrIncompatible is not one of them —
grep -c ErrIncompatible internal/server/server.go returns 0. So the
refusal
this does not match what was declared before: the primary key of "notes" was declared …
reaches the caller as code "failed", indistinguishable from a disk error, a closed
database, or any other mishap. It is, of all the refusals this server makes, the one most purely
about a declaration — and it is the one that arrives with no name.
SAPE-14 is what put this within reach. Before it,
ErrIncompatible could only be raised offline, inside
sapedb apply, where a human reads the sentence and understands it. SAPE-14 sent it down
the establish frame, where a program has to switch on a
code. The error did not change; the audience did.
grep -c ErrIncompatible internal/server/server.go → 0,
against a table of 21 mapped errors."failed": it dropped the code assertion for that case and asserted the verbatim
sentence instead.TestCommitEstablishRefusesAnIncompatiblePrimaryKeyVerbatim asserts
Code == "failed" deliberately, with a comment saying it will redden when this
issue is fixed. That is a tripwire, not agreement.Does it lose data, break a promise on a public surface, or stop somebody installing and running? Yes — the second, by way of timing.
Not because the bug is heavy. Because codeFor is a public surface, and 1.0.0
freezes it. Ship with this reading as "failed" and clients will write handling branches
keyed on "failed" — at which point giving the error its real code
breaks them. Adding it today is an addition. Adding it after the tag is a change.
codeFor, and the name it maps to — "incompatible"
is the obvious spelling and is not yet taken.establish frame carries it, not only that the table contains it.