test(leyline): gate leyline-schema/binary version parity (mache-b8af69)#469
Conversation
…ty (major.minor) mache carries two independent leyline versions — the go.mod leyline-schema client pin and the leylineBinaryVersion const (daemon binary). Per socket.go the patch may float but major.minor must match (the wire format). Until now only a comment + a human kept them in lockstep — the setup that produced the stale-cached-0.4.1 skew (mache-0acdf6). This makes the invariant executable: a minor/major bump to one without the other fails CI. Complements the runtime handshake (mache-8kif, blocked on LLO version op).
find_smells (advisory)Scoped to files changed in this PR. Rules below run on the standalone (no-LLO) cross-ref tables; No structural smells in changed files. ✓ Rules: the registry is |
There was a problem hiding this comment.
Pull request overview
Adds an executable “drift guard” test to ensure the Go leyline-schema client version pinned in go.mod stays compatible with the pinned leyline daemon binary version (leylineBinaryVersion) by enforcing major.minor parity.
Changes:
- Introduce
TestLeylineSchemaBinaryVersionParitythat readsgo.mod, extractsleyline-schema’svMAJOR.MINORand compares it toleylineBinaryVersion’svMAJOR.MINOR. - Add a small
repoRoothelper to locate the module root (by walking up togo.mod) so the test can reliably read the pinned module version.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Executable drift guard. mache carries two independent leyline versions:
go.modpin of the Go schema client (…/clients/go/leyline-schema, currentlyv0.5.6)leylineBinaryVersionconst (the daemon binary mache downloads, currentlyv0.5.7)Per
socket.go's design note the patch may float (a daemon-only LSP fix ships a binary with no wire change), but major.minor must match because that's the wire/schema format the Go client decodes. Today only a comment + a human keeping two pins in lockstep enforce it — the exact setup that produced the stale-cached-0.4.1skew (mache-0acdf6).This test parses the
leyline-schemarequire line fromgo.modand theleylineBinaryVersionconst and fails if their major.minor disagree.0.5 == 0.5today (passes); a future minor/major bump to one without the other reddens CI.Complements the runtime handshake
mache-8kif(blocked on LLO shipping a daemonversionop —ley-line-open-b9db7f); this is the cheap build-time half that needs no LLO change.Verification:
go test ./internal/leyline/ -run TestLeylineSchemaBinaryVersionParity→ PASS;go vet→ clean.