Skip to content

Tighter Phase 2 rebase: per-commit cargo check (replacement for #33's 2260-commit rebase) #43

Open

Description

@KooshaPari

Summary

PR #33 (squash-merge of 2,260 commits at 901b3310821e9d65a88301072bb0a183709eefad) was reverted by PR #36 at f19b47b196e7b9167477b19810bb6728e0874b32 because cargo check --workspace failed with 6+ errors across 3 crates (kcode-base, kcode-swarm-core, kcode-setup-hints). The 2,260-commit rebase was lossy in three known places and possibly more that were never caught.

This issue tracks the replacement attempt: a tighter, smaller-batch rebase that runs cargo check after every commit so failures are caught in real time and never accumulate into an unsalvageable mass.

Why a different approach

  • 2,260 commits is too many to validate in one pass. A failure at the end means 2,259 prior commits have to be re-investigated.
  • 3 known rebase-induced bugs (lost test body, stray };, empty Serialize impls) plus 3+ latent compile errors suggests more bugs went undetected.
  • Fixing forward on the merged state was rejected as too risky (the 2,260-commit rebase is not a clean foundation). Reverting and re-doing it tighter is safer.

Acceptance criteria (must hold before any future PR with this content merges)

  1. cargo check --workspace exits 0
  2. cargo test --workspace passes (or any pre-existing failures are documented)
  3. cargo clippy --workspace --all-targets -- -D warnings exits 0 (or failures documented)
  4. Rebase commit count per push ≤ 200. If the full rebase is larger, split into multiple PRs.
  5. Per-commit cargo check during the rebase: after every git rebase --continue, run cargo check --workspace before proceeding to the next commit. Do not batch.

Process (concrete)

  • Use a private rebase branch (e.g. decollide/round-2-rebase) on top of master at f19b47b19.
  • For each rebase step:
    1. git rebase --continue
    2. cargo check --workspace 2>&1 | tee /tmp/cargo-check.log
    3. If exit 0, proceed.
    4. If exit non-zero, STOP. Investigate. Either fix the conflict cleanly or skip the commit with git rebase --skip and document why.
  • If the same file conflicts more than twice, refactor that file first to remove the structural source of conflicts (often a rename conflict that was handled sloppily).
  • Once a coherent batch (≤200 commits) is clean, push and open a PR. Do not push the next batch until the previous PR is reviewed and merged.

Scope (in this rebase)

The rebase content itself (Phase 2 source changes) is owned by issue #32. This issue only tracks the process of doing the rebase more safely. If a specific batch surfaces a content-level decision, fork a child issue from #32.

Known lossy sites to watch for (from PR #33's failure)

These were the three sites where the 2,260-commit rebase lost or corrupted content. If they show up again, treat as a smell:

  • crates/kcode-tui-style/src/harmony.rs — test function body for print_calibration_scores was dropped
  • crates/kcode-base/src/provider/mod.rs:117 — stray }; was introduced
  • crates/kcode-swarm-core/src/lib.rs:183,187 — empty Serialize/Deserialize impls were left in place

Per-commit cargo check would have caught the empty Serialize/Deserialize impls (the others are silent data loss). A review checklist should also include a "test body count" check on harmony.rs.

Out of scope

Linked

Status

Not started. Waiting on maintainer bandwidth to schedule a tighter rebase attempt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions