Loop constructs leak each other's variables as stale or meaningless values
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Leggi prima core/loop_context.py:243 e core/control_system.py:263-267, poi traccia i due percorsi for_each, inclusa l’espansione di ForEachTask, e create_parallel_queue.on. Confronta i relativi binding esposti con core/loop_contracts.py; il lavoro è completato quando le chiavi debug-only non sono template bindings ed entrambi i percorsi for_each espongono la stessa superficie prevista.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 3
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ContextLab/orchestrator
-
Stop textually splicing variable values into expression source in ControlFlowAutoResolver._safe_evalApertaarchitecture bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
ContextLab/orchestrator#427 ·
-
MVP: evidence-driven recursive agentic runtimeForse già presa @jeremymanning l’ha presa 58 giorni fa. Apertaarchitecture enhancement epic
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
ContextLab/orchestrator#492 ·
-
architecture enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
ContextLab/orchestrator#491 ·
-
architecture enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
ContextLab/orchestrator#490 ·
-
architecture enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
ContextLab/orchestrator#489 ·
Tutte le issue di ContextLab/orchestrator
Issue simili
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue module-baseline needs triage ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
darnitdevorg/darnit#650 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nyjc-computing/campus#938 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nf-osi/nf-metadata-dictionary#1027 ·
I maintainer di solito rispondono entro 1 giorno
-
bug documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
qatrackplus/qatrackplus#913 ·
I maintainer di solito rispondono entro 3 giorni