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 폴더 제거.
5.9 KiB
5.9 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-program-comprehension-strategies | Program Comprehension Strategies | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Program Comprehension Strategies
매 한 줄
"매 90% of programming is reading code, not writing it.". 매 Brooks (1983), Pennington (1987), Soloway (1986) 의 cognitive software engineering 연구에서 출발한 매 분야 — 매 code → mental model 변환의 strategies. 매 2026 LLM 시대에는 매 Cursor/Claude Code 의 contextual indexing 이 매 human comprehension 을 augment.
매 핵심
매 3대 strategy
- Top-down (Brooks): 매 hypothesis 형성 → code 로 verify. 매 domain expert 가 사용.
- Bottom-up (Pennington): 매 statement → control-flow → data-flow → program model. 매 novice 가 사용.
- Opportunistic (mixed): 매 expert programmer 의 실제 행동 — top-down 시작, beacon 발견 시 bottom-up 으로 dive.
매 cognitive constructs
- Beacons: 매 recognizable patterns (e.g.,
for(i=0; i<n; i++)→ 매 loop,swap(a,b)→ 매 sort). - Plans: 매 stereotypical solutions (e.g., search plan, accumulator plan).
- Chunks: 매 functionally cohesive code groups stored as 1 unit in working memory.
매 응용
- Code review: 매 reviewer 는 top-down — PR 의 의도 파악 후 specific changes 검증.
- Onboarding: 매 new dev 는 bottom-up — small fixes 로 시작, 점진적 chunking.
- AI-assisted reading: 매 LLM 에게 code summarization → human 이 hypothesis 생성.
💻 패턴
Pattern 1: Top-down hypothesis-driven reading
# 매 step 1: read README / docstring → 매 form hypothesis
# 매 step 2: locate entry point (main, app.py)
# 매 step 3: trace only the path that confirms/refutes hypothesis
def trace_hypothesis(repo, hypothesis):
entry = find_entry_point(repo)
call_graph = build_call_graph(entry)
relevant = filter_by_keyword(call_graph, hypothesis.keywords)
return relevant
Pattern 2: Beacon recognition (LLM-augmented)
import anthropic
client = anthropic.Anthropic()
def extract_beacons(code: str) -> list[str]:
resp = client.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
system="Identify recognizable code patterns (beacons) and name their plan.",
messages=[{"role": "user", "content": f"```\n{code}\n```"}],
)
return parse_beacons(resp.content[0].text)
Pattern 3: Chunking via cohesion analysis
def chunk_function(ast_node):
"""매 group statements by 매 shared variables (cohesion)."""
chunks, current = [], []
last_vars = set()
for stmt in ast_node.body:
vars = extract_vars(stmt)
if last_vars and not (vars & last_vars):
chunks.append(current)
current = []
current.append(stmt)
last_vars = vars
if current:
chunks.append(current)
return chunks
Pattern 4: Cross-reference walking (bottom-up)
# 매 ripgrep + ctags-driven exploration
rg -l "AuthService" --type ts | head -5
rg "class AuthService" --type ts -A 30
rg "new AuthService\(" --type ts # 매 callers
Pattern 5: LLM-driven code summarization
# 매 Claude Code-style structured summary
PROMPT = """Summarize this file with:
1. 매 PURPOSE (1 sentence)
2. 매 KEY DATA STRUCTURES
3. 매 PUBLIC API
4. 매 NON-OBVIOUS CONTRACTS / INVARIANTS
5. 매 DEPENDENCIES (incoming + outgoing)
"""
def summarize(file_path):
code = open(file_path).read()
return claude_call(PROMPT + f"\n```\n{code}\n```")
Pattern 6: Mental model checkpointing
<!-- 매 personal-notes.md per repo while reading -->
## Module: auth/
- Purpose: JWT issuance & verification
- Entry: `auth/router.ts:loginHandler`
- Key invariant: tokens always include `iss=our-domain`
- Open Q: where is refresh-token rotation?
Pattern 7: Diagram-first — produce dependency graph before reading
madge --image deps.svg src/
# 매 visual chunking — see clusters before diving
매 결정 기준
| 상황 | Strategy |
|---|---|
| 매 domain familiar, code new | Top-down |
| 매 domain new, code small | Bottom-up |
| 매 large unknown codebase | Opportunistic + diagram first |
| 매 bug hunt | Bottom-up from stack trace |
| 매 architecture review | Top-down from entry points |
| 매 LLM augmentation | Summarize → form hypothesis → verify |
기본값: 매 opportunistic — 매 README + entry point 부터 시작, beacon 발견 시 dive.
🔗 Graph
- 부모: Cognitive Psychology
- 변형: Code Review · Onboarding
- 응용: Refactoring_Best_Practices
- Adjacent: Mental_Models · Working Memory · AST
🤖 LLM 활용
언제: 매 onboarding new repo, 매 reviewing large PR, 매 understanding legacy code, 매 building mental model. 언제 X: 매 1-line hot-fix 에 over-engineering 하지 마라.
❌ 안티패턴
- Read everything linearly: 매 working memory 초과 — chunking 없이 무너짐.
- Skip the README: 매 hypothesis 없이 bottom-up 만 → 매 lost in details.
- No checkpointing: 매 1시간 후 모두 잊음 — write down mental model.
- Trust LLM summary blindly: 매 hallucination 위험 — 매 verify on key claims.
🧪 검증 / 중복
- Verified (Brooks 1983, Pennington 1987, Soloway & Ehrlich 1984, Storey 2006 review).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — top-down/bottom-up/opportunistic + LLM augmentation |