AI System DesignData and Feature InfrastructureModule 02 — Data and feature infrastructure

Constructing Reproducible Training and Evaluation Datasets Across Changing Source Systems

Question 36 of 47 · Updated

On this page

Build a dataset compiler whose input is an immutable, validated dependency manifest and whose output is an approved cohort, feature matrix, label vector, split membership and provenance—not a query against mutable latest tables. Resolve independently changing sources into an admissible cut, reconstruct each example with the information available at its own prediction time, select target-compatible labels under a separate maturity cutoff, and freeze the actual membership of training and evaluation datasets. Rebuilds must resolve identical inputs and transformation semantics or explicitly produce a new release.

How would you construct reproducible training and evaluation datasets from independently changing source systems?

ASD-013 | Module 02 — Data and feature infrastructure | Learning order 23. The MLOps lessons on reproducible dataset snapshots, multi-dataset schedules and point-in-time feature retrieval already explain immutable storage, manifests, readiness barriers and temporal joins. The learning objective here is the system architecture that *compiles an entire multi-source supervised dataset*, including dependency-closed source cuts, cohort accounting, versioned transformation graphs, joint train/evaluation isolation, row-level evidence, and safe incremental reconstruction. ASD-009 owns capture; ASD-010 reconciles predictions under conflicting feature snapshots; ASD-011 rebuilds live state without corruption; ASD-012 issues adjudicated labels. This lesson consumes their approved artifacts. It does not redesign their infrastructure or re-teach statistical evaluation under label delay. All workloads, times and numerical examples are hypothetical. The tested fixture uses synthetic integer timestamps and values.

1. Define the reproducibility contract#

Consider a retailer building a 30-day item-return model. Order lines change as shipments and cancellations are recorded, customer and product profiles evolve, feature aggregates arrive hourly, and adjudicated return outcomes may be corrected weeks later. The model team needs both training data and a held-out evaluation cohort. A query rerun next month must not quietly substitute a new customer profile, a corrected target or a different evaluation sample.

Decide which guarantee each consumer needs:

GuaranteeMeaningFailure example
Membership reproducibilityExactly the same eligible case IDs and partition assignmentsNew orders change random sample
Logical reproducibilitySame rows, values, nulls, schema and declared ordering semanticsUpdated unit conversion changes features
Byte reproducibilityExact stored output file bytesDifferent writer version changes Parquet metadata
Provenance reproducibilityRecover or verify the source and transformation evidence for each resultMutable source reference now resolves elsewhere
Experiment reproducibilityDataset plus preprocessing, model code, configuration and environmentSame dataset but nondeterministic accelerator execution

Logical equality does not require identical compressed bytes unless the contract says so. Conversely a matching file hash does not prove causal validity or absence of leakage. An identical flawed dataset is reproducibly wrong.

Choose an atomic unit of publication: for example one dataset family containing a frozen population, three split manifests, fitted training-only preprocessing artifacts, source references and validation results. A downstream trainer receives the committed release identity, never a directory called latest. A release can be rejected, withdrawn or superseded without rewriting its original manifest.

2. Architecture and ownership#

Loading diagram…

The source owners declare authoritative meaning and supported snapshot semantics. The data platform supplies approved versioned source artifacts and their capture coverage. The target owner owns case eligibility and label semantics. The dataset compiler owns deterministic transformations, dependency resolution, split plans and row accounting. An independent evaluation owner controls the benchmark, and the data governance owner approves scope, purpose, retention and deletion. Model trainers do not have authority to silently change the held-out cohort.

A control-plane build record includes dataset family, proposed release, approved specification, exact input references, logical interval, split policy, environment, resource limits, expected predecessor and intended consumer. Data-plane tasks produce staged immutable partition artifacts. The release controller validates the complete candidate and conditionally publishes its pointer. This logical design can be implemented in one service plus a warehouse/job orchestrator; a microservice per box is unnecessary.

3. Select a dependency-closed cut across independently changing sources#

A source cut is not simply a timestamp recorded when the build starts. Within a database use a supported consistent snapshot or export. Across independent systems, each source may have a different native position, table snapshot ID and finalization rule. Represent a cut as a vector of immutable source references plus dependency and coverage evidence.

For example:

SourcePinned referenceRequired semantic condition
Order exposure ledgerorders-snapshot-72Frozen eligible case population and actual delivery/decision anchors
Product dimensionproducts-snapshot-19Effective intervals and availability history for referenced product IDs
Feature tablefeatures-snapshot-104Required entity-time partitions, approved feature definitions and publication history
Return labelslabels-release-31Correct target version, mature revisions at the declared label cutoff

The physical snapshots need not have been created simultaneously. They must collectively contain the required history and obey the declared dependencies. A profile row referencing a product revision not present in the pinned dimension is an inconsistent cut even if every individual source has a green readiness check. If order revision 8 depends on a source identity mapping revision 6 and the candidate mapping cut only contains revision 5, resolve a compatible mapping cut or reject the order cohort. Never substitute a different mapping by arrival order.

Distinguish two concepts. A distributed consistent cut respects causal dependencies: it cannot include a dependent event while omitting its causal prerequisite. A dataset's admissible cut may impose additional business rules, such as full transaction visibility, authoritative corrections and historical availability. The Chandy–Lamport distributed snapshot result illustrates consistency in a defined message-passing model; it does not magically provide a cross-SaaS transaction or semantic correctness. If the sources cannot supply a common transaction boundary, use versioned dependency references, reconciliation checks and an explicit completeness contract. State which stronger consistency claims cannot be made.

Loading diagram…

Use a bounded wait and explicit hold policy when a mandatory source is missing. Optional sources can use an approved fallback only when the intended dataset supports it. Pin which fallback and which rows it affected. A source with incomplete availability history may support a hindsight research dataset but not an exact simulation of past serving.

4. The example spine: establish the population before joining#

The example spine is a table of stable logical example identities with tenant, case/exposure ID, target version, entity/group identifiers, prediction cutoff, label window and eligibility context. It is the denominator for construction. Start from the eligible business population or prediction ledger, not the intersection of currently observed feature and label rows. An inner join across all sources can silently remove hard examples and create a deceptively clean dataset.

For each row preserve an explicit disposition such as accepted, missing mandatory feature, expired feature, unmatched entity mapping, label immature, label withdrawn, duplicate identity, or incompatible target. Record multiple reasons if the consumer needs complete diagnosis and one deterministic primary reason if counts must partition the cohort. Enforce:

expected eligible case IDs = accepted IDs disjoint-union excluded IDs

This is a set reconciliation, not just equal counts. Also assert uniqueness and target compatibility. Counts alone can conceal a missing case offset by a duplicate. Do not use a current mutable entity ID where the true example unit is a shipment attempt or order line exposure.

Keep the cohort predicate, timezone, cutoff endpoints and stable identifier version in the build specification. An example eligible under the original specification should not disappear from the denominator because a source later stopped reporting its outcome. A privacy withdrawal may require actual deletion; preserve only permitted aggregate accounting and explicitly document the resulting reconstruction limitation.

5. Temporal joins: two knowledge policies, one declared target#

Each example has a prediction cutoff t. A feature may be used only if its semantic event/effective interval is eligible at t and it was actually available to the intended inference path by t under the as-known contract. Apply the exact feature age limit, source revision and tie-breaking policy. A table snapshot captured after t can contain historical records that meet these constraints; its late publication is not itself proof that the records were knowable earlier.

Labels have a different clock. They describe what happened in a post-prediction target window and may become known later. Select the approved label revision as of the dataset's label cutoff, with target horizon and maturity evidence. Never use a post-outcome field as an input just because it belongs to the same order. Preserve action/exposure semantics: a label under one intervention may not answer a counterfactual under another.

Worked synthetic example for a 10:00 prediction, feature TTL of 30 minutes:

Feature event timeAvailable to inferenceValueEligibility
09:2009:212Too old
09:4009:425Eligible
09:5510:0812Not known at prediction
10:0210:0318Future event

Select 5, not 12 or 18. A later correction to the 09:40 record is eligible only for a mode whose knowledge boundary permits that correction. The 30-day outcome, verified on day 37, can be a training label in a release built on day 40 but cannot be a feature at the original cutoff. If the original label was revised on day 45, the day-40 release must preserve the earlier approved revision and the day-46 corrected release can select the new one.

In a historical simulation where a model is trained at time T and evaluated afterward, training labels themselves must have been available to the training process by T. Having the correct feature cutoff does not make it safe to train a simulated historical model using labels received after its training time. Keep the per-example feature cutoff, model training cutoff and evaluation label cutoff separate.

When combining multiple feature families, avoid one-to-many fanout. Resolve effective history and allowed source versions per entity/time before combining. Validate cardinality and compare accepted IDs with the spine. A missing mandatory dimension or conflicting same-revision feature is not a license to pick an arbitrary match. Define distinct missing indicators and imputation policies; fitting imputation parameters on the full cohort would introduce another leakage path.

6. Sampling and splits are artifacts, not merely random seeds#

Choose the evaluation question before deciding the split. A group-held-out test measures generalization to unseen groups; a chronological test measures later performance for a defined population; an entity-grouped chronological design may be needed when both leakage modes matter. No split is universally best.

ScenarioSuitable design
Many orders per customer, unseen-customer generalizationStable customer-group assignment
Forecasting next monthChronological or rolling-origin evaluation
Repeated document versions or near-duplicate itemsKeep related duplicates in one split
Model selection across many experimentsFrozen independent test set, limited access; validation used for tuning
Delayed targets or overlapping outcome windowsPurge/embargo boundaries consistent with actual label availability and dependence

For deterministic group assignment, hash a canonical, namespaced group key and fixed policy salt, map to a documented bucket interval, and save actual membership. A salted deterministic hash yields stable assignment for unchanged group identity and policy, not guaranteed exact 80/10/10 counts or class balance. If the sampling target demands exact quotas, define an independent deterministic ranking within strata and record the selected identities; new candidates may alter membership in a new release. Avoid language-runtime hash functions whose randomization varies between processes.

Entity merges, duplicate clusters and family relationships can alter group definitions. Freeze the identity mapping and clustering version. A later discovery that train and test share a linked entity may invalidate the benchmark; do not quietly reassign existing benchmark members while preserving its version. Publish a revised benchmark with documented comparability limitations.

Chronological split design example: train on prediction anchors in January through March, evaluate on May anchors, with a model training cutoff at the start of May. For a 30-day outcome and seven-day adjudication delay, some late-March examples may not have mature labels by the training cutoff, depending on their exact dates. Exclude or handle them under an approved methodology; do not simply use all labels available today. A validation interval must follow the applicable temporal contract too. A fixed gap is not a substitute for checking actual exposure, maturity and feature dependencies.

All learned transformations—normalization, vocabulary, target encoding, feature selection, imputation, class rebalancing—must be fitted only on the training subset or inside each appropriate cross-validation training fold. Transform validation and test using the frozen training-derived parameters. If group or chronological split and resampling are required, do not duplicate or generate related examples across boundaries. Keep benchmark labels and exact memberships access-controlled from model tuning workflows.

7. Build specification and release manifest#

Separate *what is intended* from *what was produced*. A signed or otherwise protected build specification pins the input dependency set, cohort and feature/label semantics, transformations, split and environment. A release manifest records actual output artifacts, accepted and excluded membership, validation and provenance. Bind approval to the exact release digest.

Illustrative specification (identifiers are placeholders, not measured hashes):

JSON
{ "dataset_family": "return-risk", "spec_version": "dataset-build/v3", "purpose": "as-known-supervised-training", "cohort": { "target": "return_received_30d/v1", "anchor_range": ["2025-01-01T00:00:00Z", "2025-04-01T00:00:00Z"], "population_ref": "exposure-snapshot-72" }, "sources": { "orders": "orders-snapshot-72", "features": "features-snapshot-104", "products": "products-snapshot-19", "labels": "labels-release-31" }, "source_cut_evidence_ref": "validated-cut-18", "label_cutoff": "2025-05-01T00:00:00Z", "transform_release": "dataset-compiler/r8", "environment_ref": "locked-image-digest", "split_policy": "customer-group/v2", "split_membership_ref": "frozen-split-map-17" }

A real release lists every output partition with immutable storage identity, byte size, row count, cryptographic checksum, schema, key range and logical content digest if required. It also contains exact split membership references, exclusion accounting, validation rule and result references, fitted preprocessing artifacts and their training membership, dependency graph identity, source coverage, privacy/retention constraints and responsible approval. A protected manifest root hash makes substitution detectable when verified against trusted metadata.

A SHA-256 file hash checks the actual bytes read. A logical dataset digest may use a canonical row representation, explicit type and null encodings, stable ordering or a deterministic keyed Merkle tree. Canonicalize timezones, decimal scales, NaNs, string encodings, field ordering and duplicate handling according to schema. A hash of a sample or metadata cannot establish full content integrity. A checksum does not authenticate a maliciously replaced manifest; use trusted storage, signatures or a controlled release registry according to the threat model.

Record dependencies at useful granularity: every dataset partition references its source partitions, reference snapshots, transform release and label revisions. Row-level references for high-risk cases allow exact reconstruction and incident impact analysis without storing every raw field twice. Use the OpenLineage job/run/dataset vocabulary or compatible metadata standards, but do not equate emitting a lineage event with proven input completeness.

8. Deterministic execution and independent publication#

A reproducible build must pin actual executable behavior: source query version, feature definitions, target and label compatibility, identity mappings, dependency lockfiles, runtime/container, transformation parameters, locale/timezone and deterministic ordering. A Git commit alone may not include untracked code, dependencies or remote service responses. If an external enrichment or model service is nondeterministic or mutable, persist its authorized output with exact provenance, or state that reconstructing from source will not reproduce it.

Avoid nondeterministic SQL tie-breaking, accidental current_date reads, unordered limit, partition-dependent random seeds and floating-point reductions whose order changes with worker count. Specify tolerances if exact numerical equality is not required. Pin schema and reader/writer versions for a byte-level contract. Even a pinned dataset and seed do not guarantee identical model training results.

Loading diagram…

Each worker owns a logical partition and attempt identity. Use idempotent staged writes with exact artifact digest; conflicting output for the same deterministic specification is a reproducibility incident. An attempt may leave an orphan object after failure, but not a published partial release. Conditional publication prevents a slow old build from replacing a newer approved release. Consumers pin the release before reading any files and verify their integrity. Model training and model deployment remain distinct approval processes.

9. Tested implementation: small deterministic dataset compiler#

The standard-library Python fixture builds a complete miniature dataset from three independent immutable logical input sets: cases, features and label revisions. It verifies pins, selects availability-aware features and mature labels, assigns group-stable splits and emits exclusion accounting plus logical specification/content hashes. The group split policy illustrates unseen-group evaluation, not temporal evaluation.

PYTHON
import hashlib import json from dataclasses import dataclass, replace, asdict def digest(value): data = json.dumps(value, sort_keys=True, separators=(',', ':'), allow_nan=False).encode('utf-8') return hashlib.sha256(data).hexdigest() @dataclass(frozen=True) class Case: id: str group: str cutoff: int end: int @dataclass(frozen=True) class Feature: group: str event: int available: int revision: int value: int @dataclass(frozen=True) class Label: case: str revision: int recorded: int mature: bool value: int | None def pin(rows): # Canonical logical serialization for this integer/string fixture only. return digest(sorted((asdict(r) for r in rows), key=digest)) def split(group, salt): bucket = int(digest([salt, group]), 16) % 100 return 'train' if bucket < 80 else 'validation' if bucket < 90 else 'test' def build(cases, features, labels, spec): inputs = [pin(r) for r in (cases, features, labels)] if inputs != spec['pins']: raise ValueError('input digest mismatch') if len({c.id for c in cases}) != len(cases): raise ValueError('duplicate case') rows, excluded = [], {} for c in sorted(cases, key=lambda x: x.id): fs = [f for f in features if f.group == c.group and c.cutoff - spec['ttl'] <= f.event <= c.cutoff and f.available <= c.cutoff] ls = [l for l in labels if l.case == c.id and l.recorded <= spec['label_cut']] if not ls or c.end > spec['label_cut']: excluded[c.id] = 'PENDING_LABEL' continue top = max(l.revision for l in ls) latest = {l for l in ls if l.revision == top} if len(latest) != 1: raise ValueError('label conflict') l = latest.pop() if not l.mature or l.recorded < c.end or type(l.value) is not int or l.value not in (0, 1): excluded[c.id] = 'INELIGIBLE_LABEL' continue if not fs: excluded[c.id] = 'MISSING_FEATURE' continue rank = max((f.event, f.revision) for f in fs) selected = {f for f in fs if (f.event, f.revision) == rank} if len(selected) != 1: raise ValueError('feature conflict') f = selected.pop() rows.append({'case': c.id, 'group': c.group, 'split': split(c.group, spec['salt']), 'feature': f.value, 'feature_ref': asdict(f), 'label': l.value, 'label_revision': l.revision}) return {'rows': rows, 'excluded': excluded, 'spec_hash': digest(spec), 'content_hash': digest([rows, excluded])} cases = [Case('a','g1',10,20), Case('b','g1',11,21), Case('c','g2',10,20), Case('d','g3',10,40), Case('e','g4',10,20)] features = [Feature('g1',8,9,1,5), Feature('g1',9,12,1,99), Feature('g1',12,12,1,100), Feature('g2',3,3,1,7)] labels = [Label('a',1,20,True,0), Label('a',2,35,True,1), Label('b',1,21,True,1), Label('c',1,20,True,0), Label('d',1,25,False,None), Label('e',1,22,False,None)] def spec_for(cs=cases, fs=features, ls=labels, cut=30): return {'pins': [pin(r) for r in (cs,fs,ls)], 'ttl':5, 'label_cut':cut, 'salt':'group-split/v1', 'transform':'fixture/v1'} s = spec_for() out = build(cases,features,labels,s) assert [r['case'] for r in out['rows']] == ['a','b'] assert [r['feature'] for r in out['rows']] == [5,5] assert out['rows'][0]['label'] == 0 assert out['rows'][0]['label_revision'] == 1 assert out['rows'][0]['split'] == out['rows'][1]['split'] assert out['excluded'] == {'c':'MISSING_FEATURE','d':'PENDING_LABEL','e':'INELIGIBLE_LABEL'} assert len(out['rows']) + len(out['excluded']) == len(cases) assert build(cases[::-1],features[::-1],labels[::-1],s) == out new = build(cases,features,labels,spec_for(cut=36)) assert new['rows'][0]['label'] == 1 assert new['content_hash'] != out['content_hash'] assert build(cases,features,labels,s) == out assert split('g1',s['salt']) == split('g1',s['salt']) assert pin(features) == pin(features[::-1]) assert pin(features) != pin(features + [Feature('g2',9,9,1,4)]) withdrawn = labels + [Label('a',3,36,False,None)] assert build(cases,features,withdrawn,spec_for(ls=withdrawn,cut=37))['excluded']['a'] == 'INELIGIBLE_LABEL' def rejects(cs,fs,ls,spec): try: build(cs,fs,ls,spec) except ValueError: return True return False assert rejects(cases,features[:-1],labels,s) assert rejects(cases+cases[:1],features,labels,spec_for(cs=cases+cases[:1])) conflict = features + [replace(features[0],value=6)] assert rejects(cases,conflict,labels,spec_for(fs=conflict)) conflict_l = labels + [replace(labels[0],value=1)] assert rejects(cases,features,conflict_l,spec_for(ls=conflict_l)) assert build(cases,features,labels,spec_for())['spec_hash'] == out['spec_hash'] print('20 checks passed')

Actual local execution on Python 3.13.5:

20 checks passed

The 20 assertions cover exact accepted IDs, future/late feature exclusion, original label revision, group isolation, expected exclusion reasons, cohort accounting, input-order invariance, changed label cutoff and content digest, stable replay, logical pin invariance and sensitivity, withdrawal without resurrection, input-integrity rejection, duplicate case rejection and selected feature/label identity collisions. Four assertions invoke a helper that checks expected ValueError. The executed code MD5 excluding its terminal newline is 05976425560bab20b322ebd7622b5ac1.

The code is a single-scope teaching fixture. It assumes a trusted frozen population, normalized integer timestamps and source revision semantics, approved source dependency cut and authentic expected pins. The supplied pins are logical content digests of synthetic rows, not authoritative database snapshot references or hashes of raw files. It verifies only the selected highest-revision identity conflicts, not all historical collisions or temporal ordering of every revision. The feature join assumes full-state values with no explicit tombstone; production must support the approved deletion/retraction and effective interval semantics. The label mature flag is assumed to come from an authoritative adjudication service; elapsed time alone cannot establish maturity. The fixture records only one exclusion reason per case and accepts a toy label domain. Its transform identifier is included in the specification but not independently checked against an executable image. It does not enforce tenant authorization, privacy, target contracts, training-fold preprocessing, temporal splits, actual immutable release storage, source consistency or concurrency. It performs no real model training. The SHA-256 representation is a deliberately limited logical serialization for these dataclasses, not a universal canonicalization standard.

For n cases, f feature rows and l label rows, the naive nested scan costs O(n(f+l)) time plus sorting/hashing; do not deploy that algorithm at scale. Use keyed partitioning and indexed/as-of joins or distributed sort-merge joins under the same semantics. Input digest sorting adds O(m log m) comparisons for m rows and materializes them in memory. For large immutable source files verify streaming byte hashes and a deterministic partition-manifest root. The tests establish selected local logic only.

10. Worked dataset construction and release accounting#

Suppose the return-risk project freezes 1,000,000 eligible shipment exposures under target v1. The dataset compiler finds 70,000 cases with immature labels, 15,000 with unresolved or withdrawn labels, 10,000 with missing mandatory features, and 5,000 with incompatible identity mapping. Assume these categories are mutually exclusive primary reasons.

OutcomeCases
Accepted900,000
Immature label70,000
Unresolved/withdrawn15,000
Missing mandatory feature10,000
Incompatible mapping5,000
Frozen eligible population1,000,000

Accepted coverage is 90%. This is a construction-quality measure, not model accuracy or representativeness. Check coverage by product class, region, time and decision/exposure route. Suppose the actual group-based membership has 718,000 training, 91,000 validation and 91,000 test examples. Preserve those exact counts and IDs rather than claim the nominal 80/10/10 policy produced exactly 720,000/90,000/90,000. Record the number of distinct groups in each split and verify group intersections are empty.

A corrected label release then changes 2,000 accepted labels, matures 8,000 previously pending cases, and withdraws 500 previously accepted labels. Assuming no other changes, a new build has 907,500 accepted cases. The membership delta is +7,500, while 2,000 existing values change without changing membership. The old release remains a historical artifact subject to current authorization and withdrawal rules; do not overwrite it. Report both membership and value changes and separately verify whether each change affects train, validation or test. If the evaluation cohort has a frozen membership policy, newly mature cases may become eligible for a separate new benchmark release, not an unannounced expansion of the old one.

11. Incremental reconstruction with dependency closure#

A full rebuild may be expensive. Reuse unchanged partitions only if their entire effective dependency closure remains identical or an approved equivalence proof exists. An unchanged source partition does not imply unchanged output: a customer identity mapping correction, learned preprocessing parameter or rolling feature dependency may affect many partitions.

Represent the build as a directed dependency graph. A source revision change marks directly dependent nodes dirty; propagate through descendants, including feature windows, group membership and training-fitted transformations. For a 30-day rolling feature including the current day, a correction on day D may affect outputs D through D+29. If a global training mean changes, every partition transformed by that mean may change, including validation and test. A split policy change may invalidate all fitted preprocessing artifacts, not just rows assigned differently.

Loading diagram…

Test incremental reconstruction against a full deterministic rebuild on representative partitions and periodic controlled reference runs. Compare logical content and membership rather than merely number of tasks rerun. If equivalence cannot be established, recompute. An old partition with correct features may still have outdated label eligibility or unauthorized membership. Preserve current privacy and purpose rules even for reused artifacts.

For a fictional workload of 365 daily output partitions, one changed input day with a 30-day dependency window may dirty 30 partitions, or 8.22% of the daily partitions. That is not automatically an 91.78% compute saving: costs vary, and global transformation or split dependencies may force further work. The dependency graph, not the number of corrected rows, determines the actual reconstruction scope.

12. Validation gates and reproducibility incident response#

GateEvidence
Input identity and retentionEvery pinned artifact exists and matches verified metadata/digest
Source cutRequired partition coverage, dependency closure and source revision compatibility
CohortExact expected IDs equal accepted plus excluded, no duplicate examples
Temporal correctnessPer-example event and availability boundaries, target horizon and training cutoff
Semantic consistencyFeature units, definitions, label target and entity mapping
Split isolationGroup and duplicate-cluster intersections, temporal policy, benchmark access
Transformation fitFitted artifacts depend only on permitted training members
Dataset qualityMissingness, cardinality, value constraints, critical slices and documented changes
ReconstructionRepeat build agrees under the declared logical/byte contract
PrivacyCurrent authorized use, deletion/withdrawal checks and retention
PublicationExact staged manifest approved, no stale predecessor

When a rebuild yields a different digest, first preserve both artifacts and suspend unsupported claims of reproducibility. Determine whether source references resolved differently, code or environment drifted, sorting/tie-breaking changed, global preprocessing changed, or the difference is only physical encoding. Verify actual row keys and values under the declared contract. Never modify the expected digest simply to make a validation pass.

If a source snapshot expired, restore only from an approved retained artifact or backup under current permission. If exact reconstruction is impossible, mark it unavailable, identify affected experiments and publish an explicitly different replacement dataset if justified. Do not silently reconstruct from current data and use the old release identity. If a benchmark was contaminated, quarantine its results and create a fresh independently controlled evaluation release; past metrics may no longer support the original generalization claim.

13. Production scalability and cost#

Consider a hypothetical dataset with 100 million examples and 400 bytes of logical output per example, about 40 GB before file format overhead and compression. Suppose the build must scan three sources totaling 1.2 TB and an independently benchmarked aggregate read rate is 2 GB/s. Ideal input read time alone is 600 seconds or 10 minutes, excluding join shuffle, writes, validation, skew and orchestration. Three full uncompressed output copies consume roughly 120 GB, before separate source history and intermediates.

Partition the spine and source histories by compatible entity/time boundaries. Use bucketed or range partitioning, prune to required source ranges plus lookback, and stage preaggregated features where their temporal semantics are correct. For large as-of joins, use a sorted temporal join within entity groups or an appropriate warehouse implementation; handle heavy-key skew through validated strategies that preserve ordering and entity semantics. Avoid cross joins and unbounded per-case source API calls. A repeated evaluation build should read pinned approved data, not invoke a mutable external enrichment service for every row.

Compute quotas must protect live ingestion and inference. Use bounded build admission, separate batch worker pools, source read budgets, materialized partition manifests and checkpointed progress. Track output bytes and storage retention across shared artifacts; retention-aware deduplication can reduce costs, but only if access, deletion and reference accounting remain correct.

14. Privacy, retention and consumer integration#

Data reproducibility is subject to current authorized retention and use. Define the minimum needed data, storage class, encryption and tenant/purpose scope for the spine, features, labels, exclusion ledger and manifests. A label or hashed group ID can still expose sensitive information; hashing is not anonymization. Restrict benchmark identities and adjudication evidence to authorized reviewers; give model consumers only necessary approved fields.

Retain referenced snapshots, transformations and fitted artifacts for the approved reproducibility period. Lakehouse time travel is limited by actual retained files and metadata. A garbage collector must account for dependencies and active leases before removing artifacts. If deletion or withdrawal is required, propagate through source, derived datasets, benchmark copies, cache and downstream model-impact review. Do not restore deleted records by replaying an old snapshot. Historical manifests can retain permitted minimal accounting without exposing withdrawn content; record which exact reconstruction guarantees no longer hold.

Train and evaluation consumers store dataset release ID, split ID and preprocessing reference with each run. A training service cannot modify the benchmark, and benchmark changes require a separately documented release. If an external team cannot access the source rows, provide an appropriately authorized validation receipt or approved materialized dataset rather than grant broad source access. Provenance references themselves need authorization.

15. Monitoring and production acceptance tests#

Track source-cut resolution failures, missing expected partitions, dependency mismatch, snapshot expiry headroom, case registration and accepted/excluded coverage, feature age and late-availability exclusions, label maturity and corrections, join fanout, split collisions, learned preprocessing dependency violations, reproducibility digest mismatch, full-versus-incremental parity, build throughput, publication conflicts and deletion propagation. Measure by target and release version; aggregate away private identifiers in ordinary telemetry. A green scheduler status is not evidence of dataset validity.

Test the actual data engine with concurrent source changes during builds, incomplete snapshot cuts and dependency references, duplicate case and source identities, timestamp boundaries, late corrections and tombstones, label withdrawal, group identity merges, near duplicates, fold-local preprocessing and held-out access. Inject missing artifact, changed bytes, worker interruption, stale release promotion and concurrent release reads. Rebuild from the pinned specification under changed source aliases; it must still resolve original artifacts. Compare full and incremental outputs on actual affected windows and validate current policy after backup restore. Test workload at realistic skew and scale, and use independent domain owners to assess semantic validity. None of these deployed tests are claimed by the local fixture.

16. Interview-ready answer#

I would start from a target-specific frozen example spine and a declared reproducibility contract. I would select immutable, dependency-compatible source snapshots and preserve their coverage and native frontier evidence. The compiler would reconstruct features using each example's prediction-time availability and effective-time boundaries, and join separately matured labels at the declared label cutoff. I would explicitly account for rejected and unresolved examples, preserve provenance, choose group or temporal splits based on the actual generalization objective, and fit learned preprocessing only on training members.

I would pin transformation code, dependencies, environment, parameters and actual membership. Workers would materialize immutable staged partitions, and an independent validator would check the source cut, cohort, temporal correctness, split isolation, quality, integrity and current authorized purpose. A conditional release would expose exactly the approved manifest, and training/evaluation runs would record that identity. Corrections would produce new releases; incremental reconstruction would expand through the dependency graph and be checked against full rebuilds. I would retain required artifacts within authorized policy, monitor coverage and reproducibility failures, and explicitly disclose when source retention or withdrawal makes historical reconstruction impossible.

A reproducible dataset is a versioned, validated answer to a precisely defined population and information-set question. It is not merely a frozen file or a successful training job.

References and research transparency#

Authorized offline research exception applied. The references identify established distributed-snapshot research, official data and feature documentation, evaluation guidance, dataset provenance and integrity standards. Live URL availability, current contents and Supabase changelog were not verified. Four meaningful standard triple-backtick Mermaid diagrams were structurally reviewed; parser execution and frontend rendering were not tested. The exact Python block was genuinely executed locally on Python 3.13.5 with 20 assertions passing. No actual warehouse, distributed transaction, feature store, model training, privacy assessment, production benchmark or large-scale incremental build was exercised. Scenarios, specifications and capacity estimates are hypothetical.

Related questions

Explore other topics:Forward Deployed EngineeringMachine LearningMLOpsPython