Skip to content

Fix: Enable concore run execution from outside repository root#215

Open
Titas-Ghosh wants to merge 1 commit intoControlCore-Project:devfrom
Titas-Ghosh:fix-concore-run-path-error
Open

Fix: Enable concore run execution from outside repository root#215
Titas-Ghosh wants to merge 1 commit intoControlCore-Project:devfrom
Titas-Ghosh:fix-concore-run-path-error

Conversation

@Titas-Ghosh
Copy link

Hi @pradeeban ,
I hope you're doing well! I'm submitting this PR to fix a critical issue where concore run fails when executed outside the repository root. This blocks the standard user workflow (creating and running projects in separate directories).

This PR fixes the path resolution logic so the CLI works correctly from any location, as documented in the README.

Fixes #214

Why this change?

concore run is documented as a CLI workflow step, but it only worked if you executed it from the repo root.
In real usage (concore init, cd my-project, concore run workflow.graphml), the command fails because:

  • mkconcore.py is referenced by filename only (not resolvable from a project dir)
  • mkconcore.py looks for concore assets (concore.py, concore.hpp, etc.) relative to CWD

This breaks the Quick Start and makes the CLI unusable when installed normally.


What was the problem?

  • CLI invoked mkconcore by relative pathmkconcore.py not found outside repo root
  • mkconcore assets resolved from CWDconcore.py/concore.hpp/concore.v not found
  • Result: concore run failed in the exact flow shown in concore_cli/README.md

How I solved it

  1. Resolved mkconcore by absolute path in concore_cli/commands/run.py
  2. Passed absolute paths for workflow, source, and output
  3. Set cwd to mkconcore’s directory to preserve existing relative lookups
  4. Made mkconcore resolve assets relative to its own file (fallback to CWD for backward compatibility)
  5. Added an integration test that runs concore run from a temp project directory and asserts output is generated

Changes / Implementation

  • concore_cli/commands/run.py
    • New _find_mkconcore_path() search logic
    • Absolute path invocation + cwd correction
  • mkconcore.py
    • SCRIPT_DIR + _resolve_concore_path() to locate assets robustly
  • tests/test_cli.py
    • New integration test: test_run_command_from_project_dir

How to Test Locally

  1. Install deps
    pip install -r requirements.txt
    pip install -r requirements-dev.txt

  2. Run tests
    python -m pytest -v tests/test_cli.py

or full suite
python -m pytest -v


Evidence

  • python -m pytest -v tests/test_cli.py (10 tests passed)
Screenshot 2026-02-07 031513

PR Checklist

  • Added tests for the new behavior
  • Ran tests locally (python -m pytest -v tests/test_cli.py)
  • No public API changes
  • Works from a standard project directory (not just repo root)

Note to Maintainers

I’m happy to adjust the approach if you prefer a different path‑resolution strategy or packaging layout. Please share any feedback on structure or style and I’ll iterate quickly.

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