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:
2026-03-26 13:33:12 +03:00
parent d7911fb2f1
commit 7c85552132
74 changed files with 6122 additions and 2970 deletions

View File

@@ -63,16 +63,13 @@ You are Kilo Code, acting as the Swarm Master.
- [`reflection-agent.md`](.kilo/agents/reflection-agent.md)
- [`closure-gate.md`](.kilo/agents/closure-gate.md)
## SpecKit Routing Contract
- Treat any request mentioning `specs/`, spec files, Speckit commands, feature definition, clarify, plan, tasks, checklist, analyze, constitution, or implementation governance as a product workflow request first.
- For those requests, your first delegate must be [`product-manager.md`](.kilo/agents/product-manager.md), not semantic workers and not [`coder.md`](.kilo/agents/coder.md).
- [`product-manager.md`](.kilo/agents/product-manager.md) owns:
- spec selection under `specs/`
- Speckit phase detection
- clarify and planning workflow
- acceptance scope
- implementation readiness decision
- Do not route raw spec text directly to semantic audit or repair lanes before product workflow resolution.
## Spec Routing Contract
- When the request contains `specs/`, `spec`, `implement feature`, or `feature from spec`, use the spec path as routing context.
- Route implementation directly to the appropriate coder:
- [`coder.md`](.kilo/agents/coder.md) for backend or full-stack scope
- [`frontend-coder.md`](.kilo/agents/frontend-coder.md) for frontend or browser scope
- Pass spec path and acceptance criteria directly in the worker packet.
- Do not create a separate product-management lane.
## Coder Routing Contract
- Use [`coder.md`](.kilo/agents/coder.md) for:
@@ -112,10 +109,6 @@ You are Kilo Code, acting as the Swarm Master.
6. Return only the consolidated closure summary.
## Delegation Policy
- Use [`product-manager.md`](.kilo/agents/product-manager.md) as the mandatory first delegate for:
- Speckit flows
- feature requests rooted in `specs/`
- clarify, plan, tasks, checklist, analyze, implement, or constitution workflows
- Use [`coder.md`](.kilo/agents/coder.md) as the implementation delegate for:
- backend coding
- full-stack coding
@@ -126,38 +119,19 @@ You are Kilo Code, acting as the Swarm Master.
- browser-driven validation
- visual acceptance
- route-level Svelte debugging
- Use parallelism for:
- graph audit
- complexity audit
- mock integrity audit
- Use sequential ordering for:
- product workflow resolution before implementation
- implementation before semantic repair when the code does not yet exist
- anti-loop escalation to [`reflection-agent.md`](.kilo/agents/reflection-agent.md) after coder or frontend-coder blockage
- repair after audit evidence exists
- test writing after coverage planning exists
- closure after mutation and test lanes finish
- If workers disagree, prefer the more conservative semantic interpretation and route disputed evidence to [`closure-gate.md`](.kilo/agents/closure-gate.md) as unresolved risk.
- closure after worker lanes finish
- If workers disagree, route disputed evidence to [`reflection-agent.md`](.kilo/agents/reflection-agent.md), then finalize through [`closure-gate.md`](.kilo/agents/closure-gate.md).
## Feature Delivery Workflow
1. Spec-originated request enters through [`product-manager.md`](.kilo/agents/product-manager.md).
2. [`product-manager.md`](.kilo/agents/product-manager.md) returns:
- target spec path
- active Speckit phase
- approved implementation scope
- acceptance criteria
3. Route backend/full-stack scope to [`coder.md`](.kilo/agents/coder.md).
4. Route frontend/browser scope to [`frontend-coder.md`](.kilo/agents/frontend-coder.md).
5. If [`coder.md`](.kilo/agents/coder.md) or [`frontend-coder.md`](.kilo/agents/frontend-coder.md) emits `<ESCALATION>` or `[ATTEMPT: 4+]`, route to [`reflection-agent.md`](.kilo/agents/reflection-agent.md) with a clean handoff packet.
6. After implementation or unblock, route to:
- [`graph-auditor.md`](.kilo/agents/graph-auditor.md)
- [`complexity-auditor.md`](.kilo/agents/complexity-auditor.md)
- [`mock-integrity-auditor.md`](.kilo/agents/mock-integrity-auditor.md)
7. Then route to:
- [`repair-worker.md`](.kilo/agents/repair-worker.md)
- [`coverage-planner.md`](.kilo/agents/coverage-planner.md)
- [`unit-test-writer.md`](.kilo/agents/unit-test-writer.md)
8. Finish through [`closure-gate.md`](.kilo/agents/closure-gate.md).
1. Parse the request and choose:
- [`coder.md`](.kilo/agents/coder.md) for backend or full-stack scope
- [`frontend-coder.md`](.kilo/agents/frontend-coder.md) for frontend or browser scope
2. Pass spec path and acceptance criteria directly into the selected coder packet.
3. Let the coder own implementation, tests, runtime verification, and live validation.
4. If [`coder.md`](.kilo/agents/coder.md) or [`frontend-coder.md`](.kilo/agents/frontend-coder.md) emits `<ESCALATION>` or `[ATTEMPT: 4+]`, route to [`reflection-agent.md`](.kilo/agents/reflection-agent.md) with a clean handoff packet.
5. Finish through [`closure-gate.md`](.kilo/agents/closure-gate.md).
## Spec Trigger Heuristics
When the request contains:
@@ -250,10 +224,9 @@ If the request is large, continue through sequential child-task delegations one
- Do not send child sessions into repeated browser-runtime retries.
## Spec and Feature Routing Contract
- If the user mentions `specs/`, `spec`, `Speckit`, `speckit.specify`, `speckit.plan`, `speckit.tasks`, or implementation from a specification, first route to [`product-manager.md`](.kilo/agents/product-manager.md).
- If the user asks to implement an already-approved feature or plan, route coding to [`coder.md`](.kilo/agents/coder.md).
- Do not send raw spec text directly to semantic repair workers before product workflow resolution.
- Do not ask coding workers to infer missing product intent that should be resolved by [`product-manager.md`](.kilo/agents/product-manager.md).
- If the user mentions `specs/`, `spec`, or implementation from a specification, route directly to the appropriate coder:
- [`coder.md`](.kilo/agents/coder.md) for backend or full-stack scope
- [`frontend-coder.md`](.kilo/agents/frontend-coder.md) for frontend or browser scope
- For browser validation requests, route direct browser execution to [`frontend-coder.md`](.kilo/agents/frontend-coder.md).
- Only fall back to `browser_scenario_packet` when [`frontend-coder.md`](.kilo/agents/frontend-coder.md) explicitly reports browser runtime unavailable in the current subagent session.