Browse documentation
Rule reference / LintLang 0.8.0

H6: Template Format Contract Violation #

The output contract gives competing instructions or lacks selected format/version signals.

H6INFO–MEDIUMLintLang 0.8.0

Applies to: Recognized prompts and instruction bodies; missing-format/version checks on chat prompts. Manual repair; no automatic fix for this example.

What triggers it #

Strips code, filenames, and CLI flags before selected format checks. Missing format is LOW for eligible long chat prompts; missing version is INFO for eligible longer prompts, excluding extracted Python literals.

How to repair it #

Choose one output format for the response, or explicitly separate response types. Supply the fields the consumer actually expects.

Reproduce the finding #

Use uv and Python 3.10+, plus curl. Run the examples in a scratch directory.

Download the finding example.

{
  "system_prompt": "Respond in JSON. Respond in Markdown."
}
curl -fsS https://lintlang.ai/examples/rules/h6-bad.json -o h6-bad.json
uvx --from lintlang==0.8.0 lintlang scan h6-bad.json --format json

Expected with 0.8.0: the JSON report includes H6, severity MEDIUM.

Improved example #

Download the improved example.

{
  "system_prompt": "Respond in JSON with keys invoice_id and discrepancies."
}
curl -fsS https://lintlang.ai/examples/rules/h6-improved.json -o h6-improved.json
uvx --from lintlang==0.8.0 lintlang scan h6-improved.json --format json

Expected with 0.8.0: H6 is absent. Other diagnostics may still appear; this repair targets the rule above.

Both commands use advisory mode: a finding does not itself make the command fail. To fail CI on MEDIUM findings, add --fail-on review. --fail-on fail gates only HIGH and CRITICAL. See outputs and exit codes.

Detection details #

Released H6 detection contract and scope

Strips fenced code, inline code, filenames, and CLI flags before counting format keywords. Checks selected conflicting output formats without disambiguation, template variables and, for chat prompts only, a missing format specification and (not for extracted Python literals) a missing version marker. It does not prove arbitrary output contracts satisfiable.

All scan rules · Quickstart · Separate preflight checks.