Skip to content

chore(ratewise): 生產治理 rebased on main(取代 #411)#433

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

chore(ratewise): 生產治理 rebased on main(取代 #411)#433
s123104 wants to merge 48 commits into
mainfrom
chore/ratewise-production-governance-v2

Conversation

@s123104

@s123104 s123104 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 3-way merge(非 rebase)將 origin/main 合併至新分支 chore/ratewise-production-governance-v2不修改、不關閉 PR chore(ratewise): 生產治理 — PWA precache-first、ETag 修復、SEO 治理 #411
  • 已捨棄(main 已發版 / 重疊)
    • 9 個 changeset(fallback-snapshot、production-surface、moneybox-aggregate-*、sentry-fetch-filter、ssg-snapshot、error-classification/observability、multi-rate-label)
    • apps/split-meow/ 舊版 v0.1.4 → 對齊 main v0.2.0
    • 與 main fix(ratewise): 收斂生產治理與 fallback 匯率快照 #393 重疊且已由 main 收斂的 RateProviderMenu 測試刪除
  • 仍保留的 genuinely-new 治理項(changeset):design-token-ssot、fix-nitro-theme-ssot、radius-ssot-guard、quiet-breadcrumb-token-refactor、fix-cdn-preflight-if-none-match、fix-moneybox-cdn-etag、fix-ratewise-pwa-ios-eviction、ratewise-pwa-shell-brand-sync、ratewise-sw-bounded-nav、ratewise-a11y-touch-target-focus、ratewise-exchange-shop-ratemode-nav-header、ratewise-opendata-mobile-overflow,以及 artifact-ssot / currency-route-registry / data-pr-governance 等未發版項。

衝突解決摘要

檔案 決策
sw.ts / sw.test.ts / pwa-offline.test.ts TAKE GOVERNANCE(precache-first + bounded-nav)
exchangeRateService.ts GOVERNANCE ETag 移除(無 cache:no-cache)+ main lint
moneyboxRateService.ts TAKE GOVERNANCE(含 computeConverterRate SSOT 註解)
*Service.test.ts TAKE GOVERNANCE
errorClassification.ts main lint(reason.message 無多餘 assertion)
AppLayout.tsx TAKE GOVERNANCE(tabIndex=-1 程式化聚焦)
AppLayout.safe-area.test.tsx TAKE GOVERNANCE(對應 tabIndex=-1)
MultiConverter.tsx / test TAKE GOVERNANCE(button SSOT + rateMode 測試)
RateProviderMenu.test.tsx DELETE(governance 已移除元件)
latest.json / build-time-rates.json TAKE MAIN
ratewise-production-governance.yml TAKE MAIN(checkout@v7)
002_development_reward_penalty_log.md UNION(main 條目 + governance-only 條目)
lighthouse-production.mjs / test TAKE MAIN(drift SSOT 抽至 lighthouse-drift.mjs)

Test plan

Made with Cursor

haotool and others added 30 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
- 提升多幣別匯率資訊文字對比

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

- 補上 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
- 修正 GA4 E2E 對建置 runtime 的誤判

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

測試:pnpm --filter @app/ratewise test:e2e;pnpm --filter @app/ratewise typecheck
- 線上遠端匯率來源全失敗且無快取時改用 build-time snapshot

- 更新 RateWise 與 exchangeRateService 回歸測試

測試:pnpm --filter @app/ratewise test;pnpm --filter @app/ratewise typecheck
- SSG 金額頁注入改讀 build-time fallback snapshot

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

測試:vitest build-scripts/prerender;typecheck;build(無 public/rates.json)
- 更新 build-time fallback snapshot 至最新台銀快照
- 修正刷新腳本說明與幣別數量輸出

測試:build-scripts vitest;typecheck;verify-ssot-sync;git diff --check
- 移除每日匯率資料 PR 的 workflow 直接合併步驟
- 改由 branch protection 與 GitHub 原生合併控制接手
- 補上 workflow 回歸測試與治理文件

測試:build-scripts vitest;typecheck;verify-ssot-sync;git diff --check
- 補 Firefox NetworkError 訊息匹配,避免落入 unknown 觀測桶
- 補 Safari NSURLError 系列訊息(offline / network lost / hostname not found / cannot connect)匹配
- 補 Safari TypeError("Load failed") 仍走 chunk-load 的迴歸測試,避免新 pattern 搶走 chunk recovery
- 修正 prebuild-fetch-rates cache 分支幣別數量輸出單位,與成功路徑一致
- 同步更新 002 SSOT 紀錄與 changeset

測試:vitest errorClassification(11 passed);pnpm -r typecheck;prettier --check;verify-ssot-sync
- Sentry `beforeSend` 改用 `classifyUnhandledRejection`,避免兩處重複維護 fetch 字面比對
- Firefox / Safari 多種網路失敗訊息原本繞過 Sentry 過濾,現與跨瀏覽器 SSOT 一致
- 同步更新 002 SSOT 紀錄與 changeset

測試:vitest 29 passed;typecheck;Playwright AB 7 cases(6 fetch + 1 control)全綠
- client 加 aggregate-first:與 PROVIDER_RATES_PATH.aggregate 對齊台銀 history-30d 慣例
- 5 分鐘 memory cache 涵蓋 aggregate 命中與 fallback 兩條路徑,避免重複 fetch
- aggregate 不存在時自動退回原本逐日 fetch,行為無回歸
- 4 個單測覆蓋命中 / 404 fallback / shape 不合法 / TTL cache

測試:moneyboxRateService 20 passed;typecheck;Playwright AB 50 reqs / ~5049ms → 1 req / ~2ms
- 移除說明性註解,改由函式名與結構自說明
- 抽出 fetchExchangeShopHistoricalRatesFromDailyEndpoints 與 aggregate 路徑對稱
- 兩處 historyAggregateCache 寫入收斂為單一寫入點

測試:moneyboxRateService 35 passed;typecheck
- Save snapshot 後讀本地 history/*.json 產生 history-30d.json(providerId/generatedAt/snapshots)
- git add、CDN purge、post-push refresh 同步加入 aggregate file
- 對應 client 端 fetchExchangeShopHistoricalRatesRange 的 aggregate-first 路徑

測試:本地 dry-run 3 fixture days 產生符合 client 預期 shape 的 aggregate JSON
- 建立 RateWise DESIGN/PRODUCT/SPEC,完成頁面盤點

- 收斂麵包屑、內容頁、App shell、通知與 PWA token

- 刪除未使用 UI 死碼並補齊守門測試

測試:ratewise Vitest 全量通過

測試:ratewise typecheck、SSOT sync、build 通過

測試:Chrome /seo-tech console 0 error / 0 warning
- 恢復 Tailwind 標準 radius 預設值(lg/md/sm/xl),僅新增語義 token(card/panel/control/icon/compact)作為擴充
- 全站 UI 元件遷移至語義 radius token:rounded-card(主面板)、rounded-control(互動元素)、rounded-compact(密集元素)
- 新增語義 shadow token 系統(shadow-soft/floating/brand/card/card-hover),取代散落的 Tailwind 預設 shadow
- SingleConverter CTA hover 升級至 shadow-brand、SwapButton hover 升級至 shadow-card,修正互動層級回饋
- 品牌色從 Blue 遷移至 Violet/Indigo(Zen 主題),同步 themes.ts/index.css/DESIGN.md
- 修正 classnames.ts 計算機按鍵 rounded-lg → rounded-compact(8px),rounded-t-lg → rounded-t-control
- SkeletonLoader timeout 回退卡 rounded-control → rounded-card(對齊 feedbackSurfaceTokens 語義)
- 同步 DESIGN.md radius 規格與 design-tokens.test.ts 守門測試

測試:typecheck 通過、vitest 2382 tests / 141 files 全綠

Co-authored-by: Cursor <cursoragent@cursor.com>
- PWA shell(index.html/offline.html/manifest/pwaOfflineFallback)品牌色同步至 Violet 主題
- 緊急離線卡片圓角與陰影對齊語義 token(rounded-card / shadow-card)
- CDN 備援失敗日誌從 warn 降為 debug,減少正常 fallback 場景的噪音
- moneybox workflow 補齊 aggregate 檔案不存在時的初始化觸發邏輯
- AGENTS.md 新增使用者偏好與工作區事實(agents-memory-updater 產出)

測試:exchangeRateService 測試已涵蓋日誌層級變更,typecheck 通過

Co-authored-by: Cursor <cursoragent@cursor.com>
- 換錢所 computeConverterRate 依 rateMode 選價:mid=(買+賣)/2、sell 雙向賣出、auto 維持客戶視角
- rateMode 貫穿 getUnitExchangeRate、報價 adapter 與趨勢圖,修正選中間價無效的硬編碼問題
- PageNavHeader 砍掉 sticky/safe-area hack 改 in-flow pill 返回鈕,修復 iOS PWA 頂部內容遮擋
- RateSelector 以透明命中區補回 44px 觸控目標,gitignore 忽略本地 impeccable skill bundle
- 同步收斂在途測試(themes SSR fallback、換錢所匯率期望值)並補 002 紀錄與 patch changeset

測試:typecheck 全 workspace 通過;ratewise Vitest 1800+ 全綠;scripts 7/7;prettier/eslint 通過
- RatingModal 星星按鈕由 32px 升至 44px 圓形命中區,新增觸控目標守門測試(TDD)
- OpenData 複製鈕以透明命中區補 44px 並補 focus-visible ring;MailtoLink、計算機關閉鈕同步補齊
- OpenData/Footer bare rounded 收斂為 rounded-compact,對齊語義 radius token SSOT
- 更新 002 紀錄與 patch changeset

測試:typecheck 通過;RatingModal/MailtoLink/OpenData/Footer/calculator 相關 Vitest 307+ 全綠
- 新增 radius-ssot.test.ts regex 守門:元件層禁用 bare rounded 與 Tailwind 原生圓角尺寸
- SkeletonLoader/ColorSchemeComparison/notificationTokens 殘留 bare rounded 收斂為 rounded-compact
- 趨勢圖 rounded-b-xl 改 rounded-b-card,修正與 rounded-card 卡片底角不貼合
- 更新 002 紀錄與 patch changeset

測試:config 489 tests 全綠(含新守門);SkeletonLoader/趨勢圖測試通過;typecheck/prettier 通過
- Puppeteer 程式化掃描正式站 320/768/1280 視口,僅 open-data 端點 code 標籤溢出(right=449)
- 端點路徑補 min-w-0 break-all,OpenData.test.tsx 新增窄視口防溢出守門
- 固定寬度全掃描無 320px 溢出風險,5 個表格均有 overflow-x-auto SSOT 包裹
- 更新 002 紀錄與 patch changeset

測試:OpenData 23 tests 全綠;typecheck/prettier 通過;首頁/multi/faq/guide/幣別頁 320px 零溢出
- 停止對 jsDelivr/GitHub Raw 發送 If-None-Match 條件式請求
- 移除 304 分支,保留 ETag 寫入快取供未來 Worker proxy 路徑
- 同步更新 exchangeRateService 單元測試

測試:pnpm --filter @app/ratewise test -- exchangeRateService(32 passed)

Co-authored-by: Cursor <cursoragent@cursor.com>
- 整合二十線 UX 審查收斂為韓式 fintech 對標規格
- 定義 Hero、inline numpad、資訊去重與三階段路線圖
- 附 Phase 1 可執行任務拆解(CalculatorKeypad 抽出起)

測試:pnpm prettier --check docs/superpowers(格式已通過)

Co-authored-by: Cursor <cursoragent@cursor.com>
…tion-governance-v2

# Conflicts:
#	docs/dev/002_development_reward_penalty_log.md
@github-actions

Copy link
Copy Markdown
Contributor

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

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

- MiniTrendChart 移除 price as number 兩處冗餘斷言
- exchangeRateService 移除 buildTimeRates as ExchangeRateData 冗餘斷言
- 新增 patch changeset 標記內部 lint 清理

測試:lint 0 錯、typecheck 通過、相關測試 49 passed
@github-actions

Copy link
Copy Markdown
Contributor

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

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

…tion-governance-v2

# Conflicts:
#	apps/ratewise/src/i18n/index.ts
@github-actions

Copy link
Copy Markdown
Contributor

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

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

haotool and others added 2 commits June 26, 2026 16:31
- build-scripts.test 斷言 update-moneybox-rates.yml 含 extractSeoulSnapshotDate 提取
  與 Asia/Seoul fallback、且不含 Asia/Taipei,防止 workflow 退回台北時區
- 保留 PR428 wall-clock 方案的回歸守門價值,適配本分支 snapshot date 方案
- 補 002 條目(本次 +1,累計 +67)

測試:ratewise build-scripts.test 47/47 通過

Generated with Claude Code
via Happy

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@github-actions

Copy link
Copy Markdown
Contributor

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

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

* feat(ratewise): 收編金融級計價基準 SSOT 與計算機即時換算預覽

- 新增 rateBasisLabel SSOT util 與四語系 rateBasis i18n 字串
- SingleConverter 顯示計價基準 pill 與 aria-live 換算宣告
- CalculatorKeyboard 即時顯示目標幣別換算預覽
- 清單標示臺銀賣出價基準與 TWD 單位
- 補齊 76 個 basis/a11y/preview/pristine 測試

* fix(ratewise): 多幣別收藏星與字級補足無障礙觸控與對比下限

- 未收藏星不透明度 30%→60%、hover→100% 改善非文字對比
- 幣名與匯率基準行字級 text-[11px]→text-xs(12px 下限)
- 收藏星與匯率切換鈕加 after 偽元素擴展觸控熱區

* chore(changeset): @app/ratewise minor 計價基準與計算機預覽

* fix(ratewise): 換算宣告 live region 補顯式 aria-live 語意

- conversion-live-region output 補 aria-live=polite 與 aria-atomic=true
- 不僅依賴 output 隱式 role=status,確保螢幕閱讀器確實朗讀換算結果
- a11y 測試斷言 live region 屬性防回歸(Codex review Q5)

測試:vitest SingleConverter.a11y 2 tests 通過;typecheck 通過

---------

Co-authored-by: haotool <haotool.org@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

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

- useCalculator 移除冗餘 preview state 與同步 useEffect,改 useMemo 直接衍生

- initialValue 重置改採渲染期 prev-prop 調整,移除唯一 effect 與其匯入

- 新增 getRateBasisLabelKey 與 RATE_BASIS_LIST_NOTE_KEY 集中計價基準 i18n key

- 三處元件改引用上述 SSOT,並清理過時 JSDoc 與「新增」式註解

測試:ratewise typecheck 通過、calculator 與 rate-basis 相關測試通過

Co-authored-by: haotool <haotool.org@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

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

@s123104

s123104 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

狀態更新(2026-06-27)

本 PR 暫不 merge,原因:

  1. CONFLICTING:main 已合併 chore(seo): 每日更新匯差範例數據 #473/chore(release): 更新版本套件 #481 release,需 rebase/merge main 解衝突
  2. Lighthouse CI 紅燈:CLS=0.237(perf(ratewise): 首頁換算器 CLS=0.237 超標(#441 改版引入,Lighthouse 門檻 ≤0.1) #454)— 已拆出獨立 hotfix PR 優先合 main
  3. 治理整包需 maintainer 批准:含 SW/PWA/設計 token/workflow 等多項,非 hotfix 範圍

建議路徑

  1. perf(ratewise): 首頁換算器 CLS=0.237 超標(#441 改版引入,Lighthouse 門檻 ≤0.1) #454 hotfix PR checks 綠燈並 squash merge 至 main
  2. Rebase 本分支至最新 main,將 pill 放入已預留的 rateBasisSlot(解衝突時優先採 hotfix token)
  3. 重跑 CI,確認 Lighthouse CLS ≤ 0.1
  4. 使用者明確批准後 才 squash merge 本 governance PR

@s123104

s123104 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Rebase 衝突評估(2026-06-27,main @ 70dd42f / v2.25.6 已發版)

狀態mergeStateStatus=DIRTY,需 rebase 後才能 merge。本輪 未整包 merge(依 maintainer 批准流程)。

衝突熱區(merge-tree 摘要,至少 27 檔 changed in both

  • CI/workflow.github/workflows/update-moneybox-rates.yml
  • generated mirrorsapps/ratewise/public/*.md(about/faq/index/open-data 等)
  • build scriptsgenerate-api-json.mjsgenerate-llms-txt.mjs
  • 核心功能RateWise.tsxSingleConverter.tsxdesign-tokens.tsseo-metadata.ts
  • PWA/SWsw.tspwaOfflineFallback.tssw.test.ts
  • servicesexchangeRateService.tsmoneyboxRateService.ts 及測試
  • 002 logdocs/dev/002_development_reward_penalty_log.md

建議路徑

  1. git rebase origin/main 後手動解決上述熱區(優先採 main 的 v2.25.6 產物與 cold-start/CLS 變更)
  2. Tier1(docs/CI 治理)與 Tier2(RateWise runtime)分批 PR,降低 rebase 面
  3. rebase 完成 + CI 全綠後再請 maintainer 批准整包或 Tier1 merge

本輪 pipeline 進度

@s123104

s123104 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

經 10-facet Cursor 分析 + Claude×Codex 共同決議:本 PR 禁止整包 merge / 3-way merge(基於舊 main,會回退 #512/#508/#505/#452/#493)。改拆為 7 支小 PR 逐項挑揀 + REMAP 到 #512 模組結構,追蹤見 #514。完成後關閉本 PR。

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