# Java 企業系統升級工作表 / Enterprise Java migration worksheet

教學配套，2026-10-03。這是空白驗證模板，沒有執行公司系統或填入真實結果。
Teaching template only; no enterprise-system verification has been performed.

## 1. 先選一個功能 / Choose one feature

- 功能 / Feature:
- 類型 / Workload: Web / MDB / batch / Angular
- 原始碼版本 / Source revision:
- 舊產物雜湊 / Baseline artifact hash:
- 新產物雜湊 / Candidate artifact hash:
- 啟動入口 / Entry point:
- 執行容器與管理者 / Runtime and owner:
- 回復方式 / Recovery plan:

## 2. 環境清單 / Environment inventory

| 項目 / Item | 舊 / Old | 新 / New | 證據 / Evidence |
| --- | --- | --- | --- |
| JDK（build / runtime 分開） | 未知 / unknown | 未知 / unknown | |
| EAP 版本與 patch | 未知 / unknown | 未知 / unknown | |
| Boot / Framework / Security | 未知 / unknown | 未知 / unknown | |
| Hibernate：Maven 與實際載入版本 | 未知 / unknown | 未知 / unknown | |
| JPA provider / transaction manager 擁有者 | 未知 / unknown | 未知 / unknown | |
| DataSource / JNDI / JDBC artifact | 未知 / unknown | 未知 / unknown | |
| DB server | 未知 / unknown | 未知 / unknown | |
| MQ client / RAR / Queue Manager（分開） | 未知 / unknown | 未知 / unknown | |
| Angular / Node.js / TypeScript / RxJS | 未知 / unknown | 未知 / unknown | |
| 編碼 / timezone / locale | 未知 / unknown | 未知 / unknown | |

不要記錄密碼、token、真實個資或內網連線資訊到公開範本。
Keep credentials, personal data, and private connection details out of public examples.

## 3. 行為契約 / Behavior contract

- Case ID:
- 輸入與前置狀態 / Input and preconditions:
- 隔離資料 fixture 與還原程序 / Isolated fixture and reset procedure:
- 外部服務回應條件 / External dependency conditions:
- 預期 HTTP status / headers / body:
- 預期 DB changes / commit / rollback:
- 預期 MQ body / properties / count / redelivery / correlation:
- 預期 business log events / severity / trace relationships:
- 非同步完成條件與 timeout / Async completion rule and timeout:
- 失敗、重跑與重複輸入結果 / Failure, retry, and duplicate-input expectations:

只在授權的隔離環境重播副作用，不向正式 DB / MQ 重送案例。
Replay side effects only in an authorized isolated environment, not production DB/MQ.

## 4. 比對規則 / Comparison rules

- 原始證據保存位置 / Raw evidence location:
- 正規化規則版本 / Normalization-rule revision:
- 允許忽略的欄位、原因與核准者 / Ignored fields, rationale, and reviewer:
- 動態 ID 的關聯比對方法 / Dynamic ID relationship checks:
- 是否有順序契約 / Ordering requirements:
- 必須保留的錯誤與稽核事件 / Errors and audit events that must remain:

先訂規則再比對；未知不能算 pass，缺資料不能算一致。
Define rules before comparison. Unknown is not pass; missing evidence is not equality.

## 5. AI 交接卡 / AI handoff card

- 改動前 → 改動後 / Before → after:
- 為何需要改 / Reason, tied to an actual requirement or source:
- 必看位置（最多三處） / Up to three key locations:
- 執行過的驗證、環境與結果 / Executed checks, environment, and result:
- 未驗證與可能改變的行為 / Unverified or potentially changed behavior:
- 原始 diff／log／測試結果位置 / Diff, log, and test references:

讀完後，試著自己回答：
Can you explain these without rereading the summary?

1. 入口在哪裡？/ Where is the entry point?
2. 誰管理這個物件與交易？/ Who owns the object and transaction?
3. 在哪個位置失敗會造成回滾或重新投遞？/ Which failure triggers rollback or redelivery?

## 6. 結果 / Result

- HTTP: pending / matched / different / missing
- DB: pending / matched / different / missing
- MQ: pending / matched / different / missing
- Logs: pending / matched / different / missing
- 尚未解釋的差異 / Unexplained differences:
- 核准的行為例外及理由 / Reviewed behavior exceptions and rationale:
- 決策 / Decision: pending / accept / revise

把 compile、package、部署、啟動、案例通過、正式環境驗證分開記錄。
Record compile, packaging, deployment, startup, case results, and production verification separately.
