feat(ingestion): add Phase 1 database and application foundation

Add the scoped PostgreSQL/pgvector schema, independent ingestion settings and ports, embedding profile checks, and trusted administrator bootstrap.

Include repository contracts and guidance, organized provider-free and PostgreSQL tests, deployment setup, and byte-preserving migration attributes.

Validation: 163 tests passed; all 48 PostgreSQL cases passed with pgvector Python 0.5.0 and 0.3.6. No production schema or historical metadata was changed.
This commit is contained in:
amirhosein mazaheri
2026-10-05 16:38:28 +03:30
parent cb54a35c90
commit baf58da562
50 changed files with 4628 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
"""PostgreSQL-only fixtures and marker; ordinary tests need no database."""
import os
from pathlib import Path
import pytest
from tests.support.postgres import disposable_database, validated_test_url
@pytest.fixture
def test_database_url(request):
url = os.environ.get("TEST_DATABASE_URL")
if not url:
message = "TEST_DATABASE_URL is required for PostgreSQL acceptance"
if request.config.getoption("--require-postgres"):
pytest.fail(message)
pytest.skip(message + "; skipped tests are not acceptance evidence")
try:
return validated_test_url(url)
except ValueError as exc:
pytest.fail(str(exc))
@pytest.fixture
def migrated_db(settings, test_database_url):
with disposable_database(test_database_url, settings) as database:
yield database
def pytest_collection_modifyitems(items):
for item in items:
if Path(__file__).parent in item.path.parents:
item.add_marker(pytest.mark.postgres)