Skip to content

feat(data-agent): add evidence-backed autonomous analysis#26

Open
LienJack wants to merge 4 commits into
mainfrom
codex/docs-text2sql-architecture-review
Open

feat(data-agent): add evidence-backed autonomous analysis#26
LienJack wants to merge 4 commits into
mainfrom
codex/docs-text2sql-architecture-review

Conversation

@LienJack

Copy link
Copy Markdown
Owner

Summary

Text2SQL 现在具备以证据为中心的自治分析闭环:从目标编译、Semantic/RAG 取证、Plan Ledger、受控执行、Validation、Correction 到 runId replay,均可生成可审计的 Artifact 与 Receipt。该能力保留现有 Text2SQL v2 运行缝合点,并把真实业务 Outcome 与合成评测严格分离。

本 PR 同时交付 Data Agent 自治分析平台和 Text2SQL 准确率闭环,因为二者共享同一套可信语义、执行许可、Receipt chain、修正传播与回放一致性边界。

Architecture

flowchart TB
  UI["Analysis Workspace"] --> API["Analysis API and SSE"]
  API --> Ledger["PostgreSQL Analysis Ledger"]
  API --> Workflow["Durable Workflow"]
  Workflow --> Workers["Research, Text2SQL, Calculation, Critique, Report Workers"]
  Workers --> Guard["Commit Guard"]
  Guard --> Ledger
  Ledger --> Artifacts["Artifacts, Claims, Receipts, ReleaseManifest"]
  Artifacts --> Replay["runId Replay and Save View"]
  Ledger --> Correction["Revision-based Correction"]
  Correction --> Workflow
Loading

关键设计边界:

  • PostgreSQL Analysis Ledger 是 Task、Revision、Attempt、Event、Artifact、Receipt 与 Manifest 的权威来源;Temporal、SSE、UI 与 OTel 仅承担编排或投影职责。
  • Worker 只能提出 candidate,Commit Guard 负责提交;Correction 追加 Revision,传播 stale/invalidated,并保留旧 runId replay。
  • Text2SQL 继续使用 Text2SQLWorkflowRunner -> RunV2LangGraphStage -> Text2SqlV2LangGraphRunnerService,在其周围补充 Semantic Context Pack、Plan、七层 Receipt、Execution Permit、结果 Oracle 与最多 2 次 allowlisted AST 修复。
  • 网页内容按 untrusted 处理,Report 只从 Claim projection 生成;Memory/Skill 仅可由治理后的 active KnowledgeAsset 提升。
  • shadow 模式只采集候选证据,enforce 才阻断交付。合成 focused/eval 结果不能替代真实签名 Outcome。

What changed

  • 新增自治分析 API、任务状态机、durable orchestration、worker registry、Command Outbox、Artifact/Claim/Receipt/Manifest 持久化与恢复回放。
  • 新增 Research source policy、snapshot、coverage、prompt-injection 防护,以及 KnowledgeAsset promotion/rollback。
  • 加强 Semantic/RAG、Plan Ledger、Validation、Correction、bounded execution、accuracy Receipt 与 sync/stream/save-view/replay parity。
  • 新增 /analysis 工作台及共享 analysis-task-protocol,覆盖任务创建、进度、证据、冲突、报告和控制操作。
  • 新增 Text2SQL accuracy gate、Data Agent release gate、恢复 runbook、专项标准、CI 与 Temporal/PostgreSQL 本地基础设施。
  • 刷新 graphify 架构图谱,反映自治分析和准确率闭环的当前结构。

Verification

  • Root:format:checktestbuild 通过。
  • Backend:226 个 suite 通过,858 个 test 通过,1 个跳过;Prisma Client 生成及 21 个 migration 空库回放通过。
  • Frontend:59 个测试文件、264 个测试通过,/analysis production build 与桌面/375px 浏览器验收通过。
  • Text2SQL focused strict coverage 通过:line 87.35%,branch 74.91%;v2 eval strict 为 direct_v2_go
  • no-legacy、governance terminology、backend capability boundary 门禁通过。
  • Text2SQL accuracy gate 与 Data Agent release gate 正确保持 HOLD:当前仍缺少受信签名的真实 Text2SQL Outcome、代表性 analyst Outcome,以及相应 owner approval;本 PR 不将工程测试结果表述为生产发布批准。

Compound Engineering
Codex

LienJack added 4 commits July 18, 2026 12:25
Build a durable analysis ledger and governed worker pipeline around the existing Text2SQL v2 runtime. Add signed outcome release gates, artifact-only replay, bounded research, KnowledgeAsset promotion, and the analyst workspace while preserving HOLD without real evidence.
Regenerate the repository knowledge graph after the Text2SQL accuracy and autonomous analysis architecture changes. The HTML visualization is omitted because the graph now exceeds the configured node limit.
Preserve the architecture review document allowlist while keeping generated graph artifacts ignored after the interrupted stash application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant