Documentation
¶
Overview ¶
Package profilecontract owns the v1 read-only machine-local profile protocol. It never creates, repairs, claims, or publishes metadata. The host remains the authority for full portable manifests and all ownership mutations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalPath ¶
CanonicalPath resolves symlinks in an existing prefix without creating the missing suffix. Dangling symlinks and non-absence filesystem errors fail closed.
func ReadJSON ¶
ReadJSON distinguishes an absent file from dangling/redirected metadata. Only a genuinely absent binding permits default selection. It writes nothing.
func ValidateClaims ¶
ValidateClaims validates record identity and uniqueness. Filesystem overlap policy remains with each reader; the host additionally detects case aliases.
func ValidateRecord ¶
Types ¶
type Error ¶
Error carries a private, fixed diagnostic and the host's existing error class. Underlying JSON errors must not expose machine-local metadata values.
type ManifestIdentity ¶
type ManifestIdentity struct {
SchemaVersion int `json:"schemaVersion"`
WorkspaceID string `json:"workspaceID"`
Slug string `json:"slug"`
Profile struct {
Kind string `json:"kind"`
} `json:"profile"`
}
ManifestIdentity deliberately excludes repository/link/port policy validation.
type OwnershipJournal ¶
type OwnershipJournal[M any] struct { SchemaVersion int `json:"schemaVersion"` WorkspaceID string `json:"workspaceID"` Root string `json:"root"` Phase string `json:"phase"` RenameTo string `json:"renameTo"` Manifest M `json:"manifest"` Resources []struct { CommonDir string `json:"commonDir"` } `json:"resources"` }
OwnershipJournal projects the same serialized journal into either the SDK's narrow identity view or the host's full manifest, without duplicating schema.
func (*OwnershipJournal[M]) ValidateBoundary ¶
func (j *OwnershipJournal[M]) ValidateBoundary(root, workspaceID string, intent ManifestIdentity) (string, error)
ValidateBoundary accepts only the selected root or the exact interrupted sibling rename. The returned old root must remain protected during recovery. The host must also validate the complete rename manifest before using it.
type Record ¶
type Record struct {
SchemaVersion int `json:"schemaVersion"`
WorkspaceID string `json:"workspaceID"`
StateRoot string `json:"stateRoot"`
}
Record is shared by bindings, durable claims, and external owner markers.
type WorkspaceIdentity ¶
type WorkspaceIdentity struct {
ManifestIdentity
Repositories []struct {
Directory string `json:"directory"`
} `json:"repositories"`
}