Skip to content

Fix #1979: documentation gap sweep -- add missing_docs lint + fill ~1800 gaps - #891

Closed
AlexMikhalev wants to merge 4 commits into
mainfrom
task/1979-doc-gaps
Closed

Fix #1979: documentation gap sweep -- add missing_docs lint + fill ~1800 gaps#891
AlexMikhalev wants to merge 4 commits into
mainfrom
task/1979-doc-gaps

Conversation

@AlexMikhalev

Copy link
Copy Markdown
Contributor

Summary

  • Add #![warn(missing_docs)] enforcement to terraphim_types, terraphim_config, and terraphim_service (recommended by issue #1979)
  • Fill all documentation gaps across 7 crates: ~1800 public items documented
  • Suppress missing_docs in terraphim_validation (test infrastructure crate, consistent with existing #![allow(clippy::all)])

Crates fixed

Crate Gaps resolved Lint enforced?
terraphim_types ~15 (Conversation + shared_learning) #![warn(missing_docs)] added
terraphim_config 43 #![warn(missing_docs)] added
terraphim_service 111 #![warn(missing_docs)] added
terraphim_orchestrator 675 docs only
terraphim_multi_agent 292 docs only
terraphim_grep 125 docs only
terraphim_agent 119 docs only
terraphim_usage 92 docs only
terraphim_validation suppressed #![allow(missing_docs)] added

Test plan

  • cargo check -p terraphim_types -p terraphim_config -p terraphim_service passes
  • cargo test -p terraphim_types -p terraphim_config passes (15 tests)
  • cargo test -p terraphim_service passes (2 tests)
  • cargo test -p terraphim_orchestrator passes (3 tests)
  • RUSTDOCFLAGS="-W missing-docs" cargo doc -p <crate> returns 0 warnings for all fixed crates
  • All commits formatted with cargo fmt

Refs terraphim/terraphim-ai#1979 (Gitea)

Test User added 4 commits June 2, 2026 12:32
Add `#![warn(missing_docs)]` enforcement to three core crates and fill
all documentation gaps triggered by the lint:

- terraphim_types: Conversation struct, shared_learning module
  (TrustLevel methods, TrustLevelError, LearningCategory variants,
  LearningStore trait methods, InMemoryLearningStore::new, StoreError)
- terraphim_config: Role fields, ConfigId variants, Config.selected_role,
  TerraphimConfigError variants, KnowledgeGraph fields, KnowledgeGraphLocal
  fields, get_selected_role method, ProjectDiscoveryError, ProjectConfig
  struct and fields, discover/is_empty/resolve_role_name functions
- terraphim_service: ServiceError variants, Result type alias, llm module
  (SummarizeOptions, ChatOptions, LlmClient trait), llm_proxy module,
  conversation_service fields, error.rs (CommonError variants and ctors),
  summarization_queue module, logging Custom variant field

Refs #1979
Systematic documentation sweep across all 44 source files in the
orchestrator crate, eliminating every missing_docs warning:

- Modules: all 15 pub mod declarations annotated
- Error types: OrchestratorError variants + fields, LearningError,
  CompileError, RunRecordError, MetricsPersistenceError
- Agent system: AgentRunRequest, GiteaTargetReport, TriggerMode,
  ModeResult, SyntheticEvent, AgentRuntimeValidationReport,
  AgentSubcommand, OutputFormat, AgentStatus, AgentKey, RegisteredAgent
- Flow system: FlowDefinition, FlowStepDef, StepKind, FailStrategy,
  FlowRunState, FlowRunStatus, StepEnvelope, MatrixResult, TokenUsage,
  FlowExecutor, ProjectRuntime
- Configuration: LearningConfig, EvolutionConfig, GiteaOutputConfig,
  SfiaSkillRef, TomlProjectAdfConfig, TomlAdfAgent, RoutingDecision
- PR lifecycle: PrSummary, PrComment, MergeOutcome, AutoMergeCriteria,
  PrMetadata, PrGateDecision, DispatchResponse, ReviewPrRequest
- Telemetry: TokenBreakdown, ModelUsage, ModelPerformanceSnapshot
- Learning & evolution: Learning, NewLearning, SharedLearningStore
- Control plane: RoutingDecisionEngine, WebhookContext, ScoredCandidate
- Utilities: DriftScore, DriftAlert, LocalSkillConfig, CostSnapshot,
  WebhookDispatch, GiteaComment, all payload/event types

All 675 gaps now resolved. Crate compiles cleanly with 0 warnings.

Refs #1979
…m_grep

terraphim_multi_agent (292 gaps resolved):
- Hook system: HookDecision, PreToolContext, PostToolContext, PreLlmContext,
  PostLlmContext structs + Hook trait + HookManager, all hook implementations
- LLM types: MessageRole, LlmMessage, LlmRequest, TokenUsage, LlmResponse
- Tracking: CostRecord, UsageStats, AlertWindow/Action, CostTracker
- Agent: TerraphimAgent fields, AgentGoals methods
- History: CommandRecord, CommandInput, ExecutionStep, CommandOutput,
  CommandError, CommandStatistics, CommandPriority, StepStatus, OutputType
- Chat: ChatMessage, ChatSession, ChatMessageRole, SummaryStyle
- VM execution: session_adapter, fcctl_bridge, mod, client, hooks
- Pool: LoadMetrics, PoolStats, PoolInfo, GlobalStats
- Error: struct variant fields for limit/timeout errors
- Sanitizer: SanitizedPrompt, sanitize/validate functions

terraphim_grep (125 gaps resolved):
- Search: GrepResult, GrepStats, SufficiencyState, TerraphimGrep
- Hybrid: GrepOptions, Haystack, RetrievedChunk, KgConcept, HybridResults
- Signatures: RlmSignature, Match, Citation, AnswerWithCitations, NewConcept
- Context: RlmContext, DocumentMetadata
- Judge: HeuristicThresholds, Sufficiency, SufficiencyJudge
- Error: TerraphimGrepError variants + Result alias
- KG curation: stub and llm feature structs

Refs #1979
…alidation

terraphim_agent (119 gaps resolved):
- REPL commands: ReplCommand enum + all subcommands (Robot, Update, Config,
  Role, File, Sessions, Vm, Web) with all variants and fields
- Robot module: Capabilities, CommandDoc, ArgumentDoc, FlagDoc, ExampleDoc,
  BudgetedResults, BudgetEngine, FeatureFlags fields
- Service: TuiService, ConnectivityResult, FuzzySuggestion, ChecklistResult
- REPL handler: ReplHandler struct and constructors

terraphim_usage (92 gaps resolved):
- Core: UsageError variants, Result alias, ProviderUsage fields,
  MetricLine variants, ProgressFormat variants, UsageProvider trait,
  UsageRegistry methods
- Pricing: PricingTable struct and all 5 methods
- Providers: all 6 sub-module declarations, ZaiProvider, OpenCodeGoProvider,
  MiniMaxProvider, ClaudeProvider, KimiProvider, CcusageProvider
- Store: BudgetVerdict variants
- Formatter: format_usage_text/json/csv functions

terraphim_validation: add #![allow(missing_docs)] -- this is test
infrastructure with existing clippy::all suppression; gradual adoption
is the established pattern for this crate.

Refs #1979
@AlexMikhalev

Copy link
Copy Markdown
Contributor Author

Closing as superseded. This PR is a Fix #1979: documentation gap s... patch based on an older state of main. The substantive intent has been overtaken by the polyrepo fleet-batch + the recent rebase wave (17+ PRs merged 2026-08-28/29). A rebase would require resolving hundreds of conflicts against substantial refactors. Per the user instruction "fully functional and green," these stale PRs are being closed rather than re-rebased.

Closes per Shimaguru mass-rebase pass, 2026-08-29.

@AlexMikhalev
AlexMikhalev deleted the task/1979-doc-gaps branch August 29, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant