Systems and records
Duplicate file semantic dataset check: one hash, four verdicts
By SourceX Editorial · Updated
10 sections
Short answer
A duplicate file semantic dataset check treats a matching hash as proof of identical bytes, never of identical meaning. Run on two public data repositories at pinned commits, it found 14 groups of byte-identical files that split four ways: six storage copies, four latest aliases sitting on frozen dated snapshots, three defects such as a .json file holding CSV text, and one system file. Record each group's role before deleting anything.
Retrieval
Duplicate file semantic
Key takeaways
- Identical bytes settle storage, not meaning: 8 of the 14 groups carried an alias role, a defect or a published address that a delete-the-copies rule would have lost.
- A latest file equal to today's snapshot is a pointer: the national latest file held 1,128 contents across 2,332 repository states and differed from the newest dated file in 30.
- Dated snapshots get rewritten: 353 of 1,782 national daily files changed after first publication, and 132 of those changes replaced a published non-empty value.
- Repeated values are separate events when the date lives in the record: 203 of 37,380 consecutive region-day pairs repeat every count and remain distinct reports.
- The manifest, not the file name, should carry role, alias target, declared versus parsed format, and the hash of the version each copy replaced.
What should a duplicate file semantic dataset check decide?
It should decide, for every group of byte-identical files, which of four things the copies are: one object stored twice, two roles that happen to share bytes today, a defect wearing a duplicate's disguise, or junk. Only the first kind can be collapsed safely, and even then every path has to survive in the manifest.
A content hash cannot make that call alone. Git names every stored object by the SHA-1 hash of its contents, so the same content always receives the same name in any repository, as the Git user manual explains (checked at commit 37b3475 on October 28, 2026). That property makes duplicates cheap to find. It says nothing about why the second copy exists.
The evidence that settles the question sits around the bytes: what the path encodes (a date, the word latest, a format extension), the history of each path, whether each record carries its own event identity, and whether the content parses as the format its name promises. With those four facts a delivery engineer can classify a group in minutes. Deleting by hash alone can lose a version, a role or a defect report without anyone noticing.
Fourteen byte-identical groups in two public repositories
Fourteen groups turned up when every file path in two public data repositories was grouped by git blob id. The first is plotly/datasets at commit 0c447c4 (May 4, 2026), titled Plotly Sample Datasets, whose README pairs files with chart examples and download links. The second is pcm-dpc/COVID-19 at commit fc82987 (January 10, 2025), where Italy's Civil Protection Department published its COVID-19 series under a CC BY 4.0 license. Together they hold 8,546 file paths; 29 of them sit in a group of two or more identical files.
A script sorted each group by path relation, then the paths, parse results and commit histories were read to assign a verdict. Six groups were plain storage copies, four were aliases sitting on frozen snapshots, three were defects and one was system clutter. The relation a script can see and the verdict a reviewer reaches line up less neatly than a deduplication tool assumes:
| Path relation (script rule) | Groups (paths) | Example from the census | What the copies turned out to be | Verdict |
|---|---|---|---|---|
| Dated snapshot beside a latest alias | 4 (8) | dpc-covid19-ita-regioni-20250108.csv and dpc-covid19-ita-regioni-latest.csv | A frozen daily snapshot and a pointer that moves with the next release | Keep both; record the alias target and date |
| Same stem, two format extensions | 2 (4) | Dashboard metrics files ending .csv and .json | Comma-separated Latin-1 text in both; the .json file is not JSON | Defect: fix or drop the mislabeled file |
| Different names, same folder | 4 (9) | GanttChart.csv and GanttChart-updated.csv; auto-mpg.csv and mpg.csv; three .prj files | Two alias pairs, one shared projection file, and an updated file identical to the file it claims to update | Store three once with every name mapped; flag the false version label |
| Same name in another folder | 3 (6) | wellspublic.csv at the root and inside a sample app | Copies bundled with an app, plus a root file restored to keep a published path working | Store once; keep every path |
| System file copy | 1 (2) | .DS_Store in two folders | Operating-system folder metadata, not data | Exclude from delivery |
Why a latest file that matches today's snapshot still means something else
Because a latest file is a pointer: it equals the newest snapshot only until the next release, and sometimes not even then. The data guide in the Civil Protection repository describes three files per geographic level: a daily file named with its date, a cumulative file holding every date, and a latest-data file.
Across all 2,423 commits reachable from the pinned commit, 66 of them merges, the national latest file existed in 2,332 repository states and held 1,128 different contents. It matched the newest dated national file in 2,302 of those states and differed in 30, spread over 14 commit dates. Three of its contents never appeared as any dated national file, so anyone who saved latest at those moments holds numbers that no daily snapshot preserves. The regional latest file shows the same pattern: 1,142 contents, 30 mismatched states and 4 contents never stored under a dated name.
The provincial summary PDF is the sharpest warning. Its dated series stops on June 24, 2020, yet the file named latest was last changed on November 2, 2020 and, at the pinned commit, matches none of the 114 dated provincial PDFs. It differed from the newest dated PDF in 1,745 of the 1,975 states in which it existed. A rule that keeps the latest copy and drops redundant dated files would have kept the one file whose meaning is hardest to state.
The documentation drifts too: the national section of the same data guide names dpc-covid19-ita-regioni-latest.csv, the regional file, as the national latest file. A manifest that states each alias target explicitly does not depend on that sentence being right.
Which rewritten snapshots are versions worth keeping?
Keep every version that replaced a published value; a version that only added columns can be collapsed with a note. Dated files in this repository were not frozen. Of the 1,782 national daily file names ever committed, 353 held two or more different contents over the history, up to eight. The regional family had 367 rewritten files with up to 12 versions, and the provincial family 168 with up to 11.
Classifying the 723 changes between consecutive repository states (672 between distinct versions) of those 353 national files separates housekeeping from substance. In 574 changes the header changed while every shared value stayed the same, 2 changed formatting only, and 147 changed at least one value. Of those 147, 132 replaced a published non-empty value, spread across 98 daily files; the fields replaced most often were casi_testati (50 changes), tamponi (44) and isolamento_domiciliare (33). Thirty of the 723 also rewrote the timestamp from 2020-02-24 18:00:00 style to 2020-02-24T18:00:00 style, which a naive key comparison reads as one record deleted and another created.
At the pinned commit the corrections agree with each other: all 1,781 daily national files match the cumulative file's row for the same date on every shared column. That agreement is exactly why history matters. Anyone who copied a daily file before one of those 132 replacements holds different values from someone who copies it now, and only the versions, with hashes and dates, can show which values a model saw.
Storage duplication or a repeated event?
Storage duplication is one fact recorded once and stored twice; a repeated event is two facts that happen to look alike. The test is where the event's identity lives. When the date, entity or transaction number is inside the record, two identical-looking reports stay two rows and never collide on a hash. When the identity lives only in the file path, as with a latest file beside a dated one, the bytes collide and the path has to carry the meaning.
The regional cumulative file shows why the distinction matters. Of 37,380 pairs of consecutive days within its 21 regional series, 203 repeat every count field exactly, 154 of them on days in 2024. Each is a separate daily report with its own timestamp. A comparison that ignored the date would fold those days together and erase the record that a region reported no change, which is itself a fact a model of reporting behavior may need. The national series has no such pair among its 1,780.
Business exports split the same way. A monthly retainer invoice that repeats last month's amount is a new event; the same PDF attached to two support tickets is one document stored twice. Record-level repeats have their own audit, linked below. The file-level check comes first, because one duplicated file multiplies every record inside it.
A clean checksum can certify the wrong file
It can: every defect in the census would pass a checksum comparison, because the checksum is computed on the defective bytes and then matched faithfully. The strongest alternative reading of the census is that byte duplicates are harmless storage waste and deleting them is pure hygiene. Three groups refute it.
First, the two dashboard metrics files ending .json hold the same bytes as their .csv twins: comma-separated text in Latin-1, which is neither valid UTF-8 nor JSON. The metrics documentation lists both csv and json as formats, and the changelog entry for June 14, 2022 records an update to the csv and json metrics files, so the format promise is explicit. The mobile CSV is itself uneven, with 449 rows of four fields and 494 rows of five when read as Latin-1. Deduplicating would keep one file and hide that the JSON was never delivered.
Second, plotly/datasets holds GanttChart.csv and GanttChart-updated.csv as identical 213-byte files. The history explains it. On May 10, 2016 the original was overwritten in place by a commit titled Updated GanttChart csv file, and four minutes later the same content was uploaded under the -updated name. The names promise two versions; the bytes hold one, and the pre-update version survives only in commit history.
Third, a copy can be an address. On August 11, 2023 the root file 2011_us_ag_exports.csv was moved into a course folder and re-created at the root about two hours later, in a pull request branch named add-back-dataset; the course copy later moved to its present folder. The repository's README still lists that root path as the file's download link, so dropping the root copy as redundant would break a published address. No census can see who depends on a path, which is why the manifest has to list every one.
Seven manifest fields that keep identical files apart
The manifest gives each file instance its own line and makes the role explicit, so no reviewer has to infer meaning from a name. Each field below answers a question the census had to reconstruct from commit history because the repositories did not record it:
| Manifest field | What it records | Census case it would have settled | Check that fails without it |
|---|---|---|---|
| content_sha256 with every path | One hash per object and all paths that hold it | auto-mpg.csv and mpg.csv | Deleting one alias breaks a consumer that used that name |
| role | Snapshot, moving alias, copy, sidecar or system file | A regional latest file beside its dated twin | Deduplication keeps the pointer and loses the frozen snapshot, or the reverse |
| alias_target and resolved_at | Which snapshot an alias pointed to, and when | The provincial latest PDF that matches no dated PDF | Nobody can say what latest meant on the delivery date |
| declared_format and parsed_as | The format the name promises, the format the bytes parse as, and the encoding | Metrics files ending .json that hold Latin-1 CSV text | A mislabeled file ships with a valid checksum |
| supersedes and change_class | Hash of the version replaced, and whether the change touched schema, values or formatting | 132 replaced values in 98 national daily files | A corrected number silently overwrites the one a buyer already trained on |
| event_key_in_content | Whether date and entity live inside each record | 203 repeated region-days | A content comparison folds repeated events into one |
| decision and approver | Keep, collapse, fix or exclude, and who decided | .DS_Store copies | Clutter and defects return in the next delivery |
Running the check before delivery: six steps and a stop rule
Run it on the export exactly as packaged, in the buyer's intended consumption format, before any compression or deduplication step that would hide the evidence. The stop rule is simple: hold the delivery while any group lacks a verdict or any declared format fails its parse.
Checklist · 6 items
- Group every file instance by SHA-256, or by git blob id inside a repository, and print each group with two or more paths.
- Classify each group by path relation: a date token beside a latest token, one stem with two extensions, one name in two folders, different names, or a system file. Accept a date token only if it is a real calendar date.
- Parse every file as the format its extension declares, logging encoding failures separately from structural ones.
- Walk the history of every path that holds an alias or a dated name, comparing states at every commit or export run, and record each version's hash and change class.
- Confirm that the event key lives inside the content; where it lives only in the path, copy it into the manifest.
- Write the verdict, the paths kept and the approver into the manifest, then hash the manifest itself.
0 of 6 ticked. Tick each item as you go.
Asking for roles and lineage before the data arrives
Put the rule into the request, not into the acceptance dispute. A buyer can require that byte-identical files arrive listed with every path and role, that dated snapshots come with their version lineage, and that each file parses as its declared format, then attach the census script as the acceptance test.
SourceX's request form asks AI teams for scope, volume, language, format, timing and licensing needs, and the page says datasets are sourced on request, not held in stock, so a test written this way can travel with the requirement from the first message. On the supply side, the Dataset Deal Confirmation that SourceX and a supplier sign fixes the exact dataset before the opportunity is presented externally. SourceX's sample manifest, a fictional and illustrative example, shows what a package summary covers: what is included, the fields and what was removed. A role column for duplicate files fits that summary; whether a given source system can supply version histories is a question for each candidate supplier, not something any request can assume.
Methods note: what the census counted and what it left out
Repositories and commits: plotly/datasets at 0c447c47b757ad74edecab31f0d72f849d2e67c2 and pcm-dpc/COVID-19 at fc82987b9ebda01fe8e5b59d5667e3e00721edb9, cloned on October 28, 2026; no repository code was run. Byte identity means equal git blob ids in git ls-tree at the pinned commit, with SHA-256 recomputed for each group. Path relations follow the script's ordered rules: every basename is a system file (.DS_Store, Thumbs.db, desktop.ini); one folder, with names equal after replacing one valid YYYYMMDD token or the delimited token latest, both kinds present; one folder, one stem, a different extension per path; one basename in different folders; otherwise different names. Verdicts are the writer's reading of paths, parse results and commit history, not script output.
History: the state of every commit reachable from the pinned commit (2,423, merges included), listed with git ls-tree per commit. An alias matches when its blob id equals that of the newest dated sibling present in the same state. A dated file is rewritten when its path held two or more distinct blob ids across those states. Change classes for the national family compare consecutive distinct states in commit order (git rev-list --reverse --topo-order): rows keyed by timestamp (a space before the time normalized to T) plus region and province codes where present, values compared as stripped strings on shared columns; header-only means the header changed while every shared value matched, and a replaced value was non-empty before and after. Commit dates are counted in each commit's recorded time zone offset.
Repeated days: consecutive days within each regional series, sorted by timestamp, where every count field that is non-empty on both days holds the same string and at least five such fields are compared; data, stato, the region code and name, lat, long, the two NUTS codes and the three note fields are excluded. Files were read as UTF-8 with any byte-order mark removed, falling back to Latin-1 only when a file is not valid UTF-8; the format check reports each fallback. Not measured: who uses each path, whether PDF contents differ in substance, or any repository beyond these two. The script, xs0937_census.py, and its JSON output are kept for recount.
Frequently asked questions
Are byte-identical files in a dataset always safe to delete?
No. Identical bytes prove only that the content matches today. In the census, 8 of 14 groups carried an alias role, a mislabeled format, a false version label or a published path, so each group needs a recorded verdict before any copy is removed.
What is the difference between a duplicate file and a repeated event?
A duplicate file is one record stored twice; a repeated event is a second occurrence that looks like the first. When each record carries its own date and entity, repeated events never collide on a hash, so a byte match between two files usually means the meaning lives in the path and must be written into the manifest.
Why keep a file called latest if it equals a dated snapshot?
Because it will not stay equal. In the Civil Protection repository the national latest file changed 1,128 times and sometimes matched no dated file at all. Keep it as an alias with its target and resolution date recorded, and keep the dated snapshot as the frozen version.
Does a valid checksum prove a delivered file is correct?
It proves the file arrived as hashed. A .json file holding CSV text, or an updated file identical to the original, passes a checksum perfectly. Pair checksums with a parse check against the declared format and a role for every duplicate path.
Should a buyer ask for every historical version of a dataset?
Ask for every version that replaced a published value, with its hash and date; header-only changes can be summarized. In the national series, 132 of the 723 changes between consecutive repository states replaced a published non-empty value, and those are the versions that decide which figures a model saw.
Sources
- Italy's Civil Protection Department publishes its COVID-19 series in this repository; at commit fc82987 it holds 7,359 file paths, daily, cumulative and latest files per level, and 2,423 commits of history. Source
- The repository's data guide names a daily file, a cumulative file and a latest-data file for each level, and its national section lists the regional latest file name. Source
- The metrics documentation lists csv and json as the formats of the dashboard metrics files. Source
- The changelog entry for June 14, 2022 records an update to the csv and json metrics files of the desktop and mobile dashboards. Source
- plotly/datasets at commit 0c447c4 holds 1,187 file paths, including the identical GanttChart, mpg, inset and sample-app files counted in the census. Source
- The plotly/datasets README, titled Plotly Sample Datasets, pairs each file with chart examples and a download link, including the root path of 2011_us_ag_exports.csv. Source
- A May 10, 2016 commit titled Updated GanttChart csv file overwrote GanttChart.csv in place; GanttChart-updated.csv was uploaded minutes later with the same content. Source
- On August 11, 2023 the root 2011_us_ag_exports.csv was re-created about two hours after a rename moved it, on a branch named add-back-dataset. Source
- The Git user manual says each object is named by the SHA-1 hash of its contents, so the same content is stored under the same name in every repository. Source
- SourceX's how-it-works page says the supplier and SourceX sign a Dataset Deal Confirmation that fixes the exact dataset before the opportunity is presented externally. Source
- SourceX's request page asks for scope, volume, language, format, timing and licensing, and says datasets are sourced on request, not held in stock. Source
- SourceX's sample manifest is a fictional, illustrative package summary showing what is included, the fields and what was removed. Source
Tell us what data you need
Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.