Skip to main content

Module context_lint

Module context_lint 

Source
Expand description

Injected-context linter (#960) — keeps lean-ctx’s OWN injected context (the rules block + advertised tool descriptions) high-signal.

The Nisi/WorkOS “Case” talk is the motivation: comprehensive prose and re-teaching what a competent model already knows degrades reasoning and burns a finite attention budget; only the non-obvious gotcha earns its tokens. This linter encodes that discipline so it can be enforced in CI and surfaced in doctor.

Two severities:

  • Severity::Error — exact-duplicate rule lines and low-signal re-teaching phrases in the rules block. These ride every turn, are fully under our control, and must fail the gate.
  • Severity::Warn — verbose or duplicated tool descriptions. Surfaced for triage so the ~28-tool surface can be trimmed incrementally without blocking unrelated work.

Structs§

LintFinding
One linter finding against the injected context.

Enums§

LintKind
The category of a lint finding.
Severity
Whether a finding gates CI or is merely surfaced.

Functions§

error_count
Number of gating (Error) findings.
lint_injected_context
Lints the live injected context this install would emit (rules + tool schemas).
lint_rules_text
Lints a rules-block text for re-teaching phrases (Error) and exact-duplicate content lines (Error).
lint_tool_descriptions
Lints advertised tool descriptions for byte-identical copies (Error) and gotcha-budget overruns (Warn).