Skip to content

Commit 218d9e2

Browse files
author
Test User
committed
fix: fmt and clippy warnings on main (doc_lazy_continuation, redundant_closure, use ordering)
1 parent c737fbe commit 218d9e2

8 files changed

Lines changed: 549 additions & 34 deletions

File tree

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
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
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Handover 2026-06-28 11:15 BST
2+
3+
## Summary
4+
5+
Fixed `adf-ctl` SSH 2FA failures and empty agents list for the terraphim-agents repo. Deployed developer agent schedule. Diagnosed provider probe failures.
6+
7+
---
8+
9+
## Completed
10+
11+
### 1. PR #2729 rebase (terraphim-ai)
12+
- Branch `task/search-policy-terraphim-grep` was out of sync between remotes
13+
- Rebased from gitea remote to `8ea82edf`, force-pushed to both origin and gitea
14+
- PR #2729 already existed: https://git.terraphim.cloud/terraphim/terraphim-ai/pulls/2729
15+
16+
### 2. adf-ctl fixes (terraphim-agents, PR #62 merged)
17+
18+
**Fix 1: SSH auto-fallback** (`crates/terraphim_orchestrator/src/bin/adf-ctl.rs`)
19+
- Added `is_on_orchestrator_host()` — checks for `/opt/ai-dark-factory/orchestrator.toml`
20+
- `ssh_run()` and `cmd_trigger` auto-delegate to local execution when on bigbox
21+
- Fixes "Permission denied (keyboard-interactive)" on all commands (status, agents, trigger, cancel)
22+
23+
**Fix 2: conf.d agent discovery**
24+
- Added `parse_agent_names_from_confd()` — globs `conf.d/*.toml` alongside orchestrator.toml
25+
- `cmd_agents` local mode now returns all 46 agents (previously returned empty)
26+
- Remote-mode was already correct (uses grep pipeline)
27+
28+
- **Repo**: https://git.terraphim.cloud/terraphim/terraphim-agents/pulls/62 (merged)
29+
- **Tests**: 43/43 passed, clippy clean, build clean
30+
- **Not yet deployed**: source merged to main, but binary not built/deployed to bigbox
31+
32+
### 3. terraphim-agents-developer agent (bigbox config)
33+
34+
Added to `/opt/ai-dark-factory/conf.d/terraphim-agents.toml`:
35+
```toml
36+
schedule = "*/30 * * * *" # every 30 minutes
37+
model = "kimi-for-coding/k2p6" # was unqualified "sonnet"
38+
fallback_model = "minimax-coding-plan/MiniMax-M2.5"
39+
```
40+
41+
- Agent first spawned at 12:00 CEST (10:00 UTC) — confirmed in journal
42+
- KG tier router overrode cli_tool to `pi-rust` and model to `zai-coding-plan/glm-5.2` (all primary providers were unhealthy at spawn time)
43+
- Next fire: 12:30 CEST
44+
45+
### 4. Provider probe diagnosis
46+
47+
Fresh probe from 12:00 restart (22 providers probed, 10 healthy):
48+
49+
| Status | Providers | CLI | Issue |
50+
|--------|-----------|-----|-------|
51+
| Healthy | zai-coding-plan, kimi-for-coding, minimax-coding-plan | pi-rust | Internal subscription routing |
52+
| Error | anthropic | claude | `ANTHROPIC_API_KEY` not in systemd env |
53+
| Timeout | kimi, openai, minimax | opencode | opencode OAuth credentials unreachable in systemd context |
54+
55+
Systemd drop-in at `/etc/systemd/system/adf-orchestrator.service.d/env-gitea.conf` only has `GITEA_URL` and `GITEA_TOKEN`. No API keys for claude or opencode.
56+
57+
---
58+
59+
## Current state
60+
61+
### terraphim-ai (this repo)
62+
```
63+
Branch: task/search-policy-terraphim-grep (rebased, pushed)
64+
Last commit: 8ea82edfd docs(agents): use terraphim-grep, not opencode FFF, for search
65+
PR: #2729 (open)
66+
```
67+
68+
### terraphim-agents (polyrepo)
69+
```
70+
Branch: task/fix-adf-ctl-localhost-and-conf-discovery
71+
Last commit: 12e0919 fix(adf-ctl): auto-localhost detection and conf.d agent discovery
72+
PR: #62 (merged)
73+
```
74+
75+
### bigbox orchestrator
76+
```
77+
Service: adf-orchestrator (systemd, active)
78+
PID: 2906099 (restarted 12:00 CEST)
79+
Config: /opt/ai-dark-factory/orchestrator.toml
80+
Conf.d: /opt/ai-dark-factory/conf.d/*.toml
81+
Memory: ~1GB (down from 80GB before restart — PID 1196487 was leaking)
82+
```
83+
84+
---
85+
86+
## Blocked / pending
87+
88+
1. **adf-ctl binary not deployed** — fix merged to terraphim-agents main but binary at `/usr/local/bin/adf-ctl` on bigbox is stale (Jun 22)
89+
2. **Provider API keys missing**`ANTHROPIC_API_KEY` and opencode OAuth not in systemd env; 12/22 probes unhealthy
90+
3. **PR gate config for terraphim-agents** — proposed in `/tmp/terraphim-agents-config-proposal.md` (on bigbox), not applied
91+
4. **terraphim-agents-developer model override** — KG tier router overrides `kimi-for-coding/k2p6` to `zai-coding-plan/glm-5.2` because primary providers are unhealthy; this corrects itself once providers are healthy
92+
93+
---
94+
95+
## Next steps (suggested)
96+
97+
1. Build and deploy adf-ctl from terraphim-agents main:
98+
```bash
99+
cd /home/alex/projects/terraphim-agents
100+
cargo build --release -p terraphim_orchestrator --bin adf-ctl
101+
scp target/release/adf-ctl bigbox:/usr/local/bin/adf-ctl
102+
```
103+
104+
2. Add provider API keys to systemd:
105+
```bash
106+
# On bigbox:
107+
sudo mkdir -p /etc/systemd/system/adf-orchestrator.service.d
108+
echo '[Service]' | sudo tee /etc/systemd/system/adf-orchestrator.service.d/env-api-keys.conf
109+
echo 'Environment=ANTHROPIC_API_KEY=...' | sudo tee -a ...
110+
# Or source from op:
111+
# EnvironmentFile=/run/secrets/adf-api-keys.env
112+
sudo systemctl restart adf-orchestrator
113+
```
114+
115+
3. Apply PR gate config from proposal at `/tmp/terraphim-agents-config-proposal.md`
116+
117+
4. Merge PR #2729 on terraphim-ai (doc-only, no code changes)

0 commit comments

Comments
 (0)