3 Commits

Author SHA1 Message Date
wangdl
d44fe57b6d fix: ADR-003 补充幂等流程 + 修正队列配置对齐 #288 规格
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 32s
Deploy API Server / backward-compat (push) Has been cancelled
Deploy API Server / deploy (push) Has been cancelled
Deploy API Server / current-integration (push) Has been cancelled
- 新增 §2.4 AiJobService.createJob 幂等流程(findUnique + insert + P2002 catch)
- §3.1 队列配置对齐 Issue #288:ai-interactive attempts=2, backoff=2000ms;ai-background concurrency=1, backoff=5000ms
- 新增设计理由说明与原始规格的偏差原因

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 17:11:18 +08:00
wangdl
947958052a fix: ADR-003 markSucceeded/markFailed/markCancelled 接受可选 tx 参数
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 32s
Deploy API Server / current-integration (push) Successful in 29s
Deploy API Server / backward-compat (push) Successful in 0s
Deploy API Server / deploy (push) Has been cancelled
修正 §1.4 与 §6.2 矛盾:三个终态写入方法现接受可选 Prisma.TransactionClient,
Projector 路径传入 tx 共享事务保证原子性,非 Projector 路径不传 tx 使用独立事务。
lockJob 保持无 tx(CAS 必须立即对其他 Worker 可见)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 17:09:59 +08:00
wangdl
608129be4e docs: ADR-003 冻结统一 Job Engine、Registry、Outbox 与状态机
All checks were successful
Deploy API Server / build-and-unit (push) Successful in 31s
Deploy API Server / current-integration (push) Successful in 28s
Deploy API Server / backward-compat (push) Successful in 0s
Deploy API Server / deploy (push) Successful in 1m3s
冻结 M-AI-03 完整实现契约:
- 状态机:5 状态、6 允许迁移、6 非法迁移、CAS 并发、Heartbeat/Reaper
- Job Definition Registry:TypeScript 接口冻结、注册校验、禁止 switch(jobType)
- 队列:ai-interactive/ai-background/ai-analysis 配置、Payload、Worker 边界
- Outbox:ai.job.enqueue 事件、CAS 先于 queue.add 的领取算法、崩溃窗口分析
- Execution Engine:PREPARE/RESOLVE/EXECUTE/PROJECT/COMPLETE 五阶段管线
- Projector:事务边界、AiJobArtifact 幂等、失败回滚
- API:4 端点、JobStatusResponse 接口、6 公开错误码
- 安全:Credential/Redis/日志/Snapshot/Outbox payload 约束

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 17:06:13 +08:00