Skip to content

perf(knowledge): bound full scans by total file and node budgets (AGT-4871) - #908

Open
unohee wants to merge 2 commits into
mainfrom
heewonoh/agt-4871-scan-budget
Open

unohee wants to merge 2 commits into
mainfrom
heewonoh/agt-4871-scan-budget

Conversation

@unohee

@unohee unohee commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

무엇

  • ScanOptions 에 maxFiles(기본 20,000) / maxNodes(기본 50,000) 추가.
  • 예산을 넘으면 디렉터리 순회를 즉시 멈추고 incompleteReasons 에 file budget N reached / node budget N reached 를 남긴다 (그래프는 incomplete=true).
  • walkDirectory 인자를 WalkContext 하나로 묶었다.

왜

scanProject 는 시간·파일 크기·깊이 제한만 있어, 큰 저장소에서는 타임아웃 전까지 그래프가 계속 커졌다 (AGT-4871).

검증

  • npx vitest run src/knowledge/ — 7 files / 60 tests 통과 (신규 3: 파일 예산, 노드 예산 ≤ 상한, 예산 안이면 complete).
  • npm run typecheck, oxlint src/knowledge/ 0 errors.

…-4871)

scanProject only had time, file-size and depth limits, so a large
repository kept growing the graph until the timeout. ScanOptions now
takes maxFiles/maxNodes (defaults 20,000 / 50,000); hitting either stops
the walk and records the budget in incompleteReasons.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant