Loop constructs leak each other's variables as stale or meaningless values
まだ誰も着手していません。
評価
調査の方向性
まず core/loop_context.py:243 と core/control_system.py:263-267 を読み、次に ForEachTask の展開と create_parallel_queue.on を含む 2 つの for_each パスを追跡します。公開されている bindings を core/loop_contracts.py と比較し、debug-only キーが template bindings ではなく、両方の for_each パスが同じ意図されたサーフェスを公開していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Every binding below was observed by executing a pipeline (filesystem tool only, no models) and reading what reached the file.
A construct renders names it has no concept of, and renders them as a plausible-looking value rather than failing:
| construct | leaked name | renders as | why it is wrong |
|---|---|---|---|
for_each body |
iteration |
None |
a for_each has no iteration counter |
while body |
item |
None |
a while loop walks no collection |
while body |
length, remaining, has_next, has_prev |
0, 0, False, True |
collection values for a construct with no collection |
for_each iterable |
index, is_first, is_last, position, length, ... |
0, True, ... |
the iterable resolves before the loop exists; these come from a zeroed context that is not the loop's |
create_parallel_queue.on |
index, is_first, is_last, queue_size, parallel_queue_id, parent_task |
0, True, ... |
same: on generates the queue, so nothing per-item exists yet |
{{ item }} in a for_each: iterable does error, so the boundary is enforced for exactly one name.
The mechanism for the body cases: ControlSystem._render_task_templates registers every key of metadata["loop_context"] (core/control_system.py:263-267), and that value is LoopContext.get_debug_info() (core/loop_context.py:243) — a dict built for debugging, carrying item_type, nesting_depth, is_current_first and the rest alongside the real bindings. A debug dump became the public template surface by accident.
A narrower list exists 40 lines later (item, index, is_first, is_last, $item, $index) but runs after the wholesale registration and cannot take anything back.
This matters for validation because it makes "what does this construct bind?" unanswerable from the runtime alone: the honest answer is "these six, plus everything in a debug dict". core/loop_contracts.py therefore declares the meaningful bindings and withholds the leaked ones, so validation rejects {{ iteration }} in a for_each. That is a deliberate choice to be stricter than the runtime, and it is the wrong way round — the runtime should stop offering them.
Suggested order:
- Give
LoopContextan explicitto_template_dict()-style public surface, separate fromget_debug_info(). - Register only that surface in
control_system.py. - Make the two for_each paths (
control_systemand the ForEachTask expansion) populate the same surface — they currently differ. - Then
loop_contractsdescribes the runtime instead of correcting it.
- 主要言語
- Python
- スター
- 3
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ContextLab/orchestrator のほかの issue
-
Stop textually splicing variable values into expression source in ControlFlowAutoResolver._safe_evalオープンarchitecture bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
ContextLab/orchestrator#427 ·
-
MVP: evidence-driven recursive agentic runtime対応中かも @jeremymanning が 58 日前に担当しました。 オープンarchitecture enhancement epic
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ContextLab/orchestrator#492 ·
-
architecture enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
ContextLab/orchestrator#491 ·
-
architecture enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
ContextLab/orchestrator#490 ·
-
architecture enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ContextLab/orchestrator#489 ·
ContextLab/orchestrator の issue をすべて見る
似ている issue
-
Uninstall guide omits the CloudWatch log groups AWS CodeBuild creates for useCodeBuild pipelinesオープンbug documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
awslabs/visual-asset-management-system#552 ·
メンテナーはふだん 1 日以内に返信
-
netbox status: needs triage type: documentation
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
netbox-community/netbox#23460 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
awslabs/threat-composer#362 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ansys/pyansys-common-mcp#213 ·
メンテナーはふだん 3 日以内に返信