# TASK-009: Implement history and diff API contracts Status: planned — depends on TASK-004 Owner: Codex Reviewer: Claude ## Outcome Provide frozen read-only domain and data contracts for commit history, changed files, bounded patches, and ref comparison so Claude can implement TASK-007 without editing shared layers. ## Writable paths - `app/src/main/java/com/ubisam/ubgitea/domain/history/` - `app/src/main/java/com/ubisam/ubgitea/data/history/` - `app/src/test/java/com/ubisam/ubgitea/domain/history/` - `app/src/test/java/com/ubisam/ubgitea/data/history/` - `tasks/009-history-diff-api-contract.md` ## Acceptance criteria - [ ] Domain contracts distinguish added, modified, renamed, and deleted files. - [ ] Commit history and comparison pagination is explicit and immutable. - [ ] Patch size and line limits produce an explicit truncated state. - [ ] Base and head refs are encoded independently exactly once. - [ ] Empty repository, missing ref, 401, 403, 404, 409, 422, rate-limit, network, parse, and server failures map to typed results. - [ ] Representative JSON and fake-server tests cover commit detail, rename/delete, comparison, pagination, and truncation. - [ ] No write endpoint is exposed. - [ ] Evidence records the reviewed contract-freeze commit for TASK-007. ## Required checks ```text ./gradlew assembleDebug ./gradlew testDebugUnitTest ./gradlew lintDebug ```