feat(ui): add chat-driven dataset review flow
Move dataset review clarification into the assistant workspace and rework the review page into a chat-centric layout with execution rails. Add session-scoped assistant actions for mappings, semantic fields, and SQL preview generation. Introduce optimistic locking for dataset review mutations, propagate session versions through API responses, and mask imported filter values before assistant exposure. Refresh tests, i18n, and spec artifacts to match the new workflow. BREAKING CHANGE: dataset review mutation endpoints now require the X-Session-Version header, and clarification is no longer handled through ClarificationDialog-based flows
This commit is contained in:
@@ -43,6 +43,7 @@ Represents the top-level resumable workflow container for one dataset review/exe
|
||||
| `dashboard_id` | integer \| null | no | Superset dashboard id if imported from dashboard link |
|
||||
| `readiness_state` | enum | yes | Current workflow readiness state |
|
||||
| `recommended_action` | enum | yes | Explicit next recommended action |
|
||||
| `version` | integer | yes | Optimistic-lock version incremented on every persisted session mutation |
|
||||
| `status` | enum | yes | Session lifecycle status |
|
||||
| `current_phase` | enum | yes | Active workflow phase |
|
||||
| `active_task_id` | string \| null | no | Linked long-running task if one is active |
|
||||
@@ -58,9 +59,11 @@ Represents the top-level resumable workflow container for one dataset review/exe
|
||||
- `source_input` must be non-empty.
|
||||
- `environment_id` must resolve to a configured environment.
|
||||
- `readiness_state` and `recommended_action` must always be present.
|
||||
- `version` starts at `0` on session creation and increments monotonically after every successful session mutation.
|
||||
- `user_id` ownership must be enforced for all mutations, unless collaborator roles allow otherwise.
|
||||
- `dataset_id` becomes required before preview or launch phases.
|
||||
- `last_preview_id` must refer to a preview generated from the same session.
|
||||
- Mutating requests must include the caller's last observed session version; mismatches are rejected as optimistic-lock conflicts rather than silently merged.
|
||||
|
||||
### Enums
|
||||
|
||||
@@ -342,6 +345,7 @@ Represents one recovered or user-supplied filter value.
|
||||
| `filter_name` | string | yes | Source filter name |
|
||||
| `display_name` | string \| null | no | User-facing label |
|
||||
| `raw_value` | json | yes | Original recovered value |
|
||||
| `raw_value_masked` | boolean | yes | Whether the stored or exposed raw value has been masked/redacted for assistant or LLM-facing use |
|
||||
| `normalized_value` | json \| null | no | Optional transformed value |
|
||||
| `source` | enum | yes | Origin of the filter |
|
||||
| `confidence_state` | enum | yes | Confidence/provenance class |
|
||||
@@ -370,6 +374,11 @@ Represents one recovered or user-supplied filter value.
|
||||
- `missing`
|
||||
- `conflicted`
|
||||
|
||||
### Validation rules
|
||||
- `raw_value` may be stored for audit and replay, but any context passed into assistant or LLM-facing orchestration must use a masked/redacted representation when the value may contain PII or other sensitive identifiers.
|
||||
- `raw_value_masked=true` is required whenever the exported assistant context omits or redacts sensitive substrings from the original filter payload.
|
||||
- Masking policy must preserve enough structure for mapping and clarification, for example key shape, value type, cardinality hints, and non-sensitive tokens.
|
||||
|
||||
---
|
||||
|
||||
### Entity: `TemplateVariable`
|
||||
@@ -722,6 +731,8 @@ The future API and persistence layers should group models roughly as follows:
|
||||
- `SessionDetail`
|
||||
- `SessionListItem`
|
||||
|
||||
`SessionSummary` and `SessionDetail` should both surface the current `version` so frontend workspace state, collaborator actions, and assistant-driven mutations can use the same optimistic-lock boundary.
|
||||
|
||||
### Review DTOs
|
||||
- `DatasetProfileDto`
|
||||
- `ValidationFindingDto`
|
||||
@@ -761,4 +772,4 @@ The Phase 0 research questions are considered resolved for design purposes:
|
||||
This model is ready to drive:
|
||||
- [`contracts/modules.md`](./contracts/modules.md)
|
||||
- [`contracts/api.yaml`](./contracts/api.yaml)
|
||||
- [`quickstart.md`](./quickstart.md)
|
||||
- [`quickstart.md`](./quickstart.md)
|
||||
|
||||
Reference in New Issue
Block a user