Add verify-canfetch flag and git2 integration for repo accessibility checks

```
│  Agent powering down. Goodbye!
│
│  Interaction Summary
│  Session ID:                 9010bd84-1fb3-489d-ae48-89d5e7570b34
│  Tool Calls:                 26 ( ✓ 25 x 1 )
│  Success Rate:               96.2%
│  User Agreement:             96.2% (26 reviewed)
│  Code Changes:               +116 -23
│
│  Performance
│  Wall Time:                  59m 38s
│  Agent Active:               9m 53s
│    » API Time:               4m 22s (44.1%)
│    » Tool Time:              5m 31s (55.9%)
│
│
│  Model Usage                 Reqs   Input Tokens   Cache Reads  Output Tokens
│  ────────────────────────────────────────────────────────────────────────────
│  gemini-2.5-flash-lite          6         10,569             0            596
│  gemini-3-pro-preview          23        114,081       377,312         10,537
│  gemini-3-flash-preview         7         88,472        83,196            436
│
│  Savings Highlight: 460,508 (68.4%) of input tokens were served from the cache, reducing costs.
```
This commit is contained in:
2026-01-14 21:00:50 -05:00
parent 568e5ece49
commit 20ffe86776
4 changed files with 181 additions and 2 deletions

View File

@@ -0,0 +1,21 @@
# Session 2026-01-14: Verify CanFetch Flag
**Date**: 2026-01-14
**Model**: Gemini Pro (CLI Agent)
**Goal**: Verify migration error detection and add a `--verify_canfetch` flag to check repository accessibility (fetching) without using the `git` executable.
## Plan
1. Add `git2` dependency to `Cargo.toml`.
2. Add `--verify_canfetch` flag to `Args`.
3. Implement a helper function `verify_repo_accessible(url: &str)` using `git2`.
4. Integrate this check into the "Existing Repos" discovery phase and the "Post-Migration" phase.
5. Refine error handling to exit on verification failures.
## Outcome
- Added `git2` v0.19 to `Cargo.toml`.
- Implemented `verify_repo_accessible` using `git2::Remote::create_detached` and `connect_auth`.
- Added `--verify_canfetch` CLI flag.
- The tool now optionally verifies that existing repositories and newly migrated ones are reachable and non-empty (contain refs).
- Implemented strict error handling for verifications:
- If "Existing Repos" verification fails for *any* repo, the tool exits with an error *before* calculating/printing the execution plan.
- If "Post-Migration" verification fails for any repo, the tool continues to attempt other migrations but exits with an error at the very end to indicate failure.