# xmath Print Bridge Checklist

## 1. Install

- Open `/app/print-bridge/setup`
- Create a connection code with `메인 PC 연결` or `메인 PC 변경`
- Download the latest Windows bridge zip
- Extract on the main PC
- Run `xmath-print-bridge.exe`
- Enter the connection code in the app
- Click `연결 코드로 등록`
- Click `브리지 시작`

## 2. First Connection Check

- Confirm the device appears in the setup page
- Confirm the device status changes to `온라인`
- Confirm `bridge.log` is created
- Confirm Edge or Chrome is available on the PC
- Confirm the Windows default printer is the intended printer

## 3. Core Print Flows

- `preview_split` single-student print
- `preview_split` multi-student `모두 인쇄`
- Random issue modal `메인 PC로 보내기`
- Wrong answer builder per-result `PC전송`
- Wrong answer builder batch `학생별 묶음 PC전송`
- Results page reprint `PC전송`
- Pro papers student print `PC전송`
- Paper studio student print `PC전송`

## 4. Expected Success Result

- The tablet or browser shows queue success
- The setup page shows a new recent job
- The bridge app claims the job within a few seconds
- The print dialog does not require extra user input on the main PC
- The printer outputs the correct paper
- The recent job status changes to `완료`

## 5. Failure Checks

- Main PC bridge closed:
  Queue a job and confirm it stays `대기`
- Printer unavailable:
  Confirm the recent job becomes `실패`
- Network temporarily disconnected:
  Confirm the bridge retries completion reporting
  Confirm `pending_completions.json` is cleared after recovery
- Stale claimed job:
  Confirm `멈춘 처리중 복구` moves it back to `대기`
- Failed job retry:
  Confirm `실패 작업 다시 대기` moves it back to `대기`

## 6. Multi-Student Checks

- Random issue with multiple students goes to batch print
- `preview_batch` prints all selected students
- `wrong_preview_batch` prints all students in one run
- QR / share code remains visible where needed

## 7. Duplex Checks

- Enable duplex in `preview_split`
- Confirm the bridge job keeps the duplex flag
- Confirm the batch page also keeps duplex mode
- Confirm the operator instruction is shown before print

## 8. Support Files

- `bridge.log`
- `config.json`
- `pending_completions.json`
- `/app/print-bridge/setup` recent jobs table

## 9. Before Public Notice Upload

- Confirm the latest zip opens normally
- Confirm `latest.json` version matches the zip filename
- Confirm setup instructions are still accurate
- Confirm at least one real academy PC and printer completed end-to-end testing

## 10. In-App Update Checks

- Confirm `지금 업데이트` is disabled while a print job is running
- Confirm the downloaded ZIP SHA-256 matches server metadata
- Confirm the old process exits before the stable executable is replaced
- Confirm only one `xmath Print Bridge` Run entry remains
- Confirm the updated bridge starts once and keeps the existing device token

## 11. Security and Recovery Checks

- Confirm `config.json` contains `device_token_protected` and does not contain a plaintext device token on Windows
- Confirm the existing plaintext token is migrated on the first 1.0.7 launch
- Confirm repeated invalid connection codes eventually return HTTP 429 with `Retry-After`
- Confirm retrying the same completion result succeeds idempotently
- Confirm changing an already completed result is rejected
- Confirm signed print URLs that are expired or too far in the future are rejected before browser launch
- Confirm bridge logs redact device tokens and rotate after reaching the size limit
