Files
msgexchange-v2/AGENTS.md
T
windyboy 7b7b61f100 feat(processing): 实现自有 PostgreSQL 运营航班权威存储与单事务闭环 (ACM2-28)
- FS1: 增加 Flyway 迁移 V1.1.0__flight_schd.sql,创建 FLIGHT_SCHD 与 SCHD_GEN
- FS2: 实现 FlightSchdRepository 接口及 JdbcFlightSchdRepository 与 StubFlightSchd,增强 JdbcOps 事务管理
- FS3: 扩展 MessageProcessor 事务 2 与按 FLID 点查视图,合并变更、事件与终态入单事务提交
- FS4: SnapshotFlow SQL 化(批处理 upsert、域内差删、SQL CAS 推进与熔断保护),JobExecutor 接入 PG 清场删除
- FS5: 彻底退役 Redis 权威与写路径,移除 FlightRedisClient、Lua 脚本、健康指示器与配置残留
- FS6: 补齐 U09/U29 不变量门禁(崩溃幂等、CAS 防并发、ADFT 存活保障、非 UTC JVM/会话时区无漂移)与 FlywayMigrationTest
- FS7: 交付影子对拍比较内核 FlightStoreDiffTool 与单元测试
- FS8: 全面回改 decision-flight-state、architecture、design、user-stories 权威文档与规范
2026-09-07 16:12:00 +08:00

2.9 KiB

Repository Guidelines

Project Structure & Module Organization

Application code lives under src/main/kotlin/com/gzzn/omms/msgexchange/. Keep changes within the established modules: ingress receives mailbox records, processing owns FIFO decisions, delivery handles outbound events, jobs runs maintenance work, and infra contains persistence, health, and retry adapters (Redis has exited runtime authority per ACM2-28). Runtime configuration and Flyway migrations are in src/main/resources/. Tests mirror production packages under src/test/kotlin/. Architecture and requirements live in docs/; treat docs/legacy/ as reference material, not current design. Local middleware definitions are in compose.yaml and deploy/dev/.

Build, Test, and Development Commands

  • ./gradlew build — compile, test, and package the application.
  • ./gradlew test — run the JUnit 5 test suite.
  • MICRONAUT_ENVIRONMENTS=dev ./gradlew run — start the stub-backed development profile without external services.
  • cp .env.example .env && docker compose up -d — start local PostgreSQL, MySQL, Valkey, and Kafka.
  • docker compose ps — verify middleware health.

Use JDK 25. In restricted environments, point GRADLE_USER_HOME and TMPDIR to writable directories.

Coding Style & Naming Conventions

Use Kotlin conventions with four-space indentation, trailing commas in multiline declarations, and immutable values by default. Types use PascalCase; functions and properties use camelCase; constants use UPPER_SNAKE_CASE. Name tests after behavior, for example MessageProcessorTest and InboxPollerTest. Keep handlers pure: return domain decisions rather than performing Kafka or database writes directly. Preserve the single-writer and strict message FIFO invariants documented in docs/architecture.md.

Testing Guidelines

Tests use JUnit 5, Micronaut Test, and Kotlin Test. Add focused tests beside the affected package. Changes to ordering, retry, identity, snapshot, or delivery behavior must include invariant-level regression tests. Prefer injected clocks and in-memory adapters over sleeps or live infrastructure. Run ./gradlew test before submitting.

Commit & Pull Request Guidelines

History follows Conventional Commit-style subjects such as feat(ref): ..., fix(processing): ..., and docs: ...; include the relevant Plane identifier when applicable. Keep commits scoped and avoid mixing unrelated refactors. Pull requests should explain behavior changes, affected invariants, configuration or migration impact, linked Plane work items, and verification performed. Include request/response examples for API changes; screenshots are only needed for visual documentation changes.

Security & Configuration

Never commit credentials or production endpoints. Use environment variables documented in .env.example. Shared MySQL is an external mailbox boundary: do not add schema migrations or unapproved tables there.