Skip to content

Commit 4707542

Browse files
committed
docs: update CHANGELOG and generate documentation gap report
- Update [Unreleased] with 20 entries from 2026-04-27 to 2026-04-28 - Scan 58 crates: ~2,647 pub items missing documentation - Generate gap report at .docs/reports/documentation-gap-report-20260428.md - Recurrence comment on Gitea issue #1046 Refs #1046
1 parent df31643 commit 4707542

2 files changed

Lines changed: 120 additions & 99 deletions

File tree

.docs/reports/documentation-gap-report-20260428.md

Lines changed: 101 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,122 @@
1-
# Documentation Gap Report
1+
# Documentation Gap Report -- terraphim-ai
22

3-
**Generated:** 2026-04-28
3+
**Generated:** 2026-04-28 12:42 CEST
44
**Agent:** documentation-generator (Ferrox)
5-
**Tool:** `cargo check -Wmissing_docs`
5+
**Scope:** All workspace crates (58 crates)
6+
**Method:** `grep "^pub "` across all `src/**/*.rs` files, excluding `pub mod`, `pub use`, `pub(crate)`
67

7-
## Executive Summary
8-
9-
Documentation coverage across the Terraphim workspace is below acceptable thresholds. Key public crates have extensive gaps in module-level, struct-level, and function-level documentation. This report quantifies the gaps and recommends priority targets for remediation.
10-
11-
## Missing Documentation by Crate
12-
13-
| Crate | Missing Items | Priority | Notes |
14-
|-------|--------------|----------|-------|
15-
| terraphim_orchestrator | 431 | **Critical** | New crate (v1.8.0); core ADF framework; zero module docs |
16-
| terraphim_server | 139 | **High** | Public API surface (Axum handlers, middleware) |
17-
| terraphim_agent | 102 | **High** | CLI entry point and REPL commands |
18-
| terraphim_service | 114 | **High** | Business logic layer |
19-
| terraphim_types | 79 | **High** | Core type definitions; affects all downstream crates |
20-
| terraphim_config | 39 | **Medium** | Configuration structs |
21-
| terraphim_persistence | 30 | **Medium** | Storage abstractions |
22-
| terraphim_rolegraph | 22 | **Medium** | Role graph types |
23-
24-
**Total identified gaps: ~956 items**
25-
26-
## Priority Remediation Targets
27-
28-
### 1. terraphim_orchestrator (431 gaps)
29-
**Rationale:** This is a newly introduced crate (v1.8.0) forming the core of the Autonomous Development Flow framework. It has zero module-level documentation and minimal item-level docs.
30-
31-
**Key files requiring attention:**
32-
- `src/lib.rs` -- missing module-level documentation
33-
- `src/agents/` -- agent templates undocumented
34-
- `src/workflows/` -- workflow definitions undocumented
35-
- `src/dispatch/` -- PR/push dispatch logic undocumented
36-
37-
### 2. terraphim_server (139 gaps)
38-
**Rationale:** Public HTTP API surface. Undocumented endpoints and error types reduce API discoverability.
39-
40-
**Key files requiring attention:**
41-
- `src/api.rs` -- Axum handlers and request/response types
42-
- `src/error.rs` -- Error variants and conversion functions
43-
- `src/workflows/mod.rs` -- Workflow module documentation
44-
45-
### 3. terraphim_agent (102 gaps)
46-
**Rationale:** CLI entry point. REPL commands and robot subcommand lack documentation.
47-
48-
**Key files requiring attention:**
49-
- `src/repl/commands.rs` -- REPL command variants and arguments
50-
- `src/repl/handler.rs` -- Command handlers
51-
- `src/robot/` -- Self-documentation API and budget types
52-
- `src/main.rs` -- CLI argument structs
53-
54-
### 4. terraphim_service (114 gaps)
55-
**Rationale:** Business logic layer bridging API and persistence.
56-
57-
### 5. terraphim_types (79 gaps)
58-
**Rationale:** Core types used across the entire workspace. Missing docs propagate to all dependent crates.
59-
60-
**Key files requiring attention:**
61-
- `src/lib.rs` -- Core types (Entity, Role, Profile, etc.)
62-
- `src/review.rs` -- Review-related structs
8+
---
639

64-
## API Reference Snippets
10+
## Summary
6511

66-
### terraphim_agent::robot::Self-Documentation API
12+
| Metric | Count |
13+
|--------|-------|
14+
| Total crates scanned | 58 |
15+
| Crates with missing docs | 54 |
16+
| Total pub items missing docs | ~2,647 |
17+
| Crates with 0 missing docs | 4 |
6718

68-
```rust
69-
/// Exposes runtime self-documentation for agent introspection.
70-
pub async fn robot_query(
71-
query: String,
72-
role: Option<String>,
73-
) -> Result<ResponseMeta, AgentError>;
74-
```
19+
---
7520

76-
### terraphim_server::api
21+
## Top 15 Crates by Missing Documentation
22+
23+
| Crate | Missing Items | Priority |
24+
|-------|--------------|----------|
25+
| terraphim_agent | 379 | Critical |
26+
| terraphim_orchestrator | 328 | Critical |
27+
| terraphim_validation | 235 | Critical |
28+
| terraphim_multi_agent | 169 | High |
29+
| terraphim_tinyclaw | 111 | High |
30+
| terraphim_session_analyzer | 107 | High |
31+
| terraphim_rlm | 104 | High |
32+
| terraphim_types | 126 | High |
33+
| terraphim_service | 95 | High |
34+
| terraphim_github_runner | 73 | High |
35+
| terraphim_task_decomposition | 71 | Medium |
36+
| terraphim_goal_alignment | 65 | Medium |
37+
| terraphim_symphony | 76 | Medium |
38+
| terraphim_middleware | 64 | Medium |
39+
| terraphim_router | 49 | Medium |
7740

78-
```rust
79-
/// Main Axum router composing all API routes.
80-
pub fn api_router() -> Router<AppState>;
41+
---
8142

82-
/// Health check endpoint.
83-
/// Returns 200 OK when the server is operational.
84-
async fn health_check(State(state): State<AppState>) -> impl IntoResponse;
85-
```
43+
## Critical Missing Docs (Public API Surface)
44+
45+
### terraphim_agent (379 missing)
46+
- `ReplHandler` struct -- no module-level docs
47+
- `RoleSubcommand` enum variants -- `List`, `Select` undocumented
48+
- `new_offline()` constructor -- no usage docs
49+
- `run()` method on ReplHandler -- no async contract docs
50+
- All CLI subcommands need examples
51+
- Self-Documentation API (`robot` module) lacks usage examples
52+
- Token budget types lack field documentation
53+
54+
### terraphim_orchestrator (328 missing)
55+
- Agent lifecycle hooks undocumented
56+
- Routing decision engine types lack field docs
57+
- Webhook dispatch handlers missing error docs
58+
- LearningStore trait implementations lack examples
59+
- ADF agent templates lack specification docs
60+
- PR lifecycle management functions undocumented
61+
62+
### terraphim_validation (235 missing)
63+
- Validation rules engine undocumented
64+
- Rule builder pattern lacks examples
65+
- Error variants lack diagnostic guidance
66+
- Schema linter types lack module docs
8667

87-
### terraphim_types::core
68+
---
8869

89-
```rust
90-
/// Unique identifier for a Terraphim entity.
91-
pub type Id = String;
70+
## CHANGELOG Update
71+
72+
Updated [Unreleased] section with 20 entries from 2026-04-27 to 2026-04-28:
73+
74+
### Added (9)
75+
- LLM pre/post hooks for multi-agent coordination (#451)
76+
- Self-Documentation API via robot CLI (#1011)
77+
- ForgivingParser for typo-tolerant commands (#1012)
78+
- MS Teams SDK test suite (#1034)
79+
- Tantivy index for session search (#1039)
80+
- Token budget flags on Search (#672)
81+
- JSON format on roles/config/graph (#1013)
82+
- ADF operations guide and blog post
83+
- ADF agent fleet reference
84+
85+
### Fixed (7)
86+
- RUSTSEC-2026-0049 via native-tls switch (#418)
87+
- Spec gaps in ADF templates (#1040)
88+
- Global concurrency limits (#664)
89+
- listen_mode test assertion (#1044)
90+
- Robot response formatting
91+
- MCP benchmarks gated to release (#987)
92+
- Pagination+token budget alignment (#672)
93+
94+
### Changed (4)
95+
- Robot mode --format json support
96+
- KG-routed model logging
97+
- Typed ExitCode F1.2 contract (#860)
98+
- SharedLearningStore markdown backend
9299

93-
/// Core entity representing a node in the knowledge graph.
94-
pub struct Entity {
95-
pub id: Id,
96-
pub label: String,
97-
pub properties: HashMap<String, Value>,
98-
}
99-
```
100+
---
100101

101102
## Recommendations
102103

103-
1. **Immediate:** Add `#![warn(missing_docs)]` to all crate roots to prevent regression
104-
2. **Short-term:** Target terraphim_orchestrator first (431 gaps) -- it is the newest crate with the most gaps
105-
3. **Medium-term:** Document terraphim_server public API endpoints and terraphim_types core structs
106-
4. **Long-term:** Enforce `#![deny(missing_docs)]` on release builds after gap closure
104+
1. **Batch-process top 5 crates** (agent, orchestrator, validation, multi_agent, tinyclaw) -- 1,191 items, ~45% of total gap
105+
2. **Enforce `#![deny(missing_docs)]`** on new crates
106+
3. **Require doc examples** for all public async functions
107+
4. **Auto-generate API reference** via `cargo doc --no-deps` in CI
108+
5. **Priority order:**
109+
- Phase 1: terraphim_agent (CLI entry point, user-facing)
110+
- Phase 2: terraphim_orchestrator (new ADF framework)
111+
- Phase 3: terraphim_types (core types, affects all downstream)
107112

108-
## Verification
113+
---
109114

110-
Run the following to reproduce this report:
115+
## Verification
111116

112-
```bash
113-
RUSTFLAGS="-Wmissing_docs" cargo check -p terraphim_orchestrator 2>&1 | grep "missing documentation" | wc -l
114-
RUSTFLAGS="-Wmissing_docs" cargo check -p terraphim_server 2>&1 | grep "missing documentation" | wc -l
115-
RUSTFLAGS="-Wmissing_docs" cargo check -p terraphim_agent 2>&1 | grep "missing documentation" | wc -l
116-
RUSTFLAGS="-Wmissing_docs" cargo check -p terraphim_types 2>&1 | grep "missing documentation" | wc -l
117-
```
117+
- `cargo fmt --check` -- PASS
118+
- `cargo clippy` -- PASS (existing warnings only)
119+
- `cargo test --workspace` -- PASS
118120

119121
---
120122

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- **LLM pre/post hooks** wired in agent command handlers for multi-agent coordination (Refs #451)
1213
- **Self-Documentation API** exposed via robot CLI subcommand (Refs #1011)
1314
- **ForgivingParser** integrated into CLI command dispatch for typo-tolerant command parsing (Refs #1012)
1415
- **MS Teams SDK test suite** with comprehensive SDK tests (Refs #1034)
16+
- **Tantivy index** for session search with BM25 ranking (Refs #1039)
17+
- **Token budget flags** wired to Search command for robot mode output control (Refs #672)
18+
- **JSON format support** on roles/config/graph commands in robot mode (Refs #1013)
19+
- **ADF operations guide** and blog post for PR fan-out deployment
20+
- **ADF agent fleet reference** documentation
1521

1622
### Fixed
1723

24+
- **RUSTSEC-2026-0049** eliminated by switching serenity to native-tls (Refs #418)
1825
- **Spec gaps** addressed and resolved across ADF orchestrator templates (Refs #1040)
1926
- **Global concurrency limits** enforced in orchestrator to prevent task/memory exhaustion (Refs #664)
2027
- **listen_mode test assertion** updated to match clap error output (Refs #1044)
28+
- **Robot response formatting** corrected in chaining logic
29+
- **MCP latency benchmarks** gated behind release builds to prevent debug flake (Refs #672, Refs #987)
30+
- **Pagination and token budget** wired into search response with test alignments (Refs #672)
31+
- **Performance benchmark thresholds** raised and redundant attributes removed (Refs #987)
32+
33+
### Changed
34+
35+
- **Robot mode** now honours --format json for consistent machine-readable output
36+
- **Orchestrator** uses KG-routed model in Quickwit logs and AgentRunRecord
37+
- **CLI exit codes** aligned with F1.2 contract (typed ExitCode, not bare exit(1)) (Refs #860)
38+
- **Learning store** implemented on SharedLearningStore with markdown backend
39+
- **Token budget management** engine active for robot mode output control
2140

2241
## [1.17.0] - 2026-04-27
2342

0 commit comments

Comments
 (0)