Skip to content

chore(tenancy): shared TenantRouter module + gitignore warehouse split (E3)#148

Merged
brownjuly2003-code merged 1 commit into
mainfrom
chore/e3-tenancy-hygiene
Jul 4, 2026
Merged

chore(tenancy): shared TenantRouter module + gitignore warehouse split (E3)#148
brownjuly2003-code merged 1 commit into
mainfrom
chore/e3-tenancy-hygiene

Conversation

@brownjuly2003-code

Copy link
Copy Markdown
Owner

Summary

Two hygiene items from audit_fable_02_07_26.md §3.6 (plan_endgame E3):

  • TenantRoutersrc/tenancy.py: moved out of src/ingestion/tenant_router.py. Tenant routing is a cross-cutting concern used by both serving and ingestion; importing it from src.ingestion made the serving layer's dependency on the ingestion package spurious. Updated all 6 importers (3 src, 2 tests, plus docs/security-audit.md / docs/helm-deployment.md, which named the old path). docs/perf/entity-profile-2026-04-24.md is a dated profiling snapshot and intentionally left referencing the old path.
  • .gitignore warehouse split: the blanket /warehouse/agentflow/ rule mixed genuine Iceberg runtime state with tracked DV2 SQL/Python source (191 files, historically 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 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_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 / test_assert_scope_preserved_fails_closed_on_dropped_qualifier in tests/unit/test_clickhouse_backend.py. Verified via git blame and 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): clean
  • mypy strict on touched files: clean
  • Full unit suite: 1620 passed
  • Targeted TenantRouter/tenant-isolation/ClickHouse-transpile tests: 65 passed
  • Full integration suite: 238 passed / 52 skipped / 1 deselected / 4 errors
    • The 4 errors are docker.errors.DockerException (no Docker daemon on this Windows host) — pre-existing environment limitation, unrelated to this diff (Kafka/Iceberg testcontainer fixtures).
    • 1 initial failure (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_dashboard deselected: confirmed via git stash that it hangs identically on clean main before this diff (pre-existing Windows httpx/anyio threading issue, unrelated file).

🤖 Generated with Claude Code

…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>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

DORA Metrics

  • Window: last 30 days
  • Branch: main
  • Deployment frequency: 124 total / 28.93 per week
  • Lead time for changes: avg 0.42h / median 0.0h
  • Change failure rate: 75.81% (94/124)
  • MTTR: 0.29h across 2 incident(s)

@brownjuly2003-code brownjuly2003-code merged commit e105d02 into main Jul 4, 2026
23 checks passed
@brownjuly2003-code brownjuly2003-code deleted the chore/e3-tenancy-hygiene branch July 4, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants