test(admin): assert global + tenant-b views in session-timeline scope test (follow-up to #231)#232
Merged
Merged
Conversation
… 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.
1643093 to
5239ec3
Compare
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.
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:tenant_id):episode_count == 3, and the tenant-a episode'sciting_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).episode_count == 2, and both tenant-b episodes showciting_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
ruffclean; the test passes against a freshly-migrated Postgres.