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.1 KiB
4.1 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-preprocessing-seam-전처리-접점 | Preprocessing Seam (전처리 접점) | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Preprocessing Seam (전처리 접점)
매 한 줄
"매 컴파일 전에 매 동작을 바꾸는 매 접점". Preprocessing seam은 Michael Feathers "Working Effectively with Legacy Code" (2004) 의 매 3대 seam (preprocessing / link / object) 중 매 첫 번째 — 매 source 수정 없이 매 매크로/include 치환으로 매 test isolation 가능 지점. C/C++ 같은 매 preprocessor-heavy language의 매 testability 회복 도구.
매 핵심
매 Seam 정의
- 매 Seam: 매 source 수정 없이 매 동작 변경 가능한 매 지점.
- 매 Enabling point: 매 seam을 매 활용하는 매 mechanism (here: preprocessor).
- 매 3종류: preprocessing / link / object.
매 Preprocessing seam 작동
#include "db.h"→ 매 test 시 매 fakedb.hinclude path 우선.#define malloc test_malloc→ 매 allocator hook.#ifdef TESTING매 conditional compile.
매 응용
- Legacy C codebase 매 unit test 추가.
- Embedded firmware의 매 hardware register hook.
- Time/random 매 deterministic replacement.
💻 패턴
Header substitution seam
// production: src/db.h
int db_query(const char* sql);
// test/fakes/db.h — 매 same signature, 매 fake impl
int db_query(const char* sql) { return 42; }
// CMake test target
target_include_directories(my_test PRIVATE test/fakes src) // 매 fakes 우선
Macro override
// production: alloc.h
#ifndef TESTING
# define MY_MALLOC malloc
# define MY_FREE free
#else
# define MY_MALLOC test_malloc
# define MY_FREE test_free
#endif
void* p = MY_MALLOC(64);
Time seam (deterministic test)
// time_seam.h
#ifdef TESTING
extern uint64_t mock_now;
# define NOW_MS() (mock_now)
#else
# define NOW_MS() ((uint64_t)(clock_gettime_ms()))
#endif
// test
uint64_t mock_now = 1000;
mock_now += 500;
ASSERT(elapsed() == 500);
Linker seam (sibling)
// production link: real_sensor.o
int read_sensor(void);
// test link: fake_sensor.o 매 same symbol, 매 different impl
int read_sensor(void) { return injected_value; }
// gcc test.c fake_sensor.o -o test // 매 real_sensor.o 미포함
Python equivalent — sys.modules patch
# 매 import-time seam
import sys, types
fake = types.ModuleType("db")
fake.query = lambda sql: 42
sys.modules["db"] = fake
import service # 매 service.py 의 `import db` → fake
매 결정 기준
| 상황 | Approach |
|---|---|
| C/C++ legacy, 매 source 매 못 건드림 | Preprocessing seam |
| Static lib, 매 link-time control | Link seam |
| Java/.NET runtime | Object seam (subclass / DI) |
| Python | sys.modules / monkeypatch |
기본값: Object seam 우선, 매 안 되면 link → preprocessing 순.
🔗 Graph
- 부모: Seam
- 변형: Link-Seam · Object-Seam
- 응용: Unit-Testing
- Adjacent: Dependency_Injection_(DI) · Test-Double
🤖 LLM 활용
언제: legacy C/C++ 매 testability 회복, 매 hardware seam 설계. 언제 X: 매 greenfield project (DI 우선).
❌ 안티패턴
- 매 #ifdef TESTING 폭주: 매 production code 매 #ifdef 매 가독성 파괴.
- 매 Header path race: 매 fake include order 매 fragile.
- 매 Macro hell: 매 함수 매크로 매 debug 불가.
- 매 매 seam 영구화: 매 test seam 을 매 production refactor 후에도 매 유지.
🧪 검증 / 중복
- Verified (Feathers "Working Effectively with Legacy Code" 2004 Ch.4).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Feathers 3-seam taxonomy + working C/Python examples |