start_audit
Start a background audit job on a codebase to analyze code quality with configurable analyzers and severity levels. Returns a job ID for tracking progress.
Instructions
Start a background audit job. Returns immediately with a jobId. Poll audit_status until completed, then fetch pages with audit or audit_results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | File or directory path to audit (defaults to current directory). | /app |
| analyzers | No | Analyzers to run (default: solid, dry, documentation, react, data-access). | |
| maxRetries | No | Retry attempts per shard for retryable failures (default: 1). | |
| minSeverity | No | Minimum severity level to report. | warning |
| workerCount | No | Number of worker processes for shard execution (default: min(4, CPU-1)). | |
| jobTimeoutMs | No | Maximum wall time for the entire audit job (default 30m, env CODE_AUDITOR_JOB_TIMEOUT_MS, cap 4h). Aborts workers cooperatively then tears down. | |
| maxPartitions | No | Maximum number of folder partitions for sharded audits (default: 4). | |
| indexFunctions | No | Index functions during audit (default: true). | |
| maxFilesPerRun | No | Per worker chunk: if more files match than this, the worker finishes one chunk and the parent queues the rest on another worker (optional). | |
| retryBackoffMs | No | Base retry backoff in milliseconds (default: 500). | |
| shardTimeoutMs | No | Per-shard timeout in milliseconds (default: 180000). | |
| analyzerConfigs | No | Analyzer-specific configuration overrides. | |
| generateCodeMap | No | Generate code map artifacts during audit (default: false). | |
| partitionStrategy | No | Partition mode: none | auto | top-level. auto shards when large source trees are detected. | auto |
| shardSoftBudgetMs | No | Per worker soft wall-clock budget; aborts in-process analysis cooperatively via AbortSignal so the parent can assign the next chunk to a fresh worker. | |
| analyzerConcurrency | No | Max analyzers to run in parallel (default: 1). | |
| partitionThresholdFiles | No | Minimum discovered files before auto partitioning is enabled (default: 250). |