Skip to content

feat(android): 照合ログを端末内に記録し、設定画面から JSONL で共有・保存・消去する (#122) - #124

Merged
rimtty merged 2 commits into
masterfrom
codex/android-scan-log
Sep 7, 2026
Merged

rimtty merged 2 commits into
masterfrom
codex/android-scan-log

Conversation

@rimtty

@rimtty rimtty commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Closes #122 (parent #120).

変更

  • core/model ScanLogEvent(+ ScanLogSource / ScanLogStep / ScanLogEventKind / ScanLogReason の語彙)。
  • core/data Room v4: scan_log(autoincrement id、at index)、ScanLogDao(insert / trimToLatest / count Flow / all / clear)、MIGRATION_3_4CodeMatchDatabaseCodeMatchDatabaseFactory の両方に登録)、schemas/…/4.jsonScanLogRepository(挿入後 5,000 件に切り詰め)。
  • feature/scan ScanLogRecorder + ScanSessionCoordinator のフック: 入力ソース不一致 rejected/source_mismatch、カメラ 1 フレーム目 barcode_candidate、reduce 直後に rejectedInvalidScanReason 7 種を snake_case)/ qr_accepted / barcode_accepted + match / mismatch / duplicate、結果表示中の握りつぶし rejected/result_pendingsession_end(旧状態から)。session_startScanViewModel.beginSession で記録。InvalidScan と BLE 診断はペイロード非含有のまま。
  • core/export ScanLogJsonExporteriOS/Android: 照合ログ(判定・不受理・セッション)を端末内に記録し、設定画面から JSONL で共有する #120 のスキーマ: ヘッダ行 + 1 イベント 1 行、outputStream().usecache/codematch-export/ へ)。verify-release-hardening.shFile( 許可リストに追加(それ以外の変更なし)。
  • 設定画面: LanguageCard の下に ScanLogCard(件数、共有 / 保存 / 消去、消去は AlertDialog)。共有は FileProvider text/plain、保存は SAF、消去は VM → repository。strings ja/en 15 キー。
  • docs: IMPLEMENTATION_PLAN / STATUS / TEST_PARITY / PRIVACY / CLAUDE.md。

テスト

  • lintDebug testDebugUnitTest: 457 tests, 0 failures。:app:assembleRelease 成功。verify-release-hardening.sh 全項目通過(ローカル)。
  • Pixel 7: :core:data:connectedDebugAndroidTest 32 件、:feature:settings:connectedDebugAndroidTest 22 件 緑。AppFlowInstrumentationTest の新規 1 本は CI エミュレーターで実行。

🤖 Generated with Claude Code

… share it from Settings

Room v4 adds the scan_log table (latest 5,000 events). The scan
coordinator records accepted QR/Code 128 values, match / mismatch /
duplicate verdicts, every rejection with its reason (including
source-mismatch drops and camera candidates), and session start / end,
with the raw payloads. Settings gains a 照合ログ card at the bottom
that shares or saves the log as JSON Lines (shared schema v1) and
clears it after confirmation. BLE diagnostics and InvalidScan stay
payload-free; the release gate allow-lists the new exporter.

Closes #122
…led write crash

Events are queued through one unlimited channel drained by a single
coroutine, so the log keeps the coordinator's order (the emulator run
interleaved the per-event launches), and a write that fails because the
database is already closed is dropped instead of crashing the process.
@rimtty
rimtty merged commit 9b8ec4b into master Sep 7, 2026
3 checks passed
@rimtty
rimtty deleted the codex/android-scan-log branch September 7, 2026 16:04
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.

Android: 照合ログ(Room v4 scan_log)と設定画面の共有・保存・消去

1 participant