Rewrite git-sync into focused packages

main

Commit

Soph5mo ago

Break the monolithic syncer.go (3143 lines) into 7 focused packages:

  • internal/gitproto: pkt-line, smart HTTP, capability negotiation, v1/v2 fetch/push
  • internal/planner: mapping validation, planning, relay eligibility, checkpoints
  • internal/auth: credential resolution, Entire DB tokens, git credential helper
  • internal/strategy/bootstrap: one-shot + batched bootstrap, GitHub preflight
  • internal/strategy/incremental: incremental relay execution
  • internal/strategy/materialized: materialized fallback push with size guard
  • internal/syncer: slim orchestrator (734 lines), stats, measurement

Addresses all 22 issues from docs/rewrite-issue-list.md:

Correctness: tag ref creation independent of pack (#1), duplicate target mapping rejection (#2), cross-kind mapping rejection (#3), sideband-64k preference (#4), pack reader close discipline (#5), include-tag capability gating (#6), OAuth refresh error propagation (#7).

Concurrency: mutex-protected stats (#8), bounded response reads (#9), flock-based file token store locking (#10).

Architecture: package decomposition (#11), shared session setup (#12), explicit Params structs (#13).

Performance: commit-count batch sizing heuristic (#14), materialized object count guard (#15), bounded ancestry checks with ErrAncestryDepthExceeded (#16), reusable pkt-line buffer (#17).

Testing: 73 test functions, 7 benchmarks, coverage 41-58% on core packages. Protocol malformed-input tests (#18-20), behavioral edge cases (#21), benchmarks for planning/protocol hot paths (#22).

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com Entire-Checkpoint: 27633b8ca595

Checkpoints

Can you take a look at the go code (wasm) in /Users/soph/Work/entire/devenv/entire-io-worktree1 based a bit on that I wonder if something like this can be build:

CodexGPT-5.4
View session
Checkpoint 1

Review the staged git changes (git diff --staged main) in this Go repository. This is a rewrite of a git-sync tool that mirrors Git repos over smart HTTP. The rewrite breaks a monolithic syncer.go (31

CodexGPT-5.4
View session
Checkpoint 1

Review the staged git changes (git diff --staged main) in this Go repository. This is a rewrite of a git-sync tool. Focus on: 1) any remaining correctness bugs 2) regressions from the old code 3) conc

CodexGPT-5.4
View session
Checkpoint 1

can you loc at

Claude CodeOpus 4.6[1m]
View session
Checkpoint 1