Skip to content

Dead-code sweep: empty the known-dead list and hunt the rest - #140

Merged
asmacdo merged 7 commits into
con:study-first-rewritefrom
asmacdo:dead-code-sweep
Sep 3, 2026
Merged

asmacdo merged 7 commits into
con:study-first-rewritefrom
asmacdo:dead-code-sweep

Conversation

@asmacdo

@asmacdo asmacdo commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

tldr:

  • Empties the study-first sprint's known-dead list and hunts the rest: seven commits, all deletions plus two docstrings.
  • Gone: bootstrap.sh, requirements-campaign.txt, merge_config.py, tmp-repronim-container-shim.sh, preflight.py, design/openneuro-findings.md, priority-openneuro-datasets.csv, validate.clone_ref (+ RefError + its tests), three stale .gitignore lines.
  • Each commit message carries the grep evidence that nothing references what it removes.
  • Kept, deliberately: campaign.apps_dir (vulture flags it, but the unit suite and both e2e scenarios use it as the one definition of the path).
  • Unit 416 passed (−3, the clone_ref tests), ruff both steps clean.
What each file was, and what replaced it
How the hunt was done

vulture --min-confidence 0 over the package (e2e excluded) reports two unused functions: clone_ref and apps_dir. The second is live in tests. A grep across package, tests, docs, examples and workflows for the names of every module and flag the sprint deleted (guard.py, construct.py, state.py, datalad_save_scope, configure, bootstrap, --campaign-path, derivative-attempts, desc-mechababs_datasets, run_on_cluster, --workdir, the shim, --derivative) found two docstrings still naming them, fixed in the last commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y

asmacdo and others added 7 commits September 3, 2026 13:45
…e-point

clone_ref answered "what ref can this checkout be re-cloned at" for the old
bootstrap path, where test-cluster stood in a dev campaign and re-pinned its
code from a checkout. con#127 removed that path: test-cluster now
mirrors the running install via PEP 610 metadata (campaign_init.running_mechababs_pin)
and takes --mechababs/--babs URL@REF for anything else, so nothing ever needs a
branch name read out of a working tree.

Evidence: `git grep clone_ref` finds only the definition and its four tests;
RefError is raised nowhere else. Identified on the known-dead list of the
study-first sprint.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
All three belonged to the campaign-as-dataset layout: bootstrap.sh cloned the
code pins and built the venv, requirements-campaign.txt was the extras it
installed, and merge_config.py composed pipeline x cluster x dataset into the
one babs-config.yaml that `configure` fed to babs init. Study-first replaced
each of them inside the package -- campaign_init builds the environment from a
generated pyproject + uv.lock (CAMPAIGN_EXTRAS is the extras list), and
compose.py does the composition -- and con#127 deleted `configure`,
their last caller.

Evidence: `git grep` for each filename hits only the three files themselves
and one pyproject.toml comment, which this commit rewrites.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
It built the out-of-campaign ../repronim-containers-shim dataset that vanilla
babs needed to find images before PennLINC/babs#399 resolved the
ReproNim/containers layout natively. #399 merged 2026-08-19, the native path was
verified at runtime on Unity 2026-08-26 (con#62's evidence), and the
study-first scaffold has used it since con#119. require_shim and
SHIM_DIRNAME went with con#127; this is the last piece.

Evidence: no file in the tree names the script or the shim directory.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
A hand-run script from the first shakeouts: given a dataset id it checked that
no OpenNeuroDerivatives/<id>-mriqc repo existed and that the raw dataset was
reachable. Nothing invokes it, it is MRIQC-only and OpenNeuro-only (the two
couplings the CLAUDE.md strip just moved out of the repo), and its own docstring
records the false-pass on git auth/network errors that con#10 tracks.
The check it did belongs, if anywhere, in add-dataset's sniff against the
cloned study, which already sees the study's existing derivatives.

Evidence: `git grep preflight` hits only the file and design/openneuro-findings.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
The findings doc is a 2026-03 exploration of the OpenNeuroStudies layout. Its
durable content -- the three-org table and the study/sourcedata/derivatives
shape -- is what the repo docs and the tool now encode, and the rest is our
deployment's, which lives outside the repo since con#134.

The ignore lines went with the layouts they hid: processing/ (the pre-campaign
output tree), repronim-containers/ (the shim clone), design/*.png (that doc's
figures, of which none exist).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
select.py listed desc-mechababs_datasets.tsv, the wide ledger state.py kept and
con#130 deleted, among the TSVs it is not; the statefile it should
contrast with is sourcedata+derivatives.tsv. test_spine's _iterate docstring
explained itself by the absence of --campaign-path, a flag con#127
removed, which tells a reader nothing now.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
It is our curated list of the OpenNeuro datasets we want processed: a fact
about our deployment, not about the tool. Nothing in the package reads it,
and the same reasoning that took the OpenNeuro sections out of CLAUDE.md
(con#134) applies to the data behind them. It lives with our
deployment notes now; this repo's history keeps its past.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
@asmacdo
asmacdo marked this pull request as ready for review September 3, 2026 20:16
@asmacdo
asmacdo merged commit 42beca3 into con:study-first-rewrite Sep 3, 2026
4 checks passed
@asmacdo asmacdo mentioned this pull request Sep 4, 2026
9 tasks done
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.

1 participant