Skip to content
Development documentation. The PyPI package predates these APIs. Install from GitHub instead: pip install 'increment @ git+https://github.com/kylejcaron/increment.git' Keep any extras requested by the guide, such as increment[dashboard].

Canonical unit-day artifacts

The artifact API is an explicit publication/adoption boundary. Namespace authorization belongs to the store; callers supply trusted context and pinned generation references. Context, catalog, and digest helpers are available from the artifact contract modules.

ModelPurpose
UnitDayArtifactRefPins an immutable artifact generation.
ArtifactRelationRefBinds a relation and its digests to that generation.
MeasureManifestRecords measure provenance and freshness.
ArtifactContextBinds canonical context JSON (format 2, hash-only source recipes, no source SQL) to its SHA-256 digest (encoding integrity, not authenticity). Format 1 is retired; republish.
UnitDayArtifactManifestCaptures the complete artifact manifest.
ExtensionRefBaseCarries relation, definition, and source digests.
BreakoutDimensionExtensionDescribes a pre-exposure breakout dimension.
FactorDimensionExtensionDescribes a pre-exposure factor dimension.
ClusterIdentityExtensionIdentifies the clustering relation.
CupedPreperiodExtensionSupplies a pre-period measure.
AssignmentCountsExtensionCaptures assignment population counts.
TriggerPopulationExtensionCaptures the trigger population relation.
EncouragementUptakeExtensionCaptures encouragement uptake data.
SiteVolumeExtensionRecords site-level measure volume and freshness.
UnitCovariateExtensionCarries one declared numeric per-unit covariate.
UnitCovariateLevelExtensionCarries one declared categorical per-unit covariate, including nulls.
ArtifactExtensionCatalogEntryStores a canonical extension definition and source recipe.
ArtifactExtensionRefTagged union of the ten concrete extension references.
ArtifactExtensionRequestTagged union of the ten concrete extension requests.

These are Pydantic models and tagged unions importable from increment; see increment.semantics.artifact for full field detail.

RelationLocator

A namespace-qualified relation name; never a backend SQL fragment.

RelationRole

No docstring.

BaseRelations

Required base artifact relations bound to one artifact generation.

Construct it with exposure and measure-stat relation references, usually through the artifact publication loader.

Freshness

No docstring.

SimpleMetricMeasure

No docstring.

RatioMetricMeasure

No docstring.

MetricMeasure

No docstring.

Extension references and descriptors define the supported dimensions, assignment, uptake, and site-volume extensions.

Requests validate caller-supplied extension definitions before publication.

ExtensionRequestBase

No docstring.

BreakoutDimensionRequest

No docstring.

FactorDimensionRequest

No docstring.

ClusterIdentityRequest

No docstring.

CupedPreperiodRequest

No docstring.

AssignmentCountsRequest

No docstring.

TriggerPopulationRequest

No docstring.

EncouragementUptakeRequest

No docstring.

SiteVolumeRequest

No docstring.

UnitCovariateRequest

No docstring.

UnitCovariateLevelRequest

No docstring.

Publication handles connect validated context to immutable snapshots in the authorized artifact store.

ArtifactPublication

Isolated create-only generation handle.

ArtifactSnapshot

Immutable, generation-scoped read handle.

ArtifactStore

Namespace-scoped publication/snapshot lifecycle contract.

compile_unit_day_artifact_context(experiment_name, definitions, on_mixed_assignment, encouragement_uptake, site_volume_coverage)

Compile a deterministic, non-executable context from an already-loaded Definitions model.

A naive window edge is wall-clock time at its experiment’s day_boundary and binds the equivalent UTC instant; any other naive datetime is read as UTC. Source SQL never enters the context: source recipes are represented by tagged hashes.

unit_day_artifact_extension_catalog(context)

Validate and expose the immutable extension catalog in a context.

Canonical byte encodings and SHA-256 helpers make artifact identity deterministic across publication and request boundaries.

ArtifactDigestError

Public coded refusal raised by canonical digest operations.

DigestType

No docstring.

FieldSpec(name, type_tag, nullable)

No docstring.

RelationDigests(role, schema_sha256, content_sha256, row_count, schema_bytes, rows_bytes, digest_format)

No docstring.

canonical_schema_bytes(schema)

No docstring.

canonical_row_bytes(schema, row)

No docstring.

canonical_rows_bytes(schema, rows, primary_key)

No docstring.

canonical_json_bytes(value)

No docstring.

schema_sha256(role, schema)

No docstring.

content_sha256(role, schema, rows, primary_key)

No docstring.

digest_relation(role, schema, rows, primary_key)

No docstring.

manifest_sha256(manifest)

No docstring.

context_sha256(context)

No docstring.

request_sha256(request)

No docstring.

extension_definition_sha256(kind, canonical_definition_json)

No docstring.

extension_source_provenance_sha256(kind, canonical_source_recipe_json)

No docstring.