feat(system): process heartbeat + /system/health, engine runs business fields (W9-I)

- process_heartbeat / process_heartbeat_sample (0034): api / worker / worker:agent / all
  upsert every 15s (event loop lag last/max, concurrency, running runs, SSE connections, memory)
- GET /system/health (admin): processes with 45s stale flag, SSE, DB latency/size/connections,
  disks (DATA_DIR / library roots / download dirs, cache thresholds), mount sentinel checks
  with IO timeout, engine pending/oldest/24h failure rate, schedules
- GET /system/health/history?hours=: bucketed lag / running / SSE series
- /engine/runs and /engine/runs/{id}: business {kind, refId, title, triggeredBy} joined from
  run input / task / agent_run / tasks_run_meta / outbox; businessKind / businessRefId filters
- docs/runbook/ops.md: field meanings and alert thresholds

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-28 15:23:37 +08:00
1 parent 46d37d87fe
commit e8745115f4
17 files changed
+1789 -4

No files matched your search

+6
View File
@@ -102,6 +102,9 @@ const EXPECTED_TABLES = [
// W9-D 规则组(0033)
"rule_group",
"rule_atom",
// W9-I 进程心跳(0034)
"process_heartbeat",
"process_heartbeat_sample",
].sort();
/** 不走 entityTable() 的表:追加型/引擎自有表,没有 uuid id + created_at/updated_at 三件套 */
@@ -118,6 +121,9 @@ const NON_ENTITY_TABLES = [
// 稳定 key 作主键 / 只追加的运行历史
"scheduled_job",
"scheduled_job_run",
// 进程心跳:instance_id 主键 / 只追加的采样
"process_heartbeat",
"process_heartbeat_sample",
];
describe.skipIf(skip)("schema migrations (real PG)", () => {