Skip to content

test(admin): assert global + tenant-b views in session-timeline scope test (follow-up to #231)#232

Merged
smaramwbc merged 1 commit into
mainfrom
test/admin-timeline-tenant-coverage
Jun 7, 2026
Merged

test(admin): assert global + tenant-b views in session-timeline scope test (follow-up to #231)#232
smaramwbc merged 1 commit into
mainfrom
test/admin-timeline-tenant-coverage

Conversation

@smaramwbc

Copy link
Copy Markdown
Owner

What

Follow-up to #231 (and its review nit). That PR's regression test asserted only the tenant-a filtered view of /admin/subjects/{id}/sessions/{id}/timeline. This adds the two missing views so the test fully pins the operator-global vs tenant-scoped contract:

  • Operator-global view (no tenant_id): episode_count == 3, and the tenant-a episode's citing_memory_count == 2 (cited by both tenants' memories). This is the key addition — it guards against a future over-scoping regression where a tenant filter leaks into the operator path and narrows the global view (the behavior fix(admin): scope session timeline metrics by tenant #231 is careful to preserve).
  • Tenant-b filtered view: episode_count == 2, and both tenant-b episodes show citing_memory_count == 0 (neither is cited by a tenant-b memory).

Mirrors the stronger both-tenants pattern in #229's sibling test. Test-only — no source change.

Verification

ruff clean; the test passes against a freshly-migrated Postgres.

… test

Follow-up to #231. The session-timeline tenant-scope test asserted only the
tenant-a filtered view. Add the operator-global assertion (episode_count==3
and the tenant-a episode cited by both tenants' memories == 2) and the
tenant-b filtered view (episode_count==2, citing counts == 0). The global
assertion guards against a future over-scoping regression where a tenant
filter leaks into the operator path — the behavior #231 preserves. Mirrors
the stronger both-tenants pattern in #229's test. Test-only.
@smaramwbc smaramwbc force-pushed the test/admin-timeline-tenant-coverage branch from 1643093 to 5239ec3 Compare June 7, 2026 09:40
@smaramwbc smaramwbc merged commit c29f36d into main Jun 7, 2026
5 checks passed
@smaramwbc smaramwbc deleted the test/admin-timeline-tenant-coverage branch June 7, 2026 09:43
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.

1 participant