Skip to content

feat(cli): add 'concore clean' to remove run leftovers from a study - #691

Draft
yadavchiragg wants to merge 2 commits into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-clean
Draft

yadavchiragg wants to merge 2 commits into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-clean

Conversation

@yadavchiragg

Copy link
Copy Markdown

Why

After running a study, each node leaves concoreout.txt and concorepid, and the edge directories hold data files. Today users have to run the generated clear script, which only handles the edge directories and does not exist for every build type, or delete files by hand.

What

concore clean <study_dir>

  • removes each node's concoreout.txt and concorepid, and the data files in edge directories (the same files the generated clear script removes)
  • edge directories are found by following each node's in*/out* links, so unrelated directories (results/, src/, node folders) are never touched
  • never follows a link that points outside the study
  • --dry-run lists without deleting; asks for confirmation unless -y
  • refuses while a node's pid is alive (--force to override)

Testing

  • tests/test_clean_command.py (8 tests) incl. keeps results/ and src/, symlink-escape, running-node refusal, confirmation
  • existing CLI tests, ruff format/check clean
  • tried on a generated study

Docs

Added concore clean to concore_cli/README.md

Removes each node's concoreout.txt/concorepid and the data files in edge directories (what the generated clear script removes), with --dry-run, --yes and --force, refusing while a node is running. Tests and docs included.
@pradeeban

Copy link
Copy Markdown
Member

@yadavchiragg, merge conflicts. Pls check.

@pradeeban
pradeeban marked this pull request as draft November 27, 2026 03:11
@yadavchiragg

Copy link
Copy Markdown
Author

@pradeeban I merged the latest dev and resolved the conflicts in cli.py and README.md (both concore logs and concore clean are kept). The remaining red checks are not from this PR: test (3.9) and the cancelled 3.10-3.12 jobs come from the Ubuntu 26.04 / Python 3.9 problem that #678 fixes, and the cpp-* jobs come from the params path in the C++ test that #714 fixes. I'll re-run CI here once those are merged.

@pradeeban
pradeeban marked this pull request as ready for review November 27, 2026 04:03
@pradeeban
pradeeban marked this pull request as draft November 27, 2026 04:04
@pradeeban

Copy link
Copy Markdown
Member

Looks like some more merge conflicts, @yadavchiragg

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