| Title: | Verifiable Provenance for 'R' Workflows |
|---|---|
| Description: | Provides an 'R' interface for building verifiable manifests around data, models, prompts, agents, computations, and related lineage. Exposes the public 'eqty-sdk' 'Python' package through types accessible from 'R' for creating assets, connecting computation inputs and outputs by content identifier, grouping statements in contexts, and exporting manifest JSON files. |
| Authors: | Support EQTY Lab [aut, cre] |
| Maintainer: | Support EQTY Lab <[email protected]> |
| License: | Apache License (== 2.0) |
| Version: | 0.9.2 |
| Built: | 2026-10-15 20:41:18 UTC |
| Source: | https://github.com/cran/eqty.sdk.r |
Provides direct access to 'eqty_sdk.compute()'. R functions should usually use [integrity_compute()], which executes the R function directly and records its source and execution with [Code] and [Computation].
compute(...)compute(...)
... |
Arguments passed to 'eqty_sdk.compute()'. |
The Python compute decorator or decorated callable returned by the SDK.
'eqty' is retained for compatibility. Prefer the exported R names such as [Dataset], [Context], and [integrity_init()] for new code.
A list of class eqty_sdk_proxy representing the Python
eqty_sdk module. Accessing a member with $ loads the
module and returns the requested Python object through
reticulate. Python objects inherit from
python.builtin.object; values that reticulate converts
automatically are returned as the corresponding R values.
# The compatibility proxy can be inspected without initializing Python. class(eqty) stopifnot(inherits(eqty, "eqty_sdk_proxy"))# The compatibility proxy can be inspected without initializing Python. class(eqty) stopifnot(inherits(eqty, "eqty_sdk_proxy"))
These names are lazy proxies for the matching 'eqty_sdk' classes and enums. They are available after 'library(eqty.sdk.r)' and resolve the installed Python SDK only when a member is accessed. They retain its constructors, factories, properties, and methods.
The built-in asset categories are 'Agent', 'Benchmark', 'BenchmarkResult', 'Binary', 'Certificate', 'Code', 'Configuration', 'Credential', 'Custom', 'Database', 'Dataset', 'Document', 'Guardrail', 'Media', 'Model', 'Prompt', 'Reasoning', 'Skill', 'SystemPrompt', 'Token', and 'Tool'. They share a common construction pattern. Use 'with_context(ctx)' when the asset belongs to a specific context.
[CID] identifies content and is used to connect computation inputs and outputs. [UUID] identifies objects whose identity is not derived from their content. [DID] identifies signers and other entities referenced by provenance statements.
[Service] connects the SDK to a remote Integrity Service. It is unnecessary when a workflow only exports a local manifest.
Each exported name is a list of class eqty_sdk_proxy that
lazily resolves the corresponding Python SDK class, enum, or constant.
Accessing a member with $ returns that member through
reticulate. Constructors and factories return Python-backed
objects inheriting from python.builtin.object, with SDK-specific
classes such as Dataset, Context, or CID. These
objects represent assets, provenance contexts, content identifiers,
and the other SDK types described above. Enum members and constants
represent the SDK's supported categories and algorithms.
# Inspect the lazy proxy without initializing Python. class(Dataset) stopifnot(inherits(Dataset, "eqty_sdk_proxy"))# Inspect the lazy proxy without initializing Python. class(Dataset) stopifnot(inherits(Dataset, "eqty_sdk_proxy"))
A CID is derived from content and changes when that content changes.
get_cid_for_bytes(...)get_cid_for_bytes(...)
... |
Arguments passed to 'eqty_sdk.get_cid_for_bytes()'. |
A [CID] for the supplied bytes.
Compute a CID for JSON
get_cid_for_json(...)get_cid_for_json(...)
... |
Arguments passed to 'eqty_sdk.get_cid_for_json()'. |
A [CID] for the supplied JSON value.
Compute a CID for a File or Directory
get_cid_for_path(...)get_cid_for_path(...)
... |
Arguments passed to 'eqty_sdk.get_cid_for_path()'. |
A [CID] derived from the content at the supplied path.
Creates a callable computation from an R function. When the returned function is called, the SDK records its inputs and outputs in the selected [Context]. The function executes directly in R. Its source is registered as a [Code] asset, and each call creates a [Computation] that connects that code and the call's inputs to its outputs. The computation can then serve as an entry point when the context is exported as a manifest.
integrity_compute( context = NULL, metadata = list(), func = NULL, `_store` = FALSE )integrity_compute( context = NULL, metadata = list(), func = NULL, `_store` = FALSE )
context |
An optional [Context] created with 'Context$new()' or a context factory. When omitted, the default context configured by [integrity_init()] is used. |
metadata |
A named list of metadata for the computation, such as 'list(name = "My algorithm", version = "1.0")'. The 'name' value is also used as the display name of the recorded R code asset. If omitted, it defaults to '"R Function"'. |
func |
The R function to wrap. When 'NULL', the result is a function that accepts the R function to wrap. |
_store |
Whether to store the wrapped R function's source content in the local blob store. Defaults to 'FALSE'. Set this to 'TRUE' only when the source is safe to include and contains no secrets. |
An R function that calls ‘func' and records the computation’s
inputs and outputs. Calling this function returns a Python-backed SDK
asset inheriting from python.builtin.object, or an R list of
such assets for multiple outputs. Each asset represents a result of
'func' and provides its content identifier through '$cid'. If 'func'
is 'NULL', returns an R function that accepts the function to wrap;
creating this intermediate function does not initialize Python.
# Create a decorator without requiring Python or the SDK. sum_decorator <- integrity_compute(metadata = list(name = "Sum Generator")) stopifnot(is.function(sum_decorator)) ## Not run: # Requires Python >= 3.10 and the 'eqty-sdk' Python package. # First use may download and install this additional software. ctx <- Context$new("Example computation") invisible(integrity_init(default_context = ctx, custom_dir = tempdir())) signer <- Signer$load_or_create(name = "example-computation-signer") invisible(integrity_set_active_signer(signer)) my_algo <- integrity_compute( context = ctx, metadata = list(name = "Sum Generator"), func = function(x, y) x + y ) # The result is an SDK asset representing the sum. result <- my_algo(10, 20) result$cid ## End(Not run)# Create a decorator without requiring Python or the SDK. sum_decorator <- integrity_compute(metadata = list(name = "Sum Generator")) stopifnot(is.function(sum_decorator)) ## Not run: # Requires Python >= 3.10 and the 'eqty-sdk' Python package. # First use may download and install this additional software. ctx <- Context$new("Example computation") invisible(integrity_init(default_context = ctx, custom_dir = tempdir())) signer <- Signer$load_or_create(name = "example-computation-signer") invisible(integrity_set_active_signer(signer)) my_algo <- integrity_compute( context = ctx, metadata = list(name = "Sum Generator"), func = function(x, y) x + y ) # The result is an SDK asset representing the sum. result <- my_algo(10, 20) result$cid ## End(Not run)
Converts named R values to a Python 'dict' for SDK methods that expect one.
integrity_dict(...)integrity_dict(...)
... |
Named values and optional arguments passed to [reticulate::dict()]. |
A Python 'dict' object.
Prepares the SDK's local state. Call this before changing configuration or creating lineage statements. Supply a default context when assets and computations should use it unless another context is selected explicitly.
integrity_init(...)integrity_init(...)
... |
Arguments passed to 'eqty_sdk.init()', including 'default_context' and 'custom_dir'. |
A Python-backed [Config] object for hashing, blob storage, directory filtering, and default-context settings.
Converts an R path value to Python's 'pathlib.Path', as required by methods such as 'Context$export()' and 'Context$import_manifest()'.
integrity_path(path)integrity_path(path)
path |
A character string or path-like value. |
A Python 'pathlib.Path' object.
Extracts a character path from an SDK asset, a Python path object, or a character value. If no direct path is available, the helper also checks the object's value.
integrity_resolve_path(input_object)integrity_resolve_path(input_object)
input_object |
An SDK asset, Python path object, or character value. |
A character string containing the resolved path. Returns 'NULL' if no path could be determined.
integrity_resolve_path("data/input.csv") integrity_resolve_path(list(path = "output/result.csv")) stopifnot(identical( integrity_resolve_path("data/input.csv"), "data/input.csv" ))integrity_resolve_path("data/input.csv") integrity_resolve_path(list(path = "output/result.csv")) stopifnot(identical( integrity_resolve_path("data/input.csv"), "data/input.csv" ))
Sets the signer used when higher-level SDK operations create signed statements. Configure it during workflow setup after [integrity_init()].
integrity_set_active_signer(signer)integrity_set_active_signer(signer)
signer |
A signer created by [Signer]. |
'NULL'.
Removes blobs cached in the SDK's local state. This is intended primarily for testing, development, or an intentional local reset.
purge_blob_store(...)purge_blob_store(...)
... |
Arguments passed to 'eqty_sdk.purge_blob_store()'. |
'NULL'.
Removes locally recorded lineage statements. Normal application workflows generally preserve this state.
purge_statement_store(...)purge_statement_store(...)
... |
Arguments passed to 'eqty_sdk.purge_statement_store()'. |
'NULL'.
Recomputes the statement identifier from its canonicalized JSON-LD content and checks it against the statement's recorded identifier. The check runs locally. Pass the manifest's context map when custom JSON-LD contexts are involved.
verify_statement(...)verify_statement(...)
... |
Arguments passed to 'eqty_sdk.verify_statement()'. |
'TRUE' when the statement identifier matches its content; otherwise 'FALSE'.
Checks a W3C Verifiable Credential proof locally. A statement identifier can also be supplied to confirm that the credential refers to the expected statement. Revocation and suspension status are outside this offline check.
verify_vc(...)verify_vc(...)
... |
Arguments passed to 'eqty_sdk.verify_vc()'. |
'TRUE' when the credential proof and optional subject binding verify; otherwise 'FALSE'.