Add experimental Jev features: natural-language workflow search and event history review - #3948
Draft
rossnelson wants to merge 4 commits into
Draft
rossnelson wants to merge 4 commits into
rossnelson wants to merge 4 commits into
Conversation
Add two experimental, off-by-default endpoints that use the TypeSafe System One model "Jev". Jev returns typed judgments with probabilities and never generates text: code finds the candidates, Jev selects, and code builds the result. - POST /api/v1/nl-search turns a sentence into typed workflow filters. The frontend builds the visibility query with the existing pipeline, so the model cannot invent an attribute or a value. - POST /api/v1/history-review scores event history rows for importance to the workflow outcome. Rows with the same signature share one question, failures and pending rows are pinned, and a row without an answer always stays visible. Both endpoints share one gate: 404 when off, rate limit, auth header, body limit, validation, a DescribeNamespace call with the caller's credentials, and only then the paid call. The rate limiter has a deployment bucket, a per-IP bucket and a per-caller bucket, with an overflow bucket so key rotation cannot grow the map or evict callers. Config lives in a shared `typesafe` block (one key per deployment) with separate `nlSearch.enabled` and `historyReview.enabled` gates. The key never reaches the browser; settings expose two booleans only. Also fix the config refresh goroutine, which kept looping after Close.
Natural-language search: an experimental input above the workflow filter bar sends a sentence to ui-server and turns the typed filters into the existing filter pills, so the pills, the query, the counts and saved views all keep working. Low confidence still applies the filters and asks the user to check the pills. History review: a "Review with Jev" button on the event history and the timeline collapses runs of routine rows into one toggle row. Each run has its own toggle, "Show all events" opens every run, and "Clear review" removes the review. One review is shared by both views. Nothing is sent before the click, and the request holds identifiers only: no payloads, failure messages, user metadata, memo or search attribute values. A test builds a history with all of those and asserts that none reaches the request body. Both features show only when ui-server reports them as enabled.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The translator now sends Jev every search attribute with the comparisons its type allows, and asks which attribute and comparison each value in the search uses. Each answer is recorded as a trace step with its score, threshold, probabilities, and outcome, and the response returns the trace. On the Workflows page, Why? opens a panel beside the table that shows each stage of the trace. A carousel keeps the last searches; selecting one applies its query again. The search text is kept in the nlSearch URL parameter so a reload does not clear it.
Starts a fixed set of workflows with CustomerTier and Attempts search attributes, so each demo search has one right answer. record.ts records the searches, the Why? panel, and a history review with Playwright.
This branch was successfully deployed
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
Two experimental features, both off by default, that use the TypeSafe System One model "Jev". Jev returns typed judgments (choice / yes-no / score) with probabilities. It never generates text. Code finds the candidates, Jev selects, and code builds the result.
nl-search-jev.mp4
1. Natural-language workflow search. An input above the workflow filter bar turns a sentence such as "failed order workflows from yesterday" into the existing filter pills. The frontend builds the visibility query with the existing pipeline, so the model cannot invent an attribute or a value. The pills are the verification step: the user sees what was understood and can edit it.
2. "Review with Jev" on the event history and the timeline. A button scores each row for importance to the workflow outcome. Runs of routine rows collapse into one toggle row. Each run has its own toggle, "Show all events" opens every run, and "Clear review" removes the review. One review is shared by the history and timeline views.
A short screen recording follows in a comment.
How it works
POST /api/v1/nl-searchandPOST /api/v1/history-reviewin ui-server. The TypeSafe client and the two translators are plain Go packages with no Echo or config dependency.DescribeNamespacewith the caller's credentials → the paid call. A caller that the Temporal frontend rejects causes zero TypeSafe calls (covered by tests with a bufconn fake frontend).rateLimitblock;rateLimit.disabled: trueis the explicit opt-out.Privacy
markerNameis the one name a workflow author can set freely; this is noted in the code.Configuration
Local:
TEMPORAL_TYPESAFE_API_KEY=... pnpm dev:ui-serverturns both features on indevelopment.yaml. Docker:TEMPORAL_TYPESAFE_*,TEMPORAL_NL_SEARCH_ENABLED,TEMPORAL_HISTORY_REVIEW_ENABLED.Testing
gofmt,go vet,go test -count=1 -race ./...(14 packages pass). httptest fake for TypeSafe, bufconn fake for the Temporal frontend, no network.pnpm check(0 errors),pnpm lint,pnpm test(270 files, 3487 tests pass),pnpm vite build. New render tests for the search input and the hidden-run row (pnpm checkdoes not detect a missing.svelteimport; a render test does).history-review.spec.ts(history + timeline, endpoint mocked).Also in this PR
Close()(breakinsideselect).Retry-Afteris added to the CORS exposed headers.Open items before this leaves draft
GROUP BY WorkflowTypeis not available on standard visibility, so the known-workflow-types hint is empty there; the search then selects a type only from the words in the text.html/template, so a key that contains+ & < > ' "must be set as a quoted string in a config file. Startup rejects a key that was HTML-escaped.