Migrate bad research repos without losing provenance. The first pass should make the repository understandable before trying to improve scientific quality.
Read First
references/repository-contract.mdreferences/repo-migration-policy.mdreferences/output-contracts.md
Workflow
- Snapshot current state with
git status --shortand a file inventory. - Classify files as sources, data, code, notebooks, outputs, reports, configs, credentials, generated caches, or unknown.
- Move immutable research sources into
sources/,reports/, ordata/raw/. - Move repeatable code into
src/and thin entrypoints intoscripts/. - Keep notebooks in
notebooks/only when they are exploratory or narrative. - Separate trusted, exploratory, training, analysis, and debug outputs.
- Add source ledger rows and wiki pages for important papers, proposals, and datasets.
- Record unresolved questions in
wiki/open_questions.mdinstead of guessing. - Run repository structure checks and tests.
Preserve
- original filenames in ledger notes when renaming
- archive paths and extraction paths
- proposal versions
- command history if present
- data provenance and access constraints
Do Not
- Rewrite scientific logic while doing structural migration unless required to keep tests runnable.
- Delete suspicious files without user approval.
- Promote notebook-only results to final claims without reproduction.