Files
pikasTech-unidesk/docs/MDTODO/details/web-sentinel-runtime-reliability/R2.2_Task_Report.md
T
Codex 5b4ad5e9f3
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
Pipelines as Code CI / platform-infra-gitea-nc01- Success
Pipelines as Code CI / unidesk-host- Success
docs: 冻结 Monitor 中心持久化架构
2026-07-12 21:48:13 +02:00

2.0 KiB
Raw Blame History

R2.2 任务报告

完整只读审计见 UniDesk #1871,执行任务为 qt_aef9f6210a0b4b76bb6a84d99cbf8cc4。

实测基线

  • 当前已部署 NC01 SQLite 为 1,277,952 bytes228 runs、242 findings、234 metadata;全部 run 为 blocked。
  • 仅 2 个 run 有 state_dir/report SHA 和 locator,合计 5 个 artifact。
  • 历史 runtime YAML 声明多个私有 SQLite/PVC,但不能在未观测运行实例时把它们伪装为现役迁移源。
  • SQLite 无 TTLartifact bytes 不在数据库中,仍由 PVC/stateDir 与 web-observe GC 管理。

目标持久化模型

  • 复用 config/platform-db/postgres-nc01.yaml 的 NC01 Host PostgreSQL,新建 Monitor 专用 role/database/export/Secret consumer。
  • PG 保存 runner identity、run、finding、run payload、artifact locator 和必要 timeline;时间使用 timestamptzJSON 使用 jsonb,定义 FK、唯一约束和 scope 索引。
  • artifact bytes 继续留 runner PVCPG 保存 node/lane/PVC/stateDir/relativePath/SHA/size 等不可变定位信息。
  • latest 明确定义为所选 scope 内 updated_at DESC、run_id DESC;不再扇出多个 SQLite。
  • 迁移工具只导出/导入已有事实,不合成缺失 run、finding、report 或 artifact。

切换

  1. 从 resolved YAML registry 生成真实迁移源清单并记录 SQLite fingerprint/integrity/schema/rows。
  2. 在受控短停写窗口做一致快照和 artifact existence/SHA 枚举。
  3. 每 source 单 PG transaction 幂等导入,冲突即失败。
  4. 校验行数、关键字段、latest 与 locator 可达性。
  5. 一次发布把 writer/query 切到 PG,并拒绝 SQLite fallback。
  6. 回滚只允许在接管确认前回到冻结 snapshot;确认后不再写回或服务 SQLite。

前置阻塞

受控只读状态显示 NC01 Host PG 服务和既有对象存在,但已有应用凭据 SCRAM 认证失败。实施前必须通过 owning YAML/Secret 流程修复并验证,禁止手改密码或复用其它应用凭据。