@chenmk/superflow 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.en.md +106 -0
- package/INSTALL.md +664 -0
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/README.zh-CN.md +117 -0
- package/assets/context-templates/business-rules.md +98 -0
- package/assets/context-templates/decisions.md +153 -0
- package/assets/context-templates/external-systems.md +166 -0
- package/assets/context-templates/incidents.md +89 -0
- package/assets/manifest.json +53 -0
- package/assets/prompts/superflow-archive.md +9 -0
- package/assets/prompts/superflow-clarify.md +10 -0
- package/assets/prompts/superflow-design.md +10 -0
- package/assets/prompts/superflow-docs.md +10 -0
- package/assets/prompts/superflow-implement.md +10 -0
- package/assets/prompts/superflow-pipeline.md +13 -0
- package/assets/prompts/superflow-verify.md +10 -0
- package/assets/rules/superflow-phase-guard.md +50 -0
- package/assets/scripts/claude-auto-backup-hook.sh +313 -0
- package/assets/scripts/codex-auto-backup-hook.sh +361 -0
- package/assets/scripts/install-sql-pre-commit.sh +44 -0
- package/assets/scripts/superflow-contract-hooks.sh +744 -0
- package/assets/scripts/superflow-delivery-check.sh +315 -0
- package/assets/scripts/superflow-dependency-update-hook.sh +161 -0
- package/assets/scripts/superflow-enforce-hook.sh +70 -0
- package/assets/scripts/superflow-hook-guard.sh +132 -0
- package/assets/scripts/superflow-integration-evidence-hook.sh +80 -0
- package/assets/scripts/superflow-sql-sync-hook.py +950 -0
- package/assets/scripts/superflow-test-report-lint.py +433 -0
- package/assets/scripts/superflow-verify-integration.sh +90 -0
- package/assets/scripts/sync-settings-json.py +52 -0
- package/assets/skills/api-doc-changelog/SKILL.md +193 -0
- package/assets/skills/openspec-apply-change/SKILL.md +156 -0
- package/assets/skills/openspec-archive-change/SKILL.md +114 -0
- package/assets/skills/openspec-explore/SKILL.md +288 -0
- package/assets/skills/openspec-propose/SKILL.md +110 -0
- package/assets/skills/superflow-archive/SKILL.md +61 -0
- package/assets/skills/superflow-clarify/SKILL.md +146 -0
- package/assets/skills/superflow-clarify/agents/openai.yaml +4 -0
- package/assets/skills/superflow-design/SKILL.md +83 -0
- package/assets/skills/superflow-design/agents/openai.yaml +4 -0
- package/assets/skills/superflow-docs/SKILL.md +316 -0
- package/assets/skills/superflow-docs/agents/openai.yaml +4 -0
- package/assets/skills/superflow-hotfix/SKILL.md +48 -0
- package/assets/skills/superflow-implement/SKILL.md +461 -0
- package/assets/skills/superflow-implement/agents/openai.yaml +4 -0
- package/assets/skills/superflow-pipeline/SKILL.md +844 -0
- package/assets/skills/superflow-pipeline/agents/openai.yaml +4 -0
- package/assets/skills/superflow-pipeline/references/api-design-template.md +431 -0
- package/assets/skills/superflow-pipeline/references/architecture-design-template.md +119 -0
- package/assets/skills/superflow-pipeline/references/batch-prompt-template.md +536 -0
- package/assets/skills/superflow-pipeline/references/batch-split-guide.md +140 -0
- package/assets/skills/superflow-pipeline/references/decision-point.md +30 -0
- package/assets/skills/superflow-pipeline/references/dirty-worktree.md +35 -0
- package/assets/skills/superflow-pipeline/references/document-templates.md +123 -0
- package/assets/skills/superflow-pipeline/references/feature-gated-workflow.md +124 -0
- package/assets/skills/superflow-pipeline/references/implementation-prompt-template.md +1056 -0
- package/assets/skills/superflow-pipeline/references/mock-strategy-guide.md +86 -0
- package/assets/skills/superflow-pipeline/references/openspec-format.md +57 -0
- package/assets/skills/superflow-pipeline/references/orchestration.md +639 -0
- package/assets/skills/superflow-pipeline/references/p0-baseline-template.md +174 -0
- package/assets/skills/superflow-pipeline/references/project-config.md +40 -0
- package/assets/skills/superflow-pipeline/references/prompt-usage-template.md +152 -0
- package/assets/skills/superflow-pipeline/references/quality-gate.md +299 -0
- package/assets/skills/superflow-pipeline/references/quality-standards.md +190 -0
- package/assets/skills/superflow-pipeline/references/reviewer-checklist.md +154 -0
- package/assets/skills/superflow-pipeline/references/sql-risk-review-checklist.md +323 -0
- package/assets/skills/superflow-pipeline/references/subagent-progress.md +90 -0
- package/assets/skills/superflow-pipeline/references/superpower-technical-design-template.md +125 -0
- package/assets/skills/superflow-pipeline/references/test-execution-template.md +220 -0
- package/assets/skills/superflow-pipeline/references/test-guide.md +30 -0
- package/assets/skills/superflow-pipeline/references/traceability-matrix.md +106 -0
- package/assets/skills/superflow-pipeline/references/validation-integrity.md +134 -0
- package/assets/skills/superflow-pipeline/scripts/superflow-archive.sh +178 -0
- package/assets/skills/superflow-pipeline/scripts/superflow-env.sh +118 -0
- package/assets/skills/superflow-pipeline/scripts/superflow-guard.sh +428 -0
- package/assets/skills/superflow-pipeline/scripts/superflow-handoff.sh +296 -0
- package/assets/skills/superflow-pipeline/scripts/superflow-state.sh +574 -0
- package/assets/skills/superflow-pipeline/scripts/superflow-status.sh +172 -0
- package/assets/skills/superflow-pipeline/scripts/superflow-yaml-validate.sh +138 -0
- package/assets/skills/superflow-table-impact-analysis/SKILL.md +77 -0
- package/assets/skills/superflow-tweak/SKILL.md +46 -0
- package/assets/skills/superflow-verify/SKILL.md +112 -0
- package/assets/skills-en/api-doc-changelog/SKILL.md +193 -0
- package/assets/skills-en/openspec-apply-change/SKILL.md +156 -0
- package/assets/skills-en/openspec-archive-change/SKILL.md +114 -0
- package/assets/skills-en/openspec-explore/SKILL.md +288 -0
- package/assets/skills-en/openspec-propose/SKILL.md +110 -0
- package/assets/skills-en/superflow-archive/SKILL.md +61 -0
- package/assets/skills-en/superflow-clarify/SKILL.md +146 -0
- package/assets/skills-en/superflow-clarify/agents/openai.yaml +4 -0
- package/assets/skills-en/superflow-design/SKILL.md +83 -0
- package/assets/skills-en/superflow-design/agents/openai.yaml +4 -0
- package/assets/skills-en/superflow-docs/SKILL.md +316 -0
- package/assets/skills-en/superflow-docs/agents/openai.yaml +4 -0
- package/assets/skills-en/superflow-hotfix/SKILL.md +48 -0
- package/assets/skills-en/superflow-implement/SKILL.md +461 -0
- package/assets/skills-en/superflow-implement/agents/openai.yaml +4 -0
- package/assets/skills-en/superflow-pipeline/SKILL.md +844 -0
- package/assets/skills-en/superflow-pipeline/agents/openai.yaml +4 -0
- package/assets/skills-en/superflow-pipeline/references/api-design-template.md +431 -0
- package/assets/skills-en/superflow-pipeline/references/architecture-design-template.md +119 -0
- package/assets/skills-en/superflow-pipeline/references/batch-prompt-template.md +536 -0
- package/assets/skills-en/superflow-pipeline/references/batch-split-guide.md +140 -0
- package/assets/skills-en/superflow-pipeline/references/decision-point.md +30 -0
- package/assets/skills-en/superflow-pipeline/references/dirty-worktree.md +35 -0
- package/assets/skills-en/superflow-pipeline/references/document-templates.md +123 -0
- package/assets/skills-en/superflow-pipeline/references/feature-gated-workflow.md +124 -0
- package/assets/skills-en/superflow-pipeline/references/implementation-prompt-template.md +1056 -0
- package/assets/skills-en/superflow-pipeline/references/mock-strategy-guide.md +86 -0
- package/assets/skills-en/superflow-pipeline/references/openspec-format.md +57 -0
- package/assets/skills-en/superflow-pipeline/references/orchestration.md +639 -0
- package/assets/skills-en/superflow-pipeline/references/p0-baseline-template.md +174 -0
- package/assets/skills-en/superflow-pipeline/references/project-config.md +40 -0
- package/assets/skills-en/superflow-pipeline/references/prompt-usage-template.md +152 -0
- package/assets/skills-en/superflow-pipeline/references/quality-gate.md +299 -0
- package/assets/skills-en/superflow-pipeline/references/quality-standards.md +190 -0
- package/assets/skills-en/superflow-pipeline/references/reviewer-checklist.md +154 -0
- package/assets/skills-en/superflow-pipeline/references/sql-risk-review-checklist.md +323 -0
- package/assets/skills-en/superflow-pipeline/references/subagent-progress.md +90 -0
- package/assets/skills-en/superflow-pipeline/references/superpower-technical-design-template.md +125 -0
- package/assets/skills-en/superflow-pipeline/references/test-execution-template.md +220 -0
- package/assets/skills-en/superflow-pipeline/references/test-guide.md +30 -0
- package/assets/skills-en/superflow-pipeline/references/traceability-matrix.md +106 -0
- package/assets/skills-en/superflow-pipeline/references/validation-integrity.md +134 -0
- package/assets/skills-en/superflow-pipeline/scripts/superflow-archive.sh +178 -0
- package/assets/skills-en/superflow-pipeline/scripts/superflow-env.sh +118 -0
- package/assets/skills-en/superflow-pipeline/scripts/superflow-guard.sh +428 -0
- package/assets/skills-en/superflow-pipeline/scripts/superflow-handoff.sh +296 -0
- package/assets/skills-en/superflow-pipeline/scripts/superflow-state.sh +574 -0
- package/assets/skills-en/superflow-pipeline/scripts/superflow-status.sh +172 -0
- package/assets/skills-en/superflow-pipeline/scripts/superflow-yaml-validate.sh +138 -0
- package/assets/skills-en/superflow-table-impact-analysis/SKILL.md +77 -0
- package/assets/skills-en/superflow-tweak/SKILL.md +46 -0
- package/assets/skills-en/superflow-verify/SKILL.md +112 -0
- package/dist/cli/index.js +186 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/archive.js +6 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/clarify.js +6 -0
- package/dist/commands/clarify.js.map +1 -0
- package/dist/commands/design.js +6 -0
- package/dist/commands/design.js.map +1 -0
- package/dist/commands/docs.js +6 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/doctor.js +473 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/implement.js +6 -0
- package/dist/commands/implement.js.map +1 -0
- package/dist/commands/init.js +471 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/pipeline.js +6 -0
- package/dist/commands/pipeline.js.map +1 -0
- package/dist/commands/scan.js +59 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/status.js +173 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/uninstall.js +213 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.js +187 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/verify.js +6 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/core/assets.js +27 -0
- package/dist/core/assets.js.map +1 -0
- package/dist/core/context.js +100 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/dependencies.js +146 -0
- package/dist/core/dependencies.js.map +1 -0
- package/dist/core/detect.js +71 -0
- package/dist/core/detect.js.map +1 -0
- package/dist/core/i18n.js +103 -0
- package/dist/core/i18n.js.map +1 -0
- package/dist/core/integrity.js +46 -0
- package/dist/core/integrity.js.map +1 -0
- package/dist/core/manifest.js +18 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/core/prompts.js +20 -0
- package/dist/core/prompts.js.map +1 -0
- package/dist/core/registry.js +134 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/rules.js +17 -0
- package/dist/core/rules.js.map +1 -0
- package/dist/core/scripts.js +40 -0
- package/dist/core/scripts.js.map +1 -0
- package/dist/core/skill-check.js +31 -0
- package/dist/core/skill-check.js.map +1 -0
- package/dist/core/skills.js +56 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/state.js +43 -0
- package/dist/core/state.js.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/path.js +11 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/shell.js +29 -0
- package/dist/utils/shell.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Superpowers Technical Design Template
|
|
2
|
+
|
|
3
|
+
Use this template for the Superpowers-owned source-level HOW document.
|
|
4
|
+
OpenSpec/SDD documents remain canonical for WHAT, API, database, field
|
|
5
|
+
semantics, tests, and acceptance gates.
|
|
6
|
+
|
|
7
|
+
**Output path**:
|
|
8
|
+
`docs/superpowers/specs/YYYY-MM-DD-<change-id>-technical-design.md`
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
---
|
|
12
|
+
change: <change-id>
|
|
13
|
+
status: draft|ready|final
|
|
14
|
+
handoff_hash: <sha256>
|
|
15
|
+
canonical_sources:
|
|
16
|
+
- ../../openspec/changes/<change-id>/proposal.md
|
|
17
|
+
- ../../openspec/changes/<change-id>/api.md
|
|
18
|
+
- ../../openspec/changes/<change-id>/design.md
|
|
19
|
+
- ../../openspec/changes/<change-id>/tests.md
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Superpowers Technical Design: <change title>
|
|
23
|
+
|
|
24
|
+
## Boundary
|
|
25
|
+
|
|
26
|
+
- This document owns source-level HOW only.
|
|
27
|
+
- OpenSpec/SDD remains canonical for requirements, API, DB, field semantics,
|
|
28
|
+
SQL, tests, and acceptance gates.
|
|
29
|
+
- If this document conflicts with canonical sources, stop and return to
|
|
30
|
+
`$superflow-docs`; do not let implementation prompts carry the conflict forward.
|
|
31
|
+
|
|
32
|
+
## Source-Level HOW
|
|
33
|
+
|
|
34
|
+
| Requirement/Scenario | Code anchor | Current behavior | Target HOW | Files/methods | Risk |
|
|
35
|
+
|---|---|---|---|---|---|
|
|
36
|
+
| <R1/S1> | `<file>:<line>` | <observed fact> | <implementation approach> | <files> | <risk> |
|
|
37
|
+
|
|
38
|
+
## Architecture Boundary And Call Direction
|
|
39
|
+
|
|
40
|
+
Use this whenever the change crosses repositories, services, SDKs, MQ,
|
|
41
|
+
schedulers, device protocols, callbacks, third-party platforms, mini-programs,
|
|
42
|
+
gateway layers, or adapter modules.
|
|
43
|
+
|
|
44
|
+
| Flow step | Direction | Owner module | Existing entry/exit | Proposed entry/exit | Allowed? | Evidence anchor | Forbidden shortcut |
|
|
45
|
+
|---|---|---|---|---|---|---|---|
|
|
46
|
+
| `<user/system action>` | `<upstream -> downstream>` | `<module>` | `<existing API/MQ/adapter>` | `<target API/MQ/adapter>` | `yes/no/blocker` | `<file:line/log/doc>` | `<what must not be routed through>` |
|
|
47
|
+
|
|
48
|
+
Required boundary checks:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
rg -n "<module>|<interface>|<topic>|<protocol>|<callback>" .
|
|
52
|
+
rg -n "<existing entry>|<existing exit>|<adapter>|<client>" <repo-a> <repo-b>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The technical design must prove service ownership and call direction before
|
|
56
|
+
choosing an implementation path. Do not turn an outbound adapter, protocol
|
|
57
|
+
translator, notification consumer, or device gateway into a business-entry
|
|
58
|
+
orchestrator unless the OpenSpec/SDD contract explicitly says that module owns
|
|
59
|
+
the new entry point and records the owner approval. If the correct owner is
|
|
60
|
+
unclear, mark the design blocked.
|
|
61
|
+
|
|
62
|
+
## Field And Status Reverse Impact
|
|
63
|
+
|
|
64
|
+
Use this whenever changing field values, enum/status values, derived fields,
|
|
65
|
+
sync flags, online/offline state, deletion/restoration state, payment/refund
|
|
66
|
+
state, third-party status, or any value that other code may read.
|
|
67
|
+
|
|
68
|
+
| Field/status | Write/update points | Read/filter points | Derived/sync points | Cross-module consumers | Tests covering consumers | Missing coverage/blocker |
|
|
69
|
+
|---|---|---|---|---|---|---|
|
|
70
|
+
| `running_status` | `<repository/service>` | `<query/filter/mapper>` | `<heartbeat/realtime/sync>` | `<module/repo>` | `<case IDs>` | `<none/blocker>` |
|
|
71
|
+
|
|
72
|
+
Required reverse-search commands:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
rg -n "<field>|<enum>|<status>|<column>" .
|
|
76
|
+
rg -n "<setter>|<getter>|<mapper column>|<dto field>" src test
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If the value is database-backed, also inspect Mapper XML, entity annotations,
|
|
80
|
+
DTO/VO fields, SQL migrations, scheduled jobs, MQ/event consumers, callbacks,
|
|
81
|
+
third-party adapters, and sibling repos when the table or DTO is shared.
|
|
82
|
+
|
|
83
|
+
The technical design must say which references are intentionally unchanged and
|
|
84
|
+
why. A change is not ready when only the direct setter/writer is designed.
|
|
85
|
+
|
|
86
|
+
## Execution Architecture
|
|
87
|
+
|
|
88
|
+
- Worker boundaries:
|
|
89
|
+
- Tester boundaries:
|
|
90
|
+
- Reviewer boundaries:
|
|
91
|
+
- Leader coordination:
|
|
92
|
+
- Worktree/port plan:
|
|
93
|
+
|
|
94
|
+
## TDD And RED Entry Points
|
|
95
|
+
|
|
96
|
+
| Case ID | Failing command first | Expected RED failure | GREEN command | Evidence target |
|
|
97
|
+
|---|---|---|---|---|
|
|
98
|
+
| T1 | `<command>` | <failure> | `<command>` | `test-report.md#...` |
|
|
99
|
+
|
|
100
|
+
## Implementation Plan Shape
|
|
101
|
+
|
|
102
|
+
| Batch | Scope | Dependencies | Allowed files | Forbidden files | Done evidence |
|
|
103
|
+
|---|---|---|---|---|---|
|
|
104
|
+
| P0 | <baseline> | none | <paths> | <paths> | <evidence> |
|
|
105
|
+
|
|
106
|
+
## Drift And Blockers
|
|
107
|
+
|
|
108
|
+
| Topic | Status | Required action |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| <unclear source fact> | blocked|partial|clear | <action> |
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Rules
|
|
114
|
+
|
|
115
|
+
- Use real source anchors, Mapper/XML anchors, table names, commands, and
|
|
116
|
+
prompt boundaries. Vague module names are not enough.
|
|
117
|
+
- For cross-system changes, prove owner module, call direction, existing
|
|
118
|
+
entry/exit points, and forbidden shortcuts before implementation. A design
|
|
119
|
+
that only shows "can call through this module" is not ready.
|
|
120
|
+
- For field/status changes, prove reverse impact before coding: writers,
|
|
121
|
+
readers, filters, derived sync paths, external consumers, and tests.
|
|
122
|
+
- Do not invent API fields, DB columns, status semantics, fallback behavior, or
|
|
123
|
+
acceptance criteria.
|
|
124
|
+
- Keep unresolved source facts as blockers. Do not convert them to guesses.
|
|
125
|
+
- Record the same `handoff_hash` as `.sdd/handoff/sdd-context.sha256`.
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# 测试执行与结果记录模板
|
|
2
|
+
|
|
3
|
+
记录测试的执行环境、执行过程和结果,作为交付物的一部分。
|
|
4
|
+
|
|
5
|
+
## 文档结构
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
# 测试执行报告
|
|
9
|
+
|
|
10
|
+
## 1. 执行环境
|
|
11
|
+
|
|
12
|
+
| 项目 | 信息 |
|
|
13
|
+
|------|------|
|
|
14
|
+
| 执行时间 | 2026-05-09 14:00 - 15:30 |
|
|
15
|
+
| 执行人 | ____ |
|
|
16
|
+
| 操作系统 | Linux / macOS / Windows |
|
|
17
|
+
| JDK 版本 | 17 |
|
|
18
|
+
| 数据库 | MySQL 8.0 / H2 |
|
|
19
|
+
| Spring Profile | dev / test / cmk |
|
|
20
|
+
| 应用端口 | 9527 |
|
|
21
|
+
| 上下文路径 | / |
|
|
22
|
+
|
|
23
|
+
## 2. 测试范围
|
|
24
|
+
|
|
25
|
+
| 层次 | 类型 | 用例数 | 自动化 |
|
|
26
|
+
|------|------|--------|--------|
|
|
27
|
+
| L1 | 单元测试 | __ | [自动化] |
|
|
28
|
+
| L2 | 集成测试 | __ | [自动化] |
|
|
29
|
+
| L3 | 接口测试 | __ | [自动化 / 需手工] |
|
|
30
|
+
| L4 | 验收测试 | __ | [需手工] |
|
|
31
|
+
|
|
32
|
+
## 3. 执行方式
|
|
33
|
+
|
|
34
|
+
### 3.1 自动化测试执行命令
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 全量单元测试 + 集成测试
|
|
38
|
+
mvn clean test
|
|
39
|
+
|
|
40
|
+
# 仅接口测试(需应用已启动)
|
|
41
|
+
mvn test -Dtest=*IntegrationTest
|
|
42
|
+
|
|
43
|
+
# 单测试类
|
|
44
|
+
mvn test -Dtest=UserServiceTest
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 3.2 手工测试执行步骤
|
|
48
|
+
|
|
49
|
+
1. 启动应用:`mvn spring-boot:run -Dspring-boot.run.profiles=dev`
|
|
50
|
+
2. 确认健康检查:`curl http://localhost:9527/actuator/health`
|
|
51
|
+
3. 按 tests.md 逐个执行 curl 命令
|
|
52
|
+
4. 验证数据库状态
|
|
53
|
+
5. 检查日志无 ERROR
|
|
54
|
+
|
|
55
|
+
## 4. 测试结果汇总
|
|
56
|
+
|
|
57
|
+
| 测试项 | 状态 | 通过 | 失败 | 跳过 | 备注 |
|
|
58
|
+
|--------|------|------|------|------|------|
|
|
59
|
+
| 单元测试 | ✅ / ❌ | __ | __ | __ | |
|
|
60
|
+
| 集成测试 | ✅ / ❌ | __ | __ | __ | |
|
|
61
|
+
| 接口测试 | ✅ / ❌ | __ | __ | __ | |
|
|
62
|
+
| 回归测试 | ✅ / ❌ | __ | __ | __ | |
|
|
63
|
+
|
|
64
|
+
**总体结果**: [全部通过 / 部分通过 / 未通过]
|
|
65
|
+
|
|
66
|
+
## 4.1 真实测试数据与证据
|
|
67
|
+
|
|
68
|
+
| 用例 ID | 真实参数 | 参数来源 | 自动化命令 | 证据等级 | 执行证据 | 结论 |
|
|
69
|
+
|---------|----------|----------|------------|----------|----------|------|
|
|
70
|
+
| TC-001 | parkCode=____ | 前端请求 / 用户提供 / DB查询 / Mock | curl/Newman/pytest/RestAssured | Mock only / 测试端点 / 真实入口 | 响应 + DB + 日志 | Passed / Blocked / Partial |
|
|
71
|
+
|
|
72
|
+
缺少真实参数、token、站点/运营商归属、外部服务配置或设备环境时,不得填写
|
|
73
|
+
`Passed`,必须标记为 `Blocked` 或 `Partial`。
|
|
74
|
+
|
|
75
|
+
涉及第三方、外部集成、支付、设备、回调、客户端或跨系统链路时,测试
|
|
76
|
+
Controller、mock endpoint、绕过鉴权端点只能填写 `Mock only` 或 `测试端点`。
|
|
77
|
+
只有真实外部入口的 payload、响应、trace 日志、DB 证据闭环时,才能填写
|
|
78
|
+
`Passed`。
|
|
79
|
+
|
|
80
|
+
## 4.2 Red-Green 证据
|
|
81
|
+
|
|
82
|
+
新功能、Bug 修复、CR/Px 联调补项都必须记录。RED 必须发生在生产代码修改前,
|
|
83
|
+
且失败原因必须是预期业务断言,不是环境错误、编译错误、token 缺失或测试代码错误。
|
|
84
|
+
|
|
85
|
+
| 用例 ID | RED 命令 | RED 失败摘要 | RED 判定 | GREEN 命令 | GREEN 通过摘要 |
|
|
86
|
+
|---------|----------|---------------|----------|------------|----------------|
|
|
87
|
+
| TC-001 | curl/test 命令 | 预期业务断言失败 | 正确失败/环境失败/阻塞 | 同一命令 | 响应/DB/日志均通过 |
|
|
88
|
+
|
|
89
|
+
## 4.3 接口自动化证据
|
|
90
|
+
|
|
91
|
+
涉及接口、CRUD、Mapper/XML、数据库字段、配置驱动、MQ、定时任务、设备、支付、
|
|
92
|
+
退款、小程序或第三方链路时必须填写:
|
|
93
|
+
|
|
94
|
+
| 用例 ID | Base URL | Token/Cookie 获取 | 请求命令 | 请求数据来源 | 响应断言 | DB SELECT | 日志关键词 | 结论 |
|
|
95
|
+
|---------|----------|-------------------|----------|--------------|----------|-----------|------------|------|
|
|
96
|
+
| TC-001 | http://localhost:____ | /captcha/image + /login | curl ... | tests.md / DB / 用户提供 | code/data/业务字段 | SELECT ... | traceId/业务日志 | Passed/Blocked/Partial |
|
|
97
|
+
|
|
98
|
+
HTTP 200、字段非空、mock-only、DB-only、`BUILD SUCCESS`、`Tests are skipped`
|
|
99
|
+
都不能单独作为接口通过证据。
|
|
100
|
+
|
|
101
|
+
## 5. 详细结果
|
|
102
|
+
|
|
103
|
+
### 5.1 通过的测试
|
|
104
|
+
|
|
105
|
+
| 用例 ID | 用例名称 | 执行时间 | 验证方式 |
|
|
106
|
+
|---------|----------|----------|----------|
|
|
107
|
+
| TC-001 | 用户注册成功 | 2s | 接口返回 + 数据库查询 |
|
|
108
|
+
|
|
109
|
+
### 5.2 失败的测试
|
|
110
|
+
|
|
111
|
+
| 用例 ID | 用例名称 | 失败原因 | 处理措施 | 状态 |
|
|
112
|
+
|---------|----------|----------|----------|------|
|
|
113
|
+
| TC-005 | 并发下单 | 竞态条件导致超卖 | 增加分布式锁 | 已修复 ✅ |
|
|
114
|
+
|
|
115
|
+
### 5.3 阻塞的测试
|
|
116
|
+
|
|
117
|
+
| 用例 ID | 用例名称 | 阻塞原因 | 预计解决 |
|
|
118
|
+
|---------|----------|----------|----------|
|
|
119
|
+
| TC-010 | 设备回调 | 无真实设备 | Mock 验证替代 |
|
|
120
|
+
|
|
121
|
+
## 6. 问题与风险
|
|
122
|
+
|
|
123
|
+
| 问题 | 影响 | 应对方案 |
|
|
124
|
+
|------|------|----------|
|
|
125
|
+
| ____ | ____ | ____ |
|
|
126
|
+
|
|
127
|
+
## 7. 数据库结构核查
|
|
128
|
+
|
|
129
|
+
| 表名 | 核查命令 | 预期结构 | 实际结构 | 结论 |
|
|
130
|
+
|------|----------|----------|----------|------|
|
|
131
|
+
| {table_name} | `SHOW CREATE TABLE {table_name}` | {字段/索引/默认值} | {实际输出摘要} | 一致/不一致 |
|
|
132
|
+
| {table_name} | `SELECT COUNT(*) FROM {table_name} WHERE {condition}` | N 条 | 实际 M 条 | 一致/不一致 |
|
|
133
|
+
|
|
134
|
+
## 8. 汇总 SQL 执行记录
|
|
135
|
+
|
|
136
|
+
| SQL 文件路径 | 执行的脚本(行号范围或注释标记) | 执行结果 | 复查确认 |
|
|
137
|
+
|--------------|--------------------------------|----------|----------|
|
|
138
|
+
| `openspec/changes/{change-id}/sql/{文件名}` | 第 XX-XX 行(如 "-- P16 业务字段补齐") | 成功/失败 | SHOW CREATE TABLE 确认 |
|
|
139
|
+
|
|
140
|
+
## 8.1 跨仓数据合同对账
|
|
141
|
+
|
|
142
|
+
多仓共享表、复制 PO/Entity/Mapper、MyBatis-Plus BaseMapper 或字段迁移时必须填写:
|
|
143
|
+
|
|
144
|
+
| 表 | 真源结构 | 消费仓 | 实体/Mapper/SQL 字段 | 实际库字段 | 处理结论 | 验证证据 |
|
|
145
|
+
|----|----------|--------|----------------------|------------|----------|----------|
|
|
146
|
+
| c_xxx | 版本总 SQL + SHOW CREATE TABLE | service-a | field_a, field_b | 一致/缺失 | 通过/阻塞/已修复 | 命令、文件、行号 |
|
|
147
|
+
|
|
148
|
+
如果任一消费仓映射或查询不存在列,结论必须是 `阻塞`,不得通过给测试库补废弃字段绕过。
|
|
149
|
+
|
|
150
|
+
## 9. 结论
|
|
151
|
+
|
|
152
|
+
[是否达到交付标准,是否可以进入下一阶段]
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## 任务完成 Checklist(全部满足才能标记完成)
|
|
156
|
+
|
|
157
|
+
以下 checklist 用于判定一个实现任务是否真正完成。每完成一项勾选一项,**全部勾选后才能标记任务完成**。
|
|
158
|
+
|
|
159
|
+
### 开发阶段(Worker 执行)
|
|
160
|
+
- [ ] 已从 tests.md 提取本批次用例 ID、自动化命令和断言
|
|
161
|
+
- [ ] 已在生产代码修改前执行 RED 命令
|
|
162
|
+
- [ ] RED 失败原因是预期业务断言,非环境/编译/token/测试代码错误
|
|
163
|
+
- [ ] RED 失败证据已回填 test-report
|
|
164
|
+
- [ ] 代码已修改(git diff 确认修改了正确的文件)
|
|
165
|
+
- [ ] 代码自审通过(无 CRITICAL/HIGH 问题,检查空指针/异常/事务/日志)
|
|
166
|
+
- [ ] 编译通过(`mvn clean compile -DskipTests` BUILD SUCCESS)
|
|
167
|
+
- [ ] 已执行同一命令确认 GREEN,并回填通过证据
|
|
168
|
+
- [ ] 旧进程已停止(`pkill` + 端口确认无占用)
|
|
169
|
+
- [ ] 应用已重新启动(`mvn spring-boot:run` 或 `./gradlew bootRun`)
|
|
170
|
+
- [ ] 进程已验证(PID 存在、启动时间接近当前时间、端口绑定正确)
|
|
171
|
+
- [ ] 健康检查通过(`curl /actuator/health` 返回 UP)
|
|
172
|
+
- [ ] 日志确认是本次启动(时间戳匹配当前时间)
|
|
173
|
+
|
|
174
|
+
### 接口测试阶段(Worker 逐项执行)
|
|
175
|
+
- [ ] Token 已获取(完整的 `/captcha/image` + `/login` 流程,token 非空)
|
|
176
|
+
- [ ] L3 接口用例已逐项执行(来自 tests.md 的每个 [自动化] 用例)
|
|
177
|
+
- [ ] 每个用例的 curl 命令已记录
|
|
178
|
+
- [ ] 每个用例的请求数据来源已记录
|
|
179
|
+
- [ ] 每个用例的响应已记录
|
|
180
|
+
- [ ] 每个用例的响应断言、DB 断言、日志断言已验证(通过/失败)
|
|
181
|
+
|
|
182
|
+
### 数据库验证阶段(Worker 执行)
|
|
183
|
+
- [ ] 已执行 `SHOW CREATE TABLE` 确认表结构
|
|
184
|
+
- [ ] 已执行 `SELECT` 查询确认数据状态与预期一致
|
|
185
|
+
- [ ] 数据库验证结果已记录
|
|
186
|
+
|
|
187
|
+
### 日志检查阶段(Worker 执行)
|
|
188
|
+
- [ ] 已执行 `grep ERROR` 检查应用日志
|
|
189
|
+
- [ ] 无 ERROR(除已知无关错误外)
|
|
190
|
+
- [ ] 关键日志已出现(如设计要求的特定标记)
|
|
191
|
+
|
|
192
|
+
### 报告阶段(Worker 执行)
|
|
193
|
+
- [ ] `embedded-changes/pXX-xxx/test-report.md` 已更新
|
|
194
|
+
- [ ] 包含:RED/GREEN 命令和输出、curl 命令、响应摘要、数据库查询结果、日志检查结果
|
|
195
|
+
- [ ] 包含:`Tests run:` 真实输出
|
|
196
|
+
- [ ] 包含:进程验证证据(PID、启动时间、端口)
|
|
197
|
+
|
|
198
|
+
### 独立验证阶段(Tester 执行)
|
|
199
|
+
- [ ] Tester 独立执行全部用例(不参考 Worker 报告)
|
|
200
|
+
- [ ] Tester 客观报告通过/失败
|
|
201
|
+
|
|
202
|
+
### Leader 验证阶段(Leader 执行)
|
|
203
|
+
- [ ] Leader 抽查至少 30% 关键用例
|
|
204
|
+
- [ ] Leader 确认进程是新启动的
|
|
205
|
+
- [ ] Leader 确认接口有真实调用证据
|
|
206
|
+
|
|
207
|
+
**以上 checklist 全部勾选后,才能标记任务完成。**
|
|
208
|
+
|
|
209
|
+
## 质量红线
|
|
210
|
+
|
|
211
|
+
- 不允许不执行测试直接填写"通过"
|
|
212
|
+
- 不允许先写生产代码再补 RED;未观察 RED 的用例不得 Passed
|
|
213
|
+
- 不允许修改测试断言让失败变为通过
|
|
214
|
+
- 不允许隐瞒失败测试,必须记录并说明原因
|
|
215
|
+
- 不允许只用 HTTP 200、字段非空、DB-only、BUILD SUCCESS 或 skipped tests 证明业务通过
|
|
216
|
+
- 不允许用占位参数或 mock-only 证据证明真实前端/外部系统链路已通过
|
|
217
|
+
- 不允许用测试 Controller、mock endpoint、绕过鉴权端点证明真实外部入口已通过
|
|
218
|
+
- 不允许把泛化外部失败当作通过,除非需求明确要求该失败结果
|
|
219
|
+
- 不允许只检查主仓数据库结构就关闭跨仓共享表任务;必须覆盖全部消费仓实体/Mapper/SQL
|
|
220
|
+
- **不允许"编译成功 + 单元测试通过"就标记任务完成,必须完成上述 checklist 全部项**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 测试失败修复指南
|
|
2
|
+
|
|
3
|
+
## 失败类型与修复方向
|
|
4
|
+
|
|
5
|
+
| 失败现象 | 可能原因 | 修复方向 |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| 应用启动失败 | 配置文件错误 / 端口冲突 / Bean 初始化失败 | 检查 `application.yml`,确认端口未被占用,检查 Bean 依赖注入 |
|
|
8
|
+
| 接口返回 404 | URL 路径错误 / 上下文路径未拼接 / 接口未注册 | 核对 Controller 的 `@RequestMapping` 路径,确认 context-path 已拼接 |
|
|
9
|
+
| 接口返回 500 | 空指针 / SQL 异常 / 事务回滚 | 查看日志栈追踪,定位具体异常行号,检查入参是否为空 |
|
|
10
|
+
| 数据库断言失败 | SQL 未生效 / 事务未提交 / 缓存未更新 | 确认方法上有 `@Transactional`,检查 `updateByPrimaryKeySelective` 返回值 |
|
|
11
|
+
| 日志断言失败 | 日志级别过滤 / 异步日志未刷新 | 检查 `logback.xml` 日志级别,确认日志输出时机 |
|
|
12
|
+
| 并发测试失败 | 竞态条件 / 锁未生效 / 事务隔离级别 | 检查锁的实现(数据库锁 / 分布式锁),确认事务传播行为 |
|
|
13
|
+
| 灯色下发验证失败 | DMS 未连接 / 异步任务未执行 | 确认 DMS 服务可用,检查 `@Async` 线程池配置 |
|
|
14
|
+
| Excel 导出验证失败 | 文件格式错误 / 字段映射错误 | 检查 EasyExcel 或 POI 配置,确认字段注解正确 |
|
|
15
|
+
|
|
16
|
+
## 修复流程
|
|
17
|
+
|
|
18
|
+
1. **复现问题**:根据测试用例的前置条件和执行步骤,手动复现失败场景
|
|
19
|
+
2. **查看日志**:启动应用时添加 `--debug` 或检查 `logs/` 目录下的日志文件
|
|
20
|
+
3. **定位代码**:根据日志中的异常栈追踪,找到具体的源码位置(类名 + 方法名 + 行号)
|
|
21
|
+
4. **分析根因**:对照 design.md 中的设计方案,确认实现是否与设计一致
|
|
22
|
+
5. **修改代码**:修复 bug,确保不引入新的问题(回归测试)
|
|
23
|
+
6. **重新测试**:重新执行失败的测试用例,确认修复成功
|
|
24
|
+
7. **更新文档**:如果修复涉及设计变更,同步更新 design.md 和 tasks.md
|
|
25
|
+
|
|
26
|
+
## 质量红线
|
|
27
|
+
|
|
28
|
+
- 不允许跳过失败的测试用例直接提交代码
|
|
29
|
+
- 不允许修改测试用例的断言标准来"让测试通过"
|
|
30
|
+
- 不允许在没有测试覆盖的情况下修改核心逻辑
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# 可追溯性矩阵
|
|
2
|
+
|
|
3
|
+
## 目的
|
|
4
|
+
|
|
5
|
+
确保从需求到设计到实现到测试的完整可追溯,避免"设计漂移"和"实现遗漏"。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 矩阵结构
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
# Traceability Matrix
|
|
13
|
+
|
|
14
|
+
## 需求层(spec.md)
|
|
15
|
+
|
|
16
|
+
| Req ID | Requirement | Scenario | 对应 Design | 对应 Task | 对应 Test | 对应 Prompt |
|
|
17
|
+
|--------|-------------|----------|-------------|-----------|-----------|-------------|
|
|
18
|
+
| R1 | 主数据支持多种业务类型 | S1.1 | design.md ## 主数据 | Task 1.1 | tests.md T1 | P1 |
|
|
19
|
+
| R2 | 业务创建时校验用户资格或资源充足 | S2.1 | design.md ## 创建校验 | Task 2.1 | tests.md T2 | P2 |
|
|
20
|
+
| ... | ... | ... | ... | ... | ... | ... |
|
|
21
|
+
|
|
22
|
+
## 设计层(design.md)
|
|
23
|
+
|
|
24
|
+
| Design 章节 | 涉及文件 | 涉及方法 | 对应 Task | 对应 Prompt |
|
|
25
|
+
|-------------|----------|----------|-----------|-------------|
|
|
26
|
+
| ## 主数据 | BusinessRecord.java | - | Task 1.1 | P1 |
|
|
27
|
+
| ## 开通校验 | OrderService.java | validateBalance() | Task 2.1 | P2 |
|
|
28
|
+
| ... | ... | ... | ... | ... |
|
|
29
|
+
|
|
30
|
+
## 任务层(tasks.md)
|
|
31
|
+
|
|
32
|
+
| Task ID | 文件 | 方法 | 对应 Design | 对应 Prompt | 状态 |
|
|
33
|
+
|---------|------|------|-------------|-------------|------|
|
|
34
|
+
| Task 1.1 | BusinessRecordMapper.xml | insert | design.md ## 主数据 | P1 | 待执行 |
|
|
35
|
+
| ... | ... | ... | ... | ... | ... |
|
|
36
|
+
|
|
37
|
+
## Prompt 层(prompt/*.md)
|
|
38
|
+
|
|
39
|
+
| Prompt | 覆盖 Task | 覆盖 Design | 依赖 Prompt | 状态 |
|
|
40
|
+
|--------|-----------|-------------|-------------|------|
|
|
41
|
+
| P0 | - | - | 无 | 待执行 |
|
|
42
|
+
| P1 | Task 1.1-1.5 | design.md ## 数据模型 | P0 | 待执行 |
|
|
43
|
+
| ... | ... | ... | ... | ... |
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 一致性检查规则
|
|
49
|
+
|
|
50
|
+
### 规则 1:设计漂移检查
|
|
51
|
+
|
|
52
|
+
**定义**:prompt 中出现了 design.md / api.md / database-contract.md 没有定义的新方案。
|
|
53
|
+
|
|
54
|
+
**检查方法**:
|
|
55
|
+
1. 读取每份 prompt 的"精确实现步骤"
|
|
56
|
+
2. 检查每个步骤是否能在 design.md 中找到对应章节
|
|
57
|
+
3. 检查 prompt 中提到的字段、接口、MQ topic 是否在设计文档中有定义
|
|
58
|
+
|
|
59
|
+
**标记方式**:
|
|
60
|
+
```
|
|
61
|
+
⚠️ 设计漂移:prompt/p2-charge-order.md 步骤 3 提到"使用乐观锁防止并发下单",
|
|
62
|
+
但 design.md ## 下单流程 中未提及乐观锁策略。
|
|
63
|
+
处理方式:上报 Leader 确认 / 按设计文档原方案实现
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 规则 2:实现遗漏检查
|
|
67
|
+
|
|
68
|
+
**定义**:design.md 有章节,但没有对应的 prompt 覆盖。
|
|
69
|
+
|
|
70
|
+
**检查方法**:
|
|
71
|
+
1. 遍历 design.md 的所有章节
|
|
72
|
+
2. 检查每个章节是否被至少一份 prompt 覆盖
|
|
73
|
+
3. 检查 api.md 中的每个接口是否被至少一份 prompt 覆盖
|
|
74
|
+
|
|
75
|
+
**标记方式**:
|
|
76
|
+
```
|
|
77
|
+
⚠️ 实现遗漏风险:design.md ## 订单快照 描述了快照表结构和写入时机,
|
|
78
|
+
但没有 prompt 覆盖该功能(P1-P4 均未提及)。
|
|
79
|
+
处理方式:补充 P2 或新增 Pn 覆盖
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 规则 3:测试覆盖检查
|
|
83
|
+
|
|
84
|
+
**定义**:tests.md 中的用例与 prompt 的测试要求不一致。
|
|
85
|
+
|
|
86
|
+
**检查方法**:
|
|
87
|
+
1. 检查每份 prompt 的"测试要求"是否覆盖了 tests.md 中对应章节的全部用例
|
|
88
|
+
2. 检查 prompt 中"未执行测试及原因"是否合理
|
|
89
|
+
|
|
90
|
+
**标记方式**:
|
|
91
|
+
```
|
|
92
|
+
⚠️ 测试覆盖不足:tests.md T3.2(边界:资源刚好等于业务阈值)
|
|
93
|
+
在 prompt/p2-charge-order.md 中未提及。
|
|
94
|
+
处理方式:补充到 P2 测试要求中
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 自动化检查建议
|
|
100
|
+
|
|
101
|
+
在生成所有 prompt 后,执行以下检查:
|
|
102
|
+
|
|
103
|
+
1. **生成矩阵**:从 spec.md、design.md、tasks.md、tests.md、prompt/*.md 中提取对应关系
|
|
104
|
+
2. **扫描漂移**:对比 prompt 内容与设计文档,标记未定义的方案
|
|
105
|
+
3. **扫描遗漏**:对比设计文档与 prompt 覆盖范围,标记未覆盖的章节
|
|
106
|
+
4. **输出报告**:列出所有漂移和遗漏项,供人工确认
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# 验收证据完整性门禁
|
|
2
|
+
|
|
3
|
+
Use this reference whenever SDD docs, implementation prompts, or test reports
|
|
4
|
+
claim that an API, integration flow, external dependency, dropdown, enum, or
|
|
5
|
+
frontend payload has been tested.
|
|
6
|
+
|
|
7
|
+
## Hard Gates
|
|
8
|
+
|
|
9
|
+
- Do not mark L3/L4 tests as passed without real evidence.
|
|
10
|
+
- Do not mark any Maven or Gradle test evidence as passed when the output says
|
|
11
|
+
`Tests are skipped` / `测试被跳过`. `BUILD SUCCESS` only proves the build
|
|
12
|
+
finished; it does not prove tests ran.
|
|
13
|
+
- Do not collapse multiple Maven commands into one test count. Each command
|
|
14
|
+
must have its own `Tests run` summary. If a wildcard such as
|
|
15
|
+
`-Dtest='*P47*'` does not match a needed test class, record and execute a
|
|
16
|
+
separate command for that class.
|
|
17
|
+
- Do not keep deleted methods, removed classes, or old algorithms in current
|
|
18
|
+
evidence tables. Old anchors may be mentioned only as explicitly deleted or
|
|
19
|
+
historical context.
|
|
20
|
+
- Do not treat a generic fallback error as success unless the requirement
|
|
21
|
+
explicitly defines that fallback as the expected business result.
|
|
22
|
+
- Do not use placeholder values such as `TEST_PARK_001` to prove frontend or
|
|
23
|
+
production-like integration unless the source of that value is documented.
|
|
24
|
+
- Do not let mock-only evidence close a case that requires real frontend data,
|
|
25
|
+
real database state, real operator/site/park codes, real token, or an external
|
|
26
|
+
SDK/service call.
|
|
27
|
+
- Do not let a test controller, mock endpoint, bypass-auth endpoint, or direct
|
|
28
|
+
service-call endpoint close a case that requires a real external entry.
|
|
29
|
+
- Do not treat one repository's schema verification as complete when sibling
|
|
30
|
+
services copy the same PO/Mapper or read the same table.
|
|
31
|
+
- If required test data is missing, mark the case `Blocked: missing test data`
|
|
32
|
+
and ask for or discover the data before claiming completion.
|
|
33
|
+
|
|
34
|
+
## tests.md Requirements
|
|
35
|
+
|
|
36
|
+
For every L3/L4 or frontend integration case, include these columns or equivalent
|
|
37
|
+
fields:
|
|
38
|
+
|
|
39
|
+
| Field | Required content |
|
|
40
|
+
|---|---|
|
|
41
|
+
| 用例 ID | Stable test id, referenced from spec/tasks/prompt |
|
|
42
|
+
| 接口/流程 | Full URL or user workflow |
|
|
43
|
+
| 数据来源 | User-provided, frontend captured payload, DB query, seeded fixture, or mock |
|
|
44
|
+
| 关键参数 | Real values such as parkCode/operatorId/plotId/templateId; no unexplained placeholders |
|
|
45
|
+
| 预期断言 | Response, DB, log, and external-call assertions |
|
|
46
|
+
| 证据要求 | curl/request/response/DB/log/external response required in test-report.md |
|
|
47
|
+
| 证据等级 | Mock only / Test endpoint / Real external entry |
|
|
48
|
+
|
|
49
|
+
For dropdowns, enums, external SDK calls, device callbacks, payment/refund,
|
|
50
|
+
invoice, export, import, and cross-system flows, add at least one real-data case
|
|
51
|
+
or explicitly mark the case blocked.
|
|
52
|
+
|
|
53
|
+
## test-report.md Requirements
|
|
54
|
+
|
|
55
|
+
Every passed L3/L4 case must include:
|
|
56
|
+
|
|
57
|
+
- test id and requirement/spec reference
|
|
58
|
+
- environment, profile, port, context path, branch, and commit
|
|
59
|
+
- exact command or curl
|
|
60
|
+
- real request parameters and where they came from
|
|
61
|
+
- raw or summarized response
|
|
62
|
+
- assertion result
|
|
63
|
+
- database evidence when state changes or persistence matters
|
|
64
|
+
- relevant logs
|
|
65
|
+
- external SDK/service request and response when external dependencies matter
|
|
66
|
+
- evidence level: `Mock only`, `Test endpoint`, `Partial real entry`, or
|
|
67
|
+
`Real integration passed`
|
|
68
|
+
- for cross-repository database contracts: source schema, each consumer
|
|
69
|
+
repository, entity/Mapper/SQL fields, real database columns, and conclusion
|
|
70
|
+
- exact command-to-result mapping for every automated test command. If the same
|
|
71
|
+
command appears with different `Tests run` values, the report is not
|
|
72
|
+
acceptable until reconciled.
|
|
73
|
+
- for sibling repositories whose build config skips tests by default, record the
|
|
74
|
+
direct command result (`Tests are skipped` if applicable), the temporary
|
|
75
|
+
change or profile that makes tests run, the real `Tests run` output, and the
|
|
76
|
+
clean git status after rollback.
|
|
77
|
+
|
|
78
|
+
If any of those are absent, status must be `Not executed`, `Blocked`, or
|
|
79
|
+
`Partially verified`, not `Passed`.
|
|
80
|
+
|
|
81
|
+
Before delivery, run:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
~/.codex/hooks/superflow-test-report-lint.py <embedded test-report.md>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
For root aggregate reports, run the same script with `--warn-only` and review
|
|
88
|
+
all warnings before signing off.
|
|
89
|
+
|
|
90
|
+
## Cross-Repository Schema Rule
|
|
91
|
+
|
|
92
|
+
When a table is shared across repositories or a service copies another
|
|
93
|
+
service's PO/Entity/Mapper:
|
|
94
|
+
|
|
95
|
+
- identify the source-of-truth schema: version SQL, database contract, and
|
|
96
|
+
`SHOW CREATE TABLE`
|
|
97
|
+
- list every consuming repository and runtime path, including interconnect,
|
|
98
|
+
callback, scheduled job, import/export, and test endpoint paths
|
|
99
|
+
- compare MyBatis-Plus `@TableName` entity fields, `BaseMapper` default
|
|
100
|
+
selection, Mapper XML/resultMap, and handwritten SQL against real database
|
|
101
|
+
columns
|
|
102
|
+
- fields removed from the final schema must be removed from mapped entities or
|
|
103
|
+
marked `@TableField(exist = false)`
|
|
104
|
+
- if code still queries a removed column, the fix is code/schema contract
|
|
105
|
+
alignment, not adding obsolete columns back to test database
|
|
106
|
+
|
|
107
|
+
The case is blocked if any consumer repository maps or queries a non-existent
|
|
108
|
+
column.
|
|
109
|
+
|
|
110
|
+
## Red-Green Rule
|
|
111
|
+
|
|
112
|
+
For bug fixes and CR/Px follow-ups:
|
|
113
|
+
|
|
114
|
+
1. Record the red evidence first: the exact failing test, curl, or workflow
|
|
115
|
+
before the fix, including the error response/log/DB mismatch.
|
|
116
|
+
2. Apply the fix.
|
|
117
|
+
3. Run the same evidence path again and record the green result.
|
|
118
|
+
|
|
119
|
+
For new features where no old failing path exists, use a negative control:
|
|
120
|
+
|
|
121
|
+
- one invalid or unauthorized case fails with the expected error
|
|
122
|
+
- one real happy-path case passes with response and DB/log evidence
|
|
123
|
+
|
|
124
|
+
## External Dependency Rule
|
|
125
|
+
|
|
126
|
+
When an external service is unavailable:
|
|
127
|
+
|
|
128
|
+
- record the external request parameters, endpoint/config source, exception type,
|
|
129
|
+
external code/message if available, and whether the failure is environmental or
|
|
130
|
+
code-related
|
|
131
|
+
- do not mark the business case passed unless the requirement only promises a
|
|
132
|
+
stable error under external failure
|
|
133
|
+
- keep the delivery conclusion explicit: `Blocked by external dependency`,
|
|
134
|
+
`Code path verified with mock`, or `Real integration passed`
|