Module annotate

Module annotate 

Source
Expand description

@acp:module “Annotation Generation” @acp:summary “Auto-annotation and documentation conversion for ACP adoption” @acp:domain cli @acp:layer service @acp:stability experimental

§Annotation Generation

This module provides functionality for:

  • Analyzing code to identify symbols lacking ACP annotations
  • Suggesting appropriate annotations based on heuristics
  • Converting existing documentation standards (JSDoc, docstrings, etc.) to ACP format
  • Applying changes via preview/dry-run or direct file modification

§Architecture

The module is organized into several sub-modules:

  • analyzer - Code analysis and gap detection
  • suggester - Heuristics-based suggestion engine
  • writer - File modification with diff support
  • heuristics - Pattern-based inference rules
  • converters - Per-standard documentation conversion

Re-exports§

pub use analyzer::Analyzer;
pub use converters::DocStandardParser;
pub use converters::ParsedDocumentation;
pub use suggester::Suggester;
pub use writer::CommentStyle;
pub use writer::Writer;

Modules§

analyzer
@acp:module “Annotation Analyzer” @acp:summary “Analyzes code to identify annotation gaps and existing coverage” @acp:domain cli @acp:layer service @acp:stability experimental
converters
@acp:module “Documentation Converters” @acp:summary “Converts existing documentation standards to ACP format” @acp:domain cli @acp:layer service @acp:stability experimental
heuristics
@acp:module “Annotation Heuristics” @acp:summary “Pattern-based inference rules for suggesting annotations” @acp:domain cli @acp:layer service @acp:stability experimental
suggester
@acp:module “Annotation Suggester” @acp:summary “Generates annotation suggestions by merging heuristics and converted docs” @acp:domain cli @acp:layer service @acp:stability experimental
writer
@acp:module “Annotation Writer” @acp:summary “Generates diffs and applies annotation changes to source files” @acp:domain cli @acp:layer service @acp:stability experimental

Structs§

AnalysisResult
@acp:summary “Result of analyzing a file for annotation gaps” Contains information about existing annotations and missing ones.
AnnotationGap
@acp:summary “A symbol or file lacking required annotations” Represents a gap in annotation coverage.
ExistingAnnotation
@acp:summary “An existing ACP annotation found in source”
FileChange
@acp:summary “A planned change to apply to a file”
ProvenanceConfig
@acp:summary “Configuration for RFC-0003 provenance marker generation”
Suggestion
@acp:summary “A suggested annotation to add to a symbol or file” Represents a single annotation suggestion with its metadata.

Enums§

AnnotateLevel
@acp:summary “Annotation level for controlling generation depth” Controls how many annotation types are generated.
AnnotationType
@acp:summary “Types of ACP annotations that can be suggested” Represents the different annotation types supported by ACP.
ConversionSource
@acp:summary “Source documentation standard for conversion”
OutputFormat
@acp:summary “Output format for annotation results”
SuggestionSource
@acp:summary “Source priority for annotation suggestions” Determines the priority when merging suggestions from multiple sources. Lower ordinal value means higher priority (Explicit > Converted > Heuristic).