phase: 154_sync_status_freshness
Build and Push Containers / build-and-push-app (push) Successful in 2m26s
Build and Push Containers / build-and-push-db (push) Successful in 16s

All 4 task files exist in `complete/`, and only `00_phase.md` remains in `todo/`. This is the final verification pass. I'll read through the task files and check the current state of the code.
This commit is contained in:
2026-10-04 14:24:33 -04:00
parent 966c4b0540
commit c275735db4
36 changed files with 2526 additions and 99 deletions
+27 -13
View File
@@ -54,8 +54,9 @@ Contract under test:
* **test 1 — upload does not scan**: the "Upload" button (phase 90 A3)
→ the archive → the 202 "Successfully uploaded — <source>" toast →
the settled result line "Uploaded <source> — press Sync sources to
import it." with the terminal no-count status payload
the settled result line "Uploaded <source> (<stamp>) — press Sync
sources to import it." (the phase-154 completion stamp) with the
terminal no-count status payload
(``{"message": "uploaded"}``, null/0/0 progress — phase 90 A2); the
source row is present (Local badge + the phase-89 "Ignore paths"
control) and its folder exists on the host under ``BOR_UPLOAD_DIR``
@@ -127,6 +128,19 @@ SOURCES_URL = "/sources.html"
#: filename minus the archive suffix (the phase-49 naming rule).
SOURCE_NAME = "e2e-upload-no-scan"
def _ready_for_sync_line(name: str) -> re.Pattern[str]:
"""Phase 154 (task 02): the ready-for-sync line carrying the
completion stamp — "Uploaded <name> (<stamp>) — press Sync sources
to import it." (the fresh 202 settle, the page-local name). In
E2E the stamp is ALWAYS the same-day ``HH:MM`` form — the run
settles within seconds (the date-qualified forms are unit-pinned
on a fixed clock — E2E never depends on the wall clock)."""
return re.compile(
rf"^Uploaded {re.escape(name)} \(\d{{1,2}}:\d{{2}}\)"
r" — press Sync sources to import it\.$"
)
#: v1: two sentinel docs + the notes/ file the phase-89 ignore entry
#: (``notes``) excludes from the sync. v2 (same basename): beta CHANGED,
#: alpha DROPPED, gamma ADDED — the in-place-replace subject (the
@@ -394,7 +408,8 @@ def test_upload_does_not_scan(
"""One real upload through the page: the button reads **Upload**
(phase 90 A3); the 202 fires the "Successfully uploaded — <source>"
toast; the settled result line points at the next step — "Uploaded
<source> — press Sync sources to import it." (A3) — with the
<source> (<stamp>) — press Sync sources to import it." (A3 — the
phase-154 completion stamp) — with the
terminal no-count status payload (``{"message": "uploaded"}``,
null/0/0 progress — A2). The source row is present (Local badge +
the phase-89 "Ignore paths" control) and its folder exists on the
@@ -428,9 +443,7 @@ def test_upload_does_not_scan(
# never-stale restore (button + input)…
result = page.locator("#archive-upload-result")
expect(result).to_be_visible(timeout=UPLOAD_TIMEOUT_MS)
expect(result).to_have_text(
f"Uploaded {SOURCE_NAME} — press Sync sources to import it."
)
expect(result).to_have_text(_ready_for_sync_line(SOURCE_NAME))
expect(btn).to_be_enabled()
expect(btn).to_have_text("Upload")
expect(page.locator("#archive-upload-file")).to_have_value("")
@@ -507,9 +520,10 @@ def test_ignore_list_then_sync_scans(
page.set_default_timeout(30_000)
_admin_git_sources_page(page, app_url)
# Upload: the ready-for-sync line, and still nothing indexed.
assert _upload_via_page(page, tarball_v1) == (
f"Uploaded {SOURCE_NAME} — press Sync sources to import it."
# Upload: the ready-for-sync line (the phase-154 completion
# stamp), and still nothing indexed.
assert _ready_for_sync_line(SOURCE_NAME).fullmatch(
_upload_via_page(page, tarball_v1)
)
assert _docs(page, app_url) == []
expect(page.locator("#git-sources-tbody tr", has_text=SOURCE_NAME)).to_have_count(1)
@@ -622,8 +636,8 @@ def test_reupload_replaces_without_scan(
# Baseline: v1 through the page (202 → the ready-for-sync line,
# one row, no index).
assert _upload_via_page(page, tarball_v1) == (
f"Uploaded {SOURCE_NAME} — press Sync sources to import it."
assert _ready_for_sync_line(SOURCE_NAME).fullmatch(
_upload_via_page(page, tarball_v1)
)
expect(page.locator("#git-sources-tbody tr", has_text=SOURCE_NAME)).to_have_count(1)
folder = upload_dir / SOURCE_NAME
@@ -632,8 +646,8 @@ def test_reupload_replaces_without_scan(
# Re-upload v2 — SAME basename, different parent dir (the file
# input's selection is replaced wholesale).
assert _upload_via_page(page, tarball_v2) == (
f"Uploaded {SOURCE_NAME} — press Sync sources to import it."
assert _ready_for_sync_line(SOURCE_NAME).fullmatch(
_upload_via_page(page, tarball_v2)
)
# No duplicate: exactly ONE row for that source (and one row