Repository navigation
memory.inspect's integration test expects a writer token to be refused the extraction policy with auth off - #209
Merged
Merged
Conversation
…d the extraction policy with auth off The server checks a bearer token it is sent even with auth off, so the writer token the test inspects with never reads the operator extraction policy. The test asserted the anonymous probe's answer against the writer's response. It now asserts the writer's refusal in every auth mode, and the empty policy on the anonymous answer when auth is off. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… the policy Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ed or refused for a missing token Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…the policy check fails Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
1 task done
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.
Related: #186
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Not required.
Why
tests/integration/test_memory_inspect.py::test_inspect_splits_own_from_others_and_changes_nothingfails on main's auth-off integration job withassert None == ''.Failing case: the test inspects with a writer token. With auth off, the anonymous probe gets 200, and the test then expects the writer's
settings.extraction_policyto be"".Pattern: the HTTP transport checks any bearer token it is sent, even with auth off (
_extract_auth).row_in_scope(org, ns, Role.ORG_ADMIN)therefore refuses the writer, and memory.inspect answersextraction_policy: nullwith "only an org admin reads the operator extraction policy". Only the tokenless probe has no auth context, and it reads"". The test checked the probe's answer against the writer's response. A local run against an auth-off server showed exactly this: the writer gotNonewith that reason, and the anonymous call got''.Fix: the code is correct, so the test is the thing that changes. It asserts that the writer is refused the policy in every auth mode. When auth is off, it also asserts that the anonymous answer's policy is
"". No assertion is loosened.Scope and risk
Test only. No server code changes.
Compatibility, rollout and rollback
Tests
LOOM_AUTH_REQUIRED=false(CI's integration posture),pytest tests/integration/test_memory_inspect.pyfailed before the change withassert None == ''at the policy assertion, and passes after it (1 passed, 1 skipped: the second test skips without auth enforced).make format lintpass.Other failures on main that this PR does not fix and that may show red on its head:
tests/unit/test_document_extraction.py::test_the_wide_integer_check_is_linear_in_a_deep_table_of_long_keys(wall-clock bound).tests/integration/same_key/test_retirement_ch.py(two tests,alias_merges() got an unexpected keyword argument 'cap'), fixed by The same-key retirement tests' conflict-check double accepts the keyword the bulk write now passes #179.tests/integration/test_search_statements_pass_analyzer.py::test_patch_part_probe_and_reemit_reads_pass_the_analyzer(assert 1 == 0).AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. It reproduced the failure on a local server and checked which authz branch the server took.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.main; no merged migration is edited (none).frontend/changed (unchanged).docs/describe the system as it now is (unchanged).git commit -s).🤖 Generated with Claude Code