Crux
API Reference@crux/core

Index Lint

API reference for @crux/core/lint rule metadata, findings, profiles, and suppressions.

import type { IndexLintFinding, CruxLintConfig } from '@crux/core/lint'

Index lint is the authored-graph lint contract used by crux dev, crux lint, the web devtools, and the TUI. Lint findings describe actionable issues in source-authored Crux definitions. They are separate from index diagnostics, which describe indexer health.

CruxLintConfig

interface CruxLintConfig {
  profile?: 'off' | 'recommended' | 'strict' | 'experimental'
  rules?: Record<
    string,
    {
      enabled?: boolean
      severity?: 'info' | 'warning' | 'error'
    }
  >
}

Profiles

ProfileDescription
recommendedDefault rules with high signal and low noise.
strictAdds stronger product-health checks.
experimentalIncludes rules still being proven.
offDisables index lint findings for the project.

IndexLintFinding

interface IndexLintFinding {
  id: string
  severity: 'info' | 'warning' | 'error'
  ruleId: string
  category: CruxLintCategory
  maturity: 'stable' | 'preview' | 'experimental'
  confidence: 'high' | 'medium' | 'low'
  profiles: Array<'recommended' | 'strict' | 'experimental'>
  title: string
  message: string
  rationale: string
  impact?: string
  source?: SourceLocation
  primaryDefinitionId?: string
  relatedDefinitionIds: string[]
  affectedDefinitionIds?: string[]
  evidence: IndexLintEvidence[]
  fixes: IndexLintFix[]
  docsUrl: string
  suppression?: IndexLintSuppression
  propagatedDefinitionIds?: string[]
  propagationPaths?: IndexLintPropagationPath[]
}
FieldDescription
messageConcrete "what happened" text.
rationalePer-rule "why it matters" text.
impactOptional user/system consequence.
evidenceBackend-owned evidence explaining why the finding exists.
fixesActionable fix paths, docs links, or suppression affordances.
docsUrlRule reference page.
suppressionExact suppression comment the UI can show.

Clients should render findings directly. Do not recompute rules client-side by walking index relations.

Injection-aware lint rules use the Project Index injection read model. They can point at prompt input fields contributed by contexts or injectables, explain conditional branches, and mark runtime-dependent dependencies or tool surfaces when static source cannot fully describe the composition.

Suppressions

Rule-specific source suppressions use comments:

// crux-lint-disable-next-line tool.missing_input_schema -- generated adapter
// crux-lint-disable-line definition.missing_eval_coverage -- covered externally
/* crux-lint-disable-file definition.missing_eval_coverage -- prototype */

Unknown rule ids and unused suppressions are index diagnostics.

Rule References

Rule-specific API/reference pages live under Index Lints.

On this page