ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Mirror.State.Internal

Description

Monotonic expected files retain their first admitted source fragment and companion identity.

Synopsis

Documentation

newtype StateTarget Source #

A digest of the configured target, never a credential or caller authorisation.

Constructors

StateTarget Text 

stateTarget :: Text -> StateTarget Source #

Bind records and object keys to the exact configured target identity.

data StateRevision Source #

Opaque storage revision bound to the project it came from.

data MirrorVersion Source #

Files grow monotonically. Each companion starts pending before any distribution upload.

data CompanionState Source #

A retained reference exists only after its immutable content object was written.

data CompanionRef Source #

Content-addressed metadata, with no arbitrary URL or object path.

Constructors

CompanionRef Hash Int 

data StateRead Source #

A 304 is useful only with the exact supplied, already charged project payload.

Instances

Instances details
Show StateRead Source # 
Instance details

Defined in Ecluse.Core.Mirror.State.Internal

Eq StateRead Source # 
Instance details

Defined in Ecluse.Core.Mirror.State.Internal

data StateWrite Source #

The caller rereads and unions after a collision instead of repeating an old replacement.

Instances

Instances details
Show StateWrite Source # 
Instance details

Defined in Ecluse.Core.Mirror.State.Internal

Eq StateWrite Source # 
Instance details

Defined in Ecluse.Core.Mirror.State.Internal

type StateCharge = Int -> IO () Source #

An absolute high-water requirement for sequential state work under one caller-owned lifetime.

extendProjectRecord :: MirrorStateFormat -> Limits -> StateTarget -> MirrorInventory -> Maybe ProjectMirrorRecord -> Either MirrorStateFault ProjectMirrorRecord Source #

Add only new filenames, retaining the old read fields for every unchanged physical identity.

retainCompanionReference :: Version -> VerifiedCompanionBytes -> CompanionRef -> ProjectMirrorRecord -> Either MirrorStateFault ProjectMirrorRecord Source #

Bind durable bytes only to the same admitted declaration and parent identity.

retainVerifiedIdentity :: Version -> VerifiedArtifactBytes -> ProjectMirrorRecord -> Either MirrorStateFault ProjectMirrorRecord Source #

Retain a digest computed only from bytes that passed the admitted source integrity check.

verifyCompanionBytes :: Limits -> ExpectedMirrorFile -> ByteString -> Either MirrorStateFault VerifiedCompanionBytes Source #

A pending expectation cannot become retained until its actual bytes satisfy the declaration.

verifyRetainedCompanion :: CompanionRef -> ByteString -> Either MirrorStateFault ByteString Source #

Actual reads verify immutable content identity, including the recorded size.

versionFiles :: MirrorVersion -> Map Text ExpectedMirrorFile Source #

Original source coordinates remain scoped to their fragment until the renderer assigns new ones.

recordVersion :: Version -> ProjectMirrorRecord -> Maybe MirrorVersion Source #

A valid record without the requested version is unmanaged private content.

recordTarget :: ProjectMirrorRecord -> StateTarget Source #

The configured target identity carried by this validated record.

recordPackage :: ProjectMirrorRecord -> PackageName Source #

The canonical package identity carried by this validated record.

recordVersions :: ProjectMirrorRecord -> Map Text MirrorVersion Source #

Versions contain accumulated admission fragments without a mutable completion flag.

recordEnvelope :: ProjectMirrorRecord -> Object Source #

Project fields follow the latest committed source admission, independently of file-byte updates.

versionFragments :: MirrorVersion -> NonEmpty StoredMirrorFragment Source #

Each fragment retains only its original owned source entries.

versionCompanions :: MirrorVersion -> Map Text CompanionState Source #

Pending declarations cannot be mistaken for durably retained metadata.

versionVerifiedIdentities :: MirrorVersion -> Map Text Hash Source #

These digests came from verified bytes, independently of preserved source digest fields.

companionDigest :: CompanionRef -> Text Source #

The content identity used in storage keys and byte verification.

companionSize :: CompanionRef -> Int Source #

The retained response size in bytes.

companionBody :: VerifiedCompanionBytes -> ByteString Source #

Only checked declared companion bytes reach the object writer.

targetKey :: StateTarget -> Text Source #

The target component has a fixed-length hexadecimal encoding.

projectKey :: StateTarget -> PackageName -> Text Source #

Length-independent components bind the schema, target, ecosystem, and canonical package.

checkMirrorCompletion :: MirrorVersion -> [Artifact] -> MirrorCompletion Source #

Completion uses current authorised target identities and retained companions, never a stored Boolean.

data MirrorCompletion Source #

A failed proof reports each missing file, conflicting identity, or pending companion.

declaredCompanion :: Artifact -> Bool Source #

A missing or false declaration creates no retention authority.

declaredSourceCompanion :: CompanionRequirement -> Artifact -> Bool Source #

Native source payloads can require metadata beyond artifact-advertised sidecars.

verifySourceCompanionBytes :: Limits -> CompanionRequirement -> ExpectedMirrorFile -> ByteString -> Either MirrorStateFault VerifiedCompanionBytes Source #

The native codec checks meaning before this step binds its bytes to the declared parent.

checkStateFiles :: Limits -> Int -> Either LimitError () Source #

Refuse a record count over the fixed mirror-state file ceiling, so every write stays readable.