Skip to content

fix: preserve source directories when force-importing local cases - #20

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Leroyyyyyyyyy:fix/fetch-cases-self-copy
Oct 18, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Leroyyyyyyyyy:fix/fetch-cases-self-copy

Conversation

@Leroyyyyyyyyy

Copy link
Copy Markdown

Force-importing local cases can delete the source when the destination names the same directory. Importing into a sibling cases folder also deletes a shared data/raw directory before failing to copy it.

Fixes #19.

Check directory identity with os.path.samefile before replacing a case or raw-data directory. Self-copies are reported as already present, including symlink aliases; --force still replaces distinct destinations. Add six standard-library tests and run them in the existing Python 3.9 CI job.

Validation

  • Before the fix, the self-copy/shared-data regression cases fail with FileNotFoundError after source deletion; ordinary import tests pass.
  • Python 3.9.6: python3 -m unittest discover -s tests -v — all 6 tests pass.
  • Python 3.9.6: python3 -m compileall -q harness scripts and python3 harness/run.py --version — pass.
  • pnpm typecheck and pnpm build — pass.
  • pnpm test — 17 pass, 16 skip because no local PostgreSQL is running; 0 failures. Local app checks used Node 24.16.0; CI uses Node 22 and PostgreSQL 16.
  • git diff --check — pass.

Fixtures are generated in temporary directories and contain only placeholder files; no case content or model access is needed.

@WaylandYang
WaylandYang merged commit dfb38af into deeplethe:dev Oct 18, 2026
2 checks passed
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