diff --git a/src/main/services/ExportService.ts b/src/main/services/ExportService.ts index de08d27..01cb527 100644 --- a/src/main/services/ExportService.ts +++ b/src/main/services/ExportService.ts @@ -136,7 +136,6 @@ export class ExportService { totalBytes += Buffer.byteLength(indexJsonl, 'utf8'); const manifest = composeManifest({ - exportedAt: this.now().toISOString(), noteCount: notes.length, mediaCount }); diff --git a/src/main/services/exportFormat.ts b/src/main/services/exportFormat.ts index e0eb5cd..86f31d0 100644 --- a/src/main/services/exportFormat.ts +++ b/src/main/services/exportFormat.ts @@ -253,14 +253,15 @@ export function composeIndexJsonl( // --------------------------------------------------------------------------- export function composeManifest(input: { - exportedAt: string; noteCount: number; mediaCount: number; }): string { + // exported_at 필드 의도적 제외 — note 변경 없이도 git sync 가 매 호출마다 + // timestamp 갱신 1줄 commit 을 만들어 history 노이즈와 불필요한 push 유발. + // import path 는 inkling_export_version 만 read 하므로 안전. return JSON.stringify( { inkling_export_version: 1, - exported_at: input.exportedAt, note_count: input.noteCount, media_count: input.mediaCount }, diff --git a/tests/unit/exportFormat.test.ts b/tests/unit/exportFormat.test.ts index ed7f611..bce1d67 100644 --- a/tests/unit/exportFormat.test.ts +++ b/tests/unit/exportFormat.test.ts @@ -230,16 +230,22 @@ describe('composeIndexJsonl', () => { }); describe('composeManifest', () => { - it('emits pretty JSON with required fields', () => { + it('emits pretty JSON with required fields (timestamp-free)', () => { const m = composeManifest({ - exportedAt: '2026-04-26T00:00:00.000Z', noteCount: 42, mediaCount: 17 }); const obj = JSON.parse(m); expect(obj.inkling_export_version).toBe(1); - expect(obj.exported_at).toBe('2026-04-26T00:00:00.000Z'); expect(obj.note_count).toBe(42); expect(obj.media_count).toBe(17); + // exported_at 필드 제거 — sync git history noise 방지. + expect(obj.exported_at).toBeUndefined(); + }); + + it('두 번 호출 결과 stable (sync no-op invariant — 같은 input 이면 git diff 0)', () => { + const a = composeManifest({ noteCount: 5, mediaCount: 2 }); + const b = composeManifest({ noteCount: 5, mediaCount: 2 }); + expect(a).toBe(b); }); });