|
| 1 | +# Implementation Plan: PR Merge Sprint 2026-06-29 |
| 2 | + |
| 3 | +**Status**: Draft |
| 4 | +**Research Doc**: `.docs/research-pr-merge-sprint-2026-06-29.md` |
| 5 | +**Author**: AI Agent |
| 6 | +**Date**: 2026-06-29 |
| 7 | +**Estimated Effort**: 2-3 hours (mostly waiting on CI) |
| 8 | + |
| 9 | +## Overview |
| 10 | + |
| 11 | +### Summary |
| 12 | +Merge ~50 PRs from the open backlog, fixing fmt/clippy blockers on main first, then merging in dependency-aware order starting with CI infrastructure gates, followed by quick fixes, test additions, and finally feature PRs. |
| 13 | + |
| 14 | +### Approach |
| 15 | +1. Fix fmt/clippy on main (direct push, unblocks all CI gates) |
| 16 | +2. Merge CI gate PRs (builds guardrails for future merges) |
| 17 | +3. Tier-based merge: simple -> moderate -> complex |
| 18 | +4. Resolve conflicts on 2 PRs |
| 19 | +5. Close stale/noise ADF issues |
| 20 | + |
| 21 | +### Scope |
| 22 | + |
| 23 | +**In Scope:** |
| 24 | +- Fix fmt violations on main (2 files) |
| 25 | +- Fix clippy warnings on main (1 file, 3 lines) |
| 26 | +- Merge ~40 Tier 1-3 PRs |
| 27 | +- Merge ~10 Tier 5 CI gate PRs |
| 28 | +- Handle 2 conflicting PRs (#2970, #2969) |
| 29 | +- Push to both remotes |
| 30 | +- Close duplicate ADF monitor-noise issues |
| 31 | + |
| 32 | +**Out of Scope:** |
| 33 | +- New feature development |
| 34 | +- Merging Tier 6 feature PRs without review |
| 35 | +- Full workspace test suite run (would take hours) |
| 36 | +- Fixing all 253 ready issues |
| 37 | + |
| 38 | +**Avoid At All Cost:** |
| 39 | +- Merging PRs that reference wrong issues |
| 40 | +- Bypassing CI checks |
| 41 | +- Rebasing PRs that would introduce conflicts with others |
| 42 | +- Creating new branches to fix PR conflicts manually (let agents fix their own) |
| 43 | + |
| 44 | +## Architecture |
| 45 | + |
| 46 | +### Merge Dependency Graph |
| 47 | +``` |
| 48 | +[Fix fmt+clippy on main] |
| 49 | + | |
| 50 | + [CI Gate PRs] ───── Tier 5 |
| 51 | + | |
| 52 | + [Tier 1: Quick Fixes] ───── 1-line changes, no deps |
| 53 | + | |
| 54 | + [Tier 2: Confident Merges] ── already mergeable=True |
| 55 | + | |
| 56 | + [Tier 3: Test Additions] ─── single-crate tests |
| 57 | + | |
| 58 | + [Fix #2970, #2969 conflicts] |
| 59 | + | |
| 60 | + [Tier 6: Feature PRs] ────── requires review |
| 61 | +``` |
| 62 | + |
| 63 | +### Key Design Decisions |
| 64 | +| Decision | Rationale | |
| 65 | +|----------|-----------| |
| 66 | +| Fix main first, not via PR | fmt/clippy fixes are 5 lines total; a PR would need its own CI gate which is circular | |
| 67 | +| Merge CI gate PRs early | Without gates, merging other PRs is blind; gates prevent regression | |
| 68 | +| Merge oldest/lowest PR # first | Minimises merge conflict probability | |
| 69 | +| Don't rebase conflicting PRs | Original author should rebase; we close with comment asking for rebase | |
| 70 | + |
| 71 | +## File Changes |
| 72 | + |
| 73 | +### Step 1: Fix fmt on main |
| 74 | +**Files:** `crates/terraphim_rlm/src/mcp_tools.rs`, `crates/terraphim_tinyclaw/src/main.rs` |
| 75 | +**Description:** Run `cargo fmt` on the 2 unformatted files |
| 76 | +**Verification:** `cargo fmt --all -- --check` exits 0 |
| 77 | + |
| 78 | +### Step 2: Fix clippy on main |
| 79 | +**Files:** `crates/terraphim_rlm/src/mcp_tools.rs` |
| 80 | +**Description:** Fix 3 clippy warnings: doc_lazy_continuation (2x indent), redundant_closure (replace closure with fn) |
| 81 | +**Verification:** `cargo clippy --workspace` has 0 warnings |
| 82 | + |
| 83 | +### Step 3: Merge CI Gate PRs (Tier 5) |
| 84 | +| PR | Title | |
| 85 | +|----|-------| |
| 86 | +| #2955 | cargo audit CI gate | |
| 87 | +| #2954 | CI rust-clippy + rust-compile jobs | |
| 88 | +| #2942 | workspace test execution gate | |
| 89 | +| #2939 | compile gate ci | |
| 90 | +| #2960 | host-runners workspace | |
| 91 | + |
| 92 | +### Step 4: Merge Tier 1 Quick Fixes |
| 93 | +| PR | Title | Lines | |
| 94 | +|----|-------|-------| |
| 95 | +| #3018 | fmt gate (3 crates) | ~5 | |
| 96 | +| #3012 | clippy mcp_tools | ~3 | |
| 97 | +| #2968 | remove dangling meta_coordinator | 1 | |
| 98 | +| #2966 | remove assert!(true) | 1 | |
| 99 | + |
| 100 | +### Step 4b: Merge Tier 2 Confident PRs |
| 101 | +| PR | Title | |
| 102 | +|----|-------| |
| 103 | +| #3032 | Gitea health check source profile | |
| 104 | +| #3031 | auto-merge gate log enhancement | |
| 105 | +| #3026 | auto-merge agent allowlist | |
| 106 | +| #3011 | rlm set_var safety comment | |
| 107 | +| #3007 | Ed25519 key confirmation | |
| 108 | +| #3002 | worktree disk dedup | |
| 109 | +| #3001 | flaky repro profile | |
| 110 | +| #3000 | per-test timeout | |
| 111 | +| #2993 | OnceLock redaction | |
| 112 | +| #2963 | flaky port fix | |
| 113 | +| #2948 | ADF meta-coordinator health check | |
| 114 | +| #2943 | D002+D004 clippy | |
| 115 | +| #2938 | clippy merge_coordinator/weather_report | |
| 116 | + |
| 117 | +### Step 4c: Merge Tier 3 Test PRs |
| 118 | +| PR | Title | |
| 119 | +|----|-------| |
| 120 | +| #2985 | github_runner unit tests | |
| 121 | +| #2984 | PrFile deserialization + tests | |
| 122 | +| #2979 | relocate stranded specs | |
| 123 | +| #2977 | weather_report tests | |
| 124 | +| #2976 | tinyclaw core tests | |
| 125 | +| #2974 | remove orphaned agent source | |
| 126 | +| #2962 | validation unit tests | |
| 127 | +| #2957 | gitea_runner tests | |
| 128 | +| #2952 | validation unit tests (dup?) | |
| 129 | +| #2946 | spawner validator tests | |
| 130 | +| #2926 | workspace archive tests | |
| 131 | +| #2925 | RLM strictness tests | |
| 132 | +| #2923 | tinyclaw tests | |
| 133 | +| #2918 | Atlassian email redact | |
| 134 | +| #2917 | OpenRouter runtime fallback | |
| 135 | +| #2915 | Homebrew placeholder cleanup | |
| 136 | +| #2913 | set_var data race fix | |
| 137 | +| #2912 | KG fixture on-disk tests | |
| 138 | +| #2910 | workspace test compile blocker | |
| 139 | +| #2908 | tinyclaw safety comment | |
| 140 | +| #2903 | DSM unit tests | |
| 141 | +| #2902 | KG validation executors | |
| 142 | + |
| 143 | +## Merge Procedure |
| 144 | + |
| 145 | +For each PR, the following sequence: |
| 146 | + |
| 147 | +```bash |
| 148 | +# 1. Fetch the PR branch |
| 149 | +git fetch gitea pull/PRNUM/head:pr-PRNUM |
| 150 | + |
| 151 | +# 2. Fast-forward check |
| 152 | +git merge-base --is-ancestor origin/main pr-PRNUM && echo "Fast-forward" || echo "Needs rebase" |
| 153 | + |
| 154 | +# 3. If fast-forward: merge directly |
| 155 | +git checkout main |
| 156 | +git merge pr-PRNUM --no-edit |
| 157 | +git push origin main |
| 158 | + |
| 159 | +# 4. If merge conflict: skip PR, note for later |
| 160 | + |
| 161 | +# 5. Verify sync |
| 162 | +git push gitea main |
| 163 | +git diff origin/main gitea/main --stat |
| 164 | +``` |
| 165 | + |
| 166 | +## Test Strategy |
| 167 | + |
| 168 | +### Per-Step Verification |
| 169 | +| Step | Verification | |
| 170 | +|------|-------------| |
| 171 | +| 1. Fix fmt | `cargo fmt --all -- --check` exits 0 | |
| 172 | +| 2. Fix clippy | `cargo clippy --workspace` exits 0 | |
| 173 | +| 3-4. CI gate PRs | Verify CI workflow files valid, no syntax errors | |
| 174 | +| 4b-c. Tier 2-3 | `cargo check --workspace` after each batch | |
| 175 | +| 5. Conflicting PRs | Skip; comment asking author to rebase | |
| 176 | +| After all merges | `git diff origin/main gitea/main --stat` empty | |
| 177 | + |
| 178 | +## Rollback Plan |
| 179 | + |
| 180 | +If merge introduces breakage: |
| 181 | +1. `git revert` the problematic merge commit |
| 182 | +2. Push revert to both remotes |
| 183 | +3. Investigate root cause before re-attempting |
| 184 | + |
| 185 | +## Implementation Steps |
| 186 | + |
| 187 | +### Step 1: Fix fmt and clippy on main (10 min) |
| 188 | +**Files:** `crates/terraphim_rlm/src/mcp_tools.rs`, `crates/terraphim_tinyclaw/src/main.rs` |
| 189 | +**Actions:** |
| 190 | +1. Run `cargo fmt` to fix formatting |
| 191 | +2. Fix 3 clippy warnings in mcp_tools.rs |
| 192 | +3. Verify: `cargo fmt --all -- --check && cargo clippy --workspace` |
| 193 | +4. Commit: `fix: fmt and clippy on main` |
| 194 | + |
| 195 | +### Step 2: Merge CI Gate PRs (15 min) |
| 196 | +**Targets:** #2955, #2954, #2942, #2939, #2960 |
| 197 | +**Actions:** Fetch each, verify fast-forward, merge, verify build |
| 198 | + |
| 199 | +### Step 3: Merge Tier 1 Quick Fixes (10 min) |
| 200 | +**Targets:** #3018, #3012, #2968, #2966 |
| 201 | + |
| 202 | +### Step 4: Merge Tier 2 Confident PRs (20 min) |
| 203 | +**Targets:** 13 PRs listed above |
| 204 | + |
| 205 | +### Step 5: Merge Tier 3 Test PRs (30 min) |
| 206 | +**Targets:** 20+ PRs listed above |
| 207 | + |
| 208 | +### Step 6: Handle Conflicts (10 min) |
| 209 | +**Targets:** #2970, #2969 |
| 210 | +**Action:** Comment asking author to rebase on latest main |
| 211 | + |
| 212 | +### Step 7: Final Verification and Push (5 min) |
| 213 | +**Actions:** |
| 214 | +1. `git diff origin/main gitea/main --stat` - verify empty |
| 215 | +2. Close stale ADF monitor-noise issues |
| 216 | + |
| 217 | +## Open Items |
| 218 | + |
| 219 | +| Item | Status | Owner | |
| 220 | +|------|--------|-------| |
| 221 | +| Why are 3 new branches empty? | Pending investigation | Agent | |
| 222 | +| Should ADF duplicate issues be batch-closed? | Yes, post-merge | Agent | |
| 223 | +| Are Tier 6 feature PRs worth merging? | Deferred | Human review | |
| 224 | + |
| 225 | +## Approval |
| 226 | + |
| 227 | +- [ ] Technical review complete |
| 228 | +- [ ] Merge order approved |
| 229 | +- [ ] Human approval received |
0 commit comments