Skip to content

docs(api): daily audit 2026-10-02 — align the RUM ZH example payloads with the English values - #938

Open
flashduty[bot] wants to merge 1 commit into
mainfrom
api-review/20261002T020025Z
Open

flashduty[bot] wants to merge 1 commit into
mainfrom
api-review/20261002T020025Z

Conversation

@flashduty

@flashduty flashduty Bot commented Oct 2, 2026

Copy link
Copy Markdown

api-review daily audit — 2026-10-02

--mode generate --scope all --auto. Scope: rows with Auth == "all", path not starting /event/push/, module not hidden: true.

Registry baseline. fc-pgy @ origin/main 86ea9900 vs the previous round's baseline 1ab03856: 348 public rows on both sides — 0 added, 0 removed, 0 auth reclassifications. Total registry rows grew 1090 → 1182, and the entire delta is integration rows (+92) — the alert/change push registrations, which are out of public scope. No operation was added or removed anywhere.

Operations changed

Module Added Updated Removed
on-call 0 0 0
monitors 0 0 0
rum 0 3 example values (ZH file) 0
platform 0 0 0
safari 0 0 0

No path was added or removed, so docs.json and {en,zh}/openapi/api-catalog.mdx are deliberately untouched (they only need reconciling when the operation set changes). Re-verified as a cross-check: every spec path is present in both the docs.json nav and both catalogs (0 missing for all five modules), and the catalog counts still agree with the specs — On-call 193, Monitors 23, RUM 41, AI SRE 53, Platform 28, total 338.

1. rum — the ZH spec's payload examples were Chinese, EN's were not

The bilingual contract (generate.md, "Examples are mandatory") requires request and response examples to use the same values in both language files: field keys and values are API payloads, not UI text — "Do NOT create separate Chinese examples." Three reason example values in the ZH RUM spec were Chinese renderings of the EN ones:

Path EN value ZH value (before)
POST /rum/application/remote-config/update (request) Tighten replay sampling for the Q4 launch Q4 上线前收紧回放采样
POST /rum/application/remote-config/history/revert (request) Rolled back after the Q4 launch incident Q4 上线故障后回滚
POST /rum/application/remote-config/history/list (200 data.items[0]) Tighten replay sampling for the Q4 launch Q4 上线前收紧回放采样

Only the values moved; the EN file is the reference and is byte-identical before and after. The ZH reason was introduced in a16105f7 (2026-09-03, the RUM remote-config generation) and no open PR touches it (#581's RUM delta adds the error-session switches, #778's adds a /rum/issue/info usage note; neither mentions these values). Every other module's ZH spec carries zero non-ASCII example values, so RUM was the only outlier. After the change, a mask-insensitive whole-document walk of every module's EN vs ZH files returns 0 structural differences.

Constructed examples: nothing new was authored this round. The three values inserted are the existing English values already in the EN spec — themselves constructed rather than captured from the dev API (this environment cannot read the credential env var), so they should not be read as a live capture.

Why the generator did not run (environment fact — rule 6 stop condition)

The automation's baseline-fidelity patches could not be applied, so scripts/generate_openapi.py was not run in a damaged state:

  • runbooks/api-review-daily.md and runbooks/api-review-apply-patches.py do not exist in the team knowledge pack. The pack's own sentinel lists 25 files / 5 runbooks, none of them api-review; a filesystem-wide search for either name returns nothing.
  • .api-review/ is gitignored and absent in the docs repo, so the generator has no modules/<scope>.json inputs, and its guard_no_path_drop() aborts when a path present in the committed spec is missing from the new output.
  • The route used instead is the committed-baseline + targeted minimal-diff flow recorded in team memory (api-review-consolidated-vs-split-drift-direction.md, 2026-10-01): public surface diffed via the pgy registry, source window diffed via git diff <ref> origin/main (which, unlike --since, catches commits whose author date predates the window but which were merged into main inside it), edits applied to git show HEAD:<path> baselines never to the working file, then a whole-tree deep compare.

Ruled out this round (window 2026-09-30T15:51:55Z → 2026-10-02T01:56Z)

  • fc-rum, fc-oncall, fc-statuspage, go-pkg — 0 commits in the window.
  • fc-event. Outside cmd/engine/controller/{alert,change}/ (the /event/push/* push handlers, out of scope) the only files touched are cmd/server/controller/channel/channel.go, structs/{change,severity}.go, logic/change/{change,change_event}.go, model/change/change_event.go, cmd/engine/routes.go, deploy/event.sql + one mongosh migration.
    • channel.go adds the UTF-8 guard on query/channel_name (commit f33573374, 2026-09-17, merge-carried into main inside this window). No new drift: open PR docs(api): daily audit 2026-09-29 — RUM remote-config error-session switches, channel filter UTF-8 note #581 already documents it on both fields ("Must be valid UTF-8 — invalid byte sequences are rejected with InvalidParameter"), and main's specs do not yet carry that text only because docs(api): daily audit 2026-09-29 — RUM remote-config error-session switches, channel filter UTF-8 note #581 is still open.
    • structs/change.go widens ChangeEvent.ChangeStatus to oneof=... Failed and adds IsChangeStatusTerminal; structs/severity.go drops SupportChangeStatus. Already documented — ChangeItem.change_status and ChangeEventItem.change_status in both the on-call split and the consolidated files already carry ["Planned","Ready","Processing","Canceled","Done","Failed"] in oneof order. ChangeEvent itself is the push payload, reached only from /event/push/*.
    • deploy/event.sql + 2026-09-29_change_key_scope_per_integration.sql + logic/change/change.go + model/change/change_event.go move the change lookup/uniqueness key to {account_id, channel_id, data_source_id, change_key} and add a stale-event guard. Index and behaviour only — no request or response field, no binding: tag, no enum.
    • cmd/engine/routes.go registers only evG.POST("alert/...") push routes. Out of public scope.
  • fc-pgy. cmd/server/controller/wallet/*, logic/bill/*, logic/charge/*, model/bill/*, structs/bill.go, logic/transfer.go are all platform/wallet, which is hidden: true ("Billing-only; not customer-facing public API"). structs/i18n.go changes email body strings. deploy/permission.sql and logic/permission/permission_test.go add permission factors for jwt/button routes. logic/api/api_test.go is the registry — public row set unchanged. No public-contract change; verified no wallet/billing type name (TransItem, BalanceItem, matched_amount, CostBreakdown) and no /wallet or /marketplace path appears in any spec file.
  • fc-datasource. structs/plugin.go + logic/data_source/plug_{alert,change,im_slack}.go add alert-source plugin constants (wazuh.alert, aikido.alert, …); no plugin name appears in any spec. cmd/datasource/controller/warroom.go swaps a hand-written Slack scope list for data_source.SlackAISREBotScopes(); missing_scopes is not a documented field anywhere. No public-contract change.

Committed internal drift found (rule 7) — all of it is already carried by an open PR

Comparing every split file against the consolidated file at HEAD turns up exactly the set the previous round's PR #778 already records, so nothing here is duplicated:

monitors is byte-identical between its split and consolidated forms (monit-webapi is not on GitHub, so it cannot be re-derived here and was left alone).

unresolved (unchanged from the previous rounds)

  1. POST /channel/incident/daily-counts (channel:read:incidentDailyCounts, Auth == "all", mapped to on-call/channel) — no handler exists in fc-event main and no spec documents it. Left undocumented rather than guessed; not in docs.json, not rendered.
  2. The 9 POST /integration/* rows — public, but no non-hidden module in mapping.yaml claims the /integration prefix. Covered by open PR docs(api): daily audit 2026-09-25 — document the new /integration API family #472; not duplicated.
  3. Example gaps (report only): POST /enrichment/mapping/data/upload and POST /safari/skill/upload have no requestBody example (multipart/form-data), and POST /monit/datasource/tools/invoke has neither a JSON request example nor a 200 example. The monitors one cannot be reconciled here (monit-webapi is not on GitHub).

Verification

  • Both output files re-parse under python3 -c "import json; json.load(open(path))".
  • Whole-tree deep compare against HEAD (baseline read from git show HEAD:<path>, never the working tree) over all 13 api-reference/*.json files: exactly 6 changed leaves in 2 files, all intended — rum.openapi.zh.json and openapi.zh.json, each …/example/reason under POST /rum/application/remote-config/update, …/history/revert and …/history/list. The other 11 files, including openapi.legacy.zh.json, openapi.en.json and rum.openapi.en.json, are byte-identical. docs.json is unmodified. Total diff: 6 insertions, 6 deletions.
  • Byte fidelity checked explicitly: the split file still ends 0a7d and the consolidated file still ends 7d0a (the two files historically differ on the trailing newline), and the edit was a literal string substitution, so no key order or formatting moved.

… with the English values

The api-review bilingual contract keeps request/response examples identical in
both language files: field keys and values are English API payloads, not UI text.
Three `reason` example values in the ZH RUM spec were Chinese translations of the
EN values; every other module's ZH spec has none. Split + consolidated only.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants