Repository navigation
feat(frontend): suggest next operators on the canvas - #6437
gupta-sahil01 wants to merge 22 commits into
Conversation
Automated Reviewer SuggestionsBased on the
|
|
great feature, could you please include screenshots/gifs in the PR description? |
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 714 | 0.435 | 14,369/17,840/17,840 us | 🟢 -60.0% / 🔴 +36.3% |
| 🟢 | bs=100 sw=10 sl=64 | 1,703 | 1.039 | 57,152/78,725/78,725 us | 🟢 -7.6% / 🟢 +29.7% |
| 🔴 | bs=1000 sw=10 sl=64 | 1,984 | 1.211 | 498,566/554,615/554,615 us | 🔴 -5.1% / 🟢 +47.3% |
Baseline details
Latest main 2d0a0a3 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 714 tuples/sec | 641 tuples/sec | 943.62 tuples/sec | +11.4% | -24.3% |
| bs=10 sw=10 sl=64 | MB/s | 0.435 MB/s | 0.391 MB/s | 0.576 MB/s | +11.3% | -24.5% |
| bs=10 sw=10 sl=64 | p50 | 14,369 us | 13,681 us | 10,541 us | +5.0% | +36.3% |
| bs=10 sw=10 sl=64 | p95 | 17,840 us | 44,578 us | 13,727 us | -60.0% | +30.0% |
| bs=10 sw=10 sl=64 | p99 | 17,840 us | 44,578 us | 16,861 us | -60.0% | +5.8% |
| bs=100 sw=10 sl=64 | throughput | 1,703 tuples/sec | 1,704 tuples/sec | 1,313 tuples/sec | -0.1% | +29.7% |
| bs=100 sw=10 sl=64 | MB/s | 1.039 MB/s | 1.04 MB/s | 0.801 MB/s | -0.1% | +29.7% |
| bs=100 sw=10 sl=64 | p50 | 57,152 us | 55,719 us | 79,983 us | +2.6% | -28.5% |
| bs=100 sw=10 sl=64 | p95 | 78,725 us | 85,220 us | 86,516 us | -7.6% | -9.0% |
| bs=100 sw=10 sl=64 | p99 | 78,725 us | 85,220 us | 93,488 us | -7.6% | -15.8% |
| bs=1000 sw=10 sl=64 | throughput | 1,984 tuples/sec | 2,090 tuples/sec | 1,347 tuples/sec | -5.1% | +47.3% |
| bs=1000 sw=10 sl=64 | MB/s | 1.211 MB/s | 1.276 MB/s | 0.822 MB/s | -5.1% | +47.3% |
| bs=1000 sw=10 sl=64 | p50 | 498,566 us | 474,475 us | 780,074 us | +5.1% | -36.1% |
| bs=1000 sw=10 sl=64 | p95 | 554,615 us | 537,708 us | 826,232 us | +3.1% | -32.9% |
| bs=1000 sw=10 sl=64 | p99 | 554,615 us | 537,708 us | 869,114 us | +3.1% | -36.2% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,280.30,200,128000,714,0.435,14369.39,17840.24,17840.24
1,100,10,64,20,1174.53,2000,1280000,1703,1.039,57151.81,78724.52,78724.52
2,1000,10,64,20,10079.25,20000,12800000,1984,1.211,498566.23,554615.24,554615.24
added screenshots |
|
Hi @gupta-sahil01 a high level comment: let's not name it |
I thought since they were blurred like a "ghost". If you have a better name for it, I'm open to changing it. |
|
How about just call them "suggested operators"? On the UI, the suggested operators are rendered with faded, blurred effect, but they are real suggestion instances. "ghost" the word has a negative semantic and I'd like to avoid it, and it is bundled with its UI effect: if we were to change such operators UI effect to be not blurred, the naming will be obsolete. |
Well, the word "ghost" doesn't appear directly in the UI. When we drag an operator from the panel, the 3 suggestions will show up with it. |
|
Not only about UI, or what user sees, but also for code comments, variable names as well as GitHub discussion, pr titles and description, etc. can we avoid this naming in general? Thanks |
Frontend half of the ambient operator recommender (apache#5240). After an operator is added to the canvas, 1-3 faded suggestion chips appear on its output port showing likely next operators; clicking one materializes the operator and wires the link as a single undoable action. - OperatorRecommendationService: calls the stateless agent-service POST /api/recommend endpoint and turns a chosen suggestion into a real operator. Fails soft - a disabled feature, an output-less operator, or a backend error simply yields no suggestions, leaving the canvas unchanged. - Suggestion overlay in the workflow editor, reusing the chat-popover anchoring pattern (screen-coord conversion, re-anchored on move / zoom / pan); dismissed on blank click or when the anchor operator is deleted. - Opt-in GUI config flag `operatorRecommendationEnabled`, default off, threaded through gui.conf, GuiConfig, ConfigResource, and the frontend GuiConfig type + mock.
1a02c7d to
a0794b6
Compare
|
Am I allowed to update the branches because I made some changes with respect to eliminating the word "ghost" from everywhere? |
Yicong-Huang
left a comment
There was a problem hiding this comment.
🟢 1 resolved · 0 open · 1 new (1 new = 0 newly introduced · 1 late catch)
The doc block is fixed exactly as suggested, and every claim in it re-checks out against the pinned library sources. The one new item is a word in a comment I read and cleared last round.
Polish: 1 quick touch-up (see inline comment).
Verification trace
The corrected doc block is right on all three counts. Backbone 1.4.1 fires reset and sort as (collection, options) (backbone.js:965, :1045), and joint.dia.Graph re-triggers its cells collection's events verbatim (cells.on('all', this.trigger, this), jointjs 3.5.4 dist/joint.js:16579), so a handler really does receive the collection. change is proxied per cell by _onModelEvent (backbone.js:1210-1222), and because Graph = Backbone.Model.extend (joint.js:16560) a graph-attribute set fires it with the Graph — which is what the new wording now says.
The union is still sound. add, remove and change:position all put the Cell first, so the admitted set stays a strict subset of the cell-reporting events, and the signature and body are byte-identical to the last round.
The description's numbers are now exact. grep -c gives 8 in the service spec and 116 in the editor spec; the recommender describe at :2460 holds 11 it( blocks, and the eleven behaviours the description lists match those eleven titles one-for-one.
Yicong-Huang
left a comment
There was a problem hiding this comment.
🟢 2 resolved · 0 open · 1 new (1 new = 0 newly introduced · 1 late catch)
Both round-3 findings are verified fixed and all 34 threads are resolved. Nothing left blocks merge. One note for whoever merges: the backend half (#6436) is still open and this PR carries Closes #6293, so it should land second.
Polish: 1 quick touch-up (see inline comment).
Verification trace
The corrected doc block is right. joint.dia.Graph re-triggers its cells collection's events verbatim (cells.on('all', this.trigger, this), jointjs 3.5.4 dist/joint.js:16579), and Backbone 1.4.1 fires reset and sort as (collection, options) — so both hand a handler the collection. change is genuinely both cases: the Graph is itself a Model, so graph.set(...) fires it with the Graph, while a cell's own change arrives through _onModelEvent with the Cell first (backbone.js:1210-1222). The new text states both halves, which is exactly what the previous wording got wrong.
Nothing else moved. git diff 79e35771a 3339c8f6d is one file, 4 insertions and 4 deletions, all of it comment prose. fromJointGraphCellEvent still has a single call site (workflow-editor.component.ts:1844, passing change:position); the feature still performs exactly one graph mutation (operator-recommendation.service.ts:157); and the recommender describe still holds 11 it( blocks at workflow-editor.component.spec.ts:2460 out of 116 in the file — both numbers matching the description's refreshed test line. The lock bullet the last round asked for is in the description now too.
The comment said 'Both conditions' while the condition has three conjuncts. Name the lock and port checks as guarding state no dismissal covers, and mark hasOperator as backing up the delete stream rather than load-bearing.
|
/request-review @Yicong-Huang |
Yicong-Huang
left a comment
There was a problem hiding this comment.
🟢 1 resolved · 0 open · 1 new (1 new = 0 newly introduced · 1 late catch)
The round-4/5 finding is verified fixed: the guard comment now names its three checks, and the belt-and-braces claim it adds is true. All 36 threads are resolved and every executable line is unchanged since round 3. One late catch on my own earlier wording is left.
Polish: 1 touch-up in two places (see inline comments).
For whoever merges: the backend half (#6436) is still open and this PR carries Closes #6293, so it should land second.
Verification trace
The new belt-and-braces claim holds. The rewritten comment says hasOperator only backs up the delete stream. Traced it rather than accepting it: getOperatorDeleteStream() is subscribed at workflow-editor.component.ts:1835, and its source operatorDeleteSubject.next(...) sits at shared-model-change-handler.ts:112, inside the Y-observer's delete arm but outside the if (event.transaction.local) guard that opens at :101. So a co-editor's remote delete emits the same stream as a local one, closeNextOperatorSuggestions() nulls the state, and materializeNextOperatorSuggestion returns at its own if (!this.nextOperatorSuggestion) (:1921) before the conjunct is reached. hasOperator is genuinely redundant.
Nothing else moved. git diff 3339c8f6d 7aa41664b is one file, 7 insertions and 6 deletions, all comment prose. The description's test numbers still hold in the tree: 8 it( in operator-recommendation.service.spec.ts and 116 in workflow-editor.component.spec.ts, 11 of them inside describe("Ambient Operator Recommender") at :2460.
OperatorInfo.forVisualization gives every visualization a SINGLE_SNAPSHOT output port, so a chart is not output-less and does produce suggestions. The catalog has no zero-output operator outside test stubs, so the parenthetical is dropped rather than replaced. Fixed in both the service and the component, which duplicate the guard.
|
/request-review @Yicong-Huang |
Yicong-Huang
left a comment
There was a problem hiding this comment.
🟢 1 resolved · 0 open · 0 new (0 new = 0 newly introduced · 0 late catches)
The round-6 finding is verified fixed. You said the wording was in a third place as well — the PR description — and that checks out: nothing in the tree or the description names a zero-output operator any more. All 38 threads are resolved and no executable line has changed since round 3, so there is nothing outstanding from this review series.
For whoever merges: the backend half (#6436) is still open and this PR carries Closes #6293, so it should land second.
Verification trace
The third site is genuinely fixed, not relocated. grep -rn "chart sink" over the worktree returns no hits, and the description bullet now reads "a disabled feature, an output-less operator, a backend error, or an operator type the catalog doesn't know all leave the canvas unchanged". That phrasing states the guard's input condition rather than claiming such an operator exists in the catalog, which was the actual defect. Both code sites match their suggestion blocks character for character: operator-recommendation.service.ts:91-92 and workflow-editor.component.ts:1866-1867.
Nothing else moved. git diff 3339c8f6d e8b30c44, filtered to lines whose content is not a // comment, returns nothing at all — every executable line in this PR is unchanged since round 3. The description's three test counts were re-counted in the tree rather than carried forward: 8 it( in operator-recommendation.service.spec.ts, 116 in workflow-editor.component.spec.ts, and 11 at or after describe("Ambient Operator Recommender") on :2460.
|
@gupta-sahil01 shall we wait for #6436? |
|
@Yicong-Huang I feel like since #6436 has been marked as stale, we shouldn't wait any longer. |
|
Any updates here? @Yicong-Huang |
|
please resolve the conflicts and we can merge this |
…mender-frontend # Conflicts: # bin/k8s/templates/base/gateway/gateway-routes.yaml # frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts
Done |
|
This pull request has been automatically marked as stale because it has If this PR is still relevant, please:
To exempt this PR from auto-close, a maintainer can add the |
|
This pull request has been automatically closed due to 37 days of inactivity. |
|
@Xiao-zhen-Liu, please review this PR because it has been automatically marked as closed. Should we reopen it? |
|
Hello @gupta-sahil01, can you resolve the branch and CI/CD conflicts in this PR? In the meantime, I plan to review and work with you consistently to merge the backend half of this two-part PR first. I think this PR has been open for a long time, and I would like to help resolve it. |
Resolve conflicts where both sides added code at the same place: keep the operator-recommendation-enabled setting alongside main's new AI fix model setting (gui.conf, GuiConfig, its spec, ConfigResource, the frontend GuiConfig type and mock), and merge the workflow editor's imports, dropping OperatorResultSummary, which main replaced with OperatorExecutionSummary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#6436 - Call POST /api/operator-recommendations with the operator type and the anchor output port (sourcePortID), dropping existingOperatorTypes. - Wire a clicked suggestion to the input port the backend names (targetPortID), falling back to the first input port if this frontend's operator has no port by that ID. - Drop the /api/recommend routes from the dev proxy and single-node nginx; apache#6436 adds /api/operator-recommendations to both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hello @Ma77Ball, thank you for checking the status of this PR. I've resolved the CI/CD conflicts and also updated the code to the new endpoint that is used in the backend PR. Please have a look after the required checks have finished. |
What changes were proposed in this PR?
Frontend half (PR 2 of 2) of the ambient operator recommender, Version 1 — see #6293
(design discussion #5240). Depends on the backend
/api/recommendendpoint in #6436.After the user drops an operator onto the canvas, 1–3 faded suggestion chips appear
on its output port; clicking one materializes that operator and wires the link as a
single undoable action, then offers a fresh round of suggestions on the operator it just
created. Behaves like code completion, but for dataflow graphs. Opt-in and default-off.
OperatorRecommendationServicecallsPOST /api/recommendand materializes a chosensuggestion. Fails soft: a disabled feature, an output-less operator, a backend error, or an operator type the catalog doesn't know all leave the canvas unchanged.
workflow load, undo/redo, paste, and remote co-editor edits do not fire requests.
Chaining after a click is explicit for the same reason.
with the chat popover; re-anchored on operator move and zoom, dismissed on blank click
or when the anchor operator is deleted.
operatorRecommendationEnabled(defaultfalse), threaded throughgui.conf→GuiConfig→ConfigResource→ the frontendGuiConfigtype + mock, andlisted as
falseinvalues.yaml,values-development.yaml, and.envso deploymentscan turn it on without a chart edit.
the prod gateway. On the gateway it gets its own HTTPRoute rather than joining
/api/agents: that route is the target of aBackendTrafficPolicypinning requests to areplica by consistent-hashing
X-Agent-Workflow-Id, and the recommender is stateless andsends no such header. Auth posture is unchanged either way — the gateway's
extAuthSecurityPolicyscopes to-dynamic-routesonly, which covered neither route.one subject through
switchMap, and dismissing pushes a cancel through it — so a slowresponse can neither overwrite newer suggestions nor re-open a dismissed overlay.
edge, or proximity auto-linking), and the port can acquire a link while the chips are
up, so the check runs both when asking and when a chip is clicked.
disabled — during execution, version preview, or a read-only view — and a click
re-checks the lock. Materializing writes to the shared model, and
undoAction()refuseswhile the lock is on, so the write could not be taken back.
V1 payload is intentionally minimal. The request carries the operator type and the
types already on the canvas; the backend's V1 ranker is a hardcoded table that needs no
schema or data sample, and documents
existingOperatorTypesas reserved for V2. Outputschema and graph topology arrive with the V2 LLM ranker.
Any related issues, documentation, discussions?
How was this PR tested?
yarn ng test—operator-recommendation.service.spec.ts, 8 passed.yarn ng test—workflow-editor.component.spec.ts, 116 passed, 11 covering therecommender: a drop requests suggestions; operators arriving without a drop do not;
a drop that already wired the anchor port does not; a chip click after the port
acquires a link does not materialize; disabling workflow modification dismisses the
chips; a click while modification is disabled does not materialize; a response
arriving after dismissal is ignored; the newest request wins when an older response
lands last; deleting the anchor dismisses; clicking a chip chains a fresh round;
repositioning to an unchanged position skips change detection.
yarn ng build --configuration=production— succeeds under strict templates.GUI_WORKFLOW_WORKSPACE_OPERATOR_RECOMMENDATION_ENABLED=true; verified chips render onthe output port, clicking materializes + links + re-suggests, and
POST /api/recommendis reached through the proxy.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Anthropic Claude (Claude Code)