Repository navigation
feat(m1): 实现领域核与基础设施适配器(domain 与 infra/{pg,redis,kafka,httpclient} 及真容器测试) - #9
Merged
Merged
Conversation
awu123-create
changed the base branch from
feat/issue-4-m1-foundation
to
main
November 22, 2026 08:19
…容器测试) 改动内容: - 领域核(internal/domain):新增 Endpoint / Task 聚合、DeliveryAttempt、错误 sentinel、边界常量、Idempotency Key 与 Header 一致性比对、RFC 7230 Header 校验、RFC 7493 jsontext.Value 载荷校验、Payload Signature 签验、状态机与 ParseTaskStatus / ParseAttemptErrorKind,配黑盒单测(package domain_test);移除 M1 未调用的 DeliveryResult.RetryAfter 字段。 - PostgreSQL 适配器(internal/infra/pg):实现私有 PO(统一走 domain.Parse* 校验枚举)、Endpoint CRUD 与 updated_at 乐观锁、幂等创建 Task 与同事务 Outbox、复合乐观锁 CAS 结算、抢锁取消、FOR UPDATE SKIP LOCKED Outbox 抢占派发(显式接收调用方 now)与 LISTEN/NOTIFY 专用连接,配隔离临时库真 PG 测试 store_test.go。 - Redis / Kafka / HTTP 适配器:实现 Redis Execution Lock(SetNX + Lua 验主续期/释锁)及 DB 15 真服务测试;实现 Kafka 幂等生产者、私有 offsetCoord 连续水位消费与真 Broker 恢复测试;实现出站 HTTP Sender(原始字节直发、禁 3xx 重定向、有界响应片段截断、2xx 读体保护;移除 M1 未调用的 parseRetryAfter)及黑盒单测(package httpclient_test)。 - 依赖整理:go.mod / go.sum 同步本切片实际依赖。 影响范围: - 关联 #3、关闭 #5(依赖 #4);仅新增 internal/domain 与 internal/infra/{pg,redis,kafka,httpclient},不改动控制面、调度与入口包。 验证方式: - make fmt && make lint:0 issues - make test(go test -race -short ./...):全部单测通过 - make up 后 make test-integration(go test -race -count=1 ./...):7 个测试包(含真实 PG/Kafka/Redis 测试)全部通过 - make build && pre-commit run --all-files:全部通过 回滚方法: - 执行 git revert <commit-hash> 即可完整回退本切片。
awu123-create
force-pushed
the
feat/issue-5-m1-domain-infra
branch
from
November 22, 2026 08:19
77ff4b5 to
8c7817e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #3
Closes #5
Blocked by #4(base 分支暂指向
feat/issue-4-m1-foundation,待 #8 合入main后变基切回main)交付 Milestone 1 领域核与四个基础设施适配器,并接入真容器适配器测试:
Evidence
9df46b3)仅提供容器编排、Goose 迁移与基础config/logger/metrics包,尚无领域状态机与 PG/Redis/Kafka/HTTP 适配器。make fmt && make lint:0 issues.make test(-short快速单测):7 个包全绿make test-integration(真实 PG / Kafka / Redis 容器):make build与pre-commit run --all-files:全部通过Merge Danger
Door: Two-way
纯新增
internal/domain与internal/infra/*业务及适配器代码,无数据库迁移变更,可通过git revert低成本回退。Blast Radius: Isolated
.golangci.ymldepguard锁定:domain零外部框架依赖,四个infra/*适配器互不依赖且不反向依赖上层。-short下跳过,在非-short下采用 Fail-Closed 策略(连不上服务直接失败)。