refactor(ng2): add diagnostics workflow module as single UI-facing seam

诊断区收敛为 DiagnosticsWorkflow 深 module(Candidate 03,issue #43):事实
采样、轮询代际、raw 日志投影、报告准备与导出完成登记集中一个 seam,视图只
负责生命周期触发、呈现、剪贴板、保存面板与报告文件写入。侧栏与详情共享同
一份安全摘要;收集只读,不触碰目录、凭据、runtime 与系统代理设置。

目录不再把原始 ConfigurationCatalog 写入诊断快照:CatalogWorkflow 只输出
domain-neutral 聚合事实(计数 + 已知无效数),报告 builder 只接受已裁剪的
report facts。事件导出改为显式白名单派生(diagnosticReportLine):自由
detail、主机公布地址与 runtime 错误原文一律清洗,数量/端口/领域点名原因
保留;新增事件漏 case 无法编译。raw GUI 事件行与 wrapper agent.log 尾部仅
经显式查看/复制提供,永不进入报告(ADR-0006)。导出完成事件只在用户选择的
文件实际写入成功后登记。

RuntimeEventStore 事件改为携带封闭枚举原值,渲染发生在呈现边缘(白名单清
洗只可能作用于原值)。测试:新增 workflow interface 覆盖投毒导出、白名单、
raw/报告分离、缺失标注、只读、代际覆盖与取消;ADR-0006 与 CONTEXT.md 术语
同步入库。
This commit is contained in:
Qiu Yuzhou
2026-09-22 19:22:31 +08:00
parent 3df1624d91
commit fd9be86149
15 changed files with 994 additions and 214 deletions
@@ -0,0 +1,18 @@
# Keep raw diagnostic logs separate from diagnostic reports
## Status
Accepted.
The diagnostic log view may expose raw wrapper `agent.log` text and raw GUI event detail only through an explicit view/copy action, while a diagnostic report is built exclusively from safe diagnostic facts and allowlisted, field-cleaned event projections. Reports never include raw logs, the configuration catalog, server addresses or remarks, credential references, URLs or tokens, runtime JSON, paths, or free-form failure detail. This preserves useful local troubleshooting without turning user-shared export files into an uncontrolled disclosure channel.
## Considered options
- Include the raw log tail in the exported report: rejected because wrapper output and future event details are not guaranteed to satisfy the report's sensitive-information policy.
- Remove raw log viewing entirely: rejected because explicit local viewing and copying is useful for troubleshooting and is a narrower exposure than an exported report.
## Consequences
- Diagnostics must maintain separate raw-log and safe-report projections.
- Adding a new event field does not automatically make it eligible for export; the report allowlist must be updated deliberately.
- Export completion is recorded only after the user-selected report file is successfully written.