# Configure discovery and boundaries

Source: https://usecns.dev/axon-topic-configure-discovery-and-boundaries/

[Start here](https://usecns.dev/manual-axon/)
[CLI commands](https://usecns.dev/commands-axon/)
[Configuration & integration](https://usecns.dev/axon-topics/)

Use configuration when Axon's scan or module detection does not match your repository. Axon reads `axon.yaml`, falling back to `lux.yaml` only when the modern configuration is absent. Missing configuration means defaults; malformed YAML or unknown keys are refused before command dispatch, not silently replaced with defaults.

For example, exclude generated fixtures and make the package boundary explicit:

```
scan:
  ignore_patterns: ["fixtures/generated/**"]
  exclude_generated_artifacts: true
deps:
  enabled: true
  module_boundary: "packages/{name}"
frameworks:
  laravel: false
```

Use only the settings you need:

| Group | Controls and defaults |
| --- | --- |
| `scan` | `include_patterns`, `ignore_patterns`, generated-artifact exclusion (true), and `dirty_ignore_paths` (empty). Axon's own `.axon/` and legacy `.lux/` state are already ignored for freshness. Ignoring another state directory is an explicit project decision. |
| `deps` | `enabled` (true); `module_boundary` overrides detection. `boundary_candidates` choose widest file coverage, then most modules, with order breaking ties; fallback candidates use the same scoring only when no primary matches. One boundary is selected, not a union of source roots. |
| `php` | `qualified_namespaces`, an empty-by-default list of prefixes already considered fully qualified. |
| `frameworks` | `laravel: true` forces the Laravel adapter, false disables it, omission detects it. |
| `ast` | `enabled`, default true. Disabling the AST path changes extraction quality. |
| `lsp` | `enabled` (true), `workspace_root`, and `enrichers` (empty). Only an explicit LSP section enables ordinary-index enrichment; no section means structural-only unless `--lsp`. Each enricher requires `language_id`; `server_command`, `request_timeout_ms` (10000), `init_timeout_ms` (120000), and `initialization_options` are optional, `server_args` defaults empty, `enabled` defaults true. Aliases: `languageId`, `serverCommand`, `serverArgs`, `requestTimeoutMs`, `initTimeoutMs`, `initializationOptions` (not aliases for the enclosing keys). Setup writes accepted servers here. Configured enrichment forces full indexing; explicit `--lsp` overrides the enclosing disable switch. |
| `firstParty` | `packages`, identifying first-party package names. |
| `vendorPack` | `merge`, default true, controls vendor-pack merging. |
| `siblings` | Named entries with `package`, `path`, `db`, and `role` for sibling repositories. |
| `overlay` | Optional `kernel.package` for package-aware overlay/federation interpretation. |

Default boundary candidates are `crates`, `packages`, `apps`, `services`, `internal`, `modules`, `libs`, `src/Module`, `src/Modules`, `app/Modules`, and `Modules`, each followed by `/{name}`. Fallbacks are `app`, `src`, `lib`, and `cmd`. If nothing matches, the boundary remains undetected. `deps-impact` uses the boundary recorded by the last index, not a new interpretation of current configuration.

Discovery uses Git-tracked plus untracked/nonignored files when available, otherwise a non-symlink-following directory walk. Includes narrow the eligible set; they do not override exclusions. Default exclusions include dependencies (`vendor`, `node_modules`), build/cache directories, minified files and Terraform state/plan artifacts. Generated-artifact exclusion additionally removes `public/**`, bundles and JavaScript source maps; set `exclude_generated_artifacts: false` if those are source in your repository. Hidden path components are excluded except supported YAML workflows/actions under `.github/workflows/` and `.github/actions/`. Secret-like paths (`.env*`, keys, auth files and credential configs) are denied; this is not a guarantee that every secret-bearing file is detected. Empty include/ignore lists are defaults. `dirty_ignore_paths` changes freshness accounting, not scan admission.

For database selection, precedence is `--db`, `AXON_DB_PATH`, then `.axon/axon.db`. Relative paths resolve under the corpus. Reads can fall back to `.lux/lux.db` when the modern file is absent; default writes use `.axon/axon.db`. An explicit `--db` disables automatic creation of a missing default index by queries.

After changing configuration, perform a full index and inspect status before using dependency results.