api-review daily audit 2026-09-07: zh 200 descriptions, tools/invoke restrictions, api-catalog sync - #357
Merged
Merged
Conversation
… tools/invoke restrictions, sync api-catalog
- 16 ZH ops (rum remote-config, safari artifact/sign, on-call schedule/by-person)
carried responses.200.description "Success"; aligned to the 成功 convention.
- POST /monit/datasource/tools/invoke gained its ## Restrictions block. Limits
(32/s, 2000/min per account) and permission class (Datasources Read, monit)
come from live pgy_proxy.t_api id 18847 and pgy_account.t_permission_factor,
matching fc-pgy 9c5494a / 6be0e3a - not constructed values.
- {en,zh}/openapi/api-catalog.mdx: +1 row, Monitors 39->40, total 353->354.
- docs.json untouched: no operation added or removed.
- lint_openapi.py: OK, 12 spec files, no violations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
api-review daily audit — 2026-09-07
--mode generate --scope all --auto,基线为flashduty-docs@d9f1496。本轮没有新增/删除任何 operation(registry 公开行 353,committed spec 354,差集 1 条见下文),因此未改
docs.json(防错铁律 3)。差异总计 9 files / +42 / -40,全部为下列三类语义修正,逐条见「Diff 逐条可解释」。
Per-module operation changes
responses.200.description本地化)POST /monit/datasource/tools/invoke补 Restrictions)openapi.{en,zh}.json{en,zh}/openapi/api-catalog.mdx1. ZH 200 description 本地化(16 个 operation)
rum5 个 remote-config、safari10 个 artifact/sign、on-call的POST /schedule/by-person—— 这些是 2026-09-03 / 09-04 新增的 operation,中文规格里responses.200.description留成了英文Success。同文件既有约定是成功(monitors 40/40、platform 27/27、on-call 190/193 均为成功),按约定补齐。split 与 consolidated 两处同步,修复后全库Success残留 = 0。2.
POST /monit/datasource/tools/invoke补 Restrictions该 operation(2026-09-06
d1c68d0收录)正文只有 Usage 段,缺## Restrictions(EN)/## 限制说明(ZH)。限额与权限不是构造值,取自一手证据:pgy_proxy.t_apiid 18847rate_limits=api:account 32/s、api:account 2000/60s,updated_at=2026-09-07 10:46:22,与 fc-pgy9c5494a(feat(monit): raise account rate limit for datasource tool invoke,AQps 5→32 / AQpm 100→2000)一致。pgy_account.t_permission_factor中dataSource:read:invokeTool→[3008, 3009]= 数据源查看 / 数据源管理(monit)。与/monit/datasource/info因子对完全相同,故沿用其写法(只标读权限)。3. api-catalog 主索引对齐
{en,zh}/openapi/api-catalog.mdx缺/monit/datasource/tools/invoke行(Monitors 计数 39 实际 40、总数 353 实际 354)—— 即 skill Step 5.5 描述的「第二处手工面」。补行 + 计数对齐;docs.json导航本已包含该路径(nav 缺口 0),故未动。Diff 逐条可解释(防错铁律 4)
用
git show HEAD:<path>读基线做 leaf 级深比较:36 处叶子差异 = 32 处 Fix A(16 op × split+consolidated)+ 4 处 Fix B(1 op × split+consolidated × en/zh),unexplained=0。JSON 以
indent=2 / ensure_ascii=False回写,且先验证过 9 个目标文件对 HEAD 字节级往返一致,因此不存在纯排序 diff。openapi.legacy.zh.json未被触碰;12 个 spec 文件全部json.load通过;仓库自带 lint 门python3 scripts/lint_openapi.py→ OK: 12 spec files, no violations。findings.unresolved(本轮未改,需人工裁决)
t_api均为 20/秒·300/分钟;另有rum4 个 10/600 vs 5/100、3 个 2/20 vs 3/60 等)。批量纠正会产生 >300 行 diff,超出一轮 daily 的预算,且 50/1000 是否算「未声明限额的兜底默认」是产品口径问题 → 留给人工决定,本轮只报不改。POST /monit/rule/dstypes在 registry 中已被删除,但生产仍在服务:fc-pgy6be0e3a(2026-09-06)删掉了dataSourceType:read:list行,而pgy_proxy.t_apiid 13430 仍status=enabled、deleted_at=0000-00-00,权限因子t_permission_factor也仍 enabled(→ 3002/3003 告警规则查看/管理)。按「registry 行删除不等于线上删除」的证据,保留 spec 中该 operation,请 monit owner 确认是准备下线还是 registry 误删。POST /account/info缺 Rate limits 行(EN/ZH 均只有 Permissions 行);registryaccount:read:infoAQps=50 / AQpm=1000。application/json200 example(/insight/*/export、/status-page/subscriber/export、/rum/issue/export、/enrichment/mapping/data/download、/safari/artifact/stream、/safari/session/export等)。核实后确认其 200 内容类型本就不是 JSON(text/csv/application/octet-stream/application/x-ndjson/multipart/form-data),属于误报,未构造示例。→ 本轮没有任何构造示例,两处新写文本均来自生产库与 registry 一手数据。ScheduleNotify.advance_in_time缺 epoch 字样:语义是「提前通知秒数」(duration),按 skill 规则不该加 epoch 措辞 → 误报,保持原样。运行环境与流程缺口(需补知识包)
runbooks/api-review-daily.md与runbooks/api-review-apply-patches.py(本会话knowledge/team_2586851485973/runbooks/只有 diagnose-disk-full / diagnose-proxy-5xx / monit-agent-diagnostics / prod-access 四个文件)。因此本轮未能执行「每轮先打补丁」(防错铁律 6),mapping.yaml 对齐与 generate_openapi.py 基线保真补丁均未应用。替代做法:以git show HEAD:为唯一基线,先验证序列化字节级往返,再做 leaf 级 surgical 修改 + 深比较,把 diff 压到 42/40 行。mapping.yaml的providers与 registry provider 字符串存在漂移:status-pagevsstatuspage、/calendar/*实为 providerpgy(mapping 写event)、/route/*未被任何path_prefixes覆盖、/oncall/license/list实为event(mapping 写oncall)、/rum/data|field|resource无对应 scope。若按 skill 的 provider 过滤直跑 analyze,这 44 条公开行会被静默丢弃——很可能就是缺失补丁所修的内容。请补回补丁或修正 mapping。monit-webapi/monit-edge不在 flashcatcloud org 下(clone 返回 Repository not found),monitors 模块沿用 HEAD 内容,本轮仅补 Restrictions,未做 handler 逆向。node/mint,Step 6 的mint broken-links未执行(以脚本化链接检查代替:catalog 缺失 0、nav 缺失 0)。校验命令
补充:同日二轮核实(go-pkg 到位后新增 2 条 unresolved)
首轮
go-pkg未克隆成功(GitHub 443 间歇超时),共享信封无法与代码对照;08:12 重试到位(e196752)后补做两项校验,未改动本 PR 的 diff,只追加发现:monitors / on-call / platform / rum的每个 200 都用SuccessEnvelope(propsrequest_id+data,required=[request_id, data],共 596 处引用),而safari用ResponseEnvelope(propsrequest_id+error+data,required=[request_id],104 处),consolidated 文件里两个 schema 并存。skill 的 generate.md Step 2 把ResponseEnvelope写成规范四件套之一 → 两者不可同时为正。对照一手代码go-pkg/srv/render.go:RequestID+Data(error必不存在),失败分支只填RequestID+Err。故 200 响应里error永不出现(SuccessEnvelope在这一层更准确),但Data带omitempty:handler 传srv.JSON(ctx, nil)时线上响应就是{"request_id": "..."},没有data键 →required=[request_id, data]对这类 operation 偏严。本轮未逐 handler 统计哪些接口实际返回空 data(属 353 op 逐个取证,非 daily 预算),故只标注口径问题、不改文档。raw_message确认不属于公开契约:srv.Error.RawMessage带json:"raw_message,omitempty",理论上可上线;实测 grepgo-pkg/srv/*.go与fc-pgy(排除_test)无任何RawMessage(赋值点,12 个 spec 文件也无raw_message字样 → 现状一致,非缺陷,留此记录以证伪「文档漏字段」这一假设。顺带核实(结论为「一致」,无需改动):文档
ErrorCode20 个枚举值 =go-pkg/srv/error.go的 22 个代码值减去RequestImageVerifyRequired、RequestAliyunVerifyRequired两个只在controller/captcha、controller/mfa、access/login出现的值,而这三处正是 mapping.yaml 中 hidden 的_internal/captcha与 auth≠all 的登录链路 → 20 个的口径正确。