- m009 마이그레이션: notebooks.sort_order INTEGER 컬럼 추가, 기존 rows created_at 순으로 backfill
- NotebookRepository.list ORDER BY sort_order ASC, name ASC 로 변경
- NotebookRepository.create 신규 노트북 sort_order = max+1 자동 할당
- NotebookRepository.reorder(id, direction) — swap transaction 으로 atomic 순서 변경
- IPC notebook:reorder 핸들러 등록, preload/shared types pass-through
- 테스트 45개 추가 (m009, reorder 케이스 4, list ORDER BY, IPC 핸들러 2)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- NotebookRepository.findByName(name) 추가 — COLLATE NOCASE case-insensitive 조회
- AiWorkerOptions.notebookRepo 옵션 추가 (optional Pick<NotebookRepository, ...>)
- processJob: generate 전 notebookRepo.list() → notebooks 배열 GenerateInput 에 주입
- processJob: updateAiResult 후 res.notebookMatch valid 이름이면 findByName + moveNote 호출
- main/index.ts: AiWorker 생성 시 notebookRepo 전달
- NotebookRepository.test.ts: findByName 3개 테스트 추가
- AiWorker.test.ts: notebook 매칭 describe 4개 테스트 추가 (총 45 테스트 통과)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Notebook 인터페이스 src/shared/types.ts 에 추가 (noteCount = active 노트 수)
- NotebookRepository.ts 신설: list / findById / create / rename / setColor / delete / moveNote
- delete: FK RESTRICT 위반 → ok:false reason='has_notes', 미존재 → 'not_found'
- noteCount 서브쿼리: status='active' 만 카운트 (completed/trashed 제외)
- 테스트 10개 모두 통과, typecheck clean
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>