[BUG] Make protocol compilation fail closed on invalid or unsupported parameters

オープン
#323 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend, testing

調査の方向性

Start by reading the cited compiler functions in unilabos/compile/heatchill_protocol.py and unilabos/compile/dissolve_protocol.py, then inspect unilabos/compile/utils/unit_parser.py. Trace how parsing, validation, resource resolution, and planning currently handle invalid inputs. Done means structured diagnostics are returned for the listed failure cases, silent defaults and fallbacks are removed, malformed-input tests are added, and valid action shapes remain unchanged.

索引モデルが issue の本文から書いたものです。

説明

Problem

Protocol compilation currently mutates invalid or unsupported inputs into executable actions instead of failing closed.

Concrete code evidence

  • unilabos/compile/heatchill_protocol.py:14-60: parse_temp_input() returns a default temperature when input is empty or unparseable.
  • unilabos/compile/heatchill_protocol.py:93-114: validate_and_fix_params() replaces invalid/out-of-range values with fixed values.
  • unilabos/compile/dissolve_protocol.py:44-152: parse failures return fixed default volume, mass, and time.
  • unilabos/compile/utils/unit_parser.py:12-40, 154-156: unknown volume/time returns fixed defaults.
  • unilabos/compile/heatchill_protocol.py:62-91: unresolved heater selection falls back to the first node or heatchill_1.

For example, a parse failure or unresolved binding can still produce a successful action list, so the caller cannot distinguish “validated request” from “best-effort guess”.

Design gap

Parsing, capability validation, resource resolution, and protocol planning are combined inside individual compiler functions. Device-specific limits and fallback policy therefore become hidden function-body behavior instead of an explicit contract.

Expected behavior

Compilation must fail closed with structured diagnostics such as INVALID_PARAMETER, INVALID_UNIT, RESOURCE_NOT_FOUND, AMBIGUOUS_BINDING, or CAPABILITY_MISMATCH. The original request must be preserved and no default or first-match resource may be substituted silently.

Acceptance criteria

  • Add shared strict quantity/unit parsing and structured compiler diagnostics.
  • Remove silent default/fallback behavior from protocol compilers.
  • Add tests for malformed input, unsupported units, missing resources, ambiguous resources, and out-of-range values.
  • Valid existing inputs keep their current action shape.
主要言語
Python
スター
184
フォーク
79
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

deepmodeling/Uni-Lab-OS のほかの issue

deepmodeling/Uni-Lab-OS の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。