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:
@@ -109,6 +109,7 @@ class StartSessionResult:
|
||||
class PreparePreviewCommand:
|
||||
user: User
|
||||
session_id: str
|
||||
expected_version: Optional[int] = None
|
||||
|
||||
|
||||
# [/DEF:PreparePreviewCommand:Class]
|
||||
@@ -134,6 +135,7 @@ class PreparePreviewResult:
|
||||
class LaunchDatasetCommand:
|
||||
user: User
|
||||
session_id: str
|
||||
expected_version: Optional[int] = None
|
||||
|
||||
|
||||
# [/DEF:LaunchDatasetCommand:Class]
|
||||
@@ -344,6 +346,7 @@ class DatasetReviewOrchestrator:
|
||||
)
|
||||
if active_task_id:
|
||||
persisted_session.active_task_id = active_task_id
|
||||
self.repository.bump_session_version(persisted_session)
|
||||
self.repository.db.commit()
|
||||
self.repository.db.refresh(persisted_session)
|
||||
self.repository.event_logger.log_event(
|
||||
@@ -410,6 +413,11 @@ class DatasetReviewOrchestrator:
|
||||
)
|
||||
raise ValueError("Session not found")
|
||||
|
||||
if command.expected_version is not None:
|
||||
self.repository.require_session_version(
|
||||
session, command.expected_version
|
||||
)
|
||||
|
||||
if session.dataset_id is None:
|
||||
raise ValueError("Preview requires a resolved dataset_id")
|
||||
|
||||
@@ -521,6 +529,11 @@ class DatasetReviewOrchestrator:
|
||||
)
|
||||
raise ValueError("Session not found")
|
||||
|
||||
if command.expected_version is not None:
|
||||
self.repository.require_session_version(
|
||||
session, command.expected_version
|
||||
)
|
||||
|
||||
if session.dataset_id is None:
|
||||
raise ValueError("Launch requires a resolved dataset_id")
|
||||
|
||||
@@ -761,6 +774,7 @@ class DatasetReviewOrchestrator:
|
||||
filter_name=str(item.get("filter_name") or f"imported_filter_{index}"),
|
||||
display_name=item.get("display_name"),
|
||||
raw_value=item.get("raw_value"),
|
||||
raw_value_masked=bool(item.get("raw_value_masked", False)),
|
||||
normalized_value=item.get("normalized_value"),
|
||||
source=FilterSource(
|
||||
str(item.get("source") or FilterSource.SUPERSET_URL.value)
|
||||
@@ -788,9 +802,11 @@ class DatasetReviewOrchestrator:
|
||||
|
||||
if session.dataset_id is not None:
|
||||
try:
|
||||
dataset_payload = extractor.client.get_dataset_detail(
|
||||
session_record.dataset_id
|
||||
)
|
||||
dataset_payload = parsed_context.dataset_payload
|
||||
if not isinstance(dataset_payload, dict):
|
||||
dataset_payload = extractor.client.get_dataset_detail(
|
||||
session_record.dataset_id
|
||||
)
|
||||
discovered_variables = extractor.discover_template_variables(
|
||||
dataset_payload
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user