feat: inline node execution for FBP native nodes in compute worker#101
Closed
pyramation wants to merge 1 commit into
Closed
feat: inline node execution for FBP native nodes in compute worker#101pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
Adds an inline node registry that lets the worker execute FBP native nodes (number, add, multiply, select, object, guard, template, concat, string, boolean) in-process rather than dispatching an HTTP request. When tick_execution dispatches a graph job whose task_identifier matches a registered inline node, the worker: 1. Resolves the impl from the registry 2. Executes it with the node's inputs and props 3. Calls complete_node via SQL to store outputs and trigger the next tick Cloud function jobs (send-email, etc.) still follow the existing HTTP dispatch path unchanged. Both paths converge on the same complete_node SQL, so the graph engine sees no difference. New files: - job/worker/src/inline-nodes.ts — registry + payload helpers - job/worker/src/graph-complete.ts — complete_node / fail_node SQL wrappers Tests: 32 new tests (26 registry + 6 worker integration)
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Superseded — already merged into develop via #104 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FBP native nodes (
number,add,multiply,select,object,guard,template,concat,string,boolean) now execute in-process in the compute worker instead of failing on HTTP dispatch.Previously,
tick_executiondispatched ALL non-boundary nodes as jobs toapp_jobs.jobs. The worker tried to POST every job to a function URL — but native nodes have no HTTP endpoint, so they'd fail. Now both paths converge:Key design decision: The inline path calls the same
platform_complete_node/platform_fail_nodeSQL as cloud functions. The graph engine sees no difference between inline and HTTP invocations — same state transitions, same output storage, sametick_executionre-entry.New files
job/worker/src/inline-nodes.ts—INLINE_NODESregistry mapping task identifiers toNodeImplFn, plusisGraphJob()andextractNodeProps()payload helpers. Implementations match@fbp/evaluatordefinitions (same(inputs, props) => outputscontract).job/worker/src/graph-complete.ts—completeNode(pool, executionId, nodeName, output)andfailNode(pool, executionId, nodeName, message)— thin wrappers that call theconstructive_compute_privateSQL procedures.Modified
job/worker/src/index.ts—Worker.doWorkchecksgetInlineImpl(task_identifier)+isGraphJob(payload)before falling through to HTTP dispatch. On error, callsfailNodeinstead of letting the job fail at the queue level.Tests
32 new tests across two files:
tests/integration/inline-nodes.test.ts— registry completeness, all 11 node impls,isGraphJob,extractNodeProps,completeNode/failNodeSQL mock verificationtests/integration/inline-worker.test.ts—Worker.doWorkintegration: inline execution →complete_nodeSQL, props extraction, HTTP fallback for cloud functions,fail_nodeon impl error, async impl supportLink to Devin session: https://app.devin.ai/sessions/b2291a8e333e445aa125a2efd1996206
Requested by: @pyramation