| event_payload |
{"ref":"refs/heads/main","befo {"ref":"refs/heads/main","before":"7c4b197f018b02f5ed675758af3f5be5dbd1de02","after":"601955837eb8caa25a91a2c2da96d9a06f8ea455","compare_url":"https://gitea.g-hi.com/luoanwu/juhai-ai-work-order-system/compare/7c4b197f018b02f5ed675758af3f5be5dbd1de02...601955837eb8caa25a91a2c2da96d9a06f8ea455","commits":[{"id":"601955837eb8caa25a91a2c2da96d9a06f8ea455","message":"fix(ticket): 通知投递补认领凭据与显式重试上限\n\n领取此前只看 PENDING/FAILED,且完成回写只按 status=\"SENDING\" 匹配:进程崩在 deliver() 里的那行\n会永远停在 SENDING,没有任何路径能把它捡回来。另有一处重试上限双份常数——领取查询没有上限,\n死信判定走的是 @repo/notification-delivery 的包默认 3,两边靠巧合对齐,改任一边即静默不一致。\n\n- notifications 表加 claim_owner / claim_expires_at(两后端各一份 schema 与迁移),领取写认领、\n 完成按 claimOwner 回写并清空,与其余两个消费仓的 claim 列同形。\n- 领取前先把预算烧完的行(含认领过期仍卡在 SENDING 的)扫成死信;领取查询新增「SENDING 且\n 认领已过期」一支,并显式限定 attempts \u003c NOTIFICATION_MAX_ATTEMPTS。\n- 重试上限收敛为一个常数,同时进领取查询、死信清扫和 decideNotificationFailure。\n- 迁移不建索引:本仓迁移红线把非 CONCURRENTLY 的 CREATE INDEX 判为高危 DDL(首版实测被 exit 1\n 拦下),过期 SENDING 那一支由既有 notifications_tenant_status_next_attempt_idx 的\n (tenant_id, status) 前缀服务;要加 (tenant_id, status, claim_expires_at) 须按\n expand→migrate→contract 单独提,不混在这条加列迁移里。\n- packages/notification-delivery:未知异常不再默认可重试(模板体检失败这类确定性错误重发多少次\n 都是同一个结果),并补 NotificationTemplateError 的消息分支——缺它时 lastError 会把模板错误\n 写成「供应商不可用」。与报价仓的同名包语义就此一致。\n\n验证:pnpm check 全绿(15 道静态门禁 + lint + typecheck,含 write-guard / dual-backend /\nmigrations / write-chain);包单测 9/9。领取与清扫 SQL 在本机 Postgres 建临时库实跑:清扫只命中\n「预算烧完 + 认领过期」那一行,领取只取到「到期 PENDING」与「认领过期 SENDING」,正确跳过活认领、\n他租户与 next_attempt_at 未到的行,临时库跑完已删。\n\n未跑:两后端新增的认领回收验收用例(NestJS/Fastify 逐条镜像)属 check:runtime 级别,需 pgvector\n的真实库 + Redis + 附件基础设施,本机 PG 无 pgvector,未硬凑环境,故本次不声称该级证据。\n\nCo-Authored-By: Claude Opus 5 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/juhai-ai-work-order-system/commit/601955837eb8caa25a91a2c2da96d9a06f8ea455","author":{"name":"juhailaoluo pro","email":"hillao@juhailaoluodeMacBook-Pro.local","username":""},"committer":{"name":"juhailaoluo pro","email":"hillao@juhailaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-09-18T16:06:27-07:00","added":["apps/api-fastify/prisma/migrations/20260918090000_notification_delivery_claim/migration.sql","apps/api-nestjs/prisma/migrations/20260918090000_notification_delivery_claim/migration.sql"],"removed":[],"modified":["apps/api-fastify/prisma/schema.prisma","apps/api-fastify/src/modules/ticket-operations/ticket-operations.service.ts","apps/api-fastify/test/http.acceptance.test.ts","apps/api-nestjs/prisma/schema.prisma","apps/api-nestjs/src/ticket-operations/ticket-operations.service.ts","apps/api-nestjs/test/http.acceptance.test.ts","packages/notification-delivery/src/index.test.ts","packages/notification-delivery/src/index.ts"]}],"total_commits":0,"head_commit":{"id":"601955837eb8caa25a91a2c2da96d9a06f8ea455","message":"fix(ticket): 通知投递补认领凭据与显式重试上限\n\n领取此前只看 PENDING/FAILED,且完成回写只按 status=\"SENDING\" 匹配:进程崩在 deliver() 里的那行\n会永远停在 SENDING,没有任何路径能把它捡回来。另有一处重试上限双份常数——领取查询没有上限,\n死信判定走的是 @repo/notification-delivery 的包默认 3,两边靠巧合对齐,改任一边即静默不一致。\n\n- notifications 表加 claim_owner / claim_expires_at(两后端各一份 schema 与迁移),领取写认领、\n 完成按 claimOwner 回写并清空,与其余两个消费仓的 claim 列同形。\n- 领取前先把预算烧完的行(含认领过期仍卡在 SENDING 的)扫成死信;领取查询新增「SENDING 且\n 认领已过期」一支,并显式限定 attempts \u003c NOTIFICATION_MAX_ATTEMPTS。\n- 重试上限收敛为一个常数,同时进领取查询、死信清扫和 decideNotificationFailure。\n- 迁移不建索引:本仓迁移红线把非 CONCURRENTLY 的 CREATE INDEX 判为高危 DDL(首版实测被 exit 1\n 拦下),过期 SENDING 那一支由既有 notifications_tenant_status_next_attempt_idx 的\n (tenant_id, status) 前缀服务;要加 (tenant_id, status, claim_expires_at) 须按\n expand→migrate→contract 单独提,不混在这条加列迁移里。\n- packages/notification-delivery:未知异常不再默认可重试(模板体检失败这类确定性错误重发多少次\n 都是同一个结果),并补 NotificationTemplateError 的消息分支——缺它时 lastError 会把模板错误\n 写成「供应商不可用」。与报价仓的同名包语义就此一致。\n\n验证:pnpm check 全绿(15 道静态门禁 + lint + typecheck,含 write-guard / dual-backend /\nmigrations / write-chain);包单测 9/9。领取与清扫 SQL 在本机 Postgres 建临时库实跑:清扫只命中\n「预算烧完 + 认领过期」那一行,领取只取到「到期 PENDING」与「认领过期 SENDING」,正确跳过活认领、\n他租户与 next_attempt_at 未到的行,临时库跑完已删。\n\n未跑:两后端新增的认领回收验收用例(NestJS/Fastify 逐条镜像)属 check:runtime 级别,需 pgvector\n的真实库 + Redis + 附件基础设施,本机 PG 无 pgvector,未硬凑环境,故本次不声称该级证据。\n\nCo-Authored-By: Claude Opus 5 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/juhai-ai-work-order-system/commit/601955837eb8caa25a91a2c2da96d9a06f8ea455","author":{"name":"juhailaoluo pro","email":"hillao@juhailaoluodeMacBook-Pro.local","username":""},"committer":{"name":"juhailaoluo pro","email":"hillao@juhailaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-09-18T16:06:27-07:00","added":["apps/api-fastify/prisma/migrations/20260918090000_notification_delivery_claim/migration.sql","apps/api-nestjs/prisma/migrations/20260918090000_notification_delivery_claim/migration.sql"],"removed":[],"modified":["apps/api-fastify/prisma/schema.prisma","apps/api-fastify/src/modules/ticket-operations/ticket-operations.service.ts","apps/api-fastify/test/http.acceptance.test.ts","apps/api-nestjs/prisma/schema.prisma","apps/api-nestjs/src/ticket-operations/ticket-operations.service.ts","apps/api-nestjs/test/http.acceptance.test.ts","packages/notification-delivery/src/index.test.ts","packages/notification-delivery/src/index.ts"]},"repository":{"id":82,"owner":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"law@g-hi.com","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"name":"juhai-ai-work-order-system","full_name":"luoanwu/juhai-ai-work-order-system","description":"巨嗨 AI 工单系统:治理型工单核心与 Digital Employee OS 产品适配层","empty":false,"private":true,"fork":false,"template":false,"mirror":false,"size":1867,"language":"","languages_url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/juhai-ai-work-order-system/languages","html_url":"https://gitea.g-hi.com/luoanwu/juhai-ai-work-order-system","url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/juhai-ai-work-order-system","link":"","ssh_url":"git@gitea.g-hi.com:luoanwu/juhai-ai-work-order-system.git","clone_url":"https://gitea.g-hi.com/luoanwu/juhai-ai-work-order-system.git","original_url":"","website":"","stars_count":0,"forks_count":0,"watchers_count":1,"branch_count":1,"open_issues_count":0,"open_pr_counter":0,"release_counter":0,"default_branch":"main","archived":false,"created_at":"2026-08-26T09:08:57+08:00","updated_at":"2026-09-15T15:55:21+08:00","archived_at":"1970-01-01T08:00:00+08:00","permissions":{"admin":true,"push":true,"pull":true},"has_code":true,"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"all","has_releases":true,"has_packages":true,"has_actions":true,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":true,"allow_rebase_update":true,"allow_manual_merge":false,"autodetect_manual_merge":false,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":true,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","topics":[],"licenses":[]},"pusher":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"sender":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"}}... |