Skip to content

feat(server, nodes): add json lane#1297

Draft
stepmikhaylov wants to merge 2 commits into
developfrom
feat/json-lane
Draft

feat(server, nodes): add json lane#1297
stepmikhaylov wants to merge 2 commits into
developfrom
feat/json-lane

Conversation

@stepmikhaylov

@stepmikhaylov stepmikhaylov commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Adds a generic json lane.

  • The filter infrastructure supports json lane (sendJson/writeJson).
  • The json response (Return JSON) node is implemented.
  • The webhook node supports output json lane.
  • AI rotes the application/json requests to the json lane.
  • Server tests check the json filter infrastructure and the json response node.
  • AI tests check json routing.
  • No UI changes needed, the json lane is rendered using existing UI without issues.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Response node now supports JSON output, capturing each JSON write as a separate ordered entry
    • Added new "Return JSON" service node variant for dedicated JSON data handling in pipelines
    • JSON payloads are directly writable through the response infrastructure, enabling richer data workflows

@github-actions github-actions Bot added docs Documentation module:server C++ engine and server components module:nodes Python pipeline nodes labels Jun 16, 2026
@github-actions

Copy link
Copy Markdown
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID. Do not edit or delete.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7c736b7e-7c8a-46a9-ab9d-39dcd086f75f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a new json lane type to the engine pipeline end-to-end. New sendJson/writeJson virtual methods are declared in C++ filter and binder interfaces, implemented through source/target callbacks and the binder, bridged to Python via a new WriteJson enum flag and pybind11 bindings, exposed as rocketlib protocol stubs, and consumed by a new IInstance.writeJson handler in the response node with accompanying service configurations and integration tests.

Changes

JSON Lane Feature

Layer / File(s) Summary
C++ virtual interface contracts
packages/server/engine-lib/engLib/store/headers/binder.hpp, packages/server/engine-lib/engLib/store/headers/filter.hpp
Declares sendJson, writeJson, cb_sendJson, and cb_writeJson virtual methods on IServiceFilterInstance and Binder; adds "json" to Binder::MethodNames (size 15→16); fixes two comment typos.
C++ pipeline send/write/binder implementations
packages/server/engine-lib/engLib/store/core/filter/filter.source.cpp, .../filter.callbacks.source.cpp, .../filter.callbacks.target.cpp, .../core/binder.cpp, .../filters/bottom/bottom.hpp
Implements source-mode sendJson with endpoint validation, cb_sendJson/cb_writeJson Python callbacks with GIL unlock, Binder::writeJson with callMethods and trace output, and bottom-filter no-op overrides.
Python bridge: enum flag, binding, and writeJson implementation
packages/server/engine-lib/engLib/store/python/python-base.hpp, .../python-instance.cpp, .../python-instance.json.cpp, .../python/bindings.cpp
Adds WriteJson = BIT(23) to PythonInstanceMethod, declares and binds IPythonInstanceBase::writeJson, implements C++→Python dispatch with JSON-to-dict conversion and parent fallback, and registers sendJson/writeJson in pybind11 bindings.
rocketlib Python protocol stubs
packages/server/engine-lib/rocketlib-python/lib/rocketlib/filters.py
Adds sendJson and writeJson stubs to IServiceFilterInstance and IInstanceBase protocols, mirroring the C++ binding surface.
Response node handler, service configs, and docs
nodes/src/nodes/response/IInstance.py, nodes/src/nodes/response/services.json, nodes/src/nodes/response/services.json.json, nodes/src/nodes/response/README.md
Implements IInstance.writeJson (appends to json lane list in response), registers json lane and response_json:// service variant, adds full Return JSON node config, and updates README.
C++ integration tests
packages/server/engine-lib/test/store/tests/json.cpp
Adds JsonFilterTest and store::json test cases verifying single-write fidelity and multi-write ordering under the response_json endpoint.

Sequence Diagram(s)

sequenceDiagram
  participant PyNode as Python Node
  participant cb_writeJson as cb_writeJson (TARGET)
  participant Binder as Binder::writeJson
  participant PyInstance as IPythonInstanceBase::writeJson
  participant IInstancePy as IInstance.writeJson (Python)

  PyNode->>cb_writeJson: writeJson(jsonData)
  cb_writeJson->>cb_writeJson: enforce TARGET mode, unlock GIL
  cb_writeJson->>Binder: binder.writeJson(jsonData)
  Binder->>PyInstance: callMethods("json", jsonData) + trace
  PyInstance->>PyInstance: check WriteJson flag, jsonToDict(jsonData)
  PyInstance->>IInstancePy: instance.writeJson(dict)
  IInstancePy->>IInstancePy: append to response["json"] list
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

module:server, module:nodes, docs

Suggested reviewers

  • jmaionchi
  • Rod-Christensen

Poem

🐇 A new lane hops into the pipe,
JSON objects, ripe and bright,
From C++ depths to Python's height,
writeJson carries the payload right—
One dict per write, appended tight!
The rabbit cheers with pure delight. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.62% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main feature addition: a new JSON lane type added across the server and node infrastructure.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/json-lane

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@stepmikhaylov stepmikhaylov marked this pull request as draft June 16, 2026 20:54
@stepmikhaylov stepmikhaylov changed the title feat(server, nodes): add generic json lane feat(server, nodes): add json lane Jun 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@nodes/src/nodes/response/README.md`:
- Around line 26-35: The README.md file in nodes/src/nodes/response/ has manual
documentation for the new response_json:// service variant (lines 26-35), but
the auto-generated schema block between the ROCKETRIDE:GENERATED:PARAMS START
and ROCKETRIDE:GENERATED:PARAMS END markers (lines 101-165) is missing the
corresponding Return JSON section. Run the nodes:docs-generate command to
regenerate the documentation schema block so it includes all nine service
variants including the new JSON one, then commit the updated README file with
the regenerated content.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5d2d301e-7f75-43b0-bd68-4f0ea0bcb7fd

📥 Commits

Reviewing files that changed from the base of the PR and between 214eb1a and 03fa152.

📒 Files selected for processing (17)
  • nodes/src/nodes/response/IInstance.py
  • nodes/src/nodes/response/README.md
  • nodes/src/nodes/response/services.json
  • nodes/src/nodes/response/services.json.json
  • packages/server/engine-lib/engLib/store/core/binder.cpp
  • packages/server/engine-lib/engLib/store/core/filter/filter.callbacks.source.cpp
  • packages/server/engine-lib/engLib/store/core/filter/filter.callbacks.target.cpp
  • packages/server/engine-lib/engLib/store/core/filter/filter.source.cpp
  • packages/server/engine-lib/engLib/store/filters/bottom/bottom.hpp
  • packages/server/engine-lib/engLib/store/headers/binder.hpp
  • packages/server/engine-lib/engLib/store/headers/filter.hpp
  • packages/server/engine-lib/engLib/store/python/bindings.cpp
  • packages/server/engine-lib/engLib/store/python/python-base.hpp
  • packages/server/engine-lib/engLib/store/python/python-instance.cpp
  • packages/server/engine-lib/engLib/store/python/python-instance.json.cpp
  • packages/server/engine-lib/rocketlib-python/lib/rocketlib/filters.py
  • packages/server/engine-lib/test/store/tests/json.cpp

Comment on lines +26 to +35
The same implementation is registered as ten services. The generic **HTTP Results** service (`response://`) accepts all nine lane types and lets you map each lane to its own result key. Nine single-lane variants accept exactly one lane each and expose a single `laneName` field:

| Service title | Protocol | Lane | Default result key |
|------------------|---------------------------|-------------|--------------------|
| HTTP Results | `response://` | all eight | the lane type name |
| HTTP Results | `response://` | all nine | the lane type name |
| Return Answers | `response_answers://` | `answers` | `answers` |
| Return Audio | `response_audio://` | `audio` | `audio` |
| Return Documents | `response_documents://` | `documents` | `documents` |
| Return Image | `response_image://` | `image` | `image` |
| Return JSON | `response_json://` | `json` | `json` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Regenerate node docs so the generated schema includes the new JSON variant.

Line 26/Line 35 documents response_json://, but the generated schema block (Line 101-165) does not list a Return JSON section. Please run nodes:docs-generate and commit the regenerated README content.

As per coding guidelines, documentation for node inputs/outputs/config must stay co-located and content between <!-- ROCKETRIDE:GENERATED:PARAMS START --> and <!-- ROCKETRIDE:GENERATED:PARAMS END --> is generator-managed.

Also applies to: 101-165

🤖 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 `@nodes/src/nodes/response/README.md` around lines 26 - 35, The README.md file
in nodes/src/nodes/response/ has manual documentation for the new
response_json:// service variant (lines 26-35), but the auto-generated schema
block between the ROCKETRIDE:GENERATED:PARAMS START and
ROCKETRIDE:GENERATED:PARAMS END markers (lines 101-165) is missing the
corresponding Return JSON section. Run the nodes:docs-generate command to
regenerate the documentation schema block so it includes all nine service
variants including the new JSON one, then commit the updated README file with
the regenerated content.

Source: Coding guidelines

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

addressed, recheck

@github-actions github-actions Bot added the module:ai AI/ML modules label Jun 16, 2026
@stepmikhaylov stepmikhaylov force-pushed the feat/json-lane branch 3 times, most recently from b66886d to c8c0f9d Compare June 19, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation module:ai AI/ML modules module:nodes Python pipeline nodes module:server C++ engine and server components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant