Skip to content

fix(ratewise): 收斂生產治理與 fallback 匯率快照#393

Open
s123104 wants to merge 16 commits into
mainfrom
chore/ratewise-production-governance
Open

fix(ratewise): 收斂生產治理與 fallback 匯率快照#393
s123104 wants to merge 16 commits into
mainfrom
chore/ratewise-production-governance

Conversation

@s123104
Copy link
Copy Markdown
Contributor

@s123104 s123104 commented May 12, 2026

摘要

  • 收斂 RateWise 正式公開路由、錯誤可觀測性、QA gates、generated artifacts 與幣別路由 registry。
  • 讓 prebuild 回到 deterministic,不再刷新 tracked live rate data。
  • 新增 explicit fallback rate snapshot refresh,並接入每日匯率資料 PR workflow。
  • 移除 runtime fallback 的硬編碼匯率副本,改讀 build-time snapshot SSOT。
  • 線上遠端匯率來源全失敗且無快取時,回退 build-time fallback snapshot。
  • SSG 金額頁改讀 build-time fallback snapshot,clean checkout 不再依賴 ignored public/rates.json。

影響

  • build/test 不應再因即時匯率刷新而留下 tracked generated diff。
  • fallback 匯率仍可透過排程 PR 持續跟近期 snapshot 對齊。
  • internal-only route 不再進入 production route/prerender surface。
  • 金額頁預渲染換算結果可在乾淨 CI checkout 中穩定產生。

驗證

  • pnpm test
  • pnpm --filter @app/ratewise typecheck
  • pnpm --filter @app/ratewise build
  • pnpm --filter @app/ratewise test:e2e
  • pnpm format
  • git diff --check
  • pre-push hook: typecheck + test + build:ratewise 通過
  • clean checkout 模擬:移走 ignored public/rates.json 後 build,/usd-twd/500/ 仍產生 ssg-amount-result
  • PR checks 全綠:Quality、E2E、Lighthouse CI、Production Lighthouse Baseline、SEO Audit、CodeQL、Dependency Review 通過

Review thread 狀態

  • 已回覆並 resolve 舊 PR thread drift。
  • 已回覆並 resolve Codex 對 SSG 金額頁 rates snapshot 來源的 P2 review。

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 3 package(s) with unknown licenses.
See the Details below.

License Issues

.github/workflows/ratewise-production-governance.yml

PackageVersionLicenseIssue Type
actions/checkout6.*.*NullUnknown License
actions/setup-node6.*.*NullUnknown License
pnpm/action-setup6.*.*NullUnknown License
Denied Licenses: GPL-3.0, AGPL-3.0

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 6.*.* 🟢 5.7
Details
CheckScoreReason
Maintained⚠️ 01 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Packaging⚠️ -1packaging workflow not detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
SAST🟢 8SAST tool detected but not run on all commits
actions/actions/setup-node 6.*.* 🟢 5.8
Details
CheckScoreReason
Maintained🟢 79 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 7
Code-Review🟢 10all changesets reviewed
Packaging⚠️ -1packaging workflow not detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 9binaries present in source code
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 1branch protection is not maximal on development and all release branches
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
actions/pnpm/action-setup 6.*.* 🟢 5.5
Details
CheckScoreReason
Code-Review🟢 4Found 12/30 approved changesets -- score normalized to 4
Maintained🟢 1022 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 10all dependencies are pinned
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Security-Policy⚠️ 0security policy file not detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • .github/workflows/ratewise-production-governance.yml

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Lighthouse Production Baseline ✅

  • 狀態:pass
  • 目標網址:https://app.haotool.org/ratewise/
  • 實際執行:3 次
  • 退化容忍:5%
  • Baseline 更新時間:2026-05-13T08:18:13.914Z

檢查細節

  • 無異常,指標符合要求

@github-actions
Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

haotool added 9 commits May 13, 2026 02:20
- 修正測試檔動態 import type annotation 警告
- 新增生產治理 spec 與 implementation plan
- 恢復 RateWise lint 0 warning 品質閘門

測試:pnpm --filter @app/ratewise lint;pnpm --filter @app/ratewise typecheck
- 將內部展示與測試頁排除於 production route surface
- 補 route surface 測試,避免 prerender 與 app shell 漂移
- 同步 TypeScript / Node SEO path SSOT,並新增 changeset

測試:route surface、seo public surface、prerender、typecheck、build
- 將 unhandled rejection 改為集中分類
- 限制 production hydration suppression,避免遮蔽真錯誤
- 補 chunk、history 404 與 generic fetch 分類測試

測試:errorClassification、chunkLoadRecovery、sw、pwa recovery、typecheck
- 將核心無障礙與離線體驗納入可執行驗證

- 加入 scheduled production governance workflow

- 將趨勢圖 latency budget 改為明確手動與排程 gate

測試:accessibility e2e、offline indicator e2e、trend latency e2e、typecheck、workflow prettier
- 拆分 live data、deterministic generation 與 artifact verify scripts

- 移除本機 Lighthouse 與 tsbuildinfo 產物追蹤

- 同步 README、AGENTS 與 CLAUDE 的 artifact policy

測試:build-scripts vitest、verify:artifacts、generate:deterministic、typecheck、prettier
- 將幣別落地頁 route registration 收斂到 registry

- 補齊 SEO paths、page entry 與 routes 消費的 parity tests

- 同步 production route surface 測試期望與稽核紀錄

測試:currency route registry vitest、seo paths vitest、route surface vitest、verify:ssot、typecheck
- 將 color-scheme 測試改為確認 production 不輸出 internal-only HTML

- 同步 002 稽核紀錄

測試:prerender vitest、pnpm test、build:ratewise
- prebuild 不再刷新 tracked live rate data
- refresh:fallback-rates 更新 build-time fallback snapshot
- runtime fallback 改讀 build-time snapshot SSOT

測試:pnpm test;typecheck;build;format;diff check
- 多幣別三態切換改用 pair-level availability

- 修正換錢所反向 TWD 與 spot-only label 漂移

測試:focused MultiConverter/useCurrencyConverter vitest;ratewise typecheck

- pnpm format;git diff --check;pnpm test;pnpm --filter @app/ratewise build
@s123104 s123104 force-pushed the chore/ratewise-production-governance branch from cd8d1da to 4527f53 Compare May 12, 2026 18:22
@github-actions
Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

- 提升多幣別匯率資訊文字對比

- 讓主要滾動區域可鍵盤聚焦

- 補上 AppLayout 回歸測試並同步 changeset 與 002 紀錄

測試:pnpm --filter @app/ratewise typecheck

測試:pnpm --filter @app/ratewise exec vitest run AppLayout.safe-area.test.tsx MultiConverter.test.tsx

測試:pnpm --filter @app/ratewise build

測試:Playwright 多幣別 accessibility desktop/mobile

測試:pnpm format;git diff --check
@github-actions
Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

@s123104 s123104 marked this pull request as ready for review May 12, 2026 19:03
- 修正 GA4 E2E 對建置 runtime 的誤判

- 修正 Firefox offline 測試呼叫 Chromium-only CDP 的失敗

測試:pnpm --filter @app/ratewise test:e2e;pnpm --filter @app/ratewise typecheck
@github-actions
Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d358efda7c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/ratewise/package.json
- 線上遠端匯率來源全失敗且無快取時改用 build-time snapshot

- 更新 RateWise 與 exchangeRateService 回歸測試

測試:pnpm --filter @app/ratewise test;pnpm --filter @app/ratewise typecheck
@github-actions
Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

- SSG 金額頁注入改讀 build-time fallback snapshot

- 補上 clean checkout 與 prerender 回歸測試保護

測試:vitest build-scripts/prerender;typecheck;build(無 public/rates.json)
@github-actions
Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

haotool added 2 commits May 13, 2026 14:02
- 更新 build-time fallback snapshot 至最新台銀快照
- 修正刷新腳本說明與幣別數量輸出

測試:build-scripts vitest;typecheck;verify-ssot-sync;git diff --check
@github-actions
Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

- 移除每日匯率資料 PR 的 workflow 直接合併步驟
- 改由 branch protection 與 GitHub 原生合併控制接手
- 補上 workflow 回歸測試與治理文件

測試:build-scripts vitest;typecheck;verify-ssot-sync;git diff --check
@github-actions
Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

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.

1 participant