Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

5.4 KB
Raw Blame

ADR-0008: Reviewing long-lived migration branches

Date: 2026-08-02 Status: Accepted Amendment: 2026-08-30, tracked in #6007

Context

PR #3299 replaced the application's Flask/Werkzeug request layer with FastAPI/ASGI while main continued to change. A migration of that duration and breadth creates review problems that an ordinary file-by-file pass cannot answer reliably:

  • behavior moves across routers, dependencies, middleware, and services;
  • peer modules can drift even when each file looks reasonable in isolation;
  • fixes merged to main after the fork can be lost when an old implementation is replaced; and
  • deleted or renamed files can hide behavior that has no obvious successor.

The review therefore needs both exhaustive local coverage and comparisons that cross file and history boundaries.

Decision

Use a documented, multi-axis review for a migration that is both broad and long-lived. A maintainer owns the review scope and the final disposition of every material finding.

Review the same change along independent axes

At minimum, cover these views:

  1. Changed files: inspect every changed file for local correctness.
  2. Behavior and concern: trace request identity, authorization, validation, error handling, session lifecycle, response contracts, and resource cleanup end to end across file boundaries.
  3. Change type: review deleted files, newly added files, and renamed-and-modified files separately. Each hides different omissions.
  4. Sibling consistency: compare routers, dependencies, and middleware with their peers so an outlier cannot hide behind a plausible local pattern.
  5. Predecessor to successor: map the behavior of each replaced module to the new owner rather than relying on Git rename similarity.
  6. Mainline drift: inspect changes that landed on affected main paths after the migration fork and verify their behavior in the replacement.
  7. Delivery surface: review tests, dependencies, documentation, upgrade behavior, operational configuration, and rollback separately from source correctness.

Each pass records the paths and properties it covered. Any excluded area is an explicit limitation, not an implied clean result.

Derive mainline drift from paths

Enumerate drift from the paths the migration rewrites or removes, not from commit subjects. Subject prefixes are conventions and cannot prove that every relevant change was considered.

For each affected path:

  1. establish the merge base with git merge-base origin/main HEAD;
  2. list later main commits that touched the path;
  3. inspect each diff and identify the behavior it changed; and
  4. verify that behavior in the migration's successor code or explain why it is not applicable.

Classify the merge result as one of:

  • arrives unchanged: the branch did not replace the affected path;
  • requires conflict resolution: Git presents an explicit conflict; or
  • requires a behavior port: the old path is deleted or replaced and Git cannot preserve the change automatically.

Run history-dependent checks only in a complete repository. Confirm git rev-parse --is-shallow-repository before treating a history walk as exhaustive, and use two-tree path enumeration when rename detection would hide deleted paths.

Require reproducible evidence

A review claim must identify the code path and the evidence that supports it. Static reasoning is sufficient for a structural invariant; runtime behavior needs a focused reproduction or test. High-impact or ambiguous claims receive an independent human check before they become code changes or release notes.

Review the resulting commit, not only the working tree used to create it:

  • inspect the exact commit or PR diff;
  • run the relevant tests at that SHA;
  • use git diff --check and repository hooks; and
  • confirm that documentation links and cited symbols resolve.

When practical, convert an accepted finding into an executable invariant. The durable outputs of this migration include the test-provenance guardian in tests/test_migration_decision_records.py, the source-provenance guardian in tests/test_source_provenance_map.py, and route/template consistency checks.

Prefer staged delivery

The review method reduces risk but does not remove the cost of a branch that diverges for months. Prefer small migration stages that merge independently. When a long-lived branch is unavoidable, integrate main frequently and rerun the drift review before each merge-readiness decision.

Consequences

  • Review coverage is explicit and repeatable across file, behavior, and history boundaries.
  • The process costs more than ordinary review and is reserved for changes whose breadth and lifetime justify it.
  • Static review does not replace integration, browser, upgrade, or deployment testing.
  • The method establishes review discipline, not a guarantee that two implementations are behaviorally identical.

References