Remove superseded rewrite planning docs · Entire

Remove superseded rewrite planning docs

Sessions

Changes

3

git-sync Rewrite Issue List

This document converts the review memo into a concrete issue list for a from-scratch rewrite branch.

The intent is not to patch the current architecture incrementally first. The intent is to:

  1. Preserve the parts of the current implementation that are directionally correct.
  2. Throw away the parts that are structurally wrong or too costly to evolve.
  3. Rebuild in a way that makes comparison against the current branch explicit.

Rewrite Goal

Rebuild git-sync as a smaller set of focused packages around the same product goal:

Preserve These Ideas

Replace These Structural Choices

Proposed Rewrite Shape

Issues

Correctness

1. Batched bootstrap can claim tag refs were pushed when no tag ref was created

Status: done Problem:

Current code:

Rewrite requirement:

2. Duplicate target mappings are silently accepted

Current code:

Rewrite requirement:

3. Mapping normalization accepts inconsistent ref kinds and partially-qualified refs

Current code:

Rewrite requirement:

4. Sideband preference is backwards

Current code:

Rewrite requirement:

5. Pack reader leak in bootstrap batch loop

Current code:

Rewrite requirement:

6. Protocol v2 tag fetches request include-tag without capability gating

Current code:

Rewrite requirement:

7. OAuth refresh failures are swallowed and stale tokens are reused

Current code:

Rewrite requirement:

8. statsCollector is not safely synchronized

Current code:

Rewrite requirement:

9. Unbounded response reads can cause avoidable memory blowups

Current code:

Rewrite requirement:

10. File token store has no locking

Current code:

Rewrite requirement:

Architecture

1. syncer.go is a monolith

Current code:

Rewrite requirement:

2. Entry points duplicate setup work

Rewrite requirement:

3. Functions carry too much ambient state

Current rewrite note:

Performance And Scalability

1. Batch planning probes by repeatedly fetching full packs and discarding them

Current code:

Rewrite requirement:

2. Materialized fallback path does not scale to large repos

Current rewrite note:

3. Fast-forward checks can degenerate into full graph walks

Current rewrite note:

4. Packet parsing allocates too aggressively

Current rewrite note:

Test Gaps

1. Core planning functions are under-tested directly

Rewrite requirement:

2. Relay eligibility logic is only tested indirectly

Current rewrite note:

3. Protocol v2 error handling is under-tested

Rewrite requirement:

4. Missing behavioral coverage

Current rewrite note:

5. No benchmark coverage for the expensive paths

Current rewrite note:

Rewrite Branch Acceptance Criteria

Recommended Interfaces

These do not need to be exact, but the rewrite should aim for this level of separation.

Source-side interfaces

Target-side interfaces

Planning interfaces

Logging

Desired properties:

Conclusion

The rewrite branch should preserve the core ideas while implementing a cleaner, more maintainable architecture.