feat(geo): conversation sequences — multi-turn prompt tracking - #666
feat(geo): conversation sequences — multi-turn prompt tracking#666mezotv wants to merge 1 commit into
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Comp AI code review failed. Comment Commit |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
React Doctor found 3 new issues in 2 files · 3 warnings · score 90 / 100 (Great) · 0 fixed · vs 3 warnings
Reviewed by React Doctor for commit |
| ); | ||
|
|
||
| const pending = create.isPending || update.isPending; | ||
| const validSteps = steps |
There was a problem hiding this comment.
React Doctor · react-doctor/js-combine-iterations (warning)
This loops over your list twice because .map().filter() makes two passes, so do it in one pass with .reduce() or a for...of loop
Fix → Combine .map().filter() style chains into one pass with .reduce() or a for...of loop, so you only loop over the list once
| {steps.map((step, index) => ( | ||
| <div | ||
| className="flex items-start gap-2" | ||
| key={`turn-${index.toString()}`} |
There was a problem hiding this comment.
React Doctor · react-doctor/no-array-index-as-key (warning)
Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "index".
Fix → Use a stable id from the item, like key={item.id} or key={item.slug}. Index keys break when the list reorders or filters.
| open ? sequence?.id : undefined | ||
| ); | ||
|
|
||
| const turns = useMemo( |
There was a problem hiding this comment.
React Doctor · react-doctor/react-compiler-no-manual-memoization (warning)
React Compiler can cache this value automatically. Verify that removing useMemo preserves behavior before simplifying it.
Fix → Profile compiler-managed code and remove useMemo, useCallback, or memo only when the manual cache no longer carries behavioral or performance intent.
Greptile SummaryThe PR adds project-level multi-turn GEO conversations, including CRUD dialogs, typed oRPC APIs, results grouping, and execution during grounded scans.
Confidence Score: 3/5The PR should not merge until sequence mutations enforce project scope and the enabled-sequence cap can no longer silently omit conversations from scans. Update and delete can affect a sequence in another project within the same organization, and projects with more than ten enabled sequences show conversations as active even though the scan permanently skips the newer entries. Files Needing Attention: apps/dashboard/src/lib/geo/sequences.ts, apps/dashboard/src/lib/geo/scan.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant UI as Conversations UI
participant RPC as GEO oRPC
participant DB as Postgres
participant Scan as GEO Scan
participant Engine as Grounded Engine
participant Judge as Brand Judge
participant TB as Tinybird
User->>UI: Create or enable sequence
UI->>RPC: Sequence mutation
RPC->>DB: Persist project sequence
Scan->>DB: Load enabled sequences
loop Each sequence and engine
loop Each conversation turn
Scan->>Engine: Send conversation history
Engine-->>Scan: Grounded answer
Scan->>Judge: Judge brand visibility
Judge-->>Scan: Mention result
end
end
Scan->>TB: Ingest per-turn results
UI->>RPC: Load sequence results
RPC->>TB: Query by project and sequence
TB-->>UI: Grouped turn results
Reviews (1): Last reviewed commit: "feat(geo): conversation sequences — mult..." | Re-trigger Greptile |
| eq(geoPromptSequences.organizationId, input.organizationId) | ||
| ) | ||
| ) | ||
| .returning() | ||
| ); |
There was a problem hiding this comment.
Sequence mutations bypass project scope
When an update or delete request supplies the ID of a sequence from another project in the same organization, the predicate checks only sequenceId and organizationId, so it modifies or deletes that other project's conversation despite the request's selected projectId.
Knowledge Base Used: Dashboard App Core Structure
| orderBy: [asc(geoPromptSequences.createdAt)], | ||
| limit: GEO_MAX_SEQUENCES, |
There was a problem hiding this comment.
Stacked on #657. Splits the conversation-sequences feature out of the main GEO PR into its own reviewable unit.
What's here (app layer):
ConversationsCard+ builder/results dialogs on the GEO prompts pagelib/geo/sequences.ts(CRUD + results loading) andutils/geo-sequences.tsgeo.sequences*oRPC procedures, Zod schemas, hooks, error mappingDeliberately left in the base PR (#657): the
geo_prompt_sequencestable (migration 0063 is already applied to staging/preview DBs — re-splitting applied migrations is not worth the risk) and thegeoSequenceResultsTinybird pipe (deploys are declarative and additive).Merge order: #657 first, then this.
Summary by cubic
Adds conversation sequences to GEO so teams can create, edit, enable, and track multi-turn buyer conversations, then view per-turn engine results. Sequences run during scans as grounded chats, with brand checks at each turn.
ConversationsCardwith builder and results dialogs on the GEO prompts page.geo.sequences*oRPC procedures, Zod schemas, React hooks, and error mapping.GEO_MAX_SEQUENCESandGEO_SEQUENCE_MAX_TURNSenforced, plus prompt length checks and turn grouping utility.Written for commit 97321fb. Summary will update on new commits.