Assignment and study contracts
Assignment
Section titled “Assignment”AssignmentNo docstring.
ParallelAssignment
Section titled “ParallelAssignment”ParallelAssignmentNo docstring.
IndependentBernoulliOrder
Section titled “IndependentBernoulliOrder”IndependentBernoulliOrderOne independent Bernoulli CT/TC order draw per unit-cycle.
Every unit draws its own order independently of every other unit, which is what makes the unit the independent replicate: cross-unit replication exists for a unit-level reference distribution.
SharedScheduleOrder
Section titled “SharedScheduleOrder”SharedScheduleOrderOne independent Bernoulli CT/TC order draw per two-period block, shared by every unit in a fixed, complete unit roster.
Unlike :class:IndependentBernoulliOrder, no unit draws its own order:
the whole roster follows one realized order per block, so the
independent replicate is the block, not the unit. A common roster
duplicated uniformly adds no independent blocks and therefore cannot
change the mean-unit retained-window effect scale or inferential sample
size. The switchback panel path reduces the roster within each block
and uses switchback_block_t with a block_t reference. At least
two independent blocks are required; a one-unit roster is supported.
SwitchbackWindow
Section titled “SwitchbackWindow”SwitchbackWindowA washout/observation window with a declared residual-carryover order.
carryover_order names additional observation steps, immediately
after the declared washout, still assumed contaminated by the prior
period and therefore discarded before the retained window used for
inference. Retained steps satisfy step >= washout_steps + carryover_order; the retained window’s length is observation_steps - carryover_order. carryover_order=0 is the plain
no-residual-carryover-after-washout case. Declaring an order is an
assumption, not something a balance diagnostic can prove true.
SwitchbackAssignment
Section titled “SwitchbackAssignment”SwitchbackAssignmentNo docstring.
ParallelStudyEnvelope
Section titled “ParallelStudyEnvelope”ParallelStudyEnvelopeNo docstring.
SwitchbackStudyEnvelope
Section titled “SwitchbackStudyEnvelope”SwitchbackStudyEnvelopeNo docstring.
StudyEnvelope
Section titled “StudyEnvelope”StudyEnvelopeNo docstring.
The artifact API controls how immutable unit-day data is published and adopted. The store authorizes namespaces; callers provide trusted context and pinned generation references. Artifact contract modules provide the context, catalog, and digest helpers.
| Model | Purpose |
|---|---|
UnitDayArtifactRef | Pins an immutable artifact generation. |
ArtifactRelationRef | Binds a relation and its digests to that generation. |
MeasureManifest | Records measure provenance and freshness. |
ArtifactContext | Binds 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. |
UnitDayArtifactManifest | Captures the complete artifact manifest. |
ExtensionRefBase | Carries relation, definition, and source digests. |
BreakoutDimensionExtension | Describes a pre-exposure breakout dimension. |
FactorDimensionExtension | Describes a pre-exposure factor dimension. |
ClusterIdentityExtension | Identifies the clustering relation. |
CupedPreperiodExtension | Supplies a pre-period measure. |
AssignmentCountsExtension | Captures assignment population counts. |
TriggerPopulationExtension | Version-3, cutoff-bound trigger membership with trigger-feed completeness evidence. |
TriggerMeasureStatsExtension | Singleton metric trigger-relative per-unit/day sufficient statistics bound to trigger membership. |
EncouragementUptakeExtension | Captures encouragement uptake data. |
SiteVolumeExtension | Records site-level measure volume and freshness. |
UnitCovariateExtension | Carries one declared numeric per-unit covariate. |
UnitCovariateLevelExtension | Carries one declared categorical per-unit covariate, including nulls. |
ArtifactExtensionRef | Tagged union of the eleven concrete extension references. |
ArtifactExtensionRequest | Tagged union of the eleven concrete extension requests. |
These models and tagged unions are importable from increment.artifacts.
They describe the published format without exposing source-loading machinery.
RelationLocator
Section titled “RelationLocator”RelationLocatorA namespace-qualified relation name; never a backend SQL fragment.
RelationRole
Section titled “RelationRole”RelationRoleNo docstring.
BaseRelations
Section titled “BaseRelations”BaseRelationsRequired base artifact relations bound to one artifact generation.
Construct it with exposure and measure-stat relation references, usually through the artifact publication loader.
Freshness
Section titled “Freshness”FreshnessNo docstring.
SimpleMetricMeasure
Section titled “SimpleMetricMeasure”SimpleMetricMeasureNo docstring.
RatioMetricMeasure
Section titled “RatioMetricMeasure”RatioMetricMeasureNo docstring.
MetricMeasure
Section titled “MetricMeasure”MetricMeasureNo docstring.
Artifact extensions
Section titled “Artifact extensions”These references describe artifact dimensions, assignment, trigger membership and outcomes, uptake, and site-volume extensions.
Artifact requests
Section titled “Artifact requests”Requests validate extension definitions before publication.
ExtensionRequestBase
Section titled “ExtensionRequestBase”ExtensionRequestBaseNo docstring.
BreakoutDimensionRequest
Section titled “BreakoutDimensionRequest”BreakoutDimensionRequestNo docstring.
FactorDimensionRequest
Section titled “FactorDimensionRequest”FactorDimensionRequestNo docstring.
ClusterIdentityRequest
Section titled “ClusterIdentityRequest”ClusterIdentityRequestNo docstring.
CupedPreperiodRequest
Section titled “CupedPreperiodRequest”CupedPreperiodRequestNo docstring.
AssignmentCountsRequest
Section titled “AssignmentCountsRequest”AssignmentCountsRequestNo docstring.
TriggerPopulationRequest
Section titled “TriggerPopulationRequest”TriggerPopulationRequestNo docstring.
TriggerMeasureStatsRequest
Section titled “TriggerMeasureStatsRequest”TriggerMeasureStatsRequestNo docstring.
EncouragementUptakeRequest
Section titled “EncouragementUptakeRequest”EncouragementUptakeRequestNo docstring.
SiteVolumeRequest
Section titled “SiteVolumeRequest”SiteVolumeRequestNo docstring.
UnitCovariateRequest
Section titled “UnitCovariateRequest”UnitCovariateRequestNo docstring.
UnitCovariateLevelRequest
Section titled “UnitCovariateLevelRequest”UnitCovariateLevelRequestNo docstring.
Artifact publication and storage
Section titled “Artifact publication and storage”from_definitions(..., source_snapshot_evidence=...) accepts
increment.artifacts.SourceSnapshotEvidence only when the source provides a timezone-aware
event-time cutoff and, optionally, certified per-feed completeness times.
Without a cutoff, Increment does not invent one: assigned-only operations remain
available, but triggered membership, triggered outcomes, and trigger-evidence
publication refuse with source.native.trigger_evidence_required. Missing feed
certification stays unknown; maximum observed timestamps, publication time, and
experiment end do not prove completeness. Triggered artifact outcome requests
select one trigger_measure_stats item per (trigger, metric), bound to the
version-3 membership digest and the same pinned cutoff.
SourceSnapshotEvidence
Section titled “SourceSnapshotEvidence”SourceSnapshotEvidence(observation_cutoff_ts, complete_through_by_feed)Event-time cutoff and explicitly certified per-feed completeness.
A missing or null feed watermark means completeness is unknown; this value is never inferred from rows observed in the feed.
Publication connects validated context to immutable snapshots in the authorized artifact store.
ArtifactPublication
Section titled “ArtifactPublication”ArtifactPublicationIsolated create-only generation handle.
ArtifactSnapshot
Section titled “ArtifactSnapshot”ArtifactSnapshotImmutable, generation-scoped read handle.
ArtifactStore
Section titled “ArtifactStore”ArtifactStoreNamespace-scoped publication/snapshot lifecycle contract.
WarehouseArtifactStore
Section titled “WarehouseArtifactStore”WarehouseArtifactStore(con, catalog, schema_name, namespace)An immutable artifact store backed by one SQL connection.
Publication persists generation-owned warehouse relations. A snapshot pins
the manifest and relation references, then lazily creates private temporary
copies during verification. Verified copies isolate reads from later changes
and are dropped when the snapshot closes. A declared schema and the store’s
tables are created by its first write, a publication or an abandoned
generation; reading a store whose schema does not exist creates nothing.
A catalog or schema name longer than the warehouse allows (PostgreSQL 63
bytes, Snowflake 255 characters, BigQuery 1,024 bytes) refuses at
construction with store.schema_name_too_long.
artifact_context
Section titled “artifact_context”artifact_context(experiment, reader)Return the trusted publication context for a definitions-backed experiment.
publish_unit_day_artifact
Section titled “publish_unit_day_artifact”publish_unit_day_artifact(experiment, reader, store, extensions, refresh_of)Publish a definitions-backed experiment as an immutable unit-day artifact.
ArtifactExtensionCatalogEntry
Section titled “ArtifactExtensionCatalogEntry”ArtifactExtensionCatalogEntryNo docstring.
unit_day_artifact_extension_catalog
Section titled “unit_day_artifact_extension_catalog”unit_day_artifact_extension_catalog(context)Validate and expose the immutable extension catalog in a context.
Digests and hashing
Section titled “Digests and hashing”Canonical encodings and SHA-256 helpers keep artifact identities deterministic across publication and requests.
ArtifactDigestError
Section titled “ArtifactDigestError”ArtifactDigestErrorPublic coded refusal raised by canonical digest operations.
DigestType
Section titled “DigestType”DigestTypeNo docstring.
FieldSpec
Section titled “FieldSpec”FieldSpec(name, type_tag, nullable)No docstring.
RelationDigests
Section titled “RelationDigests”RelationDigests(role, schema_sha256, content_sha256, row_count, schema_bytes, rows_bytes, digest_format)No docstring.
canonical_schema_bytes
Section titled “canonical_schema_bytes”canonical_schema_bytes(schema)No docstring.
canonical_row_bytes
Section titled “canonical_row_bytes”canonical_row_bytes(schema, row)No docstring.
canonical_rows_bytes
Section titled “canonical_rows_bytes”canonical_rows_bytes(schema, rows, primary_key)No docstring.
canonical_json_bytes
Section titled “canonical_json_bytes”canonical_json_bytes(value)No docstring.
schema_sha256
Section titled “schema_sha256”schema_sha256(role, schema)No docstring.
content_sha256
Section titled “content_sha256”content_sha256(role, schema, rows, primary_key)No docstring.
digest_relation
Section titled “digest_relation”digest_relation(role, schema, rows, primary_key)No docstring.
manifest_sha256
Section titled “manifest_sha256”manifest_sha256(manifest)No docstring.
context_sha256
Section titled “context_sha256”context_sha256(context)No docstring.
request_sha256
Section titled “request_sha256”request_sha256(request)No docstring.
extension_definition_sha256
Section titled “extension_definition_sha256”extension_definition_sha256(kind, canonical_definition_json)No docstring.
extension_source_provenance_sha256
Section titled “extension_source_provenance_sha256”extension_source_provenance_sha256(kind, canonical_source_recipe_json)No docstring.