[SEN] 建立 Sense 内部事务 Outbox 与可靠 relay 状态机 #78
Closed
opened 2026-08-14 10:29:14 +08:00 by ila
·
5 comments
No Branch/Tag Specified
dev
feat/183-bell-contact-schedule
docs/171-coordination-e2e-wiki
feature/155-coordination-e2e
docs/168-sync-coordination-wiki
feature/154-coordination-deployment
docs/152-153-connectors
feature/153-event-evidence-connector
feature/152-brain-control
docs/151-machine-identity-acceptance
task/151-machine-identity
docs/150-contract-acceptance
docs/148-149-contract-acceptance
feature/149-runtime-status-contract
feature/150-event-evidence-contract
feature/148-source-config-contract
docs/8-mvp-acceptance
feature/145-sense-e2e-isolation-cleanup
feature/134-bell-independent-e2e
feature/142-bell-ui-shell-startup
feature/140-bell-minimal-admin-menu
feature/138-bell-production-captcha
feature/133-bell-alert-lifecycle
feature/132-bell-rule-alert
feature/131-bell-event-receipt
feature/16-brain-local-events
feature/15-brain-rules
feature/14-brain-vision
feature/13-brain-decode
feature/11-brain-input
main
feat/sense-79-ops-alerts
feat/sense-78-outbox
feat/77-sense-media-shards
feat/76-sense-edge-node-status
feat/75-sense-quota-capacity
feature/74-sense-operations
feature/73-sense-local-events
feature/72-sense-bulk-provisioning
feature/113-record-parallel-acceptance
feature/113-sync-parallel-implementation-docs
feature/71-sense-e2e-regression
feature/62-bell-goadmin-skeleton
feature/10-brain-python-cuda-skeleton
feature/108-sync-devharness
feature/90-sense-root-launcher
feature/106-supervisor-sense
fix/101-sense-layout-shell
feature/104-sense-login-30-days
docs/99-acceptance
feature/99-sense-app-config
feature/70-sense-windows-delivery
fix/95-sense-media-path-constraint
feature/97-sense-password-login
docs/92-acceptance
fix/92-sense-capabilities-jsonb
docs/69-acceptance
feature/69-sense-area
feature/68-sense-liveview
feature/67-sense-mediamtx-reconcile
feature/66-sense-onvif-admission
feature/65-sense-device-credential
feature/64-sense-auth-rbac-audit
feature/61-sense-goadmin-source-baseline
docs/acceptance-batch-20260814
coordination/58-finalize-branch-governance
explore
agent/codex/56-sense-device-edit-payload
agent/codex/54-sense-liveview-on-demand
agent/codex/51-sense-auto-liveview
agent/codex/50-sense-split-camera-credentials
agent/codex/48-sense-onvif-digest
agent/codex/46-sense-env-loader
agent/codex/44-sense-empty-navigation
agent/codex/42-sense-password-length-only
agent/codex/40-sense-password-min-6
agent/codex/37-sense-windows-package
agent/codex/36-bell-docs
agent/codex/9-bell-mvp
agent/codex/21-sense-mvp
agent/codex/28-current-prototypes
agent/codex/5-goadmin-baseline
agent/codex/3-go-admin-ui-reuse
agent/codex/1-collaboration-rules
No results found.
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ila/yovision#78
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
状态
已完成(用户已验收)
基本信息
原始需求与追溯
explore只用于需求、行为与测试对照,不复制自研基础框架。目标
建立 Sense 内部事务 Outbox、幂等投递记录、退避和补投状态机,为未来可选 connector 提供可靠性基础。
范围
在同一数据库事务写入内部 outbox;实现 claim、lease、重试、死信/人工恢复、幂等键、指标和仅限测试的 sink。
非目标
不定义 Brain/Bell 标准事件 schema;不调用 Bell;不建立机器身份;不修改 contracts;不把内部 payload 当正式接口。
GoAdmin 复用要求
复用 #61/#64 建立的 GoAdmin/go-admin-ui 认证、RBAC、审计、Router、Store、Axios、Layout、表格、表单、分页、Dialog、Tag 和权限按钮;实施前读取相关冻结 go-admin-doc 并在评论记录采用方式。业务专用组件必须说明复用缺口并保持整体风格。
写路径
Sense/server/app/sense/outbox/**Sense/server/database/migrations/*outbox*Sense/ui/src/views/sense/outbox/**Sense/ui/src/api/sense/outbox*Sense/tests/outbox/**禁止写入:
Brain/**、Bell/**、contracts/**、根级构建/部署、docs/**、wiki-docs.json。需要共享路径时停止并转协调工单。文档影响
更新对应 Sense Wiki 业务规则、配置、运行、排错和验收页面;本地镜像由单一协调工单同步。
验收标准
验证方式
风险与回退
Outbox 并发错误会重复或丢失。使用数据库事务、lease 和永久幂等键;回退 relay 进程但保留未投递记录。
协同需求摘要
本工单只实现 Sense 内部端口和夹具。涉及 Sense→Brain、Brain→Sense、Sense/Brain→Bell 的正式 schema、机器身份、部署或 E2E 时另建协调工单。
原型 v0.1 待审核
D:\OPC\yovision-visualizations\issue-78\sense-outbox.htmlprototypes/:用户未触发“导出原型 #78”,符合原型导出门禁覆盖范围
非目标与边界
contracts/**。设计与验证证据
原型审核结论
实施基线与路径校正
424855a360bde00321ac4888ace37a8e36f494c4中的router.md、api.md、models.md、pro-gen-code.md。Sense/server/database/migrations/*outbox*,但当前冻结 GoAdmin 派生代码的真实迁移入口是Sense/server/cmd/migrate/migration/version/,因此实现文件为2026082815000_outbox.go;没有创建第二套迁移目录。Brain/**、Bell/**、contracts/**、根级编排或docs/**。正式 connector、共享 schema 和机器身份仍留给协调工单。docs/**镜像按本工单约束留给单一协调工单同步。实施完成,等待用户验收
最终差异
FOR UPDATE SKIP LOCKED、乐观版本、租约恢复、失败退避、死信、人工重新排队和成功幂等。测试与验收证据
go test ./...:通过。TestPostgresConcurrentWorkersDoNotClaimSameMessage通过,验证多 worker 不重复 claim。pnpm lint:0 error;32 条均为现有上游文件 warning,本工单文件无 lint 问题。pnpm test:unit -- --runInBand:31 suites / 74 tests 全部通过。pnpm build:prod:通过,仅有现有依赖/体积 warning。python dev_scripts/harness.py check --strict:通过。python -m unittest discover -s tests -v:48 tests 全部通过。提交与合并
02a5af5e3b872a4e04dabf3c4f3d370e60800afd7274bd42f52feb011b24eb5e291bff799bdcbbbcdev与origin/dev一致,工作区干净。文档影响
已更新并在线回读:
5ae46f327884de113b488f4caeb51934f772a93b637efa818b28c7d041d8799f4ecfbb78a82f49055721f90d1a7ff768b7e84b510a0228044643ab8f21981c220960d793e279ccabe9fdd7d03971b934harness.py sync --check如预期报告本地核心镜像 revision 落后;#78 禁止写docs/**,且工单已明确由单一协调工单统一同步,因此未越界修改镜像。未验证/后续边界
正式 Brain/Bell connector、共享事件 schema、机器身份和跨项目 E2E 不属于 #78,仍需后续协调工单。#78 保持打开并处于“待验收”,等待用户确认。
用户验收结论
dev的实现提交02a5af5e3b872a4e04dabf3c4f3d370e60800afd,PR #122,合并提交7274bd42f52feb011b24eb5e291bff799bdcbbbc