219 lines
9.0 KiB
Markdown
219 lines
9.0 KiB
Markdown
# P1R7b Source Owner Propagation 真实链路
|
||
|
||
日期:2026-06-06
|
||
|
||
## 结论
|
||
|
||
P1R-7b Task 7 fresh implementer 最终验证、阶段留痕与交接已执行,状态为 `DONE`。
|
||
|
||
本轮只把 AI source owner terminal event -> AI publish outbox -> AI worker -> EventsPublishApi -> `muse_unified_event` -> SSE 可见链路的 evidence 推进到 `needs_verification` 证据层;不代表 Events、P1R-7 或 Market completed approval。
|
||
|
||
本轮不提交、不 push、不清理或回退 dirty baseline;除本文档与 `docs/agent-specs/.agent` 外,不新增实现改动。
|
||
|
||
## 已验证事实
|
||
|
||
### 工作区与保护文件
|
||
|
||
- 正确 worktree:`/Users/qingse/.config/superpowers/worktrees/oh-my-muse/dev-1.0.0`。
|
||
- 分支:`dev/1.0.0`,`git status --short --branch` 显示 `## dev/1.0.0...origin/dev/1.0.0`。
|
||
- 初始与最终受保护文件定向 status/diff 均无输出:
|
||
- `docs/api-contracts/market/openapi.yaml`
|
||
- `docs/api-contracts/ai/openapi.yaml`
|
||
- `docs/api-contracts/knowledge/openapi.yaml`
|
||
- `docs/api-contracts/events/openapi.yaml`
|
||
- `muse-cloud/scripts/p1r-audit-api-coverage.py`
|
||
- `docs/superpowers/reports/p1r-api-coverage.json`
|
||
- `docs/superpowers/reports/p1r-api-coverage.md`
|
||
|
||
### Reactor build
|
||
|
||
从 `muse-cloud` 执行:
|
||
|
||
```bash
|
||
JAVA_HOME=$(/usr/libexec/java_home -v 21) PATH="$JAVA_HOME/bin:$PATH" mvn -o clean install -DskipTests -Dspring-boot.repackage.skip=true -pl muse-server -am
|
||
```
|
||
|
||
结果:exit 0,`BUILD SUCCESS`,47/47 reactor modules success,Finished at `2026-06-06T15:42:09+08:00`。
|
||
|
||
### AI / Events focused tests
|
||
|
||
执行:
|
||
|
||
```bash
|
||
JAVA_HOME=$(/usr/libexec/java_home -v 21) PATH="$JAVA_HOME/bin:$PATH" mvn -pl muse-module-ai/muse-module-ai-server,muse-module-events/muse-module-events-server -am -Dtest=MuseAiEventPublishOutboxMapperTest,MuseAiEventPublishOutboxServiceTest,MuseAiEventPublishWorkerTest,MuseAiRuntimeProjectionServiceTest,MuseJobServiceTest,EventsPublishServiceTest,EventsStreamServiceTest -Dsurefire.failIfNoSpecifiedTests=false test
|
||
```
|
||
|
||
结果:exit 0。surefire XML 证明以下目标类实际运行且 test count > 0:
|
||
|
||
| 测试类 | tests | failures | errors | skipped |
|
||
|---|---:|---:|---:|---:|
|
||
| `MuseAiEventPublishOutboxMapperTest` | 5 | 0 | 0 | 0 |
|
||
| `MuseAiEventPublishOutboxServiceTest` | 11 | 0 | 0 | 0 |
|
||
| `MuseAiEventPublishWorkerTest` | 20 | 0 | 0 | 0 |
|
||
| `MuseAiRuntimeProjectionServiceTest` | 5 | 0 | 0 | 0 |
|
||
| `MuseJobServiceTest` | 25 | 0 | 0 | 0 |
|
||
| `EventsPublishServiceTest` | 17 | 0 | 0 | 0 |
|
||
| `EventsStreamServiceTest` | 9 | 0 | 0 | 0 |
|
||
|
||
AI/Events focused tests 合计 87 个,failures/errors/skipped 均为 0。
|
||
|
||
### P1R mixed gates
|
||
|
||
执行:
|
||
|
||
```bash
|
||
JAVA_HOME=$(/usr/libexec/java_home -v 21) PATH="$JAVA_HOME/bin:$PATH" mvn -pl muse-server -am -Dtest=P1rAiEventsPublishMigrationSqlTest,P1rAiEventsPublishDependencyTest,P1rAiEventsPublishEndToEndTest,P1rApiCoverageReportTest,P1rEventsRealApiGateTest,P1rEventsRouteOwnershipTest,P1rAiRealApiGateTest,P1rAiRouteOwnershipTest -Dsurefire.failIfNoSpecifiedTests=false test
|
||
```
|
||
|
||
结果:exit 0。surefire XML 证明以下目标类实际运行:
|
||
|
||
| 测试类 | tests | failures | errors | skipped |
|
||
|---|---:|---:|---:|---:|
|
||
| `P1rAiEventsPublishMigrationSqlTest` | 4 | 0 | 0 | 0 |
|
||
| `P1rAiEventsPublishDependencyTest` | 2 | 0 | 0 | 0 |
|
||
| `P1rAiEventsPublishEndToEndTest` | 4 | 0 | 0 | 0 |
|
||
| `P1rApiCoverageReportTest` | 5 | 0 | 0 | 0 |
|
||
| `P1rEventsRealApiGateTest` | 5 | 0 | 0 | 0 |
|
||
| `P1rEventsRouteOwnershipTest` | 4 | 0 | 0 | 0 |
|
||
| `P1rAiRealApiGateTest` | 6 | 0 | 0 | 0 |
|
||
| `P1rAiRouteOwnershipTest` | 7 | 0 | 0 | 0 |
|
||
|
||
P1R mixed gates 合计 37 个,failures/errors/skipped 均为 0。
|
||
|
||
### Flyway `_test`
|
||
|
||
使用 `~/.config/muse-repo/infra.env`,测试库名为 `muse_p1r7b_events_publish_test`,符合必须以 `_test` 结尾的保护规则。
|
||
|
||
执行命令包含:
|
||
|
||
```bash
|
||
-Dtest=P1rAiEventsPublishFlywayMigrationIT
|
||
-Dflyway.postgresql.transactional.lock=false
|
||
-Dp1r.flyway.locations=filesystem:sql/muse
|
||
-Dp1r.flyway.url=jdbc:postgresql://<host>:5433/muse_p1r7b_events_publish_test
|
||
```
|
||
|
||
结果:exit 0,`BUILD SUCCESS`,surefire XML 证明 `P1rAiEventsPublishFlywayMigrationIT` tests=4、failures=0、errors=0、skipped=0。
|
||
|
||
关键输出:
|
||
|
||
```text
|
||
flyway_success=true
|
||
flyway_url=jdbc:postgresql://<host>:5433/muse_p1r7b_events_publish_test
|
||
flyway_locations_requested=filesystem:sql/muse
|
||
flyway_locations_effective=filesystem:/Users/qingse/.config/superpowers/worktrees/oh-my-muse/dev-1.0.0/muse-cloud/sql/muse
|
||
migrations_executed=17
|
||
successful_migration_count=17
|
||
target_schema_version=17
|
||
flyway_latest=17:extend ai events publish outbox
|
||
v17_table=muse_ai_event_publish_outbox
|
||
v17_indexes=idx_muse_ai_event_publish_outbox_claim,idx_muse_ai_event_publish_outbox_owner_status
|
||
v17_constraints=uk_muse_ai_event_publish_outbox_command,uk_muse_ai_event_publish_outbox_source,chk_muse_ai_event_publish_outbox_event_type,chk_muse_ai_event_publish_outbox_status,chk_muse_ai_event_publish_outbox_attempt_count,chk_muse_ai_event_publish_outbox_max_attempt
|
||
v17_triggers=trg_muse_ai_event_publish_outbox_update_time
|
||
```
|
||
|
||
### Dependency tree gate
|
||
|
||
执行 dependency tree 证明:
|
||
|
||
- AI server 有 `cn.iocoder.cloud:muse-module-events-api:jar:2026.04-SNAPSHOT:compile`。
|
||
- AI server 禁止依赖 `muse-module-events-server` 的显式探针输出 `AI_EVENTS_SERVER_ABSENT`。
|
||
- Events server 禁止依赖 AI / Knowledge / Market / Member / Content server 的显式探针输出 `EVENTS_FORBIDDEN_SOURCE_OWNER_ABSENT`。
|
||
|
||
### Coverage scanner
|
||
|
||
scanner 只在隔离副本 `/tmp/p1r7b-final-coverage-scan.AoKcDl` 运行,未在真实 worktree 运行会写报告的 scanner。
|
||
|
||
执行:
|
||
|
||
```bash
|
||
python3 scripts/p1r-audit-api-coverage.py --check
|
||
```
|
||
|
||
结果:exit 0,并只在隔离副本中生成 coverage JSON/Markdown。
|
||
|
||
隔离副本 summary:
|
||
|
||
```json
|
||
{
|
||
"totalOperations": 233,
|
||
"completedOperations": 100,
|
||
"incompleteOperations": 0,
|
||
"needsVerificationOperations": 133,
|
||
"catchAllOperations": 0,
|
||
"genericPersistenceOperations": 0,
|
||
"ssePlaceholderOperations": 0,
|
||
"missingOperations": 0,
|
||
"blockedOperations": 0
|
||
}
|
||
```
|
||
|
||
Events 状态:
|
||
|
||
```text
|
||
events streamEvents GET /app-api/muse/events dedicated needs_verification P1R-7 End-to-End Acceptance
|
||
```
|
||
|
||
Market 状态:
|
||
|
||
```text
|
||
dedicated/needs_verification 32
|
||
```
|
||
|
||
回到真实 worktree 后,受保护文件 diff/status 仍为空。
|
||
|
||
### Dirty baseline 区分
|
||
|
||
P1R-7b 实现/测试 dirty baseline 包括:
|
||
|
||
- `muse-cloud/muse-module-ai/muse-module-ai-server/pom.xml`
|
||
- `MuseAiRuntimeProjectionService.java`
|
||
- `MuseJobServiceImpl.java`
|
||
- `MuseAiProperties.java`
|
||
- `MuseAiRuntimeProjectionServiceTest.java`
|
||
- `MuseJobServiceTest.java`
|
||
- `MuseAiEventPublishOutboxService.java`
|
||
- `MuseAiEventPublishOutboxServiceImpl.java`
|
||
- `MuseAiEventPublishWorker.java`
|
||
- `MuseAiEventPublishOutboxDO.java`
|
||
- `MuseAiEventPublishOutboxMapper.java`
|
||
- `MuseAiEventPublishOutboxServiceTest.java`
|
||
- `MuseAiEventPublishWorkerTest.java`
|
||
- `MuseAiEventPublishOutboxMapperTest.java`
|
||
- `P1rAiEventsPublishDependencyTest.java`
|
||
- `P1rAiEventsPublishEndToEndTest.java`
|
||
- `P1rAiEventsPublishFlywayMigrationIT.java`
|
||
- `P1rAiEventsPublishMigrationSqlTest.java`
|
||
- `muse-cloud/sql/muse/V17__extend_ai_events_publish_outbox.sql`
|
||
|
||
文档 dirty baseline / 本轮允许文档范围:
|
||
|
||
- `docs/agent-specs/` 目录当前仍为 untracked 文档目录;本轮追加更新 `docs/agent-specs/.agent`。
|
||
- 本轮新增本文档:`docs/memorys/2026-06-06-P1R7bSourceOwnerPropagation真实链路.md`。
|
||
|
||
## 推断
|
||
|
||
基于 reactor build、focused tests、P1R mixed gates、Flyway `_test`、dependency tree、隔离 coverage scanner 和受保护文件 diff 的组合证据,可以判断 P1R-7b AI source owner propagation 真实链路已具备进入 fresh review 的 needs_verification 证据。
|
||
|
||
由于本轮没有进行 fresh spec review + fresh quality review 双 PASS,也没有用户 completed approval,不能推断 Events、P1R-7 或 Market 已 completed。
|
||
|
||
## 假设
|
||
|
||
- `~/.config/muse-repo/infra.env` 仍是项目允许用于 P1R `_test` Flyway 验收的本地/内网测试配置。
|
||
- 当前 P1R-7b 实现 dirty baseline 来自前置 fresh implementers;本轮 Task 7 不清理、不回退、不重新归因这些实现文件。
|
||
|
||
## 风险与未完成
|
||
|
||
- Maven 多次出现 nexus metadata handshake / connect timeout warning,但相关 build/test 命令最终 exit 0;该 warning 未阻塞本轮验证。
|
||
- 当前 evidence 仍是 Task 7 implementer evidence,后续必须 fresh spec review + fresh quality review。未双 PASS 前不能最终收口、提交、push 或推进 completed。
|
||
- Events 当前仍为 `dedicated / needs_verification`。
|
||
- Market 32 operations 仍为 `dedicated / needs_verification`。
|
||
- P1R-7 completed approval 必须另起单独审批,不能由本轮 Task 7 自动推出。
|
||
|
||
## 下一步
|
||
|
||
1. 派发 fresh Task 7 spec review,核对本文档、`.agent`、验证命令、surefire XML、dependency tree、coverage scanner 隔离路径和 protected diff 证据。
|
||
2. 派发 fresh Task 7 quality / feasibility review,核对真实链路、失败路径、日志审计、依赖方向、测试覆盖和交接风险。
|
||
3. 双 PASS 前不得最终收口、提交、push 或把 Events / P1R-7 / Market 标为 completed。
|
||
|