Repository navigation
feat(openapi): spec governance M0 — 3-layer reconciliation, P0 schemas, consistency + breaking-change gates - #63
Merged
Conversation
…hs out, missing ops in)
M0 W2 (spec governance):
- MfaController: doc paths /oauth2/mfa/{setup,setup/verify,disable} ->
/api/me/mfa/{setup,verify,disable} (old paths had no backing routes)
- DeviceAuthController: drop ghost /oauth2/device/verify GET+POST docs
(verification page is frontend-rendered); add /oauth2/device/approve
- SessionController: add /oauth2/logout, /oauth2/end_session GET+POST,
/health/live, /health/ready doc registrations
- DiscoveryController: add /.well-known/oauth-authorization-server (RFC 8414)
- Fingerprint test baseline: 75 -> 80 ops, with a header note that the
governance gate parses it
…of truth M0 W1 (spec governance): - endpoint reconciliation: -8 dead entries (/api/orgs*, /oauth2/device/verify, old /oauth2/mfa/* paths), +13 missing ops (admin dashboard/organizations/ scopes-resources, me/mfa/*, device/approve, logout, health/live|ready, RFC 8414 metadata) => 78 operations, byte-parity with doc registrations - P0 schema backfill from controller-verified wire contracts: TokenRequest (form body), IntrospectionResponse, UserInfoResponse, OpenIDConfiguration, OAuthAuthorizationServerMetadata, JWKSet, OAuth2Error (RFC 6749) vs ErrorEnvelope (app envelope incl. numeric_code), TokenResponse with per-grant field rules, device/login/MFA/health bodies - /oauth2/token|introspect|revoke|login|mfa/verify|device_authorization: request bodies moved from misleading query params to form/JSON bodies (server accepts both; RFC-correct declaration drives client generators) - info.version 1.0.0 -> 1.2.0 (synced with cmake/Version.cmake, gate-enforced)
…sync M0 W3: tools/openapi-governance/check_spec_governance.py asserts - routes (ADD_METHOD_TO scan, multi-line macros, first method token) == doc registrations (kFingerprint parse) modulo ROUTE_ONLY exclusions - docs == openapi.yaml ops modulo YAML_EXCLUDED self-doc paths - openapi.yaml info.version == cmake/Version.cmake Sanity floors (>=60 ops per layer) fail loudly on parse regressions. Fixture-driven --selftest covers yaml-drop / new-route / ghost-doc / version-drift fault injections (repo script conventions: 0/1/2 exit codes).
M0 W4/W5: - ci.yml static-checks: selftest + 3-layer governance check (source-only, pyyaml pinned alongside openapi-spec-validator) - new openapi-governance.yml (PR on spec/tool changes): oasdiff v1.29.1 pinned binary, base(master) vs PR breaking diff, -o ERR fails the build - bootstrap errata: 15 exemptions, each with rationale (8 dead-endpoint removals, 6 query->form/JSON body relocations, 1 revoke empty-200 fix) - release.yml version-check: openapi.yaml info.version must match the tag
M0 W6: absorbs both the pre-existing drift on master (69 rows vs 73 YAML ops) and the M0 schema backfill (statuses/content-types now populated). Verified: diff mode exits 0 after regen.
…skill update - client-sdk-facility-design.md v1.1: §十 M0 reconciliation (3-layer drift measurements, D1.5 hand-maintained-YAML decision, D3 three-layer gate, D4 bootstrap errata + version sync) - new openapi-spec-governance-plan.md: W1-W7 implementation plan with acceptance criteria (reviewed APPROVE-WITH-CHANGES, findings applied) - openapi-update skill (+ 3 mirrors): governance gate as the authoritative validation step, corrected MFA/device endpoint lists, version-sync rules - api-reference.md: single-source banner + /api/me/mfa path fix - ci-cd-guide.md: governance gate + oasdiff workflow in the CI map - next-phase plan / progress-status: A1 delivered
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ackstop
Address code-review findings (APPROVE-WITH-CHANGES, 4 MINOR):
- header comment: ignore list is .md, not .yaml
- /oauth2/login 200 success example now matches LoginSuccessResponse and
the actual handler body ({code, location}); C++ doc example synced
(CategoryA snapshot doesn't freeze login examples — verified)
- governance gate scans libs/drogon/src/**/*.cc too (closes the
macro-in-.cc blind spot); fixture now exercises the bare-method-name
regex branch (PUT /y)
- release.yml version backstop runs the gate script instead of a
PyYAML-dependent one-liner (no hard dep on runner image packages;
re-validates 3-layer consistency on the release ref)
wangrh0909
approved these changes
Aug 17, 2026
voidvec
added a commit
that referenced
this pull request
Aug 17, 2026
CHANGELOG for v1.2.0 (61 commits since v1.1.0): #43 resource-scope authorization model, A2 user-management CRUD (PR #52), B1 back-channel logout backend (PR #50), A1 OpenAPI spec governance M0 + breaking-change gates (PR #63), benchmark M2-M4 load-bearing verdicts (PR #48), and the #53-#60 user-admin hardening batch (PR #62). Per the release SOP (docs/backend/versioning-and-release.md §11.1): draft via `git cliff --unreleased --tag v1.2.0 --prepend`, then hand-curated (themed sections, security-hardening migrations, noise removed). Version SSoT already bumped to 1.2.0 in e5548ec; api-diff and the new spec-governance gate verified OK on the release ref.
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.
A1 — OpenAPI Spec 治理(M0:Layer 1 地基)
问题:三层漂移(2026-08-16 实测)
info.version落后两个 minor典型漂移:YAML 至今还在文档化 3 个月前已删除的
/api/orgs*;MFA 路由迁到/api/me/mfa/*后旧路径文档没删、新路径文档没加;/oauth2/logout、/health/ready、RFC 8414 元数据端点从未入档。交付(6 commits,W1–W8)
d42a61cW2 — C++ 文档注册对账:删 5 处幽灵路径,补 10 处缺注册(end_session/logout/me-mfa/device-approve/health 子探针/RFC 8414),指纹基线 75→80。338d7ebW1 — YAML 重写为客户端生成就绪:78 操作与文档注册逐字对账;P0 schema 按控制器实测 wire 契约补齐(TokenRequest 表单体、IntrospectionResponse、OAuth2Error vs ErrorEnvelope 双错误形态、discovery 全字段等);info.version→ 1.2.0 联动。bcfd704W3 — 治理门:check_spec_governance.py三层一致性 + 版本同步,fixture 驱动 selftest 覆盖 4 类故障注入。c5ee505W4/W5 — CI 接线:ci.yml static-checks 加治理门;新openapi-governance.ymloasdiff v1.29.1 破坏性变更门(-o ERR);bootstrap 豁免 15 条(每条带理由);release.yml version-check 加 info.version 交叉校验。423312aW6 — refactor-baseline 端点签名再生(含 master 存量漂移收敛)。fe21a52W8 — 设计文档 v1.1、实施计划、openapi-update skill(4 处镜像)、api-reference、ci-cd-guide、progress 同步。验收证据
Integration_P1_OpenApiSpec_Property4_3_1_PathMethodFingerprint_Baseline绿openapi_spec_validator绿;治理门routes=82 docs=80 yaml=78零差异-o ERRexit 1,豁免清单覆盖后 bootstrap diff exit 0兼容性说明( reviewers 请看 )
死端点删除与参数位置迁移不改 wire 行为:删除的 8 条端点无路由(调用必然 404);token/introspect/revoke/login 的参数服务器一直同时接受 query 与 form/JSON(Drogon
getParameter语义),spec 只是修正了误导性声明。oasdiff 豁免清单里有逐条理由。风险与回退