@kunlv/atdc 1.0.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/AGENTS.md +58 -0
- package/GO.md +245 -0
- package/bin/add-command.py +144 -0
- package/bin/atdc.js +460 -0
- package/bin/cls.js +98 -0
- package/central/link.sh +60 -0
- package/central/ticket_center_server/.handoffs/TASK-238389_QYinVipLimit.md +128 -0
- package/central/ticket_center_server/.test_plans/TASK-227254-SupportMembership-self-test-plan.md +566 -0
- package/central/ticket_center_server/.test_plans/task-238389-qyin-vip-limit-self-test-plan.md +210 -0
- package/commands/claude/atd.md +3 -0
- package/commands/claude/atdc/1-spec.md +5 -0
- package/commands/claude/atdc/1-update.md +5 -0
- package/commands/claude/atdc/2-qa.md +3 -0
- package/commands/claude/atdc/3-impl-skip-spec.md +5 -0
- package/commands/claude/atdc/3-impl.md +3 -0
- package/commands/claude/atdc/4-verify.md +3 -0
- package/commands/claude/atdc/5-done.md +3 -0
- package/commands/claude/atdc/add-command.md +4 -0
- package/commands/claude/atdc/add-to-hc.md +3 -0
- package/commands/claude/atdc/analysis-cls-log.md +4 -0
- package/commands/claude/atdc/article.md +6 -0
- package/commands/claude/atdc/bugfix.md +4 -0
- package/commands/claude/atdc/code-simplifier.md +8 -0
- package/commands/claude/atdc/commit.md +4 -0
- package/commands/claude/atdc/compound.md +5 -0
- package/commands/claude/atdc/context.md +3 -0
- package/commands/claude/atdc/diagnose.md +8 -0
- package/commands/claude/atdc/git-guardrails.md +18 -0
- package/commands/claude/atdc/grill-with-docs.md +8 -0
- package/commands/claude/atdc/handoff.md +8 -0
- package/commands/claude/atdc/health.md +3 -0
- package/commands/claude/atdc/learn.md +4 -0
- package/commands/claude/atdc/review.md +10 -0
- package/commands/claude/atdc/search.md +4 -0
- package/commands/claude/atdc/strategy.md +3 -0
- package/commands/claude/atdc/table2xlsx.md +4 -0
- package/commands/claude/atdc/test-plan.md +5 -0
- package/commands/claude/atdc/travel-planner.md +4 -0
- package/commands/claude/atdc/xlsx2sql-insert.md +4 -0
- package/commands/claude/atdc/xlsx2sql-update.md +4 -0
- package/commands/claude/atdc/zoom-out.md +8 -0
- package/commands/codex/atdc/SKILL.md +8 -0
- package/commands/codex/atdc-1-spec/SKILL.md +8 -0
- package/commands/codex/atdc-1-update/SKILL.md +8 -0
- package/commands/codex/atdc-2-qa/SKILL.md +8 -0
- package/commands/codex/atdc-3-impl/SKILL.md +8 -0
- package/commands/codex/atdc-3-impl-skip-spec/SKILL.md +8 -0
- package/commands/codex/atdc-4-verify/SKILL.md +8 -0
- package/commands/codex/atdc-5-done/SKILL.md +8 -0
- package/commands/codex/atdc-add-command/SKILL.md +7 -0
- package/commands/codex/atdc-add-to-hc/SKILL.md +8 -0
- package/commands/codex/atdc-analysis-cls-log/SKILL.md +5 -0
- package/commands/codex/atdc-article/SKILL.md +8 -0
- package/commands/codex/atdc-bugfix/SKILL.md +5 -0
- package/commands/codex/atdc-code-simplifier/SKILL.md +7 -0
- package/commands/codex/atdc-commit/SKILL.md +7 -0
- package/commands/codex/atdc-compound/SKILL.md +8 -0
- package/commands/codex/atdc-context/SKILL.md +8 -0
- package/commands/codex/atdc-diagnose/SKILL.md +9 -0
- package/commands/codex/atdc-git-guardrails/SKILL.md +19 -0
- package/commands/codex/atdc-grill-with-docs/SKILL.md +9 -0
- package/commands/codex/atdc-handoff/SKILL.md +9 -0
- package/commands/codex/atdc-health/SKILL.md +8 -0
- package/commands/codex/atdc-learn/SKILL.md +7 -0
- package/commands/codex/atdc-review/SKILL.md +49 -0
- package/commands/codex/atdc-search/SKILL.md +5 -0
- package/commands/codex/atdc-strategy/SKILL.md +8 -0
- package/commands/codex/atdc-table2xlsx/SKILL.md +8 -0
- package/commands/codex/atdc-test-plan/SKILL.md +13 -0
- package/commands/codex/atdc-travel-planner/SKILL.md +7 -0
- package/commands/codex/atdc-xlsx2sql-insert/SKILL.md +8 -0
- package/commands/codex/atdc-xlsx2sql-update/SKILL.md +8 -0
- package/commands/codex/atdc-zoom-out/SKILL.md +9 -0
- package/commands/cursor/atdc/SKILL.md +8 -0
- package/commands/cursor/atdc-1-spec/SKILL.md +8 -0
- package/commands/cursor/atdc-1-update/SKILL.md +8 -0
- package/commands/cursor/atdc-2-qa/SKILL.md +8 -0
- package/commands/cursor/atdc-3-impl/SKILL.md +8 -0
- package/commands/cursor/atdc-3-impl-skip-spec/SKILL.md +8 -0
- package/commands/cursor/atdc-4-verify/SKILL.md +8 -0
- package/commands/cursor/atdc-5-done/SKILL.md +8 -0
- package/commands/cursor/atdc-add-command/SKILL.md +7 -0
- package/commands/cursor/atdc-add-to-hc/SKILL.md +8 -0
- package/commands/cursor/atdc-analysis-cls-log/SKILL.md +5 -0
- package/commands/cursor/atdc-article/SKILL.md +8 -0
- package/commands/cursor/atdc-bugfix/SKILL.md +5 -0
- package/commands/cursor/atdc-code-simplifier/SKILL.md +7 -0
- package/commands/cursor/atdc-commit/SKILL.md +7 -0
- package/commands/cursor/atdc-compound/SKILL.md +8 -0
- package/commands/cursor/atdc-context/SKILL.md +8 -0
- package/commands/cursor/atdc-diagnose/SKILL.md +8 -0
- package/commands/cursor/atdc-git-guardrails/SKILL.md +18 -0
- package/commands/cursor/atdc-grill-with-docs/SKILL.md +8 -0
- package/commands/cursor/atdc-handoff/SKILL.md +8 -0
- package/commands/cursor/atdc-health/SKILL.md +8 -0
- package/commands/cursor/atdc-learn/SKILL.md +7 -0
- package/commands/cursor/atdc-review/SKILL.md +49 -0
- package/commands/cursor/atdc-search/SKILL.md +5 -0
- package/commands/cursor/atdc-strategy/SKILL.md +8 -0
- package/commands/cursor/atdc-table2xlsx/SKILL.md +8 -0
- package/commands/cursor/atdc-test-plan/SKILL.md +7 -0
- package/commands/cursor/atdc-travel-planner/SKILL.md +7 -0
- package/commands/cursor/atdc-xlsx2sql-insert/SKILL.md +8 -0
- package/commands/cursor/atdc-xlsx2sql-update/SKILL.md +8 -0
- package/commands/cursor/atdc-zoom-out/SKILL.md +8 -0
- package/commands/opencode/atd.md +6 -0
- package/commands/opencode/atdc/1-spec.md +8 -0
- package/commands/opencode/atdc/1-update.md +8 -0
- package/commands/opencode/atdc/2-qa.md +6 -0
- package/commands/opencode/atdc/3-impl-skip-spec.md +8 -0
- package/commands/opencode/atdc/3-impl.md +6 -0
- package/commands/opencode/atdc/4-verify.md +6 -0
- package/commands/opencode/atdc/5-done.md +6 -0
- package/commands/opencode/atdc/add-command.md +6 -0
- package/commands/opencode/atdc/add-to-hc.md +6 -0
- package/commands/opencode/atdc/analysis-cls-log.md +6 -0
- package/commands/opencode/atdc/article.md +6 -0
- package/commands/opencode/atdc/bugfix.md +6 -0
- package/commands/opencode/atdc/code-simplifier.md +8 -0
- package/commands/opencode/atdc/commit.md +6 -0
- package/commands/opencode/atdc/compound.md +8 -0
- package/commands/opencode/atdc/context.md +6 -0
- package/commands/opencode/atdc/diagnose.md +8 -0
- package/commands/opencode/atdc/git-guardrails.md +18 -0
- package/commands/opencode/atdc/grill-with-docs.md +8 -0
- package/commands/opencode/atdc/handoff.md +8 -0
- package/commands/opencode/atdc/health.md +6 -0
- package/commands/opencode/atdc/learn.md +6 -0
- package/commands/opencode/atdc/review.md +7 -0
- package/commands/opencode/atdc/search.md +6 -0
- package/commands/opencode/atdc/strategy.md +6 -0
- package/commands/opencode/atdc/table2xlsx.md +6 -0
- package/commands/opencode/atdc/test-plan.md +6 -0
- package/commands/opencode/atdc/travel-planner.md +6 -0
- package/commands/opencode/atdc/xlsx2sql-insert.md +6 -0
- package/commands/opencode/atdc/xlsx2sql-update.md +6 -0
- package/commands/opencode/atdc/zoom-out.md +8 -0
- package/config/cls-defaults.json +19 -0
- package/hooks/atd-archive.sh +86 -0
- package/hooks/atd-state.sh +165 -0
- package/hooks/evidence-hook.sh +88 -0
- package/hooks/evidence-log.sh +54 -0
- package/hooks/guardrails.sh +65 -0
- package/hooks/handoff-compress.sh +104 -0
- package/hooks/phase-guard.sh +134 -0
- package/hooks/phase-write-guard.sh +96 -0
- package/hooks/ponytail-fix.sh +179 -0
- package/hooks/ponytail-guard.sh +66 -0
- package/hooks/ponytail-scan.sh +62 -0
- package/install.sh +276 -0
- package/package.json +20 -0
- package/packages/cls/bin/cls.js +146 -0
- package/packages/cls/config/defaults.json +17 -0
- package/packages/cls/mcp/server.js +142 -0
- package/packages/cls/package.json +29 -0
- package/packages/cls/scripts/postinstall.js +19 -0
- package/packages/cls/src/client.js +262 -0
- package/prompts/1-spec.md +271 -0
- package/prompts/1-update.md +198 -0
- package/prompts/2-qa.md +164 -0
- package/prompts/3-impl-bugfix.md +271 -0
- package/prompts/3-impl.md +419 -0
- package/prompts/4-verify.md +160 -0
- package/prompts/5-done.md +227 -0
- package/prompts/6-article.md +571 -0
- package/prompts/X-add-command.md +60 -0
- package/prompts/X-add-to-hc.md +178 -0
- package/prompts/X-analysis-cls-log.md +68 -0
- package/prompts/X-bugfix.md +10 -0
- package/prompts/X-code-simplifier.md +38 -0
- package/prompts/X-commit.md +116 -0
- package/prompts/X-compound.md +188 -0
- package/prompts/X-context-scan.md +101 -0
- package/prompts/X-diagnose.md +116 -0
- package/prompts/X-grill-with-docs.md +120 -0
- package/prompts/X-handoff.md +80 -0
- package/prompts/X-health.md +78 -0
- package/prompts/X-learn.md +151 -0
- package/prompts/X-review.md +417 -0
- package/prompts/X-search.md +74 -0
- package/prompts/X-strategy.md +95 -0
- package/prompts/X-table2xlsx.md +46 -0
- package/prompts/X-test-plan.md +436 -0
- package/prompts/X-travel-planner.md +22 -0
- package/prompts/X-xlsx2sql-insert.md +34 -0
- package/prompts/X-xlsx2sql-update.md +40 -0
- package/prompts/X-zoom-out.md +119 -0
- package/reference/diagnose-loop.md +66 -0
- package/reference/gates.md +90 -0
- package/reference/git-guardrails.md +71 -0
- package/reference/guards.md +275 -0
- package/reference/learn.md +100 -0
- package/reference/memory.md +190 -0
- package/reference/risk.md +74 -0
- package/reference/tdd.md +40 -0
- package/scripts/svg2png.js +46 -0
- package/src/cls/client.js +244 -0
- package/src/constants.js +49 -0
- package/src/evidence/ai-draft-metrics.js +157 -0
- package/src/evidence/canvas.js +184 -0
- package/src/evidence/index.js +98 -0
- package/src/evidence/sink-events.js +165 -0
- package/src/evidence/stage-timing.js +112 -0
- package/src/installers/claude.js +79 -0
- package/src/installers/codex.js +62 -0
- package/src/installers/opencode.js +72 -0
- package/src/manifest/ponytail-patterns.json +185 -0
- package/src/mcp/cls-mcp-server.js +142 -0
- package/src/utils.js +79 -0
- package/src/validators/state-validate.js +123 -0
- package/templates/.phase-state.json +13 -0
- package/templates/adr.md +62 -0
- package/templates/changelog.md +21 -0
- package/templates/concepts.md +35 -0
- package/templates/design.md +47 -0
- package/templates/handoff.md +64 -0
- package/templates/learn-skill.md +43 -0
- package/templates/progress.json +17 -0
- package/templates/proposal.md +29 -0
- package/templates/solution.md +36 -0
- package/templates/strategy.md +39 -0
- package/templates/tasks.md +41 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# task-238389-qyin-vip-limit 自测计划(可执行版)
|
|
2
|
+
|
|
3
|
+
> 目标:验证 Q音绿钻发货出站 Redis 全局限流(挂载 `callTencentMusicAPI`)。
|
|
4
|
+
> 分支:`TASK-238389_QYinVipLimit`
|
|
5
|
+
> Change:`openspec/changes/archive/task-238389-qyin-vip-limit/`
|
|
6
|
+
> 变量:`<HOST>` 替换为测试环境(如 `http://127.0.0.1:8080` 或内网 ticketcenter 域名)。
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 第零步:测试前准备
|
|
11
|
+
|
|
12
|
+
### 0.1 代码与单测(无环境依赖,先跑)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
cd /Users/lvkun/Documents/Codes/ticket_center_server.TASK-238389_QYinVipLimit
|
|
16
|
+
go build ./service/rtconf/ ./service/redis/ ./service/rpc/
|
|
17
|
+
go test ./service/rtconf/ ./service/rpc/ \
|
|
18
|
+
-run 'ApolloQMusicVipDeliveryLimiter|EnforceQMusicVipDeliveryRateLimit|ParseDeliveryResponse' \
|
|
19
|
+
-count=1
|
|
20
|
+
# 预期:PASS
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 0.2 Apollo 配置
|
|
24
|
+
|
|
25
|
+
Key:`ApolloQMusicVipDeliveryLimiterConf`
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"switch": 0,
|
|
30
|
+
"qps_limit": 200
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
联调限流时改为:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"switch": 1,
|
|
39
|
+
"qps_limit": 2
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> `qps_limit=2` 便于人工打满;验完改回 `200` 或 `switch=0`。
|
|
44
|
+
|
|
45
|
+
### 0.3 Redis 观察(可选)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# 限流 key(跨 Pod 全局)
|
|
49
|
+
redis-cli -c GET qmusic:vip:delivery:qps
|
|
50
|
+
# 或按集群实际命令查看 redis_rate 相关 key(AllowPerSecond 写入)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 0.4 预置测试单(需真实可发货绿钻单)
|
|
54
|
+
|
|
55
|
+
| 变量 | 说明 |
|
|
56
|
+
|------|------|
|
|
57
|
+
| `<USERID>` | 已支付且含 Q音绿钻权益的 userid |
|
|
58
|
+
| `<ORDER_NO>` | 对应 order_no(订单 status=已支付) |
|
|
59
|
+
| 验收 | `user_ticket_rights`:QY `right_type=4` 且发放成功 `status=1`(以环境表结构为准) |
|
|
60
|
+
|
|
61
|
+
```sql
|
|
62
|
+
-- 按库表分片规则查询(示例,库名/表后缀按 userid 分片改)
|
|
63
|
+
SELECT id, userid, order_no, right_type, status, out_order_no, sync_status
|
|
64
|
+
FROM user_ticket_rights_X
|
|
65
|
+
WHERE userid = <USERID> AND order_no = '<ORDER_NO>';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 0.5 环境变量
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
export HOST=http://127.0.0.1:8080
|
|
72
|
+
export USERID=<USERID>
|
|
73
|
+
export ORDER_NO=<ORDER_NO>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 链 1:单测与语义回归(无外部依赖)
|
|
79
|
+
|
|
80
|
+
| # | 测试场景 | 触发方式 | 预期结果 | 验证方法 | 状态 |
|
|
81
|
+
|---|---------|---------|---------|---------|:--:|
|
|
82
|
+
| 1.1 | 配置默认关闭且 QPS<300 | `go test ./service/rtconf/ -run ApolloQMusicVipDeliveryLimiter -count=1` | PASS | 终端 PASS | ☐ |
|
|
83
|
+
| 1.2 | 限流:关/放行/拒绝/fail-open | `go test ./service/rpc/ -run EnforceQMusicVipDeliveryRateLimit -count=1` | 4 用例 PASS | 终端 PASS | ☐ |
|
|
84
|
+
| 1.3 | 未知码仍为 Retry(3) | `go test ./service/rpc/ -run ParseDeliveryResponse -count=1` | 未知码 status=Retry,非 Shipped | 终端 PASS | ☐ |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 链 2:Apollo 开关与热更新
|
|
89
|
+
|
|
90
|
+
| # | 测试场景 | 触发方式 | 预期结果 | 验证方法 | 状态 |
|
|
91
|
+
|---|---------|---------|---------|---------|:--:|
|
|
92
|
+
| 2.1 | 默认关闭不限流 | Apollo 设 `{"switch":0,"qps_limit":200}` 后发 1 次 SendVip(见链 3) | 无 `rate limited` 日志 | `grep -E "rate limited\|fail-open" <日志>` 无命中 | ☐ |
|
|
93
|
+
| 2.2 | 打开限流且 QPS=2 | Apollo 改为 `{"switch":1,"qps_limit":2}`(等 Watch 生效约数秒) | 后续请求受配额约束 | 链 3.2 | ☐ |
|
|
94
|
+
| 2.3 | 紧急关闭 | Apollo 改回 `"switch":0` | 立即不再限流 | 再发 SendVip 无 rate limited | ☐ |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 链 3:内部发货接口 `POST /v1/ticket_rights/send_vip`
|
|
99
|
+
|
|
100
|
+
> 路由:`CheckServerSignature`(服务端签名,非客户端 kugo signature)。
|
|
101
|
+
> 网关侧常见路径:`/inner/v1/ticket_rights/send_vip` → 服务 `/v1/ticket_rights/send_vip`。
|
|
102
|
+
> 以下 curl 需带环境要求的 **Server Signature**(按现网内部调用方式补 header/query;无签名环境可用已有内调工具)。
|
|
103
|
+
|
|
104
|
+
### 3.1 Switch=0:正常发放(或幂等成功)
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# 按内部约定补签名后执行;body 示例:
|
|
108
|
+
curl -s -X POST "${HOST}/v1/ticket_rights/send_vip" \
|
|
109
|
+
-H 'Content-Type: application/json' \
|
|
110
|
+
-d "{\"userid\":${USERID},\"order_no\":\"${ORDER_NO}\"}"
|
|
111
|
+
# 预期:errcode=0 / 业务成功;或已发放幂等成功
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
| # | 测试场景 | 触发方式 | 预期结果 | 验证方法 | 状态 |
|
|
115
|
+
|---|---------|---------|---------|---------|:--:|
|
|
116
|
+
| 3.1 | 关闭限流可发货 | 上方 curl(Switch=0) | 成功或幂等成功 | 响应 + SQL 权益 status | ☐ |
|
|
117
|
+
| 3.2 | QPS=2 打满后拒绝 | Switch=1,qps=2;1 秒内连续 curl ≥5 次 | 部分失败;日志含 `qmusic vip delivery rate limited` 或 `callTencentMusicAPI rate limited` | `grep "rate limited" <日志>` | ☐ |
|
|
118
|
+
| 3.3 | 限流失败不落成功态 | 对未发放成功的单,在 3.2 失败后查库 | 不得仅因限流写成绿钻发货成功;亦不得写成永久不允许(status=4) | SQL 查 rights / 订单 sync | ☐ |
|
|
119
|
+
| 3.4 | 稍后重试可成功 | 等待 >1s 或调高 qps 后再 curl 1 次 | 可重试成功(配额恢复) | 响应成功 + 权益 status=1 | ☐ |
|
|
120
|
+
|
|
121
|
+
### 3.2 压测观察脚本(可选)
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# 1 秒内连打 10 次(仍需补 Server Signature)
|
|
125
|
+
for i in $(seq 1 10); do
|
|
126
|
+
curl -s -X POST "${HOST}/v1/ticket_rights/send_vip" \
|
|
127
|
+
-H 'Content-Type: application/json' \
|
|
128
|
+
-d "{\"userid\":${USERID},\"order_no\":\"${ORDER_NO}\"}" &
|
|
129
|
+
done
|
|
130
|
+
wait
|
|
131
|
+
grep -E "rate limited|fail-open|callTencentMusicAPI" <应用日志路径>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 链 4:CLI 补单 `rights_grant_check`(限流主战场)
|
|
137
|
+
|
|
138
|
+
| # | 测试场景 | 触发方式 | 预期结果 | 验证方法 | 状态 |
|
|
139
|
+
|---|---------|---------|---------|---------|:--:|
|
|
140
|
+
| 4.1 | 低 QPS 下补单出现限流 | Apollo `switch=1,qps_limit=2`;`./bin/cli rights_grant_check -t=100 -i=0 -w=8`(按环境调整) | 日志出现 `rate limited`;不把失败单标成功 | grep 日志;抽查 rights 表 | ☐ |
|
|
141
|
+
| 4.2 | 关闭限流后积压消化 | Apollo `switch=0` 或 `qps_limit=200`;再跑同一 CLI | 待发放绿钻逐步成功 | 积压条数下降 / status 变成功 | ☐ |
|
|
142
|
+
| 4.3 | 并发不超对方 300(观察) | `qps_limit=200`;多库 job 并行(如 `-i=0..7`) | 对 Q音出站峰值 ≤200(有余量) | 监控/对端或本侧 callTencentMusicAPI done 日志 QPS | ☐ |
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# 单库示例
|
|
146
|
+
./bin/cli rights_grant_check -t=100 -i=0 -w=8
|
|
147
|
+
# 多库(运维脚本按实际)
|
|
148
|
+
# for i in 0 1 2 3 4 5 6 7; do ./bin/cli rights_grant_check -t=100 -i=$i -w=8 & done; wait
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 链 5:回收路径不受影响(回归)
|
|
154
|
+
|
|
155
|
+
| # | 测试场景 | 触发方式 | 预期结果 | 验证方法 | 状态 |
|
|
156
|
+
|---|---------|---------|---------|---------|:--:|
|
|
157
|
+
| 5.1 | 退会员/回收不走发货限流 | 对已发绿钻单走既有 `POST /v1/ticket_rights/refund_vip`(按环境签名) | 回收逻辑仍按原链路;日志无发货 rate limited(除非另有回收限流) | 响应 + 日志 | ☐ |
|
|
158
|
+
|
|
159
|
+
> 本期规格:**仅** `callTencentMusicAPI`(发货)限流,不含 `callTencentMusicRecoveryAPI`。
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 执行顺序建议
|
|
164
|
+
|
|
165
|
+
1. 链 1(单测)→ 2.1(确认默认关)
|
|
166
|
+
2. 准备 `<USERID>/<ORDER_NO>` → 3.1
|
|
167
|
+
3. 调 Apollo QPS=2 → 3.2 / 3.3 / 3.4
|
|
168
|
+
4. 链 4 CLI 压限流与恢复
|
|
169
|
+
5. 链 5 回收回归
|
|
170
|
+
6. Apollo 恢复:`switch=0` 或 `qps_limit=200`
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 快速回归命令
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
go build ./service/rtconf/ ./service/redis/ ./service/rpc/
|
|
178
|
+
go test ./service/rtconf/ ./service/rpc/ \
|
|
179
|
+
-run 'ApolloQMusicVipDeliveryLimiter|EnforceQMusicVipDeliveryRateLimit|ParseDeliveryResponse' \
|
|
180
|
+
-count=1
|
|
181
|
+
|
|
182
|
+
# 日志关键词
|
|
183
|
+
grep -E "qmusic vip delivery rate limited|callTencentMusicAPI rate limited|rate check failed, fail-open" <日志文件>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 接口与入口速查
|
|
189
|
+
|
|
190
|
+
| 类型 | 路径/命令 | 说明 |
|
|
191
|
+
|------|-----------|------|
|
|
192
|
+
| HTTP | `POST /v1/ticket_rights/send_vip` | `CheckServerSignature`;内调常经 `/inner/...` |
|
|
193
|
+
| CLI | `rights_grant_check` | 延迟发放扫表 → `rpc.SendSvip` → 绿钻出站 |
|
|
194
|
+
| CLI | `resend_qmusic_svip` | CSV 补发(可选回归) |
|
|
195
|
+
| 出站门禁 | `callTencentMusicAPI` → `enforceQMusicVipDeliveryRateLimit` | Redis key `qmusic:vip:delivery:qps` |
|
|
196
|
+
| Apollo | `ApolloQMusicVipDeliveryLimiterConf` | `switch` + `qps_limit` |
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Phase 1 确认
|
|
201
|
+
|
|
202
|
+
文档与集成测试均已生成:
|
|
203
|
+
|
|
204
|
+
- 📄 `docs/test_plans/task-238389-qyin-vip-limit-self-test-plan.md`
|
|
205
|
+
- 🧪 `service/biz/rights/rights_qmusic_vip_limit_integration_test.go`
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
go test -run TestKugoBuildSignature ./service/biz/rights/ -count=1
|
|
209
|
+
go test -run "TestQyinVipLimitInt_L1S1" ./service/biz/rights/ -count=1 -v # 需 QYIN_VIP_LIMIT_LIVE=1
|
|
210
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Git 安全防护(安装/检查 pre-push hook,拦截危险命令)。用法 /atdc:git-guardrails [install|check]
|
|
3
|
+
---
|
|
4
|
+
执行以下步骤:
|
|
5
|
+
|
|
6
|
+
1. 检查 hook 是否已安装:
|
|
7
|
+
```bash
|
|
8
|
+
ls -la .git/hooks/pre-push 2>/dev/null && echo "✅ 已安装" || echo "❌ 未安装"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
2. 如果用户说 `install` 或未安装:
|
|
12
|
+
```bash
|
|
13
|
+
ln -sf ~/atdc/hooks/guardrails.sh .git/hooks/pre-push && echo "✅ git-guardrails 已安装"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
3. 输出当前防护状态(参考 reference/git-guardrails.md 说明规则)
|
|
17
|
+
|
|
18
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 代码级 review(CRG + CodeGraph 双引擎:blast radius + 风险评分 + 测试缺口 + 受影响流程 + 架构洞察),跳过自动路由
|
|
3
|
+
---
|
|
4
|
+
请用 Read 工具读取 ${ATDC_DIR}/prompts/X-review.md,然后根据以下参数开始执行:
|
|
5
|
+
|
|
6
|
+
$ARGUMENTS
|
|
7
|
+
|
|
8
|
+
跳过 GO.md 路由,直接进行代码级 review。无参数时执行全量 review。
|
|
9
|
+
|
|
10
|
+
子模式:delta=仅变更 | pr=PR review | gaps=仅测试缺口 | flows=仅受影响流程 | arch=架构健康检查 | crg=CRG 深度分析
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: atd:git-guardrails
|
|
3
|
+
description: Git安全防护(拦截push main/force push/WIP)。触发词:git-guardrails、git防护。
|
|
4
|
+
---
|
|
5
|
+
执行以下步骤:
|
|
6
|
+
|
|
7
|
+
1. 检查 hook 是否已安装:
|
|
8
|
+
```bash
|
|
9
|
+
ls -la .git/hooks/pre-push 2>/dev/null && echo "✅ 已安装" || echo "❌ 未安装"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. 如果用户说 `install` 或未安装:
|
|
13
|
+
```bash
|
|
14
|
+
ln -sf ~/atdc/hooks/guardrails.sh .git/hooks/pre-push && echo "✅ git-guardrails 已安装"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. 输出当前防护状态(参考 reference/git-guardrails.md 说明规则)
|
|
18
|
+
|
|
19
|
+
$ARGUMENTS
|