Skip to content

feat(split_out): support dotted paths so fan-out can reach nested arrays#4

Merged
graycyrus merged 1 commit into
mainfrom
feat/split-out-dotted-path
Jul 6, 2026
Merged

feat(split_out): support dotted paths so fan-out can reach nested arrays#4
graycyrus merged 1 commit into
mainfrom
feat/split-out-dotted-path

Conversation

@graycyrus

@graycyrus graycyrus commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

split_out did a single-level item.json.get(path), so it couldn't reach an array nested inside a tool_call's {json,text,raw} envelope — e.g. GMAIL_FETCH_EMAILS returns its list at data.messages, unreachable as a top-level key, so split emitted a single null item and nulled the whole downstream fan-out.

resolve_dotted_path() now walks one object key per .-separated segment, so path="json.data.messages" traverses envelope → tool result → the array. Backward compatible: single-segment paths (path="items") unchanged; missing intermediate key → Null (as before). Bump 0.5.0 → 0.5.1.

Consumed by OpenHuman's Workflows builder, which now grounds split_out.path in the tool's real nested output path.

Summary by CodeRabbit

  • New Features

    • Support for dotted paths when selecting nested JSON data, making it easier to read deeply nested values.
    • Nested arrays can now be expanded into separate output items while keeping item pairing intact.
  • Bug Fixes

    • Missing intermediate or leaf keys now return a single null result instead of failing or returning unexpected data.
  • Chores

    • Updated the package version to 0.5.1.

split_out did a single-level item.json.get(path), so it could not reach an array
nested inside a tool_call's {json,text,raw} envelope — e.g. GMAIL_FETCH_EMAILS
returns its list at data.messages, unreachable as a top-level key, so split emitted
a single null item and nulled the whole downstream fan-out.

resolve_dotted_path() now walks one object key per '.'-separated segment, so
path='json.data.messages' traverses envelope → tool result → the array. Backward
compatible: single-segment paths (path='items') are unchanged. Missing intermediate
key → Null (same as before). Bump 0.5.0 → 0.5.1.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a dotted-path resolution helper (resolve_dotted_path) to SplitOutNode for traversing nested JSON keys, updates execute to use it when a path is configured, adds corresponding tests, and bumps the crate version from 0.5.0 to 0.5.1.

Changes

SplitOutNode Dotted Path Support

Layer / File(s) Summary
Dotted path resolver and execute wiring
src/nodes/control_flow/split_out.rs
Adds resolve_dotted_path helper to traverse .-separated JSON keys, returning Null on missing segments; execute now uses it for non-empty path configs instead of a single-level lookup.
Dotted path test coverage
src/nodes/control_flow/split_out.rs
Adds tests verifying array fan-out via nested dotted paths with correct paired_item indices, and Null output when an intermediate key is missing.
Crate version bump
Cargo.toml
Bumps package version from 0.5.0 to 0.5.1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A dot, then a dot, I hop through the keys,
Nested JSON gardens, easy as breeze,
Missing a path? I land on a Null,
Tests all pass — my burrow is full!
🐰 v0.5.1, hoppy and true! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: SplitOut now supports dotted paths to fan out nested arrays.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/nodes/control_flow/split_out.rs (1)

13-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Factor the dotted-path walk into one helper

There’s duplicated dotted-path traversal in src/nodes/control_flow/split_out.rs and src/expr.rs::resolve_path. If these semantics should stay identical, extract a shared helper instead of maintaining two copies.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/nodes/control_flow/split_out.rs` around lines 13 - 32, The dotted-path
traversal logic is duplicated between split_out’s resolve_dotted_path and
expr::resolve_path, so update the code to use one shared helper for path
walking. Extract the common dotted-path resolution behavior into a reusable
function or utility, then have both split_out and expr::resolve_path call it so
the semantics stay identical in one place. Keep the existing handling for
single-segment keys, missing segments returning Null, and nested object
traversal unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/nodes/control_flow/split_out.rs`:
- Around line 13-32: The dotted-path traversal logic is duplicated between
split_out’s resolve_dotted_path and expr::resolve_path, so update the code to
use one shared helper for path walking. Extract the common dotted-path
resolution behavior into a reusable function or utility, then have both
split_out and expr::resolve_path call it so the semantics stay identical in one
place. Keep the existing handling for single-segment keys, missing segments
returning Null, and nested object traversal unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7bdfc89-d19d-4e12-b61e-b27f44bee9f3

📥 Commits

Reviewing files that changed from the base of the PR and between 0afab64 and 1a2f6e9.

📒 Files selected for processing (2)
  • Cargo.toml
  • src/nodes/control_flow/split_out.rs

@graycyrus graycyrus merged commit eb4865d into main Jul 6, 2026
3 checks passed
graycyrus added a commit to graycyrus/openhuman that referenced this pull request Jul 6, 2026
…split_out)

tinyhumansai/tinyflows#4 squash-merged; pin to the main commit instead of the
feature-branch commit so CI resolves the submodule cleanly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant