Feat/workflow execution dialog#22
Merged
Merged
Conversation
added 25 commits
June 22, 2026 11:42
Add stdout/stderr/input_request/init_buffers event types to worker protocol. Create workflowExecutionStore for dialog state management with 100ms log batching and reopen-during-execution support.
… blocking Worker captures Python stdout/stderr via custom writer objects and emits events. Allocates SharedArrayBuffer for synchronous input blocking with Atomics.wait/notify — 30s timeout, cancellation support, 8KB text buffer.
…sponse Worker client handles stdout/stderr/input_request/init_buffers events. respondToInput() writes directly to SharedArrayBuffer + Atomics.notify (no postMessage — worker is blocked on Atomics.wait).
Real-time dialog showing progress bar, stdout/stderr log, input prompts, and errors. Auto-scrolling log with user-scroll detection. Mobile-friendly with dvh units and 44px touch targets.
executeActivity subscribes to worker events (stdout/stderr/progress/ input_request) and logs to workflowExecutionStore. ProvActivityTemplate owns dialog lifecycle — open before while loop, close after. Dialog mounted in canvas container alongside other overlays.
Sparkles icon with tooltip, conditionally rendered when workflowCatalogEnabled. Expands sidebar and opens workflows accordion.
…ivity prov:atLocation, rdf:type, and rdfs:label are now searched in both workflows and data graphs. Fixes execution of standalone example TTL files where resources may be in either graph. Improved error message when code URL not found (lists used resources, suggests catalog load).
validateWorkflowExecution() checks activity exists, has code resources with reachable URLs, and template step present. Exposed on window.__vgTestWorkflow for dev console access.
Workflow (branching nodes) icon better represents workflows than Sparkles. Updated in both collapsed rail button and expanded accordion.
Extend request_input protocol to support label/value option pairs, increase input timeout to 300s, add dialog-side cancel on close with backdrop/Escape guards, and add integration test fixture and tests for the end-to-end input resolution flow.
Derive base URL from codeUrl, fetch shared libraries (spw_input.py) to Pyodide FS at /tmp, cache across executions. Ensures /tmp is in sys.path so scripts can use standard import. Graceful 404 fallback.
…ate canvas vars Remove CSVWMetadataURI and CSVWColumnName input variables from the catalog template — the Python script discovers available CSVW entities at runtime and prompts the user to select. Deduplicate template variable IRIs when placing on canvas to fix React duplicate-key warning for shared variables (e.g. LoadedColumnData used as both step output and input).
All workflows discover inputs at runtime via graph queries and user prompts. Input variables remain in the catalog as documentation but the instantiator no longer creates run-level placeholder entities or places them on the canvas. Also deduplicates template variable IRIs to fix React duplicate-key warning for shared variables.
…ibility Firefox blocks CORS on HTTP→HTTPS 301 redirects for JSON-LD @context URLs. Resolve remote contexts on the main thread before passing to the worker, upgrading http:// to https:// and inlining the fetched context objects. Also add application/ld+json to the Accept header for rdfUrl loads.
Add try/catch around respondToInput to prevent unhandled errors. Fix TextEncoder.encodeInto replaced with encode+subarray to handle large response values that exceed the SharedArrayBuffer view.
When loading JSON-LD via rdfUrl, extract remote @context URLs during context resolution and pass them as candidates to discoverReferencedOntologies. This puts JSON-LD context vocabularies through the same discovery/loading pipeline as owl:imports, so referenced vocabularies (e.g. CSVW) appear in the ontology widget. Context URL load failures are non-fatal.
…des display Blank nodes whose parent subjects had no recognized rdf:type (e.g. csvw:Table nodes without explicit @type) were never propagated into bNodeViewMap. The fallback defaulted to TBox, hiding tableSchema blank nodes and their column connections from the ABox canvas view.
Output oa:Annotation entities from Python workflow scripts were only visible as canvas nodes. Now executeActivity extracts rdfs:label from annotations in the output Turtle and appends them as stderr log entries in the WorkflowExecutionDialog, so error/result messages are immediately visible to the user.
…t activity Scripts discover inputs at runtime via find_candidates(), which excludes entities that are prov:used by the activity AND have p-plan:correspondsToVariable. The old wiring caused step 2's collection to be excluded — making calculate_average report "No prov:Collection found" even though load_csvw_column produced one.
…ain__ request_input was defined via pyodide.runPython() which puts it in __main__.__dict__. After extracting spw_input.py as a shared module, the call site moved to a separate module that can't see __main__'s globals. Injecting into builtins makes it available to all modules.
After a successful workflow run, closing the dialog zooms the canvas to the first output entity of the last executed step. Uses the existing navigateToIri mechanism which handles element lookup and view switching.
…s CRLF Generate mcp.json before drift check since it is now gitignored. Refactor WorkflowExecutionDialog to satisfy react-hooks/refs and set-state-in-effect rules using render-time state derivation. Normalize CRLF in fixture test and add .gitattributes enforcing LF for cross-platform consistency.
The prebuild script and drift check both need the file on disk. Reverting the gitignore exclusion so the generated file is tracked.
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
End-to-end interactive execution of Python workflow steps inside the canvas, with live progress, log streaming, user input prompts, and automatic navigation to results.
What's new
request_input()(select dropdowns, text, number); dialog surfaces these as inline form controls using SharedArrayBuffer for synchronous blocking@contextURLs are fetched on the main thread before passing to the worker parser, fixing Firefox CORS/redirect failures@contextURLs are treated as ontology import candidatesspw_input.pyis fetched from the same base URL as the script and pre-loaded into Pyodide's filesystemKey fixes
executeActivityno longer wires intermediate data entities asprov:usedon the next activity — this causedfind_candidates()to exclude the very collections/values it should discoverrequest_input()is injected into Pythonbuiltins(not just__main__), so shared libraries likespw_input.pycan call itmcp.jsonbuild artifact