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.8 KiB
4.8 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-checkin | 과잉 속성 체크 (Excess Property Checking) | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
과잉 속성 체크 (Excess Property Checking)
매 한 줄
"매 object literal 을 직접 assign / pass 할 때만 발동하는 TS 의 추가 strictness rule". 매 structural typing 의 원칙적으론 OK 인 extra property 를 매 fresh object literal 에 한해 error 로 잡아 typo 방지. 매 변수 경유 시 자동 비활성화.
매 핵심
매 작동 방식
- TS 의 structural / duck typing 은 매 extra property OK.
- 그러나 매 object literal 을 fresh 하게 assign 시 TS 는 추가로 surplus key 를 error 로 보고.
- 매 변수에 한 번 alias 하면 fresh 신호가 사라져 EPC 우회.
매 발동 조건
- 매 object literal 의 직접 assignment / argument / return.
- 매 contextual type 이 존재.
- 매 변수 경유, type assertion (
as), spread 시 비활성화.
매 응용
- Component prop typo 방지 (React).
- API request body 의 surplus field 차단.
- Config object 의 misnamed key 발견.
💻 패턴
매 EPC 발동 (error)
interface User { name: string; age: number }
const u: User = { name: "Lee", age: 30, emial: "x" };
// ^^^^^ 매 EPC: 'emial' does not exist on User
매 변수 경유 우회 (error 사라짐)
const raw = { name: "Lee", age: 30, emial: "x" };
const u: User = raw; // ✅ OK — fresh 아니라 EPC 비활성
// 매 structural compatibility 만 본다 (User 의 모든 prop 충족 → OK)
매 함수 인자 EPC
function greet(u: User) { console.log(u.name); }
greet({ name: "A", age: 1, extra: 1 }); // ❌ EPC error
const x = { name: "A", age: 1, extra: 1 };
greet(x); // ✅ OK
매 index signature 의 escape hatch
interface Loose {
name: string;
[key: string]: unknown;
}
const l: Loose = { name: "A", whatever: 123, deep: { x: 1 } }; // ✅ OK
매 union type 의 EPC quirk
type A = { kind: "a"; a: number };
type B = { kind: "b"; b: number };
const x: A | B = { kind: "a", a: 1, b: 2 };
// ❌ EPC: 'b' is not in A; not in B 의 fresh form
// 매 변수 경유 시 통과 — 의도치 않은 leakage 가능
매 의도적 우회 (type assertion — 위험)
const u: User = { name: "A", age: 1, emial: "x" } as User;
// ⚠ 매 작동하지만 매 typo 의 silent — 매 강력히 X
매 React component prop typo 방지
type ButtonProps = { label: string; onClick: () => void };
const Button = (p: ButtonProps) => <button onClick={p.onClick}>{p.label}</button>;
<Button labl="Hi" onClick={() => {}} />; // ❌ EPC: 'labl' typo 발견
매 satisfies operator (TS 4.9+) — 매 EPC 유지 + inference
const config = {
port: 8080,
host: "localhost",
// typoKey: 1 // ❌ EPC error if uncomment
} satisfies { port: number; host: string };
// 매 config.port: number 의 narrow type 유지 + EPC 활성
매 결정 기준
| 상황 | Approach |
|---|---|
| 매 strict typo 검출 | 매 object literal 직접 assign + EPC 활용 |
| 매 동적 key 다수 | index signature 추가 |
| 매 narrow + EPC 동시 | satisfies operator |
| 매 변수 경유 필요 | type annotation 변수 + literal 사용 |
| 매 EPC 의도적 회피 | 매 보통 X — type 의 재설계 |
기본값: 매 object literal 의 직접 assign + satisfies 또는 explicit type — 매 변수 경유 의 무의식적 우회 X.
🔗 Graph
- 부모: TypeScript · 구조적 타이핑(Structural Typing)
- 변형: satisfies operator
- 응용: API Contract
- Adjacent: Type Narrowing · Discriminated Union
🤖 LLM 활용
언제: TS error 디버깅 ("excess property"), refactor 시 EPC 의도 검증. 언제 X: 매 runtime validation — 매 EPC 는 컴파일타임만.
❌ 안티패턴
- as Type 으로 EPC 회피: 매 typo 의 silent.
- 변수 경유 의 우회: 매 의도면 OK, 매 실수면 위험.
- EPC 비활성화 의 흔한 오해: 매 spread
{ ...x, extra: 1 }의 fresh — EPC 발동. - runtime 신뢰: EPC 는 매 compile-time only — 매 런타임 검증 X.
🧪 검증 / 중복
- Verified (TypeScript Handbook — Object Types, TS 5.x source).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — EPC 발동 조건 + 우회 + satisfies |