QJudge Quality Gates Owner
Repository scope
主 repo gates 只涵蓋主系統與文件站;官網在 PopcornT/qjudge-website 執行自己的 build、Worker tests 與 browser tests。移出的檔案須同步移除 audit decisions 與過時 fixture,不要重新加入 landing baseline。 See docs/website-migration.md at the repository root.
Quick start
依變更範圍選擇以下命令;文件整理不需要先跑全套 frontend 檢查。
- 先跑 naming:
node .codex/skills/qjudge-quality-gates-owner/scripts/lint-naming.js --root frontend/src- 再跑 architecture:
node .codex/skills/qjudge-quality-gates-owner/scripts/lint-architecture.js --root frontend/src- 檢查 repository public surface:
node .codex/skills/qjudge-quality-gates-owner/scripts/lint-repository-exports.js- 跑 Carbon 全量 audit(不因 review findings 失敗):
node .codex/skills/qjudge-quality-gates-owner/scripts/audit-carbon-practices.js --root frontend/src- 本機快速檢查 staged hard blockers:
bash .codex/skills/qjudge-quality-gates-owner/scripts/check-carbon-style.sh --staged- 執行與 CI 相同的 Carbon strict hard gate:
bash .codex/skills/qjudge-quality-gates-owner/scripts/check-carbon-style.sh --all- 修復無效的
var(--cds-spacing-*)與可精確映射的 spacing(先 dry-run): node .codex/skills/qjudge-quality-gates-owner/scripts/fix-carbon-spacing-tokens.js --root frontend/srcnode .codex/skills/qjudge-quality-gates-owner/scripts/fix-carbon-spacing-tokens.js --root frontend/src --write
責任邊界(Owner Scope)
- ✅ lint 規則、Carbon audit/staged/strict profile、CI gate 定義。
- ✅ 架構/命名/Carbon public API/樣式禁則的可執行檢查腳本。
- ✅ 違規分類與遷移節奏(先報告再阻擋)。
- ❌ 不做 feature 架構決策(交給
qjudge-architecture-owner)。 - ❌ 不做 PR 流程決策(交給
qjudge-github-workflow-owner)。
Policy
audit:全量掃描,將每個檔案標成clean、findings、policy-reviewed、exception-review或not-applicable;review 類不阻擋。staged:以--staged快速檢查已暫存檔案,供本機迭代使用;它不是 CI 的完整替代。strict:以--all掃整個 root;只要仍有 blocker 就失敗。這是目前.github/workflows/ci.yml的 CI hard gate。
Carbon audit contract
blocker:.cds--*/.bx--*internal selector、!important、Carbon React 不會輸出的--cds-*變數(含--cds-spacing-*、字型 token 與 v10 舊名稱,--all以編譯出的@carbon/reacttoken 清單比對),以及任何帶 fallback 的var(--cds-*, …)。review:hard-coded theme/spacing/type、raw controls、accessible labels、notification variant、scroll owner 等需結合 UI context 判斷的候選。policy-reviewed:已由references/carbon-audit-decisions.json以精確檔案、元件類型、理由、owner 與移除條件完成審查;新路徑或新控制類型不會自動繼承決策。exception-review:測試 fixture、shared/copilotboundary、editor/media 等合理但仍需人工驗證的例外。review是人工檢查線索,不鎖定候選數量,也不要求每個原生控制項或通知先登記例外。依本次變更檢查實際行為;spacing fixer 是選用工具,先確認 diff 再套用。- Audit script 會使用專案 TypeScript parser 做 JSX semantic checks;缺少 frontend dependencies 時退回保守 regex 掃描。
- 不建立不存在的 generic Carbon override allowlist。若真的需要 compatibility boundary,必須是命名明確、範圍最小且有移除條件的 app-owned wrapper。
參考文件
references/quality-profiles.mdreferences/carbon-audit-decisions.jsonscripts/lint-naming.jsscripts/lint-architecture.jsscripts/lint-repository-exports.jsscripts/audit-carbon-practices.jsscripts/check-carbon-style.sh
Portable notes
- 可移植核心:可執行規則 > 文字規範。
- 新專案只需替換 root path 與 package-specific exception policy,即可重用。