chore: bootstrap repository with governance docs

Initialize git, add Apache-2.0 LICENSE, .gitattributes (LF line
endings), AGENTS.md (entry points, stack, discovery order, baseline
checks), RUNBOOK.md (dev boot, prod deploy with overlay, ingestion,
failures, rollback, scaling notes), .env.prod.example with rotated
credential placeholders, and dev-only warnings on .env.example.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vadim Malanov
2026-05-13 16:41:50 +03:00
commit 7f72171572
157 changed files with 11298 additions and 0 deletions

74
scripts/smoke_test.py Normal file
View File

@@ -0,0 +1,74 @@
"""Smoke test - verify all infrastructure is reachable and indices are present.
Exits non-zero on first hard error.
"""
from __future__ import annotations
import sys
from sqlalchemy import text
from app.db.session import get_engine
from app.indexing.opensearch_client import ensure_index, get_opensearch
from app.indexing.qdrant_client import ensure_collection, get_qdrant
from app.logging_config import configure_logging, get_logger
from app.storage.minio_client import get_storage
configure_logging()
logger = get_logger(__name__)
def main() -> int:
failures: list[str] = []
# Postgres
try:
with get_engine().connect() as conn:
conn.execute(text("SELECT 1"))
print("[ok] postgres")
except Exception as exc: # noqa: BLE001
failures.append(f"postgres: {exc}")
print(f"[err] postgres: {exc}")
# MinIO
try:
s = get_storage()
s.ensure_buckets()
info = s.health()
if info.get("status") != "ok":
raise RuntimeError(info)
print("[ok] minio:", info.get("buckets"))
except Exception as exc: # noqa: BLE001
failures.append(f"minio: {exc}")
print(f"[err] minio: {exc}")
# OpenSearch
try:
ensure_index()
info = get_opensearch().cluster.health()
print("[ok] opensearch:", info.get("status"))
except Exception as exc: # noqa: BLE001
failures.append(f"opensearch: {exc}")
print(f"[err] opensearch: {exc}")
# Qdrant
try:
ensure_collection()
cols = [c.name for c in get_qdrant().get_collections().collections]
print("[ok] qdrant collections:", cols)
except Exception as exc: # noqa: BLE001
failures.append(f"qdrant: {exc}")
print(f"[err] qdrant: {exc}")
if failures:
print("\nSMOKE FAIL:")
for f in failures:
print(" -", f)
return 1
print("\nSMOKE OK")
return 0
if __name__ == "__main__":
sys.exit(main())