交付三种引擎登记、草稿/已保存连接测试、可逆启用、每源熔断与 Cron 巡检,以及控制台页面;用户确认收尾后标 DONE_LOCAL。 Co-authored-by: Cursor <cursoragent@cursor.com>
2.1 KiB
2.1 KiB
Review Result
Slice
S7 — Cron periodic datasource health checks
Gate class: high-risk; risk score: 4
Stage 1: Boundary And Compliance Review
No blocking findings.
- The implementation stays within the approved S7 areas: Celery Beat registration, Cron validation, health-check orchestration, settings, dependency lock, environment example, and focused tests. No
web/**or migration file was modified for this slice. - It uses the existing Celery Beat application and
croniter; no second scheduler was introduced. - Disabled, invalid-Cron, disabled-source, and open-circuit paths all no-op or skip before probing. The per-source probe rechecks usability, preserving the S6 circuit boundary.
- Failed probes update persisted test outcomes and write a credential-free audit payload. No WeCom send path is present.
- Cron validation explicitly rejects simultaneous restricted DOM/DOW fields, avoiding the known croniter (OR) versus Celery (AND) semantic mismatch. A direct Celery compatibility check also confirmed that unsupported weekday
7is rejected rather than silently scheduled.
Stage 2: Implementation Quality Review
No blocking findings.
- The candidate IDs are collected before network I/O and each source is committed independently, avoiding a long database transaction during probes and preventing one source failure from aborting the batch.
- Tests cover switch and invalid-Cron no-ops, enabled-and-closed selection, mid-loop disable, outcome accounting, audit secret hygiene, circuit opening, Beat registration, configuration parsing, and task execution.
Validation Evidence
- Supplied:
cd services/watchman && uv run pytest—262 passed, including 30 new S7 tests. - Reviewed runtime compatibility: Celery rejects an unsupported
day_of_week=7; the adapter treats it as invalid and does not register a schedule.
Residual Risk
This remains production scheduling/configuration work (risk_score: 4). The test evidence is mock-probe based, so an environment-level Beat/worker/RabbitMQ execution check is still appropriate during later integration validation.
Recommendation
PASS