Skip to content

feat(analyzers): recognize NestJS projects#3

Open
aolin480 wants to merge 5 commits into
bugfix/huggingface-fixfrom
feature/nestjs-analyzer
Open

feat(analyzers): recognize NestJS projects#3
aolin480 wants to merge 5 commits into
bugfix/huggingface-fixfrom
feature/nestjs-analyzer

Conversation

@aolin480

@aolin480 aolin480 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Note

This PR currently includes files from the Hugging Face/reranker fix branch because it is stacked on top of bugfix/huggingface-fix. The Hugging Face PR needs to be merged into the primary repository first: PatrickSys/codebase-context#125.

Summary

  • Add a NestJS analyzer for controllers, providers, modules, guards, pipes, interceptors, filters, repositories, and common Nest testing patterns.
  • Update the analyzer registry and framework metadata so NestJS can be selected alongside the existing framework analyzers.
  • Refresh React and Next.js analyzer detection with current project patterns and add regression coverage for the updated indicators.
  • Make the searchable chunk limit configurable per project while keeping 5,000 as the default.

Large repository indexing

While indexing a large Nx monorepo project, Codebase Context created more than 22,000 chunks but only kept the first 5,000 in both the semantic and keyword indexes. The limit was hardcoded in CodebaseIndexer, so increasing chunk size would not fix the missing search coverage.

This adds projects[].parsing.maxChunks to ~/.codebase-context/config.json:

{
  "projects": [
    {
      "root": "/path/to/large-project",
      "parsing": {
        "maxChunks": 25000
      }
    }
  ]
}

The default stays at 5,000 for smaller projects. A project can raise the limit when it has enough files to exceed that safety cap. The value is validated as a positive integer and is used by both indexing paths:

  • MCP server indexing loads the project setting through its runtime overrides.
  • codebase-context reindex resolves the current root against the same server config.
  • Semantic embeddings and the keyword index use the same resolved limit, so they keep matching coverage.

Verification

  • pnpm build
  • pnpm format:check
  • pnpm test — 624 tests passed across 87 files
  • Focused server-config and indexer tests — 20 tests passed
  • Verified the installed CLI resolves the configured large-project root to maxChunks: 25000
  • Smoke-tested React, Next.js, and NestJS analyzer behavior against local projects before splitting this branch

Notes

  • This PR is stacked on top of bugfix/huggingface-fix and should be reviewed after the Hugging Face/reranker branch lands upstream.
  • The analyzer examples are framework usage signals only; they do not encode project-specific behavior.
  • Raising maxChunks increases embedding time, memory use, and local index size. The override is intentionally per project rather than a larger global default.

@aolin480
aolin480 force-pushed the bugfix/huggingface-fix branch from acb7cba to e1ba165 Compare July 5, 2026 15:46
@aolin480
aolin480 force-pushed the feature/nestjs-analyzer branch 2 times, most recently from 74acd54 to 677bc98 Compare July 5, 2026 17:07
@aolin480
aolin480 force-pushed the bugfix/huggingface-fix branch from e1ba165 to b51adeb Compare July 5, 2026 17:07
aolin480 added 2 commits July 15, 2026 14:55
React 19 and Next 16 added framework signals that the analyzers were not classifying yet. Keep the analyzer surface current without touching core search or indexing behavior.
We work in NestJS code often enough that treating it as generic TypeScript loses useful context. Add a dedicated analyzer for controllers, modules, providers, routes, DI, and common Nest packages so backend code gets the same first-class treatment as React and Next.js.
@aolin480
aolin480 force-pushed the feature/nestjs-analyzer branch from 677bc98 to d083c3a Compare July 15, 2026 19:58
aolin480 added 3 commits July 15, 2026 15:52
Large repositories were silently limited to the first 5,000 searchable chunks. Let each configured project raise that safety limit while keeping 5,000 as the default for smaller codebases.

Use the same setting in MCP server and CLI reindex paths so both keyword and semantic indexes cover the same files.
Keep the auto-extracted Git history in project memory so future searches can surface the fixes and test constraints already handled in this repository.
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