Documentation
¶
Overview ¶
Package releaseidentity defines release-wide claims. Valid structure is not authentication: only releasetrust can establish a verified release.
Index ¶
- Constants
- func CompareUpdateVersions(a, b *semver.Version) int
- func SafeName(name string) bool
- func ValidateTarget(profile Profile, version string, sequence uint64, commit string) error
- type Digest
- type Engine
- type Identity
- type Migration
- type MigrationManifest
- type Profile
- type SnapshotFloor
- type Source
Constants ¶
const ( FreshGenesisV1 = "fresh/v1" LegacyGenesisV1 = "legacy/v1" )
const ( SQLite Engine = "sqlite" Postgres Engine = "postgres" MaxMigrations = 4096 MaxMigrationBytes = 4 << 20 )
Variables ¶
This section is empty.
Functions ¶
func CompareUpdateVersions ¶
CompareUpdateVersions orders nightlies after their stable base and its other prereleases: they may contain migrations added after that stable release. All other comparisons retain SemVer ordering. This is eligibility, not migration authorization.
Types ¶
type Identity ¶
type Identity struct {
Profile Profile `json:"profile"`
Version string `json:"version"`
Sequence uint64 `json:"sequence"`
Commit string `json:"commit"`
CompatibilitySHA256 Digest `json:"compatibility_sha256"`
ManifestSHA256 Digest `json:"manifest_sha256"`
}
Identity deliberately excludes platform and installation identity. Every architecture of one release shares this identity; artifact bytes are bound separately by its verified release manifest.
type MigrationManifest ¶
type MigrationManifest struct {
Engine Engine `json:"engine"`
Entries []Migration `json:"entries"`
}
MigrationManifest is ordered by strictly increasing goose version. Its digest covers the engine and each exact migration byte digest in that order.
func BuildMigrationManifest ¶
func BuildMigrationManifest(source fs.FS, directory string, engine Engine) (MigrationManifest, error)
BuildMigrationManifest reads the actual source-owned SQL bytes. Callers pass the embedded migration filesystem or an explicit build-time filesystem; this leaf package never imports datastore adapters.
func (MigrationManifest) Clone ¶
func (m MigrationManifest) Clone() MigrationManifest
func (MigrationManifest) Digest ¶
func (m MigrationManifest) Digest() (Digest, error)
func (MigrationManifest) Validate ¶
func (m MigrationManifest) Validate() error
type SnapshotFloor ¶
type SnapshotFloor struct {
MetadataSequence int64 `json:"metadata_sequence"`
MetadataSHA256 Digest `json:"metadata_sha256"`
HighestReleaseSequence int64 `json:"highest_release_sequence"`
CatalogSequence int64 `json:"catalog_sequence"`
CatalogSHA256 Digest `json:"catalog_sha256"`
}
SnapshotFloor is an untrusted persisted claim, not signature authority. The verifier authenticates new values; the ledger atomically preserves them.
func (SnapshotFloor) Advance ¶
func (f SnapshotFloor) Advance(next SnapshotFloor) error
Advance refuses counter rollback and equivocation. Root/domain equality is a separate mandatory installation binding owned by the calling ledger.
func (SnapshotFloor) Validate ¶
func (f SnapshotFloor) Validate() error
type Source ¶
type Source struct {
Genesis string `json:"genesis,omitempty"`
Release Identity `json:"release,omitzero"`
}
Source names either an exact release or an explicitly declared fresh/legacy genesis. It is a claim: accepting a genesis still requires F2's independent complete schema/migration inspection. Engine migration and schema digests travel alongside this value, never as an invented release identity.