[BUG] Make resource, device, and route resolution deterministic and safety-aware

Open
#326 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start by reading the resolver and fallback paths in unilabos/compile/evacuateandrefill_protocol.py, stir_protocol.py, dissolve_protocol.py, separate_protocol.py, and unilabos/devices/workstation/workflow_executors.py. Then inspect the existing authority and reservation work before defining the resolution record and fail-closed diagnostics. Done means ambiguous, stale, disconnected, or unsafe routes block compilation, while tests cover multiple candidates, disconnected paths, stale reservations, and an allowed alternate route.

Written by the indexing model from the issue text.

Description

Problem

Resource and route resolution uses naming heuristics and first-match fallbacks, which can produce an executable action sequence for the wrong device or route.

Concrete code evidence

  • unilabos/compile/evacuateandrefill_protocol.py:40-123 searches gas sources by names and falls back to the first default gas source.
  • unilabos/compile/evacuateandrefill_protocol.py:179-238 searches valves by connectivity/name and can continue without an exact valve binding.
  • unilabos/compile/stir_protocol.py:15-44 returns the first stirrer or stirrer_1 if no exact connection is found.
  • unilabos/compile/dissolve_protocol.py:333-382 returns the first heater/stirrer candidate.
  • unilabos/compile/separate_protocol.py:604-689 falls back to the first separator/stirrer.
  • unilabos/devices/workstation/workflow_executors.py:559-568 returns the first available tip rack when the requested set is unavailable.

Design gap

A graph path is treated as sufficient evidence of a safe executable route. It does not encode valve state, isolation, pressure, reservation, interlocks, or ambiguity.

Expected behavior

Resource and route resolution must return an explicit resolution record or a fail-closed diagnostic. First-match selection must not be used for outcome-relevant resources.

Acceptance criteria

  • Missing, ambiguous, stale, or disconnected bindings block compilation.
  • Resolved routes include nodes, handles, state transitions, and required interlocks.
  • Unsafe valve/pump ordering is rejected before execution.
  • Tests cover multiple candidates, disconnected paths, stale reservations, and an allowed alternate route.
  • Resource ownership remains aligned with the existing authority/reservation work rather than adding a parallel authority.
Dominant language
Python
Stars
186
Forks
79
Avg merge
1h 2m
Merged PRs (30d)
29

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from deepmodeling/Uni-Lab-OS

All issues in deepmodeling/Uni-Lab-OS

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.