phase: 135_git_source_branch
All verification complete. No edits were needed by this pass — the phase work and docs were already consistent and green. **Phase 135 final verification pass — report** - Verified all 5 tasks' work present & correct: migration 0024 (reversible), `GitSource.branch` + 4 schema shapes, `validate_branch_name` (full check order per design), `clone_or_pull(…, branch)` (HEAD guard first, `--branch` clone, fetch+ff merge), both call sites pass `row.branch`, UI (add-form field, editor field, row tag), `file://` URL transport. - Completion criteria: (1) branch-mirrored through Sync + CLI — **pass** (E2E + integration); (2) `branch=None` byte-identical — **pass** (`test_branch_none_argv_is_byte_identical_pre_phase_sequence` green); (3) fixed 422s / local-row 422 / tri-state — **pass**; (4) mismatch fails loudly with remove-and-re-add — **pass** (E2E); (5) coverage 99% >90%, E2E isolated green — **pass**; (6) no regressions — **pass**. - Tests: `uv run pytest --cov=app --cov-report=term-missing` → 3223 passed, app/ 99%; `uv run pytest tests/e2e/test_git_source_branch.py -v --no-cov` → 4 passed (16.4 s); `uv run ruff check .` clean; `uv run pyright` → 0 errors, 0 warnings. - Documentation: README.md reviewed in full — phase-135 branch section accurate; the phase's README diff also correctly fixed a pre-existing stale line (shallow `--depth 1` clone vs full-history, phase 107). Routes, env defaults, feature lists verified against code. AGENTS.md — all 10 rules + quick-reference verified (referenced tests, PLAN.md, phases dirs, commands all accurate). **Verified consistent — no changes needed.** - No live-infrastructure changes (dev DB already running and healthy; no live steps in this phase). - Next pending phase: `.agents/phases/todo/136_force_push_reset`.
This commit is contained in:
@@ -812,14 +812,15 @@ def fresh_sync_status() -> Iterator[None]:
|
||||
class _GatedClone:
|
||||
"""A ``clone_or_pull`` that parks between start and finish on a
|
||||
threading gate, so the test can read the status during the
|
||||
clone/pull phase (A4: no file yet)."""
|
||||
clone/pull phase (A4: no file yet). Phase 135: accepts the row's
|
||||
branch pin (the third argument — ``None`` for this file's rows)."""
|
||||
|
||||
def __init__(self, started: threading.Event, release: threading.Event) -> None:
|
||||
self.started = started
|
||||
self.release = release
|
||||
self.calls: list[tuple[str, Path]] = []
|
||||
|
||||
def __call__(self, url: str, dest: Path | str) -> Path:
|
||||
def __call__(self, url: str, dest: Path | str, branch: str | None = None) -> Path:
|
||||
dest = Path(dest)
|
||||
self.calls.append((url, dest))
|
||||
dest.mkdir(parents=True, exist_ok=True)
|
||||
@@ -1402,10 +1403,12 @@ def test_chunk_position_clears_at_phase_transitions_and_terminal(
|
||||
# the event set / releases.
|
||||
|
||||
|
||||
def _fast_clone(url: str, dest: Path | str) -> Path:
|
||||
def _fast_clone(url: str, dest: Path | str, branch: str | None = None) -> Path:
|
||||
"""A non-gated ``clone_or_pull`` — the loop thread must STAY FREE
|
||||
for the loop-thread action, so nothing in the prelude may block it
|
||||
(the import's gate is an ``asyncio.to_thread`` park — loop-safe)."""
|
||||
(the import's gate is an ``asyncio.to_thread`` park — loop-safe).
|
||||
Phase 135: accepts the row's branch pin (the third argument —
|
||||
``None`` for this file's rows)."""
|
||||
dest = Path(dest)
|
||||
dest.mkdir(parents=True, exist_ok=True)
|
||||
(dest / "notes.md").write_text("# repo\ncontent for the KB\n", encoding="utf-8")
|
||||
@@ -1721,7 +1724,8 @@ def test_event_alone_cancels_at_the_import_boundary(
|
||||
clone_release = threading.Event()
|
||||
clone_calls: list[tuple[str, Path]] = []
|
||||
|
||||
def parking_clone(url: str, dest: Path | str) -> Path:
|
||||
def parking_clone(url: str, dest: Path | str, branch: str | None = None) -> Path:
|
||||
# phase 135: the row's branch pin (None for this file's rows)
|
||||
dest = Path(dest)
|
||||
dest.mkdir(parents=True, exist_ok=True)
|
||||
(dest / "notes.md").write_text("# repo\ncontent for the KB\n", encoding="utf-8")
|
||||
@@ -1864,7 +1868,8 @@ def test_event_cancels_at_the_top_of_the_source_loop(
|
||||
release.wait() # blocking is fine: the date walk is a sync call
|
||||
return {}
|
||||
|
||||
def fast_clone(url: str, dest: Path | str) -> Path:
|
||||
def fast_clone(url: str, dest: Path | str, branch: str | None = None) -> Path:
|
||||
# phase 135: the row's branch pin (None for this file's rows)
|
||||
dest = Path(dest)
|
||||
dest.mkdir(parents=True, exist_ok=True)
|
||||
(dest / "notes.md").write_text("# repo\ncontent for the KB\n", encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user