Skip to content

Give a subscription share a shape that survives a rollback - #9

Merged
lr00rl merged 1 commit into
integrationfrom
feat/principal-design16-share-model
Aug 5, 2026
Merged

Give a subscription share a shape that survives a rollback#9
lr00rl merged 1 commit into
integrationfrom
feat/principal-design16-share-model

Conversation

@lr00rl

@lr00rl lr00rl commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

First task of design-16 sub-project 1. Model only — no behaviour, no consumers yet.

Extra captures fields written by a newer schema version and re-emits them, so a server reading a record it does not fully understand cannot silently delete the parts it did not recognize. Additive migration is the release law (rules/01 §8); this is what makes it true in the record rather than only in the process.

A known field always beats a same-named Extra entry. That has its own test because the merge direction is easy to get backwards and the symptom — a write that appears to succeed then reads back stale — looks like a caching bug rather than a serialization one.

Gates: gofmt clean · go vet ./... · go test -race ./... green (model, plugin).

Extra captures fields written by a newer schema version and re-emits them, so a
server reading a record it does not fully understand cannot silently delete the
parts it did not recognize. Additive migration is the release law; this is what
makes it true in the record rather than only in the process.

A known field always beats a same-named Extra entry, so an edit the caller just
made cannot be shadowed by whatever an older decode stashed. That case has its
own test because the merge direction is easy to get backwards and the symptom --
a write that appears to succeed and then reads back stale -- looks like a caching
bug rather than a serialization one.

Tested: go test -race ./... (model, plugin); gofmt; go vet ./...
@lr00rl
lr00rl merged commit 5478e57 into integration Aug 5, 2026
1 check passed
@lr00rl
lr00rl deleted the feat/principal-design16-share-model branch August 5, 2026 09:45
@lr00rl

lr00rl commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

A second commit landed on integration from this same branch after the first merge: 5de2ef6 (no-ff merge) adding SubscriptionSnapshot.

Recording it here rather than opening a second PR for one model file, per rules/01 §8.5's requirement that a landing not go unreported.

The snapshot is held by the core, not the plugin, and the reason is worth keeping with the model: a plugin cannot reach bolt, and its runtime working directory is deleted by SystemRunner.Stop by design. A plugin has no durable storage that is not the state file, so the core stores the bytes as an opaque blob and hands them back on the next render. SnapshotKey separates its two parts because concatenating them would let one subscription's content be served under another's id.

Consumers: lattice-server pins v0.2.19-0.20260805102934-5de2ef61a718.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant