moon_doctor

    A MoonBit project health checker for release-ready repositories.

    moonbit
    doctor
    quality
    release
    health-check
    Download zip
    Version
    0.3.0
    License
    MIT
    Last updated
    3 months ago
    Downloads
    34

    #Moon Doctor

    This file exists for MoonBit documentation workflows. The GitHub-facing project README is README.md.

    AnalysisContext

    pub(all) struct AnalysisContext {
    config : DoctorConfig
    inventory : ProjectInventory
    manifest : MoonManifest?
    package_graph : PackageGraph
    } derive(Eq,
    Debug
    )

    Shared result of one offline release-quality analysis.

    AnalysisContext::new

    fn AnalysisContext::new(config : DoctorConfig, inventory : ProjectInventory, manifest : MoonManifest?, package_graph : PackageGraph) -> AnalysisContext

    AnalysisContext::snapshot

    CliOptions

    pub(all) struct CliOptions {
    target : String
    format : OutputFormat
    strict : Bool
    help : Bool
    } derive(Eq,
    Debug
    )

    Parsed Moon Doctor command-line options.

    CommandRequest

    pub(all) struct CommandRequest {
    command : DoctorCommand
    target : String
    format : OutputFormat
    strict : Bool
    help : Bool
    config_path : String?
    profile : String?
    } derive(Eq,
    Debug
    )

    Request parsed from both modern subcommands and legacy check syntax.

    CommandRequest::default

    Diagnostic

    pub(all) struct Diagnostic {
    severity : Severity
    code : String
    message : String
    detail : String
    location : SourceLocation?
    remediation : Array[String]
    } derive(Eq,
    Debug
    )

    One finding produced by Moon Doctor.

    Diagnostic::at

    fn Diagnostic::at(severity : Severity, code : String, message : String, detail : String, location : SourceLocation, remediation : Array[String]) -> Diagnostic

    Diagnostic::new

    fn Diagnostic::new(severity : Severity, code : String, message : String, detail : String) -> Diagnostic

    DiagnosticQuery

    pub(all) struct DiagnosticQuery {
    severity : Severity?
    category : RuleCategory?
    path_prefix : String?
    include_unlocated : Bool
    } derive(Eq,
    Debug
    )

    Immutable query parameters for filtering a DoctorReport.

    DiagnosticQuery::all

    DiagnosticQuery::count

    fn DiagnosticQuery::count(self : DiagnosticQuery, report : DoctorReport) -> Int

    DiagnosticQuery::filter

    DiagnosticQuery::matches

    fn DiagnosticQuery::matches(self : DiagnosticQuery, diagnostic : Diagnostic) -> Bool

    DoctorCommand

    pub(all) enum DoctorCommand {
    Check
    Rules
    Explain(String)
    } derive(Eq,
    Debug
    )

    Top-level Moon Doctor command.

    DoctorConfig

    pub(all) struct DoctorConfig {
    version : Int
    profile : DoctorProfile
    disabled_rules : Array[String]
    severity_overrides : Map[String, Severity]
    ignore_paths : Array[String]
    required_commands : Array[String]
    release_metadata : Map[String, String]
    source : String
    } derive(Eq,
    Debug
    )

    Project-local policy loaded from moon.doctor.json when present.

    DoctorConfig::default

    fn DoctorConfig::default(profile? : DoctorProfile) -> DoctorConfig

    DoctorConfig::ignores_path

    fn DoctorConfig::ignores_path(self : DoctorConfig, path : String) -> Bool

    DoctorConfig::is_rule_disabled

    fn DoctorConfig::is_rule_disabled(self : DoctorConfig, rule_id : String) -> Bool

    DoctorConfig::release_checklist

    fn DoctorConfig::release_checklist(self : DoctorConfig) -> Array[String]

    DoctorConfig::severity_for

    fn DoctorConfig::severity_for(self : DoctorConfig, rule_id : String, default_severity : Severity) -> Severity

    DoctorProfile

    pub(all) enum DoctorProfile {
    Default
    Github
    Mooncakes
    Release
    } derive(Eq,
    Debug
    )

    Profiles express the intended publication target without using network APIs.

    DoctorProfile::label

    fn DoctorProfile::label(self : DoctorProfile) -> String

    DoctorReport

    pub(all) struct DoctorReport {
    root : String
    diagnostics : Array[Diagnostic]
    score : Score
    profile : String
    checklist : Array[String]
    } derive(Eq,
    Debug
    )

    Complete report data before rendering.

    DoctorReport::conclusion

    fn DoctorReport::conclusion(self : DoctorReport) -> String

    DoctorReport::new

    fn DoctorReport::new(root : String, diagnostics : Array[Diagnostic]) -> DoctorReport

    DoctorReport::with_context

    fn DoctorReport::with_context(root : String, diagnostics : Array[Diagnostic], profile : String, checklist : Array[String]) -> DoctorReport

    ManifestField

    pub(all) struct ManifestField {
    key : String
    value : ManifestValue
    line : Int
    } derive(Eq,
    Debug
    )

    Field captured from moon.mod or moon.pkg with a stable source line.

    ManifestField::location

    fn ManifestField::location(self : ManifestField, path : String) -> SourceLocation

    ManifestValue

    pub(all) enum ManifestValue {
    Text(String)
    TextArray(Array[String])
    Raw(String)
    } derive(Eq,
    Debug
    )

    Parsed manifest value retained in a form useful to release rules.

    ManifestValue::as_array

    fn ManifestValue::as_array(self : ManifestValue) -> Array[String]?

    ManifestValue::as_text

    fn ManifestValue::as_text(self : ManifestValue) -> String?

    MarkdownCodeBlock

    pub(all) struct MarkdownCodeBlock {
    language : String
    content : String
    start_line : Int
    end_line : Int
    } derive(Eq,
    Debug
    )

    Fenced code block discovered from a Markdown document.

    MarkdownDocument

    pub(all) struct MarkdownDocument {
    path : String
    headings : Array[MarkdownHeading]
    code_blocks : Array[MarkdownCodeBlock]
    links : Array[String]
    image_links : Array[String]
    command_examples : Array[String]
    line_count : Int
    } derive(Eq,
    Debug
    )

    Static facts extracted from a repository Markdown document.

    MarkdownDocument::has_command

    fn MarkdownDocument::has_command(self : MarkdownDocument, command : String) -> Bool

    MarkdownDocument::has_heading

    fn MarkdownDocument::has_heading(self : MarkdownDocument, expected : String) -> Bool

    MarkdownDocument::has_heading_casefold

    fn MarkdownDocument::has_heading_casefold(self : MarkdownDocument, expected : String) -> Bool

    MarkdownDocument::heading_location

    fn MarkdownDocument::heading_location(self : MarkdownDocument, expected : String) -> SourceLocation?

    MarkdownDocument::summary

    fn MarkdownDocument::summary(self : MarkdownDocument) -> String

    MarkdownHeading

    pub(all) struct MarkdownHeading {
    level : Int
    text : String
    line : Int
    } derive(Eq,
    Debug
    )

    Heading discovered from a Markdown document.

    MetricGroup

    pub(all) struct MetricGroup {
    name : String
    files : Int
    lines : Int
    characters : Int
    } derive(Eq,
    Debug
    )

    Counted file group used for an explainable project inventory summary.

    MetricGroup::add_file

    fn MetricGroup::add_file(self : MetricGroup, file : ProjectFile) -> MetricGroup

    MetricGroup::new

    fn MetricGroup::new(name : String) -> MetricGroup

    MoonManifest

    pub(all) struct MoonManifest {
    path : String
    fields : Array[ManifestField]
    imports : Array[String]
    comments : Int
    nonempty_lines : Int
    } derive(Eq,
    Debug
    )

    Lightweight parse of a MoonBit manifest file.

    MoonManifest::field

    fn MoonManifest::field(self : MoonManifest, key : String) -> ManifestField?

    MoonManifest::field_location

    fn MoonManifest::field_location(self : MoonManifest, key : String) -> SourceLocation?

    MoonManifest::has_import

    fn MoonManifest::has_import(self : MoonManifest, package_name : String) -> Bool

    MoonManifest::new

    fn MoonManifest::new(path : String, fields : Array[ManifestField], imports : Array[String], comments : Int, nonempty_lines : Int) -> MoonManifest

    MoonManifest::text

    fn MoonManifest::text(self : MoonManifest, key : String) -> String?

    MoonManifest::text_array

    fn MoonManifest::text_array(self : MoonManifest, key : String) -> Array[String]

    MoonPackage

    pub(all) struct MoonPackage {
    path : String
    import_path : String
    manifest : MoonManifest
    source_files : Array[ProjectFile]
    test_files : Array[ProjectFile]
    } derive(Eq,
    Debug
    )

    A MoonBit package discovered from a moon.pkg file.

    MoonPackage::has_source

    fn MoonPackage::has_source(self : MoonPackage) -> Bool

    MoonPackage::has_tests

    fn MoonPackage::has_tests(self : MoonPackage) -> Bool

    MoonPackage::new

    fn MoonPackage::new(path : String, import_path : String, manifest : MoonManifest, source_files : Array[ProjectFile], test_files : Array[ProjectFile]) -> MoonPackage

    OutputFormat

    pub(all) enum OutputFormat {
    Text
    Json
    Sarif
    } derive(Eq,
    Debug
    )

    Output format selected by the command-line interface.

    OutputFormat::label

    fn OutputFormat::label(self : OutputFormat) -> String

    PackageGraph

    pub(all) struct PackageGraph {
    module_name : String
    packages : Array[MoonPackage]
    local_edges : Map[String, Array[String]]
    missing_local_imports : Array[(String, String)]
    cycles : Array[Array[String]]
    } derive(Eq,
    Debug
    )

    Directed graph of local package imports in one MoonBit module.

    PackageGraph::edge_count

    fn PackageGraph::edge_count(self : PackageGraph) -> Int

    PackageGraph::find_package

    fn PackageGraph::find_package(self : PackageGraph, import_path : String) -> MoonPackage?

    PackageGraph::new

    fn PackageGraph::new(module_name : String, packages : Array[MoonPackage], local_edges : Map[String, Array[String]], missing_local_imports : Array[(String, String)], cycles : Array[Array[String]]) -> PackageGraph

    PackageGraph::package_count

    fn PackageGraph::package_count(self : PackageGraph) -> Int

    ProjectFile

    pub(all) struct ProjectFile {
    path : String
    content : String
    line_count : Int
    char_count : Int
    } derive(Eq,
    Debug
    )

    One text file captured during a deterministic project scan.

    ProjectFile::line_of

    fn ProjectFile::line_of(self : ProjectFile, needle : String) -> Int?

    ProjectFile::location_of

    fn ProjectFile::location_of(self : ProjectFile, needle : String) -> SourceLocation?

    ProjectFile::new

    fn ProjectFile::new(path : String, content : String) -> ProjectFile

    ProjectInventory

    pub(all) struct ProjectInventory {
    root : String
    files : Array[ProjectFile]
    directories : Array[String]
    ignored_paths : Array[String]
    } derive(Eq,
    Debug
    )

    Complete, offline tree inventory for a project root.

    ProjectInventory::files_under

    fn ProjectInventory::files_under(self : ProjectInventory, path : String) -> Array[ProjectFile]

    ProjectInventory::files_with_suffix

    fn ProjectInventory::files_with_suffix(self : ProjectInventory, suffix : String) -> Array[ProjectFile]

    ProjectInventory::find_file

    fn ProjectInventory::find_file(self : ProjectInventory, path : String) -> ProjectFile?

    ProjectInventory::has_directory

    fn ProjectInventory::has_directory(self : ProjectInventory, path : String) -> Bool

    ProjectInventory::has_file

    fn ProjectInventory::has_file(self : ProjectInventory, path : String) -> Bool

    ProjectInventory::new

    fn ProjectInventory::new(root : String, files : Array[ProjectFile], directories : Array[String], ignored_paths : Array[String]) -> ProjectInventory

    ProjectInventory::to_snapshot

    ProjectInventory::total_lines

    fn ProjectInventory::total_lines(self : ProjectInventory) -> Int

    ProjectMetrics

    pub(all) struct ProjectMetrics {
    root : String
    total_files : Int
    total_directories : Int
    total_lines : Int
    total_characters : Int
    moonbit_source : MetricGroup
    moonbit_tests : MetricGroup
    markdown_docs : MetricGroup
    workflows : MetricGroup
    config_files : MetricGroup
    fixture_files : MetricGroup
    example_files : MetricGroup
    package_count : Int
    local_dependency_edges : Int
    ignored_path_count : Int
    } derive(Eq,
    Debug
    )

    Structural metrics produced entirely from local repository contents.

    ProjectSnapshot

    pub(all) struct ProjectSnapshot {
    root : String
    files : Map[String, String]
    dirs : Array[String]
    } derive(Eq,
    Debug
    )

    Lightweight view of a MoonBit project directory.

    ProjectSnapshot::field_mentions

    fn ProjectSnapshot::field_mentions(self : ProjectSnapshot, key : String, needle : String) -> Bool

    ProjectSnapshot::gitignore_mentions

    fn ProjectSnapshot::gitignore_mentions(self : ProjectSnapshot, expected : String) -> Bool

    ProjectSnapshot::has_any_test_file

    fn ProjectSnapshot::has_any_test_file(self : ProjectSnapshot) -> Bool

    ProjectSnapshot::has_dir

    fn ProjectSnapshot::has_dir(self : ProjectSnapshot, path : String) -> Bool

    ProjectSnapshot::has_exact_file

    fn ProjectSnapshot::has_exact_file(self : ProjectSnapshot, path : String) -> Bool

    ProjectSnapshot::has_example_content

    fn ProjectSnapshot::has_example_content(self : ProjectSnapshot) -> Bool

    ProjectSnapshot::has_file

    fn ProjectSnapshot::has_file(self : ProjectSnapshot, path : String) -> Bool

    ProjectSnapshot::has_readme_file

    fn ProjectSnapshot::has_readme_file(self : ProjectSnapshot) -> Bool

    ProjectSnapshot::has_workflow

    fn ProjectSnapshot::has_workflow(self : ProjectSnapshot) -> Bool

    ProjectSnapshot::license_mentions

    fn ProjectSnapshot::license_mentions(self : ProjectSnapshot, expected : String) -> Bool

    ProjectSnapshot::moon_mod_field

    fn ProjectSnapshot::moon_mod_field(self : ProjectSnapshot, key : String) -> String?

    ProjectSnapshot::new

    fn ProjectSnapshot::new(root : String, files : Map[String, String], dirs : Array[String]) -> ProjectSnapshot

    ProjectSnapshot::read_file

    fn ProjectSnapshot::read_file(self : ProjectSnapshot, path : String) -> String?

    ProjectSnapshot::readme_mentions

    fn ProjectSnapshot::readme_mentions(self : ProjectSnapshot, needle : String) -> Bool

    ProjectSnapshot::workflow_mentions

    fn ProjectSnapshot::workflow_mentions(self : ProjectSnapshot, needle : String) -> Bool

    QualityArea

    pub(all) struct QualityArea {
    category : RuleCategory
    possible : Int
    achieved : Int
    errors : Int
    warnings : Int
    infos : Int
    notes : Array[String]
    } derive(Eq,
    Debug
    )

    One weighted quality area in a Moon Doctor scorecard.

    QualityArea::label

    fn QualityArea::label(self : QualityArea) -> String

    QualityArea::percent

    fn QualityArea::percent(self : QualityArea) -> Int

    QualityScorecard

    pub(all) struct QualityScorecard {
    profile : String
    areas : Array[QualityArea]
    total_possible : Int
    total_achieved : Int
    percentage : Int
    grade : String
    } derive(Eq,
    Debug
    )

    Explainable quality score independent of strict pass/fail mode.

    ReleaseReadiness

    pub(all) struct ReleaseReadiness {
    profile : DoctorProfile
    module_name : String?
    version : String?
    repository : String?
    license : String?
    readme : String?
    description : String?
    keywords : Array[String]
    has_license_file : Bool
    has_ci : Bool
    has_examples : Bool
    has_tests : Bool
    has_changelog : Bool
    has_contributing : Bool
    has_acceptance : Bool
    required_commands : Array[String]
    } derive(Eq,
    Debug
    )

    Release-oriented facts derived from an inventory, manifest and policy.

    ReleaseReadiness::missing_items

    fn ReleaseReadiness::missing_items(self : ReleaseReadiness) -> Array[String]

    ReleaseReadiness::summary

    fn ReleaseReadiness::summary(self : ReleaseReadiness) -> String

    RemediationPlan

    pub(all) struct RemediationPlan {
    project : String
    profile : String
    tasks : Array[RemediationTask]
    blocking_tasks : Int
    advisory_tasks : Int
    } derive(Eq,
    Debug
    )

    Ordered plan that turns diagnostics into release work.

    RemediationPlan::is_release_ready

    fn RemediationPlan::is_release_ready(self : RemediationPlan) -> Bool

    RemediationPlan::new

    fn RemediationPlan::new(project : String, profile : String, tasks : Array[RemediationTask]) -> RemediationPlan

    RemediationTask

    pub(all) struct RemediationTask {
    priority : Int
    category : RuleCategory
    title : String
    actions : Array[String]
    rule_ids : Array[String]
    blocking : Bool
    } derive(Eq,
    Debug
    )

    A grouped release task derived from one or more diagnostics.

    RemediationTask::new

    fn RemediationTask::new(priority : Int, category : RuleCategory, title : String, actions : Array[String], rule_ids : Array[String], blocking : Bool) -> RemediationTask

    ReportBundle

    pub(all) struct ReportBundle {
    report : DoctorReport
    remediation : RemediationPlan
    scorecard : QualityScorecard
    text : String
    json : String
    sarif : String
    markdown : String
    } derive(Eq,
    Debug
    )

    All deterministic report representations produced from one analysis result.

    ReportBundle::artifact_names

    fn ReportBundle::artifact_names() -> Array[String]

    ReportBundle::for_format

    fn ReportBundle::for_format(self : ReportBundle, format : String) -> String?

    ReportBundle::new

    ReportBundle::release_ready

    fn ReportBundle::release_ready(self : ReportBundle) -> Bool

    ReportBundle::summary_json

    fn ReportBundle::summary_json(self : ReportBundle) -> String

    RuleCategory

    pub(all) enum RuleCategory {
    Manifest
    Package
    Documentation
    Ci
    Release
    } derive(Eq,
    Debug
    )

    Quality area that owns a release-readiness rule.

    RuleCategory::label

    fn RuleCategory::label(self : RuleCategory) -> String

    RuleDefinition

    pub(all) struct RuleDefinition {
    id : String
    category : RuleCategory
    default_severity : Severity
    title : String
    description : String
    remediation : String
    profiles : Array[String]
    } derive(Eq,
    Debug
    )

    Stable metadata for an explainable Moon Doctor rule.

    RuleDefinition::new

    fn RuleDefinition::new(id : String, category : RuleCategory, default_severity : Severity, title : String, description : String, remediation : String, profiles : Array[String]) -> RuleDefinition

    Score

    pub(all) struct Score {
    grade : String
    status : String
    errors : Int
    warnings : Int
    infos : Int
    } derive(Eq,
    Debug
    )

    Final score summary for a diagnostic run.

    Score::from_diagnostics

    fn Score::from_diagnostics(diagnostics : Array[Diagnostic]) -> Score

    Severity

    pub(all) enum Severity {
    Error
    Warn
    Info
    } derive(Eq,
    Debug
    )

    Severity level for a project health diagnostic.

    Severity::label

    fn Severity::label(self : Severity) -> String

    SourceLocation

    pub(all) struct SourceLocation {
    path : String
    line : Int
    column : Int
    } derive(Eq,
    Debug
    )

    Source location attached to a diagnostic when a parser can identify it.

    SourceLocation::new

    fn SourceLocation::new(path : String, line : Int, column : Int) -> SourceLocation

    WorkflowFacts

    pub(all) struct WorkflowFacts {
    path : String
    name : String?
    triggers : Array[String]
    permissions : Array[String]
    commands : Array[String]
    actions : Array[String]
    jobs : Array[String]
    has_moon_setup : Bool
    has_moon_check : Bool
    has_moon_build : Bool
    has_moon_test : Bool
    has_moon_package : Bool
    has_artifact_upload : Bool
    } derive(Eq,
    Debug
    )

    Static features extracted from one GitHub Actions workflow.

    WorkflowFacts::new

    fn WorkflowFacts::new(path : String) -> WorkflowFacts

    WorkflowFacts::summary

    fn WorkflowFacts::summary(self : WorkflowFacts) -> String

    analyze_project

    fn analyze_project(root : String, config : DoctorConfig) -> DoctorReport raise

    Run the full recursive inventory, package graph, policy and legacy checks.

    analyze_release_readiness

    fn analyze_release_readiness(inventory : ProjectInventory, manifest : MoonManifest?, config : DoctorConfig) -> ReleaseReadiness

    Derive a release status object without running package or network commands.

    analyze_workflow

    fn analyze_workflow(file : ProjectFile) -> WorkflowFacts

    Extract release-relevant YAML facts without implementing a general YAML parser.

    analyze_workflows

    fn analyze_workflows(inventory : ProjectInventory) -> Array[WorkflowFacts]

    build_package_graph

    fn build_package_graph(inventory : ProjectInventory) -> PackageGraph

    Build the local package dependency graph from a recursive inventory.

    build_quality_scorecard

    fn build_quality_scorecard(report : DoctorReport) -> QualityScorecard

    build_remediation_plan

    fn build_remediation_plan(report : DoctorReport) -> RemediationPlan

    Build an ordered remediation plan from an analyzed report.

    calculate_project_metrics

    fn calculate_project_metrics(inventory : ProjectInventory, graph : PackageGraph) -> ProjectMetrics

    cli_usage

    fn cli_usage() -> String

    Return the stable command-line usage text.

    command_usage

    fn command_usage() -> String

    default_release_checklist

    fn default_release_checklist() -> Array[String]

    diagnose

    fn diagnose(project : ProjectSnapshot) -> DoctorReport

    Run all default-profile health checks. This preserves the original API.

    diagnose_with_config

    fn diagnose_with_config(project : ProjectSnapshot, config : DoctorConfig) -> DoctorReport

    Run health checks with a project-local release policy.

    diagnostic_counts_by_category

    fn diagnostic_counts_by_category(report : DoctorReport) -> Map[String, Int]

    diagnostic_counts_by_severity

    fn diagnostic_counts_by_severity(report : DoctorReport) -> Map[String, Int]

    diagnostic_query_summary

    fn diagnostic_query_summary(report : DoctorReport, query : DiagnosticQuery) -> String

    diagnostic_query_to_json

    fn diagnostic_query_to_json(report : DoctorReport, query : DiagnosticQuery) -> Json

    documentation_health_report

    fn documentation_health_report(inventory : ProjectInventory) -> String

    find_rule_definition

    fn find_rule_definition(rule_id : String) -> RuleDefinition?

    load_config

    fn load_config(root : String, path? : String, profile? : String) -> DoctorConfig raise

    Load a project policy or return the selected built-in profile when absent.

    load_project

    fn load_project(root : String) -> ProjectSnapshot raise

    Load the project files Moon Doctor needs for a first-pass health check.

    markdown_report_json

    fn markdown_report_json(report : DoctorReport) -> Json

    metrics_markdown

    fn metrics_markdown(metrics : ProjectMetrics) -> String

    parse_cli_args

    fn parse_cli_args(args : Array[String]) -> Result[CliOptions, String]

    Parse process arguments, including the executable name at index zero.

    parse_command_request

    fn parse_command_request(args : Array[String]) -> Result[CommandRequest, String]

    Parse process arguments. Omit a subcommand to preserve legacy check usage.

    parse_inventory_markdown

    fn parse_inventory_markdown(inventory : ProjectInventory) -> Array[MarkdownDocument]

    parse_manifest

    fn parse_manifest(path : String, content : String) -> MoonManifest

    Parse moon.mod or moon.pkg without requiring a general TOML parser.

    parse_manifest_file

    fn parse_manifest_file(file : ProjectFile) -> MoonManifest

    parse_markdown

    fn parse_markdown(path : String, content : String) -> MarkdownDocument

    Parse common Markdown structures without depending on a browser or network.

    parse_root_manifest

    fn parse_root_manifest(inventory : ProjectInventory) -> MoonManifest?

    project_metrics_to_json

    fn project_metrics_to_json(metrics : ProjectMetrics) -> Json

    project_name

    let project_name : String

    Human-readable project name.

    quality_scorecard_to_json

    fn quality_scorecard_to_json(scorecard : QualityScorecard) -> Json

    readme_document

    fn readme_document(inventory : ProjectInventory) -> MarkdownDocument?

    release_readiness_to_json

    fn release_readiness_to_json(readiness : ReleaseReadiness) -> Json

    remediation_plan_to_json

    fn remediation_plan_to_json(plan : RemediationPlan) -> Json

    render_bundle_index

    fn render_bundle_index(bundle : ReportBundle) -> String

    render_bundle_markdown

    fn render_bundle_markdown(bundle : ReportBundle) -> String

    render_diagnostic_query

    fn render_diagnostic_query(report : DoctorReport, query : DiagnosticQuery) -> String

    render_json_report

    fn render_json_report(report : DoctorReport) -> String

    Render a deterministic JSON report for CI and other local tooling.

    render_markdown_report

    fn render_markdown_report(report : DoctorReport) -> String

    Render a reviewer-friendly report for pull requests and release notes.

    render_project_metrics

    fn render_project_metrics(metrics : ProjectMetrics) -> String

    render_quality_scorecard

    fn render_quality_scorecard(scorecard : QualityScorecard) -> String

    render_release_readiness

    fn render_release_readiness(readiness : ReleaseReadiness) -> String

    render_remediation_markdown

    fn render_remediation_markdown(plan : RemediationPlan) -> String

    render_report

    fn render_report(report : DoctorReport) -> String

    Render a report as plain text for terminals, CI logs, and README examples.

    render_rule_catalog

    fn render_rule_catalog() -> String

    render_rule_explanation

    fn render_rule_explanation(rule_id : String) -> String?

    render_rule_explanation_json

    fn render_rule_explanation_json(rule_id : String) -> String?

    render_sarif_report

    fn render_sarif_report(report : DoctorReport) -> String

    Render a deterministic SARIF 2.1.0 document for GitHub Code Scanning.

    report_json_schema

    let report_json_schema : String

    Stable schema name for machine-readable Moon Doctor reports.

    rule_catalog

    fn rule_catalog() -> Array[RuleDefinition]

    Return the complete stable v1 rule catalog.

    rules_for_profile

    fn rules_for_profile(profile : DoctorProfile) -> Array[RuleDefinition]

    scan_project

    fn scan_project(root : String, config : DoctorConfig) -> ProjectInventory raise

    Recursively scan a project without touching ignored or generated directories.

    scan_project_default

    fn scan_project_default(root : String) -> ProjectInventory raise

    should_fail_strict

    fn should_fail_strict(options : CliOptions, report : DoctorReport) -> Bool

    Strict mode blocks release workflows on errors and warnings, not INFO advice.

    workflow_release_report

    fn workflow_release_report(inventory : ProjectInventory) -> String