Documentation
¶
Overview ¶
Package release plans schema-family versions from caller-supplied evidence. It deliberately does not claim to prove schema compatibility.
Index ¶
- Constants
- func Recover(rootPath string) error
- func ReservedTransactionPath(path string) bool
- type Artifact
- type ArtifactChange
- type BreakingFix
- type ChangeKind
- type ComparisonRef
- type ComparisonResult
- type CompatibilityEvidence
- type CompatibilityOverride
- type ContentID
- type DeletionArtifact
- type Direction
- type FilePrecondition
- type GeneratedVersion
- type ImportKind
- type ImportPin
- type Issue
- type JavaArtifactInventory
- type JavaArtifactLimits
- type JavaArtifactVerification
- type MavenCoordinates
- type MavenPlan
- type MavenPlanningInput
- type PlanResult
- type PlanningInput
- type PromotionFamily
- type PromotionImport
- type PromotionInput
- type PromotionResult
- type PublicationFile
- type PublicationLedger
- type PublicationPlan
- type PublicationPlanningInput
- type PublicationRecord
- type PublicationState
- type PublicationTarget
- type PublishedRelease
- type ReleaseBaseline
- type ReplacementArtifact
- type Version
Constants ¶
const PublicationLedgerVersion = 1
const TransactionLockName = ".refine-release.lock"
TransactionLockName is shared by project generation and release promotion. Both mutate owned outputs and must serialize with one another.
Variables ¶
This section is empty.
Functions ¶
func Recover ¶
Recover rolls back incomplete transactions and removes committed transaction metadata. It refuses malformed journals and only removes destinations that are still hard links to this transaction's staged inode.
func ReservedTransactionPath ¶
ReservedTransactionPath identifies root-level internal transaction state. Callers pass a cleaned relative path. Case folding prevents platform-specific output bundles from claiming the lock or a staging directory.
Types ¶
type ArtifactChange ¶
type ArtifactChange uint8
const ( ArtifactNoChange ArtifactChange = iota ArtifactPatchChange ArtifactFeatureChange ArtifactBreakingChange )
type BreakingFix ¶
type BreakingFix struct {
Comparison ComparisonRef
Justification string
}
BreakingFix is separate even when it targets the same comparison.
type ChangeKind ¶
type ChangeKind uint8
const ( NoChange ChangeKind = iota DocumentationOnly CompatibleFix CompatibleFeature BreakingChange )
type ComparisonRef ¶
type ComparisonRef struct {
Family string
Baseline Version
BaselineContent ContentID
CandidateContent ContentID
Direction Direction
}
ComparisonRef identifies a comparison by both versions' exact content. The candidate is a SNAPSHOT, so its eventual version is deliberately not part of the identity.
type ComparisonResult ¶
type ComparisonResult uint8
ComparisonResult is explicitly three-valued. Unknown is not compatibility.
const ( ComparisonValid ComparisonResult = iota + 1 ComparisonInvalid ComparisonUnknown )
func (ComparisonResult) String ¶
func (r ComparisonResult) String() string
type CompatibilityEvidence ¶
type CompatibilityEvidence struct {
Comparison ComparisonRef
Result ComparisonResult
Detail string
}
type CompatibilityOverride ¶
type CompatibilityOverride struct {
Comparison ComparisonRef
Reason string
}
CompatibilityOverride acknowledges invalid or unknown evidence. It does not assert that a breaking change is a fix.
type ContentID ¶
type ContentID string
ContentID is the lowercase SHA-256 of the exact bytes being compared.
func PublicationInventoryDigest ¶
func PublicationInventoryDigest(record PublicationRecord) ContentID
PublicationInventoryDigest binds an attestation to its schema bytes, exact generated-source inventory, and (for published records) actual JAR entries.
type DeletionArtifact ¶
type FilePrecondition ¶
type GeneratedVersion ¶
type ImportKind ¶
type ImportKind uint8
const ( ExactRelease ImportKind = iota + 1 SnapshotImport VersionRangeImport )
type JavaArtifactInventory ¶
type JavaArtifactInventory struct {
// contains filtered or unexported fields
}
JavaArtifactInventory is immutable evidence derived from explicitly supplied JAR bytes. It is not evidence that the bytes were published or authentic.
func InspectJavaArtifact ¶
func InspectJavaArtifact(input []byte, requested JavaArtifactLimits) (*JavaArtifactInventory, error)
InspectJavaArtifact reads every entry through archive/zip's CRC checker. It never extracts files and inventories only exact .class entry bytes.
func (*JavaArtifactInventory) ArtifactSHA256 ¶
func (i *JavaArtifactInventory) ArtifactSHA256() ContentID
func (*JavaArtifactInventory) Classes ¶
func (i *JavaArtifactInventory) Classes() []PublicationFile
func (*JavaArtifactInventory) EntryCount ¶
func (i *JavaArtifactInventory) EntryCount() int
func (*JavaArtifactInventory) ExpandedBytes ¶
func (i *JavaArtifactInventory) ExpandedBytes() int64
type JavaArtifactLimits ¶
type JavaArtifactLimits struct {
InputBytes int64
Entries int
ExpandedBytes int64
EntryBytes int64
NameBytes int
}
JavaArtifactLimits bounds both ZIP metadata and streamed decompression. Zero fields select defaults; nonzero fields may only tighten hard limits.
func DefaultJavaArtifactLimits ¶
func DefaultJavaArtifactLimits() JavaArtifactLimits
type JavaArtifactVerification ¶
type JavaArtifactVerification struct {
// contains filtered or unexported fields
}
JavaArtifactVerification checks a ledger's historical byte claims. It makes no Java ABI compatibility or publication-authenticity conclusion.
func VerifyPublishedArtifact ¶
func VerifyPublishedArtifact(ledger *PublicationLedger, inventory *JavaArtifactInventory) JavaArtifactVerification
VerifyPublishedArtifact compares a valid publication ledger with inventory obtained from explicitly supplied JAR bytes. Nil evidence is Unknown.
func (JavaArtifactVerification) Issues ¶
func (v JavaArtifactVerification) Issues() []Issue
func (JavaArtifactVerification) Ready ¶
func (v JavaArtifactVerification) Ready() bool
func (JavaArtifactVerification) Unknown ¶
func (v JavaArtifactVerification) Unknown() bool
type MavenCoordinates ¶
type MavenCoordinates struct {
GroupID string `json:"groupId"`
ArtifactID string `json:"artifactId"`
Version string `json:"version"`
}
MavenCoordinates are values from Maven's effective model, not a raw pom.xml.
type MavenPlan ¶
type MavenPlan struct {
Ready bool
NoPendingVersion bool
Suggested Version
Accepted *Version
RequiredChange ArtifactChange
Removed []GeneratedVersion
Issues []Issue
}
func PlanMavenVersion ¶
func PlanMavenVersion(input MavenPlanningInput) MavenPlan
PlanMavenVersion applies the explicitly schema-family-major-based no-codegen policy. It does not inspect Java bytecode or claim general API compatibility.
type MavenPlanningInput ¶
type MavenPlanningInput struct {
Current Version
Intended *Version
PreviouslyPublished []GeneratedVersion
Next []GeneratedVersion
OtherChange ArtifactChange
}
type PlanResult ¶
type PlanResult struct {
Ready bool
NoPendingVersion bool
Suggested *Version
Accepted *Version
Issues []Issue
}
func Plan ¶
func Plan(input PlanningInput) PlanResult
Plan validates evidence and computes exactly the minimum permitted version. Policy rejection is returned as issues rather than an opaque error so a CLI can display the suggestion and every failed comparison together.
type PlanningInput ¶
type PlanningInput struct {
Family string
SnapshotContent ContentID
SnapshotImports []ImportPin
Intended *Version
Change ChangeKind
Releases []ReleaseBaseline
Comparisons []CompatibilityEvidence
Overrides []CompatibilityOverride
BreakingFixes []BreakingFix
EnforceForward bool
}
type PromotionFamily ¶
type PromotionFamily struct {
Family string
Version Version
SnapshotPath string
// SnapshotFileContent protects the editable file against a plan/apply race.
// It differs from ReleaseContent when promotion materializes exact pins.
SnapshotFileContent ContentID
ReleasePath string
ReleaseContent []byte
Imports []PromotionImport
Generated []Artifact
}
type PromotionImport ¶
type PromotionImport struct {
Family string
Kind ImportKind
Version Version
Content ContentID
}
PromotionImport is typed so callers cannot accidentally erase whether the source used an exact version, SNAPSHOT, or a floating range.
type PromotionInput ¶
type PromotionInput struct {
Root string
Families []PromotionFamily
Available []PublishedRelease
Replacements []ReplacementArtifact
Deletions []DeletionArtifact
Preconditions []FilePrecondition
}
type PromotionResult ¶
type PromotionResult struct {
Released []PublishedRelease
SnapshotPending map[string]bool
}
func Promote ¶
func Promote(input PromotionInput) (PromotionResult, error)
Promote validates and stages the whole batch before installing any output. Installation uses hard links, which fail rather than overwrite a colliding immutable destination. Returned errors are rolled back. A process crash is recovered by Recover, using inode identity so unrelated files are untouched.
type PublicationFile ¶
type PublicationLedger ¶
type PublicationLedger struct {
Version int `json:"version"`
GroupID string `json:"groupId"`
ArtifactID string `json:"artifactId"`
Records []PublicationRecord `json:"records"`
}
type PublicationPlan ¶
type PublicationPlan struct {
Applicable bool
Ready bool
Unknown bool
Maven *MavenPlan
Removed []GeneratedVersion
Issues []Issue
}
func PlanPublication ¶
func PlanPublication(input PublicationPlanningInput) PublicationPlan
PlanPublication is the shared fail-closed no-codegen/removal gate. It proves only checked-in publication inventory and the required artifact version; it is not a general Java ABI comparison.
type PublicationPlanningInput ¶
type PublicationPlanningInput struct {
Ledger *PublicationLedger
Available []PublicationTarget
Excluded []PublicationTarget
DeletedSources []PublicationFile
Next []GeneratedVersion
Maven *MavenPlanningInput
Effective MavenCoordinates
}
type PublicationRecord ¶
type PublicationRecord struct {
State PublicationState `json:"state"`
Family string `json:"family"`
SchemaVersion string `json:"schemaVersion"`
SchemaSHA256 ContentID `json:"schemaSha256"`
GeneratedSources []PublicationFile `json:"generatedSources"`
ArtifactVersion string `json:"artifactVersion,omitempty"`
ArtifactSHA256 ContentID `json:"artifactSha256,omitempty"`
Classes []PublicationFile `json:"classes,omitempty"`
InventorySHA256 ContentID `json:"inventorySha256"`
Reason string `json:"reason"`
}
type PublicationState ¶
type PublicationState string
const ( PublicationPublished PublicationState = "published" PublicationUnpublished PublicationState = "unpublished" )
type PublicationTarget ¶
type PublishedRelease ¶
type ReleaseBaseline ¶
type ReplacementArtifact ¶
ReplacementArtifact is the narrowly scoped mutable part of a promotion. ExpectedContent binds replacement to the exact regular file observed while planning; recovery retains an inode-owned backup until commit.
type Version ¶
Version is a stable semantic version. Prerelease/build syntax is intentionally excluded: released schema identities are exact x.y.z versions.