9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
4.4 KiB
4.4 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-초과-속성-검사-excess-property-checks | 초과 속성 검사 (Excess Property Checks) | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
초과 속성 검사 (Excess Property Checks)
매 한 줄
"매 object literal 의 typo 잡는 TypeScript 의 strictness gate". 매 object literal 을 직접 assign / pass 할 때, target type 에 없는 property 가 있으면 error. 매 typo prevention 의 first line of defense — 그러나 매 변수 indirection 으로 우회 가능.
매 핵심
매 trigger 조건
- 매 object literal 만 적용 —
{ ... }직접 assign / argument pass / return. - 매 변수 binding 후 pass 하면 EPC X (structural subtyping 만 적용).
- 매 type assertion (
as Foo) 시 EPC X.
매 왜 존재
- 매 typo (
colorvscolour) 같은 silent bug 방지. - 매 structural typing 의 hole 메우기 — 매 extra property 는 logically unintended.
매 응용
- Component props 의 typo 방지.
- API request body 의 unintended field 방지.
- Config object 의 unknown key 방지.
💻 패턴
1. Basic EPC trigger
interface Square { color: string; width: number; }
function createSquare(s: Square) { /* ... */ }
// Error: 'colour' does not exist in type 'Square'
createSquare({ colour: 'red', width: 100 });
// OK — 매 변수 indirection bypass
const sq = { colour: 'red', width: 100 };
createSquare(sq); // structural — passes
2. Index signature escape hatch
interface SquareConfig {
color?: string;
width?: number;
[propName: string]: unknown; // 매 extra property 허용
}
createSquare({ color: 'red', width: 100, foo: 'bar' }); // OK
3. Type assertion bypass
createSquare({ colour: 'red', width: 100 } as Square); // EPC suppressed (위험)
4. Spread bypass
const extras = { foo: 'bar' };
createSquare({ color: 'red', width: 100, ...extras }); // OK — spread bypasses EPC
5. React props 의 typo 방지
interface ButtonProps { variant: 'primary' | 'secondary'; }
function Button(p: ButtonProps) { return <button>{p.variant}</button>; }
// Error: 'varient' does not exist on type 'ButtonProps'
<Button varient="primary" />;
6. Discriminated union 의 EPC
type Shape =
| { kind: 'circle'; radius: number }
| { kind: 'square'; side: number };
const s: Shape = { kind: 'circle', radius: 5, side: 10 };
// Error: 'side' does not exist in type '{ kind: "circle"; radius: number; }'
7. satisfies operator (modern alt)
const config = {
color: 'red',
width: 100,
} satisfies Square;
// 매 EPC 적용 + 매 narrowest type preserved
매 결정 기준
| 상황 | Approach |
|---|---|
| Object literal direct pass | Rely on EPC (default) |
| Plugin / dynamic config | Index signature [k: string]: unknown |
| Test / migration code | Type assertion as (last resort) |
| Modern TS 4.9+ | satisfies for both EPC + inference |
기본값: 매 object literal 직접 pass 의 EPC 의존, 매 variable indirection 회피 (의도 불분명).
🔗 Graph
- 부모: TypeScript Type System · Structural Typing
- 변형: satisfies Operator · Type Assertion
- Adjacent: Discriminated_Unions
🤖 LLM 활용
언제: TS strict mode 에서 props/config object literal 의 typo 발견 시. satisfies migration 권장 시.
언제 X: 매 dynamic / runtime-shaped object — 매 schema validation (Zod) 를 prefer.
❌ 안티패턴
- Type assertion 남용:
as Foo로 EPC bypass — 매 type safety 완전 상실. - Spread laundering:
{ ...obj }으로 EPC 우회 — 매 typo 가 silently 통과. - Index signature 남발:
[k: string]: any— 매 EPC 의 효력 무효화. - Variable indirection: 매 의도적으로 EPC 회피 — 매 reviewer 혼란.
🧪 검증 / 중복
- Verified (TypeScript Handbook — Object Types / Excess Property Checks).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — EPC trigger/bypass + satisfies modern alt |