"""git_sources.include_hidden: per-source hidden-folders flag (phase 105) Revision ID: 0019 Revises: 0018 Create Date: 2026-09-12 Phase 105 (per-source hidden-folders toggle: dot-prefixed paths become indexable per input — the owner flips a "Hidden" checkbox next to the "Ignore paths" button on the Sources page): when the flag is ON, the importer walk (``app.rag.importer.iter_importable_files``) no longer skips dot-prefixed path components for that source — files inside hidden folders AND hidden files with an importable extension are indexed, embedded, and summarized exactly like visible files (A1). ``EXCLUDED_DIRS`` (``.venv``, ``node_modules``, ``.git``, …) stay excluded in BOTH states, and the extension filter always applies. The flag takes effect on the NEXT sync (no auto-sync — the ignore-list precedent, phase 89); a previously indexed hidden file is pruned on the next sync after the flag flips OFF (A2). One additive, fully reversible column (A13), no other schema change: * ``git_sources.include_hidden`` — BOOLEAN NOT NULL with server default ``false``: every pre-phase-105 row reads ``False`` — byte-identical import behavior until the owner flips it (A4). """ from __future__ import annotations import sqlalchemy as sa from alembic import op revision = "0019" down_revision = "0018" branch_labels = None depends_on = None def upgrade() -> None: op.add_column( "git_sources", sa.Column( "include_hidden", sa.Boolean(), server_default=sa.text("false"), nullable=False, ), ) def downgrade() -> None: # The column is the only 0019 artefact — dropping it leaves # 0018's schema byte-identical (A13, fully reversible). op.drop_column("git_sources", "include_hidden")