H-6364: Temporal wiring + ingest UI redesign#8572
H-6364: Temporal wiring + ingest UI redesign#8572lunelson wants to merge 26 commits intoln/h-6363-ingest-routefrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR SummaryMedium Risk Overview Redesigns the ingest UI and results experience: the Updates document viewing and types: replaces the paginated Written by Cursor Bugbot for commit 8709ff3. This will update automatically on new commits. Configure here. |
🤖 Augment PR SummarySummary: Extends local ingest dev wiring to better integrate with Mastra/Temporal and redesigns the ingest UI to use continuous document scrolling and entity-centric results. Changes:
Technical Notes: Highlights are now computed per-page for the scroll viewer, and selection drives both bbox overlays and programmatic scrolling to relevant pages. 🤖 Was this summary useful? React with 👍 or 👎 |
ae007c6 to
d7c0c10
Compare
2a4d202 to
456597a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| <ResultsPanel | ||
| rosterEntries={view.roster.entries} | ||
| claims={view.claims} | ||
| mentionContexts={view.mentionContexts} |
There was a problem hiding this comment.
Missing mentionContexts from API crashes results panel
Medium Severity
mentionContexts was added as a required field on IngestRunView, but the API response is cast with as IngestRunView without runtime validation. If the upstream API omits this field (e.g. older pipeline versions, as noted in "Known issues"), view.mentionContexts is undefined, and buildEntityAssertionMap crashes with a TypeError on the for...of loop because undefined is not iterable. A fallback like view.mentionContexts ?? [] at the call site would prevent the crash.
Additional Locations (1)
| return; | ||
| } | ||
|
|
||
| void router.push(navigationAction.path); |
There was a problem hiding this comment.
Semgrep identified a blocking 🔴 issue in your code:
Untrusted input could be used to tamper with a web page rendering, which can lead to a Cross-site scripting (XSS) vulnerability. XSS vulnerabilities occur when untrusted input executes malicious JavaScript code, leading to issues such as account compromise and sensitive information leakage. To prevent this vulnerability, validate URLs and their protocol before using them in your codebase.
Why this might be safe to ignore:
The tainted data flows through
normalizeQueryParamwhich restricts the value to a string and then throughgetIngestPageNavigationActionwhich constructs a safe navigation path. The router.push is using an internally constructed path rather than directly using untrusted user input.
Dataflow graph
flowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>apps/hash-frontend/src/pages/ingest.page.tsx</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/hashintel/hash/blob/d8d3cbf5bd5fe3e168f11ce8608db14b11a347b5/apps/hash-frontend/src/pages/ingest.page.tsx#L28 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 28] router.query.runId</a>"]
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2["<a href=https://github.com/hashintel/hash/blob/d8d3cbf5bd5fe3e168f11ce8608db14b11a347b5/apps/hash-frontend/src/pages/ingest.page.tsx#L28 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 28] normalizeQueryParam</a>"]
v3["<a href=https://github.com/hashintel/hash/blob/d8d3cbf5bd5fe3e168f11ce8608db14b11a347b5/apps/hash-frontend/src/pages/ingest.page.tsx#L22 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 22] value</a>"]
v4["<a href=https://github.com/hashintel/hash/blob/d8d3cbf5bd5fe3e168f11ce8608db14b11a347b5/apps/hash-frontend/src/pages/ingest.page.tsx#L28 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 28] runId</a>"]
v5["<a href=https://github.com/hashintel/hash/blob/d8d3cbf5bd5fe3e168f11ce8608db14b11a347b5/apps/hash-frontend/src/pages/ingest.page.tsx#L69 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 69] navigationAction</a>"]
end
v2 --> v3
v3 --> v4
v4 --> v5
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/hashintel/hash/blob/d8d3cbf5bd5fe3e168f11ce8608db14b11a347b5/apps/hash-frontend/src/pages/ingest.page.tsx#L84 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 84] navigationAction.path</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
To resolve this comment:
🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by react-nextjs-router-push.
You can view more details about this finding in the Semgrep AppSec Platform.



🌟 What is the purpose of this PR?
Wire the HASH frontend to the internal repo's Temporal workers and Mastra API for local dev, and redesign the ingest UI with continuous-scroll document viewer, collapsible entity cards with assertion windows, and a two-panel input layout.
🔗 Related links
internal/apps/agent-workflows/docs/reference/e2e-ingest-ui-design.md(internal)🚫 Blocked by
/ingestroute scaffolding)🔍 What does this change?
Temporal wiring:
/artifacts/*to proxy page images from Mastra API/api/ingest/[runId]/events— Next.js rewrites buffer responses, breaking SSE streaming; this API route manually proxies with proper streaming headersTEMPORAL_NAMESPACEenv var on TS worker, Python worker, and Mastra API Temporal clientUI redesign — document viewer:
PageViewer(Prev/Next buttons, single page) with continuous vertical scroll of all page imagesscrollToPageviauseImperativeHandlehighlightedBlocksByPagemapUI redesign — results panel:
participants[].rosterEntryIdSelectiontypes (entity|assertion) andbuildEntityAssertionMap()in evidence-resolverUI redesign — inputs view:
Type alignment:
IngestRunViewnow includesmentionContexts: MentionContextPlan[]MentionContextPlandiscriminated union (assertion_windows|mechanical_fallback)AssertionWindow,FallbackWindow,ContextDiagnosticstypes matching internal repo contractsPre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
typeSelectionwiring through to Temporal workflowTEMPORAL_NAMESPACE=HASH🐾 Next steps
🛡 What tests cover this?
turbo lint:tsc --filter=@apps/hash-frontend— type checkingyarn fix:eslint— zero lint errorsyarn fix:format— formatting clean❓ How to test this?
yarn external-services up -dyarn start:graph,yarn dev:backend,yarn dev:frontendinternal/apps/agent-workflows):TEMPORAL_NAMESPACE=HASH yarn temporal:worker:tsTEMPORAL_NAMESPACE=HASH yarn temporal:worker:pyTEMPORAL_NAMESPACE=HASH yarn dev:apialice@example.com/password/ingest— two-panel layout with extraction mode toggle📹 Demo