﻿# Wildcard dataset discovery: exclude sidecar reports from the training population

Wildcard dataset discovery: exclude sidecar reports from the training population. A practical data-quality guide with failure mechanisms, validation steps, acceptance evidence and primary references.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/dq-wildcard-loader-sidecar-contamination/
Language: en

A release directory contains data shards and readable sidecar reports using the same extension. A broad file glob discovers both, silently adding validation records or old exports to the training population.

## The mechanism that changes the example

Syntactic readability does not establish dataset membership. Discovery rules, ignored prefixes and explicit file manifests define a selection boundary that can change when new operational files appear.



## Define the comparison boundary

Record the exact discovered file set before scanning. A directory may contain success markers, schema sidecars, temporary outputs and reports whose extension or parser behavior differs from the intended data files.

Use explicit members or a reviewed inclusion rule, and test that rule against a sidecar that is syntactically readable but semantically not part of the population. An option ignoring invalid files only addresses parseability; it cannot reject every valid-looking unrelated table.

Compare the discovered set with a release manifest that was established independently of the scan. Otherwise the reader can define its own success population by whatever it happens to find. Retain exclusions with reasons and verify that a newly added legitimate shard is accepted, while temporary and administrative objects remain outside the prepared examples.

## A constructed test case

Add a well-formed sidecar report to the release directory using the same extension as actual shards. A reader must exclude it by approved membership, not accept it merely because its schema and parser happen to be compatible.

## A reproducible validation procedure

Add decoy sidecars and backup shards to a fixture directory. Compare discovered files with the approved release manifest and reject extras as well as missing members. Keep diagnostic outputs in a separately governed location.

Include an unchanged control and a deliberately invalid case. Verify that the checker distinguishes them before testing the complete release.

Exercise the actual preparation path, including later serialization and reload. Limit retained diagnostic content to the evidence required for this comparison.

## Evidence needed for acceptance

Keep the exact discovered member set and a rejected-extra-file report.

## Containment and recovery

A file allowlist can still include semantically wrong records; membership and content checks remain distinct.

Quarantine an invalid release candidate or use an explicit partial-release rule. Preserve the last approved artifact and record corrections without silently rewriting historical inputs.

## Interpretation and references

Implementation references: [Arrow dataset reading and writing](https://arrow.apache.org/docs/python/dataset.html); [S3 object integrity verification](https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html).

This is a proposed engineering validation, not an executed Retrivium benchmark. Documentation specifies interfaces; dataset acceptance needs its own evidence and must be repeated after relevant dependency changes.

## Related reading

Continue with [Parquet row groups: faster reads without accidental dataset sampling](/journal/data-guide-parquet-rowgroup-statistics/); [Hugging Face Datasets: choose materialized or iterable processing](/journal/data-guide-hf-datasets-arrow-transformations/). These guides supply adjacent context; the decision in this article remains the specific example-preservation check above.
