readStoredArtifact
Purpose and behavior
Section titled “Purpose and behavior”Validate an untrusted reference, check its contract and any expected producer and parents, then load the bytes and verify their size and SHA-256 digest before decoding. Each mismatch rejects with an error naming it, such as Artifact contract mismatch. Use it outside a task, for example in another process.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”storeRequiredArtifactStoreStore holding the artifact bytes.contractRequiredArtifactContract<T>Expected contract: its name, version and encoding must match the reference, and it decodes the bytes.valueRequiredunknownReference to read, typically parsed from JSON. It is validated and its id recomputed before any bytes are loaded.optionsOptionalReadArtifactOptions | undefinedExpected producer and parents, and a cancellation signal.options.producerOptionalArtifactProducer | undefinedExpected execution, task key and attempt; any difference rejects with Artifact producer mismatch.options.parentsOptionalreadonly ArtifactReference[] | undefinedExpected parent references, in order; a different list rejects with Artifact lineage mismatch.options.signalOptionalAbortSignal | undefinedAborting it rejects the read with the signal’s reason.