Reference: Audit Results

Overview

This documents the results produced by the audit documentation command.

JSON Format

{
  "results": [
    {
      "rule": "content-exists-check",
      "description": "Check that backend documentation exists",
      "pass": true,
      "checks": [
        {
          "source": "backend",
          "document": "CHANGELOG.md",
          "uri": "document://backend/CHANGELOG.md",
          "rule": "content-exists-check",
          "check": "CONTENT_EXISTS",
          "pass": true,
          "message": ""
        }
      ]
    },
    {
      "rule": "content-length-check",
      "description": "Check that README has sufficient content",
      "pass": false,
      "checks": [
        {
          "source": "backend",
          "document": "README.md",
          "uri": "document://backend/README.md",
          "rule": "content-length-check",
          "check": "CONTENT_MIN_LENGTH",
          "pass": false,
          "message": "Content length is 277, minimum required is 10000."
        }
      ]
    }
  ]
}

Fields

A list of fields, their types, and a description of each.

FieldTypeDescription
resultsArrayThe array of audit rule results
results[n]ObjectAn audit rule result
results[n].ruleStringThe rule ID from configuration, or auto-generated if not provided
results[n].descriptionStringThe rule description
results[n].passBooleanWhether all checks in the rule passed
results[n].checksArrayThe array of individual check results
results[n].checks[n]ObjectA check result
results[n].checks[n].sourceStringThe documentation source ID
results[n].checks[n].documentStringThe document ID
results[n].checks[n].sectionArray OR undefinedIf present, the section path
results[n].checks[n].section[n]StringA section path segment
results[n].checks[n].uriStringThe document URI
results[n].checks[n].ruleStringThe rule ID this check belongs to
results[n].checks[n].checkStringThe type of check performed
results[n].checks[n].passBooleanWhether the check passed
results[n].checks[n].messageStringThe check message (may be empty)

Checks

The list of available checks, their associated config property (under audit.rules[n]), and a description of each.

CheckConfig PropertyDescription
CONTENT_EXISTSchecks.content.existsVerifies that documentation matching the filter exists
CONTENT_MIN_LENGTHchecks.content.min-lengthChecks if content meets the minimum length requirement
CONTENT_MATCHES_REGEXchecks.content.matches-regexValidates content against a regular expression pattern
CONTENT_MATCHES_PROMPTchecks.content.matches-promptUses an LLM to check if content matches a custom prompt
CONTENT_MATCHES_PURPOSEchecks.content.matches-purposeUses an LLM to verify content aligns with its stated purpose
PURPOSE_EXISTSchecks.purpose.existsChecks that a purpose is defined for the document or section
TAGS_CONTAINSchecks.tags.containsVerifies required tags are present

Note: When the CONTENT_EXISTS check fails to find matching content, the source, document, section, and uri fields will be empty