Skip to content

[CSV exports] Support universal CSV generation across all paths and file types #1071

Description

@paullizer

Summary

Provide one universal CSV-generation capability that works across Chat Search, ordinary Chat, streaming responses, selected agents, Analyze, Compare, workflows, and source-free prompts. CSV generation must not depend on whether the input is a PDF, Office document, text, image/media-derived evidence, CSV/XLSX, mixed selected files, a single file, many files within configured limits, or no workspace files.

User Value

Users need a reliable downloadable CSV whenever they ask for structured CSV output. The current behavior varies by route and source type, so equivalent requests can return inline text, a partial relevance-bounded result, or no artifact at all.

Current Failure

  1. Select multiple workspace documents, for example 16 PDFs.
  2. Leave the chat document action set to Search.
  3. Ask: turn these into a single csv.
  4. The response can say it contains one row per retrieved document and render inline CSV, but it does not reliably cover every selected file or attach a downloadable CSV artifact.

The shared CSV-intent predicate currently accepts turn these into a csv but rejects turn these into a single csv, so the exact request above does not invoke the artifact publisher.

Proposed Behavior

  • Treat CSV as an output capability shared by all response producers, not as a tabular-file-only or Analyze-only feature.
  • Recognize natural CSV requests including single CSV, combined CSV, one CSV, download/export/save CSV, and equivalent phrasing.
  • For explicit selected sources, preserve the path's evidence semantics while making the requested CSV coverage explicit. When the request requires all selected sources, do not silently export only relevance hits.
  • When a requested row shape or schema is ambiguous, ask one durable clarification rather than guessing whether rows represent files, documents, or extracted records.
  • For larger requests, use a durable background job and publish the authorized completed artifact to the originating chat. Small results may publish immediately.
  • For source-free requests, convert validated model-produced structured rows into the same downloadable CSV artifact contract.
  • Produce a valid downloadable CSV or an explicit failure/partial-coverage result; never fabricate unprocessed rows.

Acceptance Criteria

  • A request such as turn these into a single csv creates a downloadable CSV when the response contains valid structured rows.
  • CSV intent works for Chat Search, ordinary and streaming Chat, selected agents, Analyze, Compare, workflows, and source-free prompts.
  • The capability works with every supported queryable input format through its native evidence adapter, including PDF, Office/text, image/media-derived evidence, CSV/XLSX, and mixed selections.
  • Explicit selected-source requests disclose and enforce the requested coverage instead of silently reducing to relevance hits.
  • Ambiguous row granularity/schema produces one resumable clarification; explicit row/schema instructions bypass it.
  • Large work is durable, cancellable, reauthorizes source access and revision before publication, and exposes the completed download without duplicating artifacts.
  • CSV output preserves current formula-injection protection, safe headers, quoted/multiline values, and authorized download controls.
  • Partial, failed, unsupported, unresolved, canceled, and source-version-changed inputs are surfaced with per-source coverage and do not produce misleading complete results.
  • Functional coverage validates no-source, one source, multi-source, mixed formats, all response paths, exact single CSV phrasing, clarification, background completion, cancellation, authorization loss, and downloads.

Notes

  • This is a distinct output-capability issue, not a subtask of mixed-source orchestration issue [Mixed-source orchestration] Phase 6: Harden and roll out native mixed-source processing #1061.
  • Existing artifacts and downloads are already generic enough to reuse; the main remediation is shared intent/finalization and source-coverage coordination.
  • Focused existing CSV serializer tests passed 23/23. The current lossless-analysis artifact test needs harness maintenance because its AST loader does not inject the new cancellation helper and it has an outdated version pin.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions