todos · Entire

todos

Sessions

32adf4e023ef View transcript

Changes

2

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: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

2. Duplicate target mappings are silently accepted

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

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

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

4. Sideband preference is backwards

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

5. Pack reader leak in bootstrap batch loop

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

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

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

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

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

Concurrency And Safety

8. statsCollector is not safely synchronized

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

9. Unbounded response reads can cause avoidable memory blowups

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

10. File token store has no locking

Status: open

Problem:

Current code:

Rewrite requirement:

Architecture

11. syncer.go is a monolith

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

12. Entry points duplicate setup work

Status: open

Problem:

Rewrite requirement:

13. Functions carry too much ambient state

Status: open

Problem:

Rewrite requirement:

Performance And Scalability

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

Status: open

Problem:

Current code:

Rewrite requirement:

Comparison check:

15. Materialized fallback path does not scale to large repos

Status: open

Problem:

Rewrite requirement:

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

Status: open

Problem:

Current code:

Rewrite requirement:

17. Packet parsing allocates too aggressively

Status: open

Problem:

Current code:

Rewrite requirement:

Test Gaps

18. Core planning functions are under-tested directly

Status: open

Missing direct tests include:

Rewrite requirement:

19. Relay eligibility logic is only tested indirectly

Status: open

Missing direct tests include:

Rewrite requirement:

20. Protocol v2 error handling is under-tested

Status: open

Missing test coverage includes:

Rewrite requirement:

21. Missing behavioral coverage

Status: open

Known missing cases:

22. No benchmark coverage for the expensive paths

Status: open

Rewrite requirement:

Rewrite Branch Acceptance Criteria

Suggested Execution Order

  1. Define package boundaries and minimal interfaces.
  2. Rebuild mapping validation and planning first.
  3. Rebuild protocol and capability layer.
  4. Rebuild bootstrap relay.
  5. Rebuild incremental relay.
  6. Rebuild fallback materialized push path.
  7. Rebuild auth and token store behavior.
  8. Port and expand tests.
  9. Compare rewrite branch behavior against current integration fixtures.