184 lines
5.2 KiB
Markdown
184 lines
5.2 KiB
Markdown
# P1R Meta Remaining 5 状态推进
|
||
|
||
日期:2026-06-10
|
||
|
||
## 结论
|
||
|
||
本轮只把 Meta 剩余 5 个 operation 从 `dedicated / needs_verification` 推进为 `dedicated / completed`,继续使用 operation-level approval,没有把 `meta` 加入 domain-level completed allowlist。
|
||
|
||
审批对象:
|
||
|
||
- `meta:listProtectionNodes`
|
||
- `meta:getProtectionNode`
|
||
- `meta:listFunctionChains`
|
||
- `meta:previewFunctionChainImpact`
|
||
- `meta:activateFunctionChainVersion`
|
||
|
||
推进后 coverage summary:
|
||
|
||
```text
|
||
total=233
|
||
completed=117
|
||
needsVerification=116
|
||
incomplete=0
|
||
genericPersistence=0
|
||
ssePlaceholder=0
|
||
```
|
||
|
||
Meta 当前为 16 个 operation 全部 `dedicated / completed`。Account 33、Market 32、Content 51 仍保持 `dedicated / needs_verification`,总 P1R 仍未 completed。
|
||
|
||
## 修改范围
|
||
|
||
允许范围内修改:
|
||
|
||
- `muse-cloud/scripts/p1r-audit-api-coverage.py`
|
||
- `docs/superpowers/reports/p1r-api-coverage.json`
|
||
- `docs/superpowers/reports/p1r-api-coverage.md`
|
||
- `muse-cloud/muse-server/src/test/java/cn/iocoder/muse/server/framework/api/P1rApiCoverageReportTest.java`
|
||
- `muse-cloud/muse-server/src/test/java/cn/iocoder/muse/server/framework/api/P1rMetaRealApiGateTest.java`
|
||
- `muse-cloud/muse-server/src/test/java/cn/iocoder/muse/server/framework/api/P1rMetaFlywayMigrationIT.java`
|
||
- `muse-cloud/muse-server/src/test/java/cn/iocoder/muse/server/framework/api/P1rEventsRealApiGateTest.java`
|
||
- `muse-cloud/muse-server/src/test/java/cn/iocoder/muse/server/framework/api/P1rAiRealApiGateTest.java`
|
||
- `muse-cloud/muse-server/src/test/java/cn/iocoder/muse/server/framework/api/P1rKnowledgeRealApiGateTest.java`
|
||
- `muse-cloud/muse-server/src/test/java/cn/iocoder/muse/server/framework/api/P1rMarketRealApiGateTest.java`
|
||
- `docs/agent-specs/.agent`
|
||
- `docs/agent-specs/2026-06-10-P1RMetaRemaining5CompletedApproval审阅版.md`
|
||
- `docs/agent-specs/2026-06-10-P1RMetaRemaining5CompletedApproval执行版.md`
|
||
- `docs/memorys/2026-06-10-P1RMetaRemaining5状态推进.md`
|
||
|
||
未修改:
|
||
|
||
- `docs/api-contracts/**`
|
||
- Meta 业务实现
|
||
- Account / Market / Content 业务实现
|
||
|
||
## 关键实现
|
||
|
||
`p1r-audit-api-coverage.py` 仅在 `APPROVED_COMPLETED_OPERATIONS` 追加 5 个 Meta operation key:
|
||
|
||
```text
|
||
meta:listProtectionNodes
|
||
meta:getProtectionNode
|
||
meta:listFunctionChains
|
||
meta:previewFunctionChainImpact
|
||
meta:activateFunctionChainVersion
|
||
```
|
||
|
||
`APPROVED_COMPLETED_DOMAINS` 仍只有:
|
||
|
||
```text
|
||
ai
|
||
knowledge
|
||
```
|
||
|
||
新增 `P1rMetaFlywayMigrationIT`,用真实 PostgreSQL `_test` 库验证 V1 到 V10 Flyway:
|
||
|
||
- 目标版本:`10`
|
||
- 当前描述:`extend meta real api schema`
|
||
- 成功 SQL migration 数:`10`
|
||
- 关键表:`muse_meta_function_chain_version`、`muse_meta_function_chain_slot`、`muse_meta_function_chain_node`、`muse_meta_protection_node`、`muse_meta_function_chain`
|
||
- 关键约束:FunctionChain version unique、active partial unique、slot/node unique、ProtectionNode unique
|
||
- 关键 trigger:ProtectionNode、FunctionChain、FunctionChain version/slot/node update trigger
|
||
- 失败路径:重复 `tenant_id/chain_id/version_no`、重复 active version、缺少 `chain_id` 均由 PostgreSQL 拒绝
|
||
|
||
## 验证证据
|
||
|
||
TDD RED:
|
||
|
||
```text
|
||
mvn -o test -pl muse-server -am \
|
||
-Dtest=P1rApiCoverageReportTest,P1rMetaRealApiGateTest \
|
||
-Dsurefire.failIfNoSpecifiedTests=false
|
||
```
|
||
|
||
RED 失败点符合预期:
|
||
|
||
- `P1rApiCoverageReportTest` 期望 completed `117`,旧 report 仍为 `112`
|
||
- `P1rMetaRealApiGateTest` 期望 Meta 16 completed,旧 report 仍是 11 completed / 5 needs_verification
|
||
|
||
Scanner:
|
||
|
||
```text
|
||
python3 muse-cloud/scripts/p1r-audit-api-coverage.py --check
|
||
```
|
||
|
||
结果:
|
||
|
||
```text
|
||
Generated docs/superpowers/reports/p1r-api-coverage.json
|
||
Generated docs/superpowers/reports/p1r-api-coverage.md
|
||
233 117 116 0 0 0
|
||
```
|
||
|
||
P1R mixed gates:
|
||
|
||
```text
|
||
P1rApiCoverageReportTest
|
||
P1rMetaRealApiGateTest
|
||
P1rEventsRealApiGateTest
|
||
P1rAiRealApiGateTest
|
||
P1rKnowledgeRealApiGateTest
|
||
P1rMarketRealApiGateTest
|
||
P1rContentRealApiGateTest
|
||
P1rAccountRealApiGateTest
|
||
```
|
||
|
||
结果:45/45 pass。
|
||
|
||
Meta focused gates:
|
||
|
||
```text
|
||
ProtectionNodeServiceTest
|
||
FunctionChainServiceTest
|
||
AdminProtectionNodeControllerTest
|
||
AdminFunctionChainControllerTest
|
||
FunctionChainGuardTest
|
||
MetaProtectionNodeGuardTest
|
||
P1rMetaMigrationSqlTest
|
||
P1rMetaFlywayMigrationIT
|
||
```
|
||
|
||
XML 计数确认:
|
||
|
||
```text
|
||
ProtectionNodeServiceTest tests=3
|
||
FunctionChainServiceTest tests=12
|
||
AdminProtectionNodeControllerTest tests=7
|
||
AdminFunctionChainControllerTest tests=7
|
||
FunctionChainGuardTest tests=4
|
||
MetaProtectionNodeGuardTest tests=5
|
||
P1rMetaMigrationSqlTest tests=3
|
||
P1rMetaFlywayMigrationIT tests=4
|
||
```
|
||
|
||
真实 Flyway `_test`:
|
||
|
||
```text
|
||
test_db=muse_p1r2_meta_remaining5_test
|
||
flyway_success=true
|
||
migrations_executed=10
|
||
successful_migration_count=10
|
||
target_schema_version=10
|
||
flyway_latest=10:extend meta real api schema
|
||
```
|
||
|
||
XML 防空跑覆盖 16 个目标测试类,全部 failures/errors/skipped 为 0。
|
||
|
||
Diff gates:
|
||
|
||
- `git diff --check`:通过
|
||
- `docs/api-contracts` staged / unstaged protected diff:空
|
||
- allowed-diff gate:只允许本轮批准范围内文件
|
||
|
||
## 边界
|
||
|
||
本轮不代表:
|
||
|
||
- 总 P1R completed
|
||
- Account completed
|
||
- Market completed
|
||
- Content completed
|
||
- 未来 Meta 新 operation 自动 completed
|
||
|
||
后续如果推进 Account / Market / Content,仍必须分别进入审阅版、执行版、fresh review、用户批准和 TDD/验证流程。
|