This file is an ordered checklist for agents performing the repo cleanup from the ponytail audit. Do the steps in order. Keep each step in its own commit when practical, because most steps are independent and easy to review.
Rules for every step:
- Start by checking the worktree with
rtk git status --short. Ifrtkis unavailable, usegit status --short. - Do not overwrite unrelated user changes. If a target file is already edited, inspect it first and preserve unrelated changes.
- Prefer deletion and existing tooling over replacement code.
- After each step, run the smallest relevant verification listed in that step.
- If a step removes public files, confirm no source, tests, docs, package manifests, or CI jobs still reference them.
Goal: make later cleanup failures easy to attribute.
Actions:
- Capture current branch and dirty files:
rtk git status --short rtk git branch --show-current
- Record current source counts and heavy directories:
rtk find . -maxdepth 2 -type d du -sh data javascript/src/data python/research www/old_docs stubs javascript/src/threejs_lib 2>/dev/null
- Run the cheapest existing checks that work in the current environment:
If the native extension is not built, record that and continue. Do not spend time building the whole physics engine just to start a deletion PR.
rtk pytest python/tests/unit
Verification:
- A later agent can compare failures against this baseline.
- No files changed in this step unless you intentionally write a short baseline note in the PR description.
Goal: remove the biggest low-risk source weight first.
Target:
javascript/src/data/movement.binjavascript/src/data/test.binjavascript/src/data/cartpole.txtjavascript/src/data/realtime.txtjavascript/src/data/worm.txt- Keep
javascript/src/data/preview.jsonfor now becausejavascript/src/screenshot.tsimports it. - Keep
javascript/src/data/.gitignoreandjavascript/src/data/.npmignore.
Actions:
- Confirm references:
rg -n "movement\.bin|test\.bin|cartpole\.txt|realtime\.txt|worm\.txt|preview\.json" javascript - Delete only files with no live import or documented packaging need.
- Update
javascript/src/data/.gitignoreso generated recordings stay local:*.bin *.bin.gz *.txt !.gitignore !.npmignore !preview.json
- If a deleted fixture is referenced only by a dev demo, change that demo to load a user-provided URL or
preview.json.
Verification:
rg -n "movement\.bin|test\.bin|cartpole\.txt|realtime\.txt|worm\.txt" javascriptreturns no live references.npm run build-for-pythonfromjavascript/still succeeds, or any pre-existing failure is documented.
Goal: keep package source and tests, not personal experiments.
Target:
python/research/marker_fitpython/research/mujoco_loaderpython/research/sprinter_fitpython/research/synthetic_joint_recovery
Actions:
- Confirm all references outside
python/research:rg -n "python/research|research/|synthetic_joint_recovery|synthetic_recovery|sprinter_fit|marker_fit" . \ -g '!python/research/**' \ -g '!build/**' \ -g '!dist/**'
- If tests reference research fixtures, move only the required fixtures to
data/test/...and update those tests. Do not keep the whole research tree for a few fixtures. - Delete the remaining research files.
- Add
python/research/to.gitignoreif local experiments are still common.
Verification:
- The reference search above returns only intentional docs or updated test fixture paths.
- Any touched tests still pass, or native-build preconditions are documented.
Goal: stop vendoring three examples while already depending on three.
Target:
javascript/src/threejs_lib- Imports in:
javascript/src/components/View.tsjavascript/src/NimbleView.ts
Actions:
- List current local imports:
rg -n "threejs_lib" javascript/src - Replace standard Three.js example imports with package imports:
import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer.js"; import { SSAOPass } from "three/examples/jsm/postprocessing/SSAOPass.js"; import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
- For
CapsuleBufferGeometry, first check whether the installedthreeversion already provides an equivalent in examples. If not, keep onlyCapsuleBufferGeometryin a small local file underjavascript/src/geometry/. - Delete
javascript/src/threejs_libafter imports are gone. - Do not upgrade
threein this step. Dependency upgrades are a separate risk.
Verification:
rg -n "threejs_lib" javascript/srcreturns nothing.npm run buildandnpm run build-for-pythonfromjavascript/compile.- The visualizer still loads a simple recording or
preview.json.
Goal: remove generated stub trees from source while keeping stub generation in the build.
Target:
stubs/_nimblephysicsstubs/_nimblephysics-stubsgenerate_pyi_stubs.sh- Stub-copying block in
setup.py
Actions:
- Confirm the build script still generates stubs:
sed -n '1,220p' generate_pyi_stubs.sh rg -n "generate_pyi_stubs|stubs/_nimblephysics" setup.py MANIFEST.in pyproject.toml .gitignore
- Delete tracked generated stubs.
- Add generated stub outputs to
.gitignore:stubs/_nimblephysics/ stubs/_nimblephysics-stubs/
- Keep
generate_pyi_stubs.sh. - Keep the
setup.pycopy step only if the wheel needs generated.pyifiles insidenimblephysics_libs. If the copy step is kept, make sure build failure is explicit when stub generation fails. - Fix the repeated
nimblephysics_libs.nimblephysics_libs...path rewrite ingenerate_pyi_stubs.shif it still appears after regeneration.
Verification:
- A local build regenerates stubs.
- The generated wheel still contains usable
.pyifiles andpy.typedif typed distribution is intended. git status --shortdoes not show generated stubs after a build.
Goal: keep one docs tree.
Target:
www/old_docs- Any links pointing at
old_docs
Actions:
- Confirm references:
rg -n "old_docs|www/old_docs" README.md www .github ci CMakeLists.txt - Move any still-useful source
.rstcontent intowww/docsonly if current docs lack it and it is still accurate. - Delete
www/old_docs.
Verification:
rg -n "old_docs|www/old_docs" . -g '!build/**' -g '!dist/**'returns nothing.- Current docs build or static docs check still works if the repo has one.
Goal: avoid split npm/yarn dependency state.
Target:
javascript/yarn.lockjavascript/package-lock.jsonjavascript/README.md
Actions:
- Keep
package-lock.jsonbecause scripts and docs use npm. - Delete
javascript/yarn.lock. - Update docs that mention yarn, if any, to npm.
- Add a short package-manager note to
javascript/README.mdif helpful:Use npm. Do not commit yarn.lock.
Verification:
npm cifromjavascript/works.git status --short javascript/yarn.lockshows deletion only.
Goal: replace five near-identical configs with one config plus env switches.
Target:
javascript/webpack.config.jsjavascript/webpack.config.python.jsjavascript/webpack.config.devserver.jsjavascript/webpack.config.devserver-python.jsjavascript/webpack.config.devserver-screenshot.jsjavascript/package.json
Actions:
- Create one
webpack.config.jsthat exports a function:module.exports = (_env = {}, argv = {}) => { const target = _env.target || "package"; // choose entries, externals, devServer, and mode from target };
- Preserve existing entry sets:
package:NimbleStandaloneReact,NimbleStandalone,NimbleRemotepython:live,embeddabledev:embedded_dev,NimbleStandaloneReact,NimbleStandalone,NimbleRemotedev-python:live,NimbleStandaloneReact,NimbleStandalone,NimbleRemotedev-screenshot:screenshot,NimbleStandaloneReact,NimbleStandalone,NimbleRemote
- Update scripts:
{ "dev": "webpack-dev-server --env target=dev", "dev-python": "webpack-dev-server --env target=dev-python", "dev-screenshot": "webpack-dev-server --env target=dev-screenshot", "prod": "webpack --mode=production --env target=package", "build-for-python": "webpack --env target=python" } - Delete the four extra webpack config files.
Verification:
npm run buildnpm run build-for-python- One dev-server command starts without config errors.
Goal: use Webpack 5 native asset handling.
Target dependencies:
raw-loaderfile-loaderarraybuffer-loader
Actions:
- Replace inline imports:
with normal imports:
import playSvg from "!!raw-loader!./play.svg";
import playSvg from "./play.svg";
- Add webpack rules:
{ test: /\.svg$/i, type: "asset/source" }, { test: /\.(bin|gz)$/i, type: "asset/resource" }, { test: /\.txt$/i, type: "asset/source" }
- Remove the loader dependencies from
javascript/package.json. - Regenerate
package-lock.jsonwithnpm install --package-lock-onlyornpm install.
Verification:
npm run buildnpm run build-for-python- SVG icons still render in the player.
Goal: remove dependency clutter after the loader cleanup.
Targets:
pathinjavascript/package.jsondeclaration-bundler-webpack-plugininjavascript/package.jsonsha256-uint8arrayinjavascript/package.jsonDeclarationBundlerPluginimports in webpack configscreateHash,lastRecordingHash, and related unused hash code injavascript/src/NimbleStandalone.ts
Actions:
- Confirm each symbol is unused:
rg -n "DeclarationBundlerPlugin|declaration-bundler|sha256-uint8array|createHash|lastRecordingHash|from ['\"]path|require\\(['\"]path" javascript - Remove unused imports, fields, and dependencies.
- Keep Node's built-in
require("path")in webpack config. Remove only the npm package dependency namedpath. - Regenerate
package-lock.json.
Verification:
- The search above returns only intended built-in
require("path"). npm ciandnpm run buildwork.
Goal: remove Boost from core code where C++17 already covers the need.
Target local Boost uses:
boost::filesystemin:dart/common/SharedLibrary.*dart/common/detail/SharedLibraryManager.*dart/server/GUIStateMachine.cppdart/server/GUIWebsocketServer.cpp
boost::regexfallback indart/common/Uri.cppboost::lexical_cast,boost::trim_copy, andboost::splitindart/utils/XmlHelpers.cpp- Boost link setup in:
cmake/DARTFindBoost.cmakedart/CMakeLists.txtCMakeLists.txt
Actions:
- Replace filesystem:
Use
#include <filesystem> namespace fs = std::filesystem;
fs::path,fs::exists, andfs::canonical. - Replace
std::hash<boost::filesystem::path>specialization with the standard hash forstd::filesystem::path, or store canonical path strings as map keys. - Replace
boost::regexfallback inUri.cppwithstd::regex; this project already requires C++17. - Replace scalar
boost::lexical_castwith:std::to_stringfor simple numerictoStringstd::ostringstreamwhen formatting Eigen valuesstd::stoi,std::stoul,std::stof,std::stodstr.at(0)or stream extraction for char, matching existing behavior as closely as possible
- Replace
boost::trim_copyandboost::splitwith a tiny local helper inXmlHelpers.cpp:static std::vector<std::string> splitWhitespace(const std::string& value) { std::istringstream input(value); std::vector<std::string> out; std::string token; while (input >> token) out.push_back(token); return out; }
- Remove
Boost::regex,Boost::filesystem, andBoost::systemlinks if no remaining local source requires them. - Keep any vendored third-party code untouched unless it is the only remaining Boost dependency and is no longer used.
Verification:
rg -n "boost::|<boost/" dart cmake CMakeLists.txt -g '!dart/server/external/**' -g '!dart/external/**'returns nothing or only intentional third-party code.- CMake configure succeeds.
- Native build reaches at least the same point as the baseline.
Goal: delete generic factory machinery if "dart" is the only collision detector implementation.
Target:
dart/common/Factory.hppdart/common/detail/Factory-impl.hppdart/collision/CollisionDetector.hppdart/collision/CollisionDetector.cppdart/collision/dart/DARTCollisionDetector.cppdart/utils/SkelParser.cpp
Actions:
- Confirm registered implementations:
rg -n "CollisionDetector::Registrar|registerCreator|getFactory\\(\\)->create|CollisionDetector::getFactory" dart - If only
DARTCollisionDetectoris registered, delete the registrar and factory path. - Replace:
with explicit handling:
collision::CollisionDetector::getFactory()->create(cdType)if (cdType.empty() || cdType == "dart") collisionDetector = collision::DARTCollisionDetector::create(); else warn or fall back exactly as current behavior does;
- Delete
common::Factoryonly if no other code uses it. If other code still uses it, leave it. - Keep public behavior for unknown collision detector strings. Do not silently accept a value that used to warn.
Verification:
rg -n "common::Factory|FactoryRegistrar|CollisionDetector::getFactory|getFactory\\(\\)->create" dartshows no stale collision factory path.- Skeleton parsing still handles missing or
"dart"collision detector config. - Collision unit tests compile.
Goal: remove subprocess-based distutils Python probing.
Target:
python/_nimblephysics/CMakeLists.txtsetup.pyCMake arguments if they duplicate Python discovery
Actions:
- Replace manual
find_program(PYTHON_EXECUTABLE ...)andexecute_process(...distutils...)with:find_package(Python3 ${DARTPY_PYTHON_VERSION} COMPONENTS Interpreter Development REQUIRED)
- Use:
${Python3_EXECUTABLE} ${Python3_INCLUDE_DIRS} ${Python3_LIBRARIES}
- Keep
DARTPY_PYTHON_VERSIONoverride support fromsetup.py. - Remove commented-out old Python discovery blocks while touching the file.
- Do not change pybind11 version requirements in this step.
Verification:
- CMake configure finds the active Python from the build environment.
- Python extension build still receives the expected include and library paths.
- macOS special casing is gone unless a real build failure proves it is needed.
Goal: remove an unused configure-time command that calls a missing tool.
Target:
- The
FILESYSTEM_CASE_SENSITIVEblock in top-levelCMakeLists.txt.
Actions:
- Delete this block:
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/case_sensitive_filesystem RESULT_VARIABLE FILESYSTEM_CASE_SENSITIVE_RETURN) ...
- Do not add a replacement unless a live source reads
FILESYSTEM_CASE_SENSITIVE.
Verification:
rg -n "FILESYSTEM_CASE_SENSITIVE|case_sensitive_filesystem" . -g '!build/**' -g '!dist/**'returns nothing.- CMake configure no longer reports an error or warning for the missing tool.
Goal: clean generated Python metadata and bytecode.
Target:
python/nimblephysics.egg-infopython/**/__pycache__*.pycpython/nimblephysics_libsif it is generated in the local worktree
Actions:
- Confirm these are generated and not package source:
git ls-files | grep -E '(egg-info|__pycache__|\\.pyc$|^python/nimblephysics_libs/)'
- Delete tracked bytecode and egg metadata.
- Keep
.gitignoreentries:python/nimblephysics_libs/ python/**/__pycache__/ python/*.egg-info/
- If
python/nimblephysics_libscontains generated stubs after a build, leave it ignored.
Verification:
- Running tests or a build does not create tracked files.
git status --shortafter verification shows no generated Python artifacts except ignored files.
Goal: prove the repo is leaner and still builds at the same level as the baseline.
Actions:
- Run searches for stale references:
rg -n "old_docs|threejs_lib|yarn.lock|movement\\.bin|test\\.bin|python/research|FILESYSTEM_CASE_SENSITIVE" . \ -g '!build/**' \ -g '!dist/**'
- Run package checks:
cd javascript && npm ci && npm run build && npm run build-for-python
- Run Python tests that do not require a fresh native build:
rtk pytest python/tests/unit
- Run CMake configure and the smallest native compile target available in the environment:
cmake -S . -B build/refactor-check cmake --build build/refactor-check --target _nimblephysics -j2 - Measure the cut:
git diff --stat git ls-files | wc -l du -sh javascript/src/data python/research www/old_docs stubs javascript/src/threejs_lib 2>/dev/null
Done criteria:
- Generated files are ignored, not tracked.
- No stale references to deleted trees remain.
- JS builds pass.
- Native/Python checks pass or fail only for documented baseline reasons.
- The final PR summary lists line count removed, dependency count removed, and any intentionally deferred cleanup.