Skip to content

Reject file-directory collisions in research export bundles - #3641

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
roger-sato:fix/export-file-topology
Oct 20, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
roger-sato:fix/export-file-topology

Conversation

@roger-sato

Copy link
Copy Markdown
Contributor

Summary

A real Git package declaring .research-export.json/input.dat currently exports and passes check, then fails extraction: the input requires .research-export.json to be a directory, while the export receipt requires it to be a file. A self-consistent bundle containing a and a/child likewise passes the checker in either member order despite being impossible to extract as regular files.

Validate the complete regular-file tree, including the generated receipt, before publishing an export and before accepting a checked bundle. Every slash-delimited ancestor is checked against the full file set, so reversed member order, deeper paths and intervening lexical siblings cannot hide a collision. Valid sibling files, distinct prefixes and receipt-first bundles remain supported. The checker still never extracts or executes content.

This is a transport-integrity repair building on Tekalign's exporter in #3138, distinct from the Windows drive-path policy in #3629. It does not authenticate Git provenance or validate mathematics. No frozen source, source pin, registered manifest or selected result changes. The canonical source/manifest census found no declared exporter dependency requiring historical replay.

The portable-replay task is narrowed here to consistency of exported path structure: a successful integrity check must reject contradictory file/directory roles.

Base: canonical main 20ecf2891d80b5acf18d980b2164fb44ea7faa90, priority revision 6. Complete overlap snapshots checked 347 open PRs, 2,964 closed PRs and 2,454 Discussion records (2026-10-18 12:12–12:14 UTC); no matching collision fix was found. A submission-time refresh found only the unrelated Fourier-tape PR #3640 since that snapshot, and #1166 was unchanged since 12:07 UTC. Canonical main was refetched unchanged. Search coverage is not an exhaustive novelty claim.

Test plan

  • Actual baseline export → check → fresh-directory extraction reproduces the receipt collision: both CLIs print PASS_RESEARCH_EXPORT, then extraction raises IsADirectoryError.
  • The five new regression methods against canonical production produce eight failing collision cases; valid controls pass.
  • Existing exporter tests plus five new CLI/Git/extraction regressions: 14 tests pass with warnings treated as errors, both normally and under optimized Python.
  • New controls include both file/member orders, deep descendants, intervening lexical siblings, the receipt namespace, no output/temp residue on rejection, valid shared-directory siblings, receipt-like prefix siblings, and shuffled/receipt-first valid bundles.
  • The production patch from pending Reject Windows drive-qualified paths in research exports #3629 applies cleanly; all 19 combined exporter regression methods pass.
  • Separate same-session reviewer reproduces the baseline and verifies the repair; git diff --check passes.
  • Hosted CI and native Windows execution; no full historical mathematical replay is claimed.

Run from the repository root (tested on macOS arm64, CPython 3.12.14, Git 2.54.0):

python3.12 -W error -B -m unittest discover -s tests -p 'test_research_export*.py' -v
python3.12 -O -W error -B -m unittest discover -s tests -p 'test_research_export*.py' -v
git diff --check

Prepared for roger-sato with substantial OpenAI Codex assistance in diagnosis, implementation, regression tests and writing. Apache-2.0. Same-session agent review is not independent human acceptance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants