feat(mcp): 新增短信验证码提取工具 sms.vercode.latest.query(REQ-20261113-0009)

按手机号提取 m0 sms_send_record 最近一条验证码(buss_type=验证码+soft_delete=0+id DESC
首条),正则提取 4-8 位数字码,send_state 不过滤并配文案,返回 ageSeconds 供判断 90s
redis 有效期。零行级权限,安全模型靠专用 scope 门禁:prod 只绑研发专用 scope 6、dev 只绑
测试专用 scope,显式排除业务 scope(全平台唯一)。王恒拍板 4 决策点全部按建议值执行。
测试:SmsToolsTest 10 例全绿;测试环境冒烟 4/4(有记录提取/无记录 notice/非法入参/
operation scope 拒绝)。
This commit is contained in:
my_local_kimi_dev2
2026-11-13 17:41:41 +08:00
parent f2eb8afcdd
commit 021cee37df
8 changed files with 503 additions and 0 deletions
+8
View File
@@ -107,6 +107,14 @@ SELECT s.id, t.id, 0 FROM agent_scope s JOIN tool t
WHERE s.code = 'test' AND t.kind = 'write'
AND NOT EXISTS (SELECT 1 FROM scope_tool st WHERE st.scope_id = s.id AND st.tool_id = t.id);
-- 短信验证码提取(sms.vercode.latest.query,REQ-20261113-0009):验证码 = 登录敏感原语,
-- 全平台唯一"显式排除业务 scope"的工具——dev 只绑「测试专用」(code='test'),对应 prod 只绑研发专用 scope 6;
-- 不进入 operation/hardware/ops-query/sync 等任何其他作用域。
INSERT INTO scope_tool (scope_id, tool_id, create_id)
SELECT s.id, t.id, 0 FROM agent_scope s JOIN tool t
WHERE s.code = 'test' AND t.name = 'sms.vercode.latest.query'
AND NOT EXISTS (SELECT 1 FROM scope_tool st WHERE st.scope_id = s.id AND st.tool_id = t.id);
COMMIT;
-- 校验