From 7c87762a23f9f4a9647d8670f060b474e4ad99a3 Mon Sep 17 00:00:00 2001 From: "cyrus@tinyhumans.ai" Date: Wed, 8 Jul 2026 18:50:57 +0530 Subject: [PATCH 1/2] =?UTF-8?q?fix(flows):=20builder-condition=20jq=20?= =?UTF-8?q?=E2=80=94=20normalize=20bare=20scope=20keys=20+=20warn=20agains?= =?UTF-8?q?t=20mixing=20(B17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The builder emitted condition fields like `=item.labels | any(.name == "in progress") | not` — shorthand bare key (`item`, no leading dot) piped into jq. expr::run_jq compiled bare `item` as an undefined jq function → Null → condition routed ALL items to false → 0 output (proven live: 95 real issues all filtered). - vendor/tinyflows -> 68590ed (tinyflows#6): normalize_bare_scope_ref prepends `.` when a jq program starts with a bare top-level scope key (item/items/run/nodes) so `=item.labels | …` resolves as field access; leading-dot exprs + jq builtins (`any(...)`) untouched. - prompt.md: warn the builder to never mix the shorthand with jq — use `=.item.x | …` (leading dot) for any piped/functional expression; plain `=item.x` shorthand is fine alone. tinyflows 310 pass; openhuman cargo check clean; flows:: 413 pass. --- src/openhuman/flows/agents/workflow_builder/prompt.md | 5 +++++ vendor/tinyflows | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openhuman/flows/agents/workflow_builder/prompt.md b/src/openhuman/flows/agents/workflow_builder/prompt.md index 4d5c5c7153..9db9ff5bcb 100644 --- a/src/openhuman/flows/agents/workflow_builder/prompt.md +++ b/src/openhuman/flows/agents/workflow_builder/prompt.md @@ -307,6 +307,11 @@ the run scope (`.`): the first output is used; a bad program yields `null` (never an error). - A string **without** a leading `=` is a literal. To emit a literal `=`, don't start the string with it. +- **Never mix the shorthand with jq.** If an expression uses `|`, `[`, + functions (`any(...)`, `length`), or any jq beyond a plain dotted path, it + MUST start with `.` (the jq root): write + `"=.item.labels | any(.name==\"x\")"`, NOT `"=item.labels | any(...)"`. The + plain shorthand `"=item.labels"` (no jq) is fine alone. The scope exposes: diff --git a/vendor/tinyflows b/vendor/tinyflows index 56d81dfdad..68590ed32e 160000 --- a/vendor/tinyflows +++ b/vendor/tinyflows @@ -1 +1 @@ -Subproject commit 56d81dfdadc1454189322d744e050ae4f7e525f9 +Subproject commit 68590ed32e2450c62dbdb9d2ff5a0178e00c22ea From f50bc2dda67b9bce4a33f0b2ab9eb07f7b6837a4 Mon Sep 17 00:00:00 2001 From: "cyrus@tinyhumans.ai" Date: Wed, 8 Jul 2026 19:19:01 +0530 Subject: [PATCH 2/2] fix(flows): scope the jq-root guard in prompt.md to bare scope keys (addresses @chatgpt-codex-connector on prompt.md:312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prior wording said "any expression that uses |, [, functions... must start with a dot", which read as applying even to expressions that already begin with valid jq syntax (e.g. `=[.item.a, .item.b]` for array construction) — following it literally would prepend a stray leading dot and change the expression's meaning. Scope the guard explicitly to expressions that begin with a bare scope key (item/items/run/nodes). --- src/openhuman/flows/agents/workflow_builder/prompt.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/openhuman/flows/agents/workflow_builder/prompt.md b/src/openhuman/flows/agents/workflow_builder/prompt.md index 9db9ff5bcb..a9805b4f06 100644 --- a/src/openhuman/flows/agents/workflow_builder/prompt.md +++ b/src/openhuman/flows/agents/workflow_builder/prompt.md @@ -307,11 +307,14 @@ the run scope (`.`): the first output is used; a bad program yields `null` (never an error). - A string **without** a leading `=` is a literal. To emit a literal `=`, don't start the string with it. -- **Never mix the shorthand with jq.** If an expression uses `|`, `[`, - functions (`any(...)`, `length`), or any jq beyond a plain dotted path, it - MUST start with `.` (the jq root): write +- **Never mix the shorthand with jq.** If an expression **begins with a bare + scope key** (`item`/`items`/`run`/`nodes`) and continues into jq syntax — + `|`, `[`, functions (`any(...)`, `length`), or anything beyond a plain + dotted path — it MUST start with `.` instead (the jq root): write `"=.item.labels | any(.name==\"x\")"`, NOT `"=item.labels | any(...)"`. The - plain shorthand `"=item.labels"` (no jq) is fine alone. + plain shorthand `"=item.labels"` (no jq) is fine alone. Expressions that + already start with valid jq syntax (e.g. `"=[.item.a, .item.b]"` for array + construction) don't need an extra leading dot — only bare scope keys do. The scope exposes: