**Phase 193 — final verification pass: all gates green.**
- **Verified (all 3 tasks already complete in `complete/193_sync_remaining_count/`):** `fmtSyncLabel`'s count part is `total > 0 && total - done > 0 ? \`${total - done} remaining\` : ""` (plain int, hidden at `N==0`, `total===0` → no part); docstrings updated; chunk/image/summaries parts + `counts_line` terminal + `app/` byte-untouched (`git diff --stat`: no `app/` files).
- **Completion criteria:** `N remaining` shape + marker pins ✅ · upload shares the builder (E2E upload arm) ✅ · chunk/image/summaries pins green ✅ · terminal `counts_line` green unedited + A4 title/`#sync-progress` pin ✅ · suite green, coverage 99% ✅ · lint/types clean ✅ · commit + `todo/→complete/` left to the harness (no git index/history commands run).
- `uv run pytest -q --cov=app --cov-report=term-missing` → **exit 0**, junit: **4792 tests, 0 failures/errors/skipped**, `TOTAL 7181 16 → 99%` (>90%)
- `uv run pytest tests/e2e/test_sync_remaining_count.py -v --no-cov` → **3 passed** (isolated, 53 s)
- Isolated `--no-cov` sweep of the 14 sync-lineage suites (label_mobile, upload_progress, chunk_progress, image_progress, progress_box, summary_visibility, archive_upload_sources, status_freshness, upload_no_scan, peak_memory_visible, session_reset, fast_path_deferred_content, git_freeze, smoke) → **14/14 exit 0**
- `uv run ruff check .` → All checks passed · `uv run pyright` → **0 errors**
- **Docs:** README.md reviewed in full (all 2408 lines) + AGENTS.md. Fixed 2 inconsistencies: the sync running-label clause claimed the upload label shows the count — now states it shares the ONE builder/shape but reports no counts since phase 90 (renders bare); phase-190's "the other ~72 rows" → "the other 83 rows of the panel's 86-row catalogue" (mechanically: 86 CATALOG rows, 84 overridable). `N remaining` already in the sync paragraph; task-01's `(n/m)` examples gone. AGENTS.md verified consistent (no clause names the running count part → unchanged per the phase's "do not add if absent"). Mechanically re-verified: all 86 `BOR_*` settings documented + defaults match, `.env.example` 88 vars covered, 0 broken README anchors, all cited file paths exist, 17 palette colors, migrations head `0030`, pages/shell routes, ports 8123/8901, E2E port allocations (new suite's 8211/8914 unique).
- **Notable:** task 02's documented deviation stands — `files_done` is the importer's 1-based *current* file, so the phase doc's `[1-4]` range is unreachable; count-bearing frames are `1 … N−1` (pinned). Pre-existing, untouched: `E2E_APP_PORT_TOOLBUDGET`/`SAVEDOC` both 8129 and `SYNCUP`/`SYCNCEL` both 8133 — harmless under the one-suite-at-a-time rule.
- **Next pending phase:** none — `193_sync_remaining_count` is the last entry in `.agents/phases/todo/`.
4.3 KiB
4.3 KiB
Task 03 — The phase E2E suite, the full gates, the docs pass, the commit
Phase: 193_sync_remaining_count · Source: TODO.md:7
Story: n/a
Objective
The dedicated Playwright suite proves the owner-visible contract — the label counts DOWN as the run progresses and goes quiet at the final file — run in isolation per AGENTS rule 4; the full gates pass; the docs are consistent; one atomic commit.
Work
tests/e2e/test_sync_remaining_count.py(NEW — the module docstring names the TODO item, the A1/A2 assumptions and the "server untouched" clause) — the module-app fixture pattern (the phase-64/98 E2E convention — verify intests/e2e/conftest.py/ the sibling sync suites):- the fixture: a small git source with N files (N ≥ 4, the phase-98 fixture convention — the
N_FILESshape oftest_sync_upload_progress.py). - (a) the count-down arm: start the sync through the RAG page's sync flow; capture
#sync-progress(and the button title — the A4 full-label placement) across the run: while files are in flight the label matches^Syncing… <file> [1-N] remainingand the displayedNis NON-INCREASING across polls (thetotal − doneshape — a strict count-down; the pin: the sequence of capturedNs, when a new value appears, is smaller); the· chunk n/mpart coexists when a batch is in flight (the phase-129 part, unbroken); when the walk reaches the final file the part is ABSENT (the main part names the file —^Syncing… <last-file>$, no count part — the A1 hidden edge); the run's terminal result line is the phase-64 shape (thecounts_linehelper — byte-identical, the terminal-line pin). - (b) the upload arm (A2): the upload job (the same fixture as an archive, the
test_sync_upload_progress.pyconvention) → the label showsImporting <file> [1-N] remaining(the shared builder, the shared shape — the pin) and the chunk part coexists (the pin). - (c) the pre-walk edge: the first poll before the walk knows the total → NO count part (
^Syncing…$, the phase-64 contract — thetotal === 0guard, owner-visible).
- the fixture: a small git source with N files (N ≥ 4, the phase-98 fixture convention — the
- Regression, run in isolation:
tests/e2e/test_sync_label_mobile.py,tests/e2e/test_sync_upload_progress.py(the task-02 retargets),tests/e2e/test_sync_chunk_progress.py,tests/e2e/test_sync_summary_visibility.py(the chunk/image/summaries pins) — green. - The full gates, in order:
uv run pytest(unit + integration) — 100% passing;uv run pytest --cov=app --cov-report=term-missing— >90% onapp/;uv run pytest tests/e2e/test_sync_remaining_count.py -v --no-cov— green in isolation;uv run ruff check . && uv run pyright— clean.
- Documentation pass (the phase file's Documentation section):
README.md+AGENTS.mdreviewed in their entirety against the post-phase app; the sync section's running-label example (the(done/total)shape, if present inREADME.md) becomes theN remainingone;AGENTS.mdcorrected only where a phase-64/98 clause names the running count part. - Commit: one atomic, professional commit (Conventional Commits,
--no-gpg-sign), e.g.feat(sync): the running label counts down — "N remaining" (phase 193)— the body names the one-linefmtSyncLabelchange (sync + upload through the shared builder), the hidden-at-final-file edge, and the untouched chunk/image/summaries/terminal parts..agents/phases/todo/193_sync_remaining_count/moves to.agents/phases/complete/in the SAME commit (AGENTS rule 8).
Testing & Quality
- E2E: the suite above, isolated; the regression suites green.
- Coverage: >90% on
app/. - Lint/types: clean.
Completion Criteria
tests/e2e/test_sync_remaining_count.pygreen in isolation — (a) the count-down (non-increasingNacross polls, the chunk part coexisting, the part absent at the final file, the terminal line byte-identical); (b) the upload arm (Importing <file> N remaining); (c) the pre-walk edge (no count part before the total is known).uv run pytest100% passing;uv run pytest --cov=app --cov-report=term-missing>90%;uv run ruff check . && uv run pyrightclean.README.md/AGENTS.mdconsistent (the running-label shape).- the phase directory is in
.agents/phases/complete/; one atomic commit with--no-gpg-sign.