|
| 1 | +# Implementation Plan: Merge PR #1951 Doc Fixes into Main |
| 2 | + |
| 3 | +**Status**: Draft |
| 4 | +**Research Doc**: `.docs/research-pr-1951-doc-gaps-merge.md` |
| 5 | +**Author**: Opencode (GLM-5.1) |
| 6 | +**Date**: 2026-06-01 |
| 7 | +**Estimated Effort**: 2-3 hours |
| 8 | + |
| 9 | +## Overview |
| 10 | + |
| 11 | +### Summary |
| 12 | +Cherry-pick 19 doc-comment commits from PR #1951 onto a fresh branch from main, resolving conflicts and verifying zero doc warnings. |
| 13 | + |
| 14 | +### Approach |
| 15 | +Sequential cherry-pick of each `docs(...)` commit, conflict resolution, validation. |
| 16 | + |
| 17 | +### Scope |
| 18 | +**In Scope:** |
| 19 | +- All 19 doc-comment commits from `gitea/task/doc-gaps-2026-06-01` |
| 20 | +- Conflict resolution for 3-7 files |
| 21 | +- Verification: `cargo doc`, `cargo test`, `cargo clippy`, `cargo fmt` |
| 22 | + |
| 23 | +**Out of Scope:** |
| 24 | +- Non-doc code changes from PR #1951 (guard.rs removal, config refactoring, etc.) |
| 25 | +- Release tagging (PR #1968 handled separately) |
| 26 | + |
| 27 | +**Avoid At All Cost:** |
| 28 | +- Full merge of PR #1951 (brings undesired code changes) |
| 29 | +- Rewriting main history |
| 30 | + |
| 31 | +## File Changes |
| 32 | + |
| 33 | +### Modified Files (Expected) |
| 34 | +| File | Nature | Conflict Likelihood | |
| 35 | +|------|--------|-------------------| |
| 36 | +| `crates/terraphim_persistence/src/lib.rs` | Doc additions | High | |
| 37 | +| `crates/terraphim_rolegraph/src/lib.rs` | Doc additions | High | |
| 38 | +| `crates/terraphim_agent/src/service.rs` | Doc additions | Low | |
| 39 | +| `crates/terraphim_agent/src/robot/*.rs` | Doc additions | Low | |
| 40 | +| `crates/terraphim_agent_evolution/src/*.rs` | Doc additions | Medium | |
| 41 | +| `crates/terraphim_orchestrator/src/*.rs` | Doc additions | Medium | |
| 42 | +| `crates/terraphim_rlm/src/*.rs` | Doc additions | Low | |
| 43 | +| `crates/terraphim_service/src/*.rs` | Doc additions | Low | |
| 44 | +| `crates/terraphim_grep/src/*.rs` | Doc additions | Low | |
| 45 | +| `crates/terraphim_middleware/src/*.rs` | Doc additions | Low | |
| 46 | +| `crates/terraphim_workspace/src/lib.rs` | Doc additions | Low | |
| 47 | +| `crates/terraphim_sessions/src/model.rs` | Doc additions | Low | |
| 48 | +| `crates/terraphim_settings/src/lib.rs` | Doc additions | Low | |
| 49 | +| `crates/terraphim_validation/src/*.rs` | Doc additions | Low | |
| 50 | +| `crates/terraphim_config/src/*.rs` | Doc additions | Medium | |
| 51 | +| `crates/terraphim_types/src/lib.rs` | Doc additions | High | |
| 52 | +| `crates/terraphim_agent_messaging/src/*.rs` | Doc additions | Low | |
| 53 | +| `crates/terraphim_agent_registry/src/*.rs` | Doc additions | Low | |
| 54 | +| `crates/terraphim_agent_supervisor/src/*.rs` | Doc additions | Low | |
| 55 | + |
| 56 | +## Implementation Steps |
| 57 | + |
| 58 | +### Step 0: Merge PR #1968 (Release) |
| 59 | +**Description:** Merge the release PR first to mark v2026.05.31 |
| 60 | +**Command:** `gtr merge-pull --owner terraphim --repo terraphim-ai --index 1968` |
| 61 | +**Estimated:** 2 minutes |
| 62 | + |
| 63 | +### Step 1: Create Feature Branch |
| 64 | +**Description:** Fresh branch from main |
| 65 | +**Commands:** |
| 66 | +```bash |
| 67 | +git checkout main |
| 68 | +git pull origin main |
| 69 | +git checkout -b task/1951-doc-gaps-cherry-pick |
| 70 | +``` |
| 71 | +**Estimated:** 1 minute |
| 72 | + |
| 73 | +### Step 2: Cherry-Pick Doc Commits (Sequential) |
| 74 | +**Description:** Cherry-pick each of the 19 doc commits in chronological order |
| 75 | +**Commits (oldest first):** |
| 76 | +``` |
| 77 | +27cdc798d docs(terraphim_sessions): add missing doc comments to model structs |
| 78 | +b09660d40 docs(terraphim_workspace): add missing doc comments to public API |
| 79 | +05b7ff8e9 docs(terraphim_rlm): add missing doc comments to MCP tool structs |
| 80 | +c2b0de56a docs(terraphim_grep): add missing doc comments to public API |
| 81 | +efdd110c7 docs(terraphim_config): add missing doc comments to public API |
| 82 | +4b9a2f75b docs(terraphim_persistence): fix missing docs and intra-doc link warnings |
| 83 | +310e7c72e docs(terraphim_middleware): add missing doc comments to public API |
| 84 | +b2d5ef411 docs(terraphim_rolegraph): fix missing docs and intra-doc link warnings |
| 85 | +6ede7c70b docs(terraphim_agent_supervisor): add missing doc comments |
| 86 | +5ae10ea43 docs(terraphim_service): add missing doc comments to public API |
| 87 | +3c7ea033a docs(terraphim_agent_messaging): add missing doc comments |
| 88 | +42ef3fa69 docs(terraphim_agent_registry): add missing doc comments |
| 89 | +32f95470a docs(terraphim_agent_evolution): add missing doc comments phase 1 |
| 90 | +fa07272e5 docs(terraphim_agent): add missing doc comments to service and robot modules |
| 91 | +ef1a4a921 docs(terraphim_settings): fix missing doc comments |
| 92 | +b6aedd304 docs(terraphim_validation): add missing doc comments to public API |
| 93 | +8afceba91 docs(terraphim_orchestrator): add missing doc comments phase 1 |
| 94 | +b84d0bd1f docs(terraphim_orchestrator): add missing doc comments phase 2 |
| 95 | +6b3792098 docs: correct CHANGELOG entry for PR #1943 |
| 96 | +``` |
| 97 | + |
| 98 | +**Conflict Resolution Strategy:** |
| 99 | +- For each conflict: keep main's code, add the doc comments from the cherry-pick |
| 100 | +- Skip commits that fail with irreconcilable conflicts and note for manual follow-up |
| 101 | +- Run `cargo check` after each cherry-pick to catch issues early |
| 102 | + |
| 103 | +**Estimated:** 60-90 minutes |
| 104 | + |
| 105 | +### Step 3: Verify Doc Warnings |
| 106 | +**Description:** Run cargo doc to confirm zero missing-doc warnings |
| 107 | +**Command:** `cargo doc --workspace 2>&1 | grep -c 'warning: missing documentation'` |
| 108 | +**Expected:** 0 |
| 109 | +**Estimated:** 10 minutes |
| 110 | + |
| 111 | +### Step 4: Run Quality Gates |
| 112 | +**Description:** Full test + lint suite |
| 113 | +**Commands:** |
| 114 | +```bash |
| 115 | +cargo fmt --all -- --check |
| 116 | +cargo clippy --workspace --all-targets -- -D warnings |
| 117 | +cargo test --workspace |
| 118 | +``` |
| 119 | +**Estimated:** 30-60 minutes (on bigbox) |
| 120 | + |
| 121 | +### Step 5: Commit, Push, PR |
| 122 | +**Description:** Push branch and create PR |
| 123 | +**Commands:** |
| 124 | +```bash |
| 125 | +git push origin task/1951-doc-gaps-cherry-pick |
| 126 | +gtr create-pull --owner terraphim --repo terraphim-ai \ |
| 127 | + --title "docs: cherry-pick PR #1951 doc-comment additions across 17 crates" \ |
| 128 | + --head task/1951-doc-gaps-cherry-pick \ |
| 129 | + --body "Cherry-picks the 19 doc-comment commits from closed PR #1951..." |
| 130 | +``` |
| 131 | +**Estimated:** 5 minutes |
| 132 | + |
| 133 | +## Rollback Plan |
| 134 | +- Delete branch if cherry-picks cause unresolvable conflicts |
| 135 | +- Fall back to manual doc-comment additions per crate |
| 136 | +- Original branch preserved at `gitea/task/doc-gaps-2026-06-01` |
| 137 | + |
| 138 | +## Approval |
| 139 | +- [ ] Research document reviewed |
| 140 | +- [ ] Implementation plan approved |
| 141 | +- [ ] Human confirms non-doc changes should be excluded |
0 commit comments