fix(fugu): accept a bare-int access index in the workflow parser (#225)#240
fix(fugu): accept a bare-int access index in the workflow parser (#225)#240minion1227 wants to merge 2 commits into
Conversation
…i-router#225) `_normalize_access` validated one `access_list` entry of a Conductor workflow proposal. It accepted a scalar string digit ("0" -> [0]), None/"" (-> []), and lists of indices — but a bare scalar int (0) fell through every branch to `return None`, which rejects the *entire* workflow. So two semantically identical proposals disagreed purely on notation: access_list=[[], 0] -> parsed_ok=False, training_reward=0.0 access_list=[[], "0"] -> parses fine A bare integer is the most natural thing a model emits for "read step N", and the parser's stated goal is to avoid false negatives, so this depressed parse-rate on otherwise-valid workflows. Add a bare-int branch that returns [acc] when 0 <= acc < step_index, matching the accepted "0" / [0] forms. `bool` is rejected first since it subclasses int and is never a step index. Adds tests/test_fugu_workflow_bare_int_access.py: the three equivalent forms parse and produce an identical workflow, and the rejections that matter still hold (bool, negative, forward reference, self reference at step 0), plus the pre-existing forms are unchanged. Fixes mini-router#225
AGENTS.md §6 requires a dated JOURNAL entry for every mistake/fix; the original commit changed workflow.py and tests but skipped the lab notebook.
73bd02d to
370951c
Compare
Overlap with #226 — that PR came firstTo be upfront: @galuis116's #226 fixes this same issue and was opened 2026-07-17, six days before this one. The core change is the same in both (a bare- Flagging the differences only so nothing useful gets lost whichever way that goes:
If #226 lands first I'll close this and re-send the docstring fix plus the four extra cases as a small follow-up on top of it. CI:
|
Fixes #225
Problem
_normalize_accessinsrc/trinity/fugu/workflow.pyvalidates oneaccess_listentry of a Conductor workflow proposal. It accepts a scalar string digit ("0"->[0]),None/""(->[]), and lists of indices — but a bare scalar int (0) falls through every branch toreturn None, which rejects the entire workflow.Two semantically identical proposals therefore disagree purely on notation:
A bare integer is the most natural thing a model emits for "read step N", and the parser's stated design goal is to avoid false negatives. Rejecting it depresses parse-rate on otherwise-valid workflows — and a rejected workflow means
parsed_ok=False,training_reward=0.0,is_correct=0.Fix
Add a bare-
intbranch returning[acc]when0 <= acc < step_index, matching the already-accepted"0"/[0]forms.boolis rejected first, since it subclassesintand is never a step index.Tests
Adds
tests/test_fugu_workflow_bare_int_access.py(17 cases, offline — no GPU/network):0,"0",[0]) all parse and produce an identical workflowTrue/False(bool-before-int ordering), negative indices, forward references (>= step_index), self-reference at step 0, and a bare-int forward reference still rejecting the whole workflowNone,"all","","query",[0,1], junk) unchangedFull root suite: 263 passed (existing
test_fugu_workflow.pygreen);ruffclean.