---
id: JNY-PFM-LLM-005
title: A staff member refines a query and resumes its Jazz AI conversation
feature: FEAT-PFM-LLM-07
product_area: platform
module: llm
revision: 1
status: draft
product_intent: proposed
implementation_evidence: partially-observed
supersedes: []
source_sha:
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
actor: ACT-PFM-032
goal: 'Refine a query, undo an unwanted change and return to the same conversation.'
capabilities:
  - CAP-PFM-LLM-020
  - CAP-PFM-LLM-019
screens:
  - '/console/{tenantId}/queries/new'
  - '/console/{tenantId}/agent'
steps:
  - 'n': 1
    surface: '/console/{tenantId}/queries/new'
    action: Describe a query using Build with Jazz AI.
    capability: CAP-PFM-LLM-020
    expected: 'The workspace creates the draft, resolves its kind when necessary and opens the refinement panel.'
    provenance: observed
    source: 'react-console:components/queries/query-workspace.tsx:create'
  - 'n': 2
    surface: '/console/{tenantId}/queries/new'
    action: Ask for narrower criteria and another column.
    capability: CAP-PFM-LLM-020
    expected: 'The draft changes in place, preserves personal column order and remains unsaved.'
    provenance: observed
    source: 'react-console:components/queries/query-workspace.tsx:refine'
  - 'n': 3
    surface: '/console/{tenantId}/queries/new'
    action: Choose Undo for the last refinement.
    capability: CAP-PFM-LLM-020
    expected: The previous query state is restored and the conversation records the revert.
    provenance: observed
    source: 'react-console:components/console/agent-chat.tsx:undo'
  - 'n': 4
    surface: '/console/{tenantId}/agent'
    action: Find the conversation in the full Jazz AI view.
    capability: CAP-PFM-LLM-019
    expected: The conversation directs the person back to the query for further changes.
    provenance: observed
    source: 'react-console:components/console/agent-chat.tsx'
  - 'n': 5
    surface: '/console/{tenantId}/queries/new'
    action: Reopen Jazz AI beside the query.
    capability: CAP-PFM-LLM-020
    expected: The existing scoped conversation and its messages return.
    provenance: observed
    source: 'react-console:lib/agent/store.ts:createConversation'
alternates:
  - from_step: 2
    condition: The organization cannot admit the refinement request.
    path: The interpreter returns an allowance refusal.
    outcome: The current query remains unchanged.
    provenance: inferred
    source: 'react-console:lib/queries/client.ts:interpret'
    note: >-
      The interpreter rejects the request before the refinement handler applies its result; this implies that
      the current query remains unchanged.
failures:
  - from_step: 4
    condition: The server restarts before the person returns.
    path: The in-memory conversation is lost.
    outcome: The person must start another conversation.
    provenance: observed
    source: 'react-console:lib/agent/store.ts:db'
rules_in_play:
  - BR-CAP-PFM-LLM-020-01
  - BR-CAP-PFM-LLM-020-02
  - BR-CAP-PFM-LLM-020-03
  - BR-CAP-PFM-LLM-020-06
  - BR-CAP-PFM-LLM-019-07
assertions:
  - id: AS-JNY-PFM-LLM-005-01
    statement: Refinement updates the draft while preserving personal columns; saving remains a separate action.
    provenance: observed
    source: 'react-console:components/queries/query-workspace.tsx:refine'
  - id: AS-JNY-PFM-LLM-005-02
    statement: Undo restores the state captured before the latest change.
    provenance: observed
    source: 'react-console:components/console/agent-chat.tsx:undo'
  - id: AS-JNY-PFM-LLM-005-03
    statement: Returning to the query reuses its scoped conversation.
    provenance: observed
    source: 'react-console:lib/agent/store.ts:createConversation'
e2e_policy: required
e2e_reason: >-
  No automated test proves the complete path across the query workspace, side panel and full Jazz AI view.
  Their shared state needs browser verification.
evidence:
  - >-
    react-console at baf6dae382d6f41dce976c7f848667ccc37e076f: components/queries/query-workspace.tsx;
    components/console/agent-chat.tsx; components/agent/**; lib/agent/**; app/api/agent/**;
    app/(console)/console/[tenantId]/agent/page.tsx.
proved_by: []
---

# A staff member refines a query and resumes its Jazz AI conversation

## Story

A staff member asks Jazz AI to refine a query while viewing the draft. The journey follows scoped conversation reuse, draft changes and undo. Later the person finds the conversation in the full view and returns to the query to continue. The prototype demonstrates these interactions in code, but persistence and a complete automated walkthrough remain open.
