Skip to content

fix: reject file edge labels that have more than one source node - #597

Merged
pradeeban merged 1 commit into
ControlCore-Project:devfrom
Sahil-u07:fix/shared-edge-label
Oct 5, 2026
Merged

pradeeban merged 1 commit into
ControlCore-Project:devfrom
Sahil-u07:fix/shared-edge-label

Conversation

@Sahil-u07

@Sahil-u07 Sahil-u07 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #596

When two file edges share a label but come from different source nodes, mkconcore keeps the first source and drops the rest. The second source never gets an out mount, so its writes on that edge go nowhere, and the target mounts the same volume twice. Nothing reported it, and concore validate passed the workflow.

An edge label maps to one volume with a single writer (edges_dict is label -> [source, [targets]]), and none of the graphml files in the repo use the same label from two sources, so I made this an error instead of trying to support it.

Changes:

  • mkconcore.py: when a file edge label already has a different source node, log an error naming both nodes and exit with status 1
  • validate.py: collect the source nodes of every file edge label and report an error when there's more than one. ZMQ edges are skipped since port conflicts are already checked separately. Added an edge_label_multiple_sources error_type for --format json
  • tests: one validate test (text and json output) in test_graph.py, and one build test in test_cli.py that checks the build fails with the error message

Fan-out (one source, several targets on the same label) still works the same as before.

Verified with:
pytest tests/test_cli.py tests/test_graph.py (both new tests fail on dev without the fix)
built demo/sample.graphml and demo/generalcontrol.graphml with posix to make sure normal workflows are unaffected
ruff format --check . and ruff check . pass

Before

On dev the workflow passes validation, and the generated run script has no out mount for B while C mounts shared twice:

before

After

With this PR both validate and build report the problem:

after

Copilot AI balanced review requested due to automatic review settings October 2, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An edge label in mkconcore is a single volume with one writer.
edges_dict keeps the source of the first edge with a given label and
silently ignores the source of any later edge with the same label, so
the second source node never gets an out mount and everything it
writes on that edge is lost. The target also ends up mounting the
same volume twice (in1 and in2).

mkconcore now stops with an error when a file edge label has more
than one source node, and concore validate reports the same case so
it gets caught before building.
@Sahil-u07
Sahil-u07 force-pushed the fix/shared-edge-label branch from a8992a8 to 9810006 Compare October 2, 2026 23:30
@pradeeban
pradeeban merged commit 0d9597f into ControlCore-Project:dev Oct 5, 2026
14 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.

3 participants