Skip to content

Commit e431d1b

Browse files
committed
fix(content): PR 리뷰 정책 오류 수정
contentType을 ingestion 필수 필드로 바꾸고 production build에서도 콘텐츠 진단 로그가 남도록 수정했습니다. Life 글의 writing score 부족은 private 전환 검토가 아니라 보강 필요로 분류하도록 audit 정책과 테스트를 보강했습니다.
1 parent 90a93a3 commit e431d1b

6 files changed

Lines changed: 52 additions & 6 deletions

File tree

blog/model/frontmatter-schema.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,24 @@ describe('FeedFrontmatterSchema', () => {
99
description: 'desc',
1010
date: '2026-04-13',
1111
category: 'Tech',
12+
contentType: 'essay',
1213
});
1314

1415
expect(parsed.visibility).toBe('public');
1516
});
1617

18+
it('requires content type classification', () => {
19+
expect(() =>
20+
FeedFrontmatterSchema.parse({
21+
title: 'Example',
22+
slug: 'example',
23+
description: 'desc',
24+
date: '2026-04-13',
25+
category: 'Tech',
26+
})
27+
).toThrow();
28+
});
29+
1730
it('accepts empty quality review scaffolds', () => {
1831
const parsed = FeedFrontmatterSchema.parse({
1932
title: 'Example',
@@ -89,6 +102,7 @@ describe('FeedFrontmatterSchema', () => {
89102
description: 'desc',
90103
date: '2026-04-13',
91104
category: 'Tech' as const,
105+
contentType: 'essay' as const,
92106
};
93107

94108
expect(() =>

blog/model/frontmatter-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const FeedFrontmatterSchema = z.object({
1414
description: z.string(),
1515
date: z.string(),
1616
category: z.enum(['Tech', 'Life']),
17-
contentType: z.enum(['essay', 'retrospective', 'review']).optional(),
17+
contentType: z.enum(['essay', 'retrospective', 'review']),
1818
visibility: z.enum(['public', 'private']).default('public'),
1919
tags: z.array(z.string()).optional(),
2020
image: z.string().optional(),

blog/model/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface FeedFrontmatter {
2727
date: string;
2828
updated?: string;
2929
category: PostCategory;
30-
contentType?: PostContentType;
30+
contentType: PostContentType;
3131
visibility?: PostVisibility;
3232
tags?: string[];
3333
image?: string;

blog/services/post-repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { FeedFrontmatterSchema } from '@/blog/model/frontmatter-schema';
55

66
const postsDirectory = path.join(process.cwd(), 'posts');
77
const isProduction = process.env.NODE_ENV === 'production';
8-
const shouldLogContentIssues = process.env.NODE_ENV === 'development';
8+
const shouldLogContentIssues = process.env.NODE_ENV !== 'test';
99

1010
// Cache for folder path lookups by slug
1111
const slugToFolderCache = new Map<string, string>();

tooling/scripts/posts/audit-post-quality.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,11 @@ function determineStatus(meta, policy, taxonomy, quality, writingScore) {
331331
return 'private-review';
332332
}
333333

334-
if (writingScore !== null && writingScore <= 2.5) {
335-
return 'private-review';
334+
if (taxonomy.warnings.length > 0) {
335+
return 'revise';
336336
}
337337

338-
if (taxonomy.warnings.length > 0) {
338+
if (writingScore !== null && writingScore <= 2.5) {
339339
return 'revise';
340340
}
341341

tooling/scripts/posts/audit-post-quality.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,36 @@ describe('post quality audit script', () => {
110110
expect(output).toContain('missing-content (6)');
111111
expect(output).toContain('## Improvement Priorities');
112112
});
113+
114+
it('does not mark public Life posts private for low writing scores', () => {
115+
writePostFixture('low-scored-life', {
116+
title: 'Life 기준을 다시 세운 기록',
117+
slug: 'low-scored-life',
118+
description: '설명',
119+
date: '2026-06-17',
120+
category: 'Life',
121+
contentType: 'essay',
122+
visibility: 'public',
123+
tags: ['Life'],
124+
qualityReview: {
125+
philosophy: 4,
126+
design: 4,
127+
implementation: 4,
128+
brandFit: 4,
129+
clarity: 2.5,
130+
structure: 2.5,
131+
evidence: 2.5,
132+
usefulness: 2.5,
133+
originality: 2.5,
134+
polish: 2.5,
135+
},
136+
});
137+
138+
const output = runAudit();
139+
140+
expect(output).toContain('[보강 필요] low-scored-life (public, Life)');
141+
expect(output).not.toContain(
142+
'[private 전환 검토] low-scored-life (public, Life)'
143+
);
144+
});
113145
});

0 commit comments

Comments
 (0)