Skip to content

Allow safe relative subdirectory paths in GraphML node source labels#327

Merged
pradeeban merged 1 commit intoControlCore-Project:devfrom
Titas-Ghosh:allow-subdir-node-sources-clean
Feb 14, 2026
Merged

Allow safe relative subdirectory paths in GraphML node source labels#327
pradeeban merged 1 commit intoControlCore-Project:devfrom
Titas-Ghosh:allow-subdir-node-sources-clean

Conversation

@Titas-Ghosh
Copy link

Hi @pradeeban , This PR fixes #297 ,

Summary

This PR allows GraphML node source labels to use relative subpaths (for example, script.py while preserving path-safety checks. Also this PR contains only actual functional code changes (no formatting-only/EOL-only churn) and is limited to 2 files: mkconcore.py and tests/test_cli.py.

Problem

mkconcore.py currently rejects / and \ in node source labels, which forces a flat src/ layout.
That makes larger workflows harder to organize and maintain.

What Changed

  • Added safe_relpath() validation for node source paths.
  • Allowed relative subpaths in node labels.
  • Continued to reject unsafe paths:
  • path traversal (..)
  • absolute paths (/..., ~...)
  • drive-root style paths (C:...)
  • invalid empty segments
  • Ensured parent directories are created before writing/copying generated artifacts tied to subpath-based sources.
  • Added CLI integration test coverage for subdirectory source workflow execution.

Files Changed

mkconcore.py
test_cli.py

@pradeeban pradeeban merged commit 977369d into ControlCore-Project:dev Feb 14, 2026
6 checks passed
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