chore(tenancy): shared TenantRouter module + gitignore warehouse split (E3)#148
Merged
Merged
Conversation
…t (E3) Two hygiene items from audit_fable_02_07_26.md §3.6: - TenantRouter moved from src/ingestion/tenant_router.py to src/tenancy.py. Tenant routing is a cross-cutting concern consumed by both serving and ingestion; importing it from src.ingestion made the serving layer's dependency on the ingestion package spurious. Updates all 6 importers (src + tests) and the two docs that named the old path. - .gitignore's blanket /warehouse/agentflow/ rule mixed genuine Iceberg runtime state with tracked DV2 SQL/Python source (previously force-added via `git add -f`). Narrowed to the two directories that are actually generated: orders/ (the Iceberg lake) and dv2/reference/build/ (generated parquet/manifest). New files under dv2/ no longer need -f. The other E3 item — a post-transpilation assert that tenant-scope survives the DuckDB->ClickHouse transpile (§3.3) — turned out to already be done: ClickHouseBackend._assert_scope_preserved was added in b09d42b (2026-07-02, the ADR 0006 Phase 1 coherence commit) and is covered by test_translate_preserves_tenant_schema_qualification and test_assert_scope_preserved_fails_closed_on_dropped_qualifier in tests/unit/test_clickhouse_backend.py. No code change needed there. Verified: full unit 1620 passed; ruff check/format (src/tests/scripts, CI scope) clean; mypy strict clean on touched files; full integration 238 passed/52 skipped/1 deselected/4 errors — the 4 errors are docker.errors. DockerException (no Docker daemon on this Windows host, pre-existing, unrelated to this diff); the 1 initial failure (test_batch_executes_items_concurrently_and_reports_wall_time, a timing assert) reproduced clean in isolation, so it was host-load flake from running this diff's other test passes in parallel; test_admin_ui_renders_ dashboard was deselected because it hangs identically on a clean-main stash (pre-existing Windows httpx/anyio threading issue, not in this diff's touched files). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
DORA Metrics
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two hygiene items from
audit_fable_02_07_26.md§3.6 (plan_endgame E3):TenantRouter→src/tenancy.py: moved out ofsrc/ingestion/tenant_router.py. Tenant routing is a cross-cutting concern used by both serving and ingestion; importing it fromsrc.ingestionmade the serving layer's dependency on the ingestion package spurious. Updated all 6 importers (3 src, 2 tests, plusdocs/security-audit.md/docs/helm-deployment.md, which named the old path).docs/perf/entity-profile-2026-04-24.mdis a dated profiling snapshot and intentionally left referencing the old path..gitignorewarehouse split: the blanket/warehouse/agentflow/rule mixed genuine Iceberg runtime state with tracked DV2 SQL/Python source (191 files, historically force-added viagit add -f). Narrowed to the two directories that are actually generated:orders/(the Iceberg lake) anddv2/reference/build/(generated parquet/manifest). New files underdv2/no longer need-f.The third E3 item — a post-transpilation assert that tenant-scope survives the DuckDB→ClickHouse transpile (§3.3) — turned out to already be done.
ClickHouseBackend._assert_scope_preservedwas added inb09d42b(2026-07-02, the ADR 0006 Phase 1 coherence commit) and is covered bytest_translate_preserves_tenant_schema_qualification/test_assert_scope_preserved_fails_closed_on_dropped_qualifierintests/unit/test_clickhouse_backend.py. Verified viagit blameand by reading both the implementation and the tests — no code change needed there.Test plan
ruff check src/ tests/ scripts/+ruff format --check(CI scope): cleanmypystrict on touched files: cleanTenantRouter/tenant-isolation/ClickHouse-transpile tests: 65 passeddocker.errors.DockerException(no Docker daemon on this Windows host) — pre-existing environment limitation, unrelated to this diff (Kafka/Iceberg testcontainer fixtures).test_batch_executes_items_concurrently_and_reports_wall_time, a wall-clock timing assert) reproduced passing in isolation — host-load flake from running this diff's other verification passes in parallel, not a regression.test_admin_ui_renders_dashboarddeselected: confirmed viagit stashthat it hangs identically on cleanmainbefore this diff (pre-existing Windows httpx/anyio threading issue, unrelated file).🤖 Generated with Claude Code