fix(lifecycle): NoteStatus 의 archived 제거 — MoveStatusModal/classifyStatus/store 정리

- NoteStatus 에서 'archived' 제거 (active | completed | trashed 3분기)
- MoveStatusModal ALL_STATUSES 에서 'archived' 제거 + statusLabel switch 정리
- classifyStatus VALID/FALLBACK/PROMPT 에서 archived 제거 → completed fallback
- inboxApi IPC set-status VALID 배열에서 archived 제거, classify-status fallback → completed
- store InboxView 에서 'archived' 제거, InboxCounts.archived 제거, archived: 0 spread 제거
- ImportService.applySyncFromDir — 기존 파일의 status=archived 를 completed 로 coerce
- 영향 받는 tests 13개 파일 모두 update (archived → completed, 없어진 UI 옵션 제거)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
th-kim0823
2026-05-15 11:03:09 +09:00
parent 96174f84c9
commit 274c171ee8
13 changed files with 78 additions and 94 deletions

View File

@@ -13,15 +13,16 @@ export interface ClassifyStatusOutput {
rationale: string;
}
const VALID: readonly NoteStatus[] = ['completed', 'archived', 'trashed'];
// v0.4 Task 16 — 'archived' 제거. completed / trashed 만 유효 추천값.
// AI 응답이 'archived' 를 반환해도 VALID 에 없으므로 FALLBACK(completed) 로 coerce됨.
const VALID: readonly NoteStatus[] = ['completed', 'trashed'];
const PROMPT_TEMPLATE = `다음 메모를 분류하세요.
가능한 status:
- completed: 작업이 끝났고 더 이상 행동 불필요
- archived: 장기 보관 — 회수 가능, 지금은 보지 않음
- trashed: 불필요, 의미 없는 메모
JSON 출력만 하세요: { "recommended": "completed|archived|trashed", "rationale": "<한 문장 한국어>" }
JSON 출력만 하세요: { "recommended": "completed|trashed", "rationale": "<한 문장 한국어>" }
메모 본문:
{{rawText}}
@@ -32,17 +33,18 @@ JSON 출력만 하세요: { "recommended": "completed|archived|trashed", "ration
사용자 이동 사유:
{{reason}}`;
// v0.4 Task 16 — fallback 을 'completed' 로 변경 ('archived' 제거).
const FALLBACK: ClassifyStatusOutput = {
recommended: 'archived',
rationale: '판단 실패 — 안전하게 보관 추천'
recommended: 'completed',
rationale: '판단 실패 — 완료 처리 추천'
};
/**
* v0.2.9 Cut B Task 9 — AI 자동 분류 (status 추천).
*
* provider.generateRaw 가 있으면 raw JSON 응답 사용, 없으면 generate() 재사용 시도
* (그 경우 응답 형태 불일치로 보통 fallback). 에러/parse 실패 시 'archived' 안전 default
* (사용자 데이터 보존 우선).
* (그 경우 응답 형태 불일치로 보통 fallback). 에러/parse 실패 시 'completed' fallback
* (v0.4 Task 16 — 'archived' 제거, 안전 default 를 completed 로 변경).
*/
export async function classifyStatus(
input: ClassifyStatusInput

View File

@@ -230,7 +230,7 @@ export function registerInboxApi(deps: InboxIpcDeps): void {
ipcMain.handle(
'inbox:set-status',
async (_e, id: string, status: NoteStatus, reason: string | null) => {
const VALID: readonly NoteStatus[] = ['active', 'completed', 'archived', 'trashed'];
const VALID: readonly NoteStatus[] = ['active', 'completed', 'trashed'];
if (!VALID.includes(status)) {
return { ok: false as const, reason: 'invalid status' as const };
}
@@ -242,14 +242,14 @@ export function registerInboxApi(deps: InboxIpcDeps): void {
);
// v0.2.9 Cut B Task 9 — AI 자동 분류 (status 추천).
// Ollama provider.generateRaw 호출 + JSON 응답 파싱. 에러/실패 시 archived fallback
// (사용자 데이터 보존 우선). 자세한 prompt + parse 로직은 src/main/ai/classifyStatus.ts.
// Ollama provider.generateRaw 호출 + JSON 응답 파싱. 에러/실패 시 completed fallback
// (v0.4 Task 16 — 'archived' 제거). 자세한 prompt + parse 로직은 src/main/ai/classifyStatus.ts.
ipcMain.handle('ai:classify-status', async (_e, id: string, reason: string) => {
const note = deps.repo.findById(id);
if (note === null) {
return {
recommended: 'archived' as const,
rationale: '메모를 찾을 수 없음 — 안전하게 보관 추천'
recommended: 'completed' as const,
rationale: '메모를 찾을 수 없음 — 완료 처리 추천'
};
}
const provider = deps.providerHolder.get();

View File

@@ -150,7 +150,9 @@ export class ImportService {
userIntent: parsed.userIntent,
intentPromptedAt: parsed.intentPromptedAt,
tags: parsed.tags,
status: parsed.status,
// v0.4 Task 16 — 'archived' 는 NoteStatus 에서 제거됨. 기존 내보내기 파일의
// status=archived 를 읽을 때 completed 로 coerce (m008 과 동일 정책).
status: parsed.status === 'archived' ? 'completed' : parsed.status,
statusChangedAt: parsed.statusChangedAt,
moveReason: parsed.moveReason,
dueDate: parsed.dueDate,