Skip to content

Cap scanner file count and warn on missing framework detection#15

Merged
4nkur merged 1 commit intomainfrom
scanner-robustness
Apr 25, 2026
Merged

Cap scanner file count and warn on missing framework detection#15
4nkur merged 1 commit intomainfrom
scanner-robustness

Conversation

@4nkur
Copy link
Copy Markdown
Owner

@4nkur 4nkur commented Apr 25, 2026

Closes two of the open questions in CLAUDE.md (Q1 and Q5).

Scanner gains a configurable file cap (DEFAULT_MAX_FILES = 5000) to protect against runaway walks in monorepos. The scan() function now accepts { maxFiles } and stops walking once the cap is hit, returning the truncated flag and the cap that was applied. Walk respects the flag mid-recursion to avoid extra work.

config.yaml gains an optional scan section:

scan:
  max_files: 10000

loadConfig parses scan.max_files into config.scanMaxFiles (coerced to a positive integer). Each command that calls the scanner now passes config.scanMaxFiles through to scan().

Two warnings via the new src/utils/scan-warnings.js helper:

  • "Note: scanner stopped at N source files. Raise scan.max_files in .draftwise/config.yaml for fuller coverage." — surfaced in every command that invokes the scanner whenever truncated is true.

  • "Heads up: no framework detected. Draftwise's scanner supports JS/TS (Next.js, Express, Fastify, Vue, Svelte) and common ORMs (Prisma, Mongoose, Drizzle). Other languages will produce shallow scans until language-specific support lands." — only surfaced in init (brownfield) and scan, since those are the natural moments to recalibrate expectations.

10 new tests across scanner, config, and the warnings helper. 112 total, all passing.

Per docs-sync: CLAUDE.md config.yaml example shows the new scan section; open questions list marks Q1 and Q5 as resolved and adds a new Q7 noting Python is the next planned scanner expansion.

Closes two of the open questions in CLAUDE.md (Q1 and Q5).

Scanner gains a configurable file cap (DEFAULT_MAX_FILES = 5000)
to protect against runaway walks in monorepos. The scan() function
now accepts { maxFiles } and stops walking once the cap is hit,
returning the truncated flag and the cap that was applied. Walk
respects the flag mid-recursion to avoid extra work.

config.yaml gains an optional scan section:

    scan:
      max_files: 10000

loadConfig parses scan.max_files into config.scanMaxFiles (coerced
to a positive integer). Each command that calls the scanner now
passes config.scanMaxFiles through to scan().

Two warnings via the new src/utils/scan-warnings.js helper:

- "Note: scanner stopped at N source files. Raise scan.max_files
  in .draftwise/config.yaml for fuller coverage." — surfaced in
  every command that invokes the scanner whenever truncated is
  true.

- "Heads up: no framework detected. Draftwise's scanner supports
  JS/TS (Next.js, Express, Fastify, Vue, Svelte) and common ORMs
  (Prisma, Mongoose, Drizzle). Other languages will produce
  shallow scans until language-specific support lands." — only
  surfaced in init (brownfield) and scan, since those are the
  natural moments to recalibrate expectations.

10 new tests across scanner, config, and the warnings helper.
112 total, all passing.

Per docs-sync: CLAUDE.md config.yaml example shows the new scan
section; open questions list marks Q1 and Q5 as resolved and adds
a new Q7 noting Python is the next planned scanner expansion.
@4nkur 4nkur merged commit 479ebab into main Apr 25, 2026
@4nkur 4nkur deleted the scanner-robustness branch April 25, 2026 11:23
4nkur added a commit that referenced this pull request Apr 25, 2026
Per the user's request — every change to the project gets recorded
here by tag ID, date, and author. Format follows Keep a Changelog
(keepachangelog.com) with semver versioning.

Retroactively populated:
- [0.0.1] — 2026-04-25 — Ankur — the first npm release, with
  every command in the v1 build order (init, scan, explain, new,
  tech, tasks, list, show) and the AI plumbing for Claude.
- [Unreleased] — everything merged to main since 0.0.1 but not
  yet published: greenfield init routing (#12), greenfield-aware
  new/tech/tasks (#13), scaffold (#14), scanner robustness (#15),
  Python support (#16), scan cache + flow filter (#17), pruning
  resolved questions out of CLAUDE.md (#18), and this changelog.

Going forward (saved as a feedback memory):
- Every functional PR adds an entry under [Unreleased] in the
  same PR — bundled with the change, not as a follow-up.
- On version tag, [Unreleased] entries move into a versioned
  section header `## [X.Y.Z] — YYYY-MM-DD — author` and a fresh
  empty [Unreleased] block is added at the top.
- Pure-internal noise (test-only refactors, lockfile bumps,
  settings.local.json) is skipped.
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