phase: 105_hidden_folders_toggle
All completion criteria verified. Everything is green. **Phase 105 final verification pass — all criteria verified** - Verified the full implementation in the working tree: `git_sources.include_hidden` column + alembic `0019` (dev DB at head, column present), `iter_importable_files`/`import_sources` flag support with `str(root)`-keyed map used by both walk and progress pre-walk, `GitSourcePatchIn` rename with optional fields, sync/CLI pipeline wiring (OR-collision), and the per-row "Hidden" checkbox + tag + error line on the Sources page - Unit + integration: `uv run pytest` → exit 0 (2148 tests collected, all pass; this sandbox occasionally swallows pytest's final status line — exit codes verified) - Coverage: `uv run pytest --cov=app --cov-report=term-missing` → **TOTAL 99%** (3879 stmts, 15 miss) — >90% gate ✓ - Dedicated E2E: `uv run pytest tests/e2e/test_hidden_folders_toggle.py -v --no-cov` → **6 passed in 23.20s** (DB up, in isolation) - Regression E2E in isolation: `test_source_ignore_paths` 6 passed, `test_git_sources_admin` 6 passed, `test_local_directory_sources` 3 passed, `test_sync_button` 3 passed, `test_smoke` 3 passed - Lint/types: `uv run ruff check .` + `uv run pyright` → clean (0 errors/warnings) **Completion criteria:** (1) checkbox persists via PATCH 200 → "hidden on" tag + GET round-trips `include_hidden: true`; failure path reverts box + `role="alert"` canned message ✓; (2) flag OFF byte-identical (only `visible.md` indexed), ON indexes `.hidden/note.md` into the KB catalog, `EXCLUDED_DIRS` excluded both states ✓; (3) A2: flag OFF → `detail.pruned==1`, doc gone from catalog ✓; (4) PATCH bool-only/list-only/both/neither no-op, phase-89 fixed 422s unchanged, 404, anonymous 403 (incl. bool-only body) ✓; (5) env-fallback rows render no checkbox, WCAG-clean (aria-label, keyboard focus, visible label, text tag) ✓; (6) full gate green ✓; (7) commit left to the harness per instructions (no `git add`/`commit` run; phase files untouched). **Deviations:** none — no defects found; no code changes were needed on this pass. **Next pending phase:** `.agents/phases/todo/98_sync_summary_visibility`.
This commit is contained in:
@@ -134,6 +134,42 @@ def test_git_source_python_default_empty_list() -> None:
|
||||
assert col.default.arg(None) == [], "the default must resolve to []"
|
||||
|
||||
|
||||
def test_git_sources_include_hidden_column_contract() -> None:
|
||||
"""Phase 105: every source row carries its hidden-folders flag —
|
||||
BOOLEAN, NOT NULL, server default ``false`` (a pre-phase-105 row
|
||||
reads ``False``, so every existing source imports byte-identically
|
||||
until the owner flips it — A4)."""
|
||||
sources = Base.metadata.tables["git_sources"]
|
||||
assert "include_hidden" in sources.c, (
|
||||
"git_sources must have the include_hidden column (phase 105)"
|
||||
)
|
||||
col = sources.c["include_hidden"]
|
||||
assert col.nullable is False, "git_sources.include_hidden must be NOT NULL"
|
||||
sd = col.server_default
|
||||
assert isinstance(sd, DefaultClause), "include_hidden needs a server default"
|
||||
assert isinstance(sd.arg, TextClause), (
|
||||
"the server default must be the literal SQL text false"
|
||||
)
|
||||
assert sd.arg.text == "false", "include_hidden server default must be false"
|
||||
|
||||
|
||||
def test_git_source_python_default_include_hidden_false() -> None:
|
||||
"""A freshly constructed row (no DB) resolves the flag to ``False``
|
||||
via the Python-side default (``default=False``) — the ORM INSERT-time
|
||||
default, so an ORM insert that omits the column inserts ``false``
|
||||
rather than NULL (the server default ``false`` independently covers
|
||||
non-ORM inserts — A4)."""
|
||||
from app.models import GitSource
|
||||
|
||||
row = GitSource(url="https://example.com/r.git", kind="git")
|
||||
col = row.__table__.c["include_hidden"]
|
||||
assert col.default is not None, (
|
||||
"include_hidden needs a Python-side (INSERT-time) default"
|
||||
)
|
||||
# A scalar default: the arg IS the value (not a callable).
|
||||
assert col.default.arg is False, "the default must resolve to False"
|
||||
|
||||
|
||||
def test_doc_drafts_column_contract() -> None:
|
||||
"""Phase 59: the editable triple (title/path/body) + status +
|
||||
timestamps are NOT NULL; ``branch`` / ``commit_sha`` are NULL
|
||||
|
||||
Reference in New Issue
Block a user