fix(members): enqueue the rules read/write audits inline, not via to_thread - #8844
Conversation
…thread #8741 (#8608) warmed the SEL singleton at startup and inverted the members AST guard: no log_api_access may hide inside an asyncio.to_thread lambda, because the first-touch initialization that hop used to offload never runs. #7235 then landed two to_thread-wrapped audits for the member rules GET and PUT, so main fails test_no_members_sel_audit_is_offloaded on every PR's merge ref (seen on #8816, Backend Tests (Windows) 3). Direct enqueue, guarded the way the deny-path audits in this file already are.
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Minimal cross-merge repair that restores the file's own established audit pattern, pinned by the existing AST guard; nothing to redesign. The two rules-audit sites now match the deny-path sites in the same file byte-for-pattern (direct enqueue, [DESIGN-REVIEWED] 7268629 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of All claims verified. The remaining First-Principles-Verdict: PASS Unwedges a red main by deleting two thread hops the startup warm made pointless; every line is either the fix or the file's established audit guard. What this change shipsIntent: get main green again after #8741's AST guard and #7235's rules handlers cross-merged — a FIX.
The change is pure subtraction plus the guard the file already uses everywhere else (grepped Watch
[FIRST-PRINCIPLES-REVIEWED] 7268629 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/dashboard/handlers/members.py:583 -- Failed SEL warm retries blocking initialization on the event loop Adjudication (Opus 4.8) — is blocking on each finding proportionate?The finding is anchored to Harm rung: MEDIUM-to-HIGH loop stall, but the anchor rule's [ADJUDICATION] 7268629 total=1 uphold=1 downgrade=0 False positive or not applicable? A repository writer can comment: |
Problem / Motivation
Main is red on
test/test_members_dm_thread.py::TestDenialAuditOffload::test_no_members_sel_audit_is_offloaded(seen on #8816's merge ref, Backend Tests (Windows) 3). Two PRs crossed: #8741 (#8608) warmed the SEL singleton at startup and inverted the members AST guard so that nolog_api_accessmay sit inside anasyncio.to_threadlambda; #7235 then landed the member rules GET/PUT handlers with exactly that wrapper around their success audits (handlers/members.pylines 581 and 716).What changed
The two rules audits become direct enqueues, guarded the way the deny-path audits in the same file already are (
try/except Exception→ debug log; an audit must never change the outcome). Comments updated to name the startup warm (#8608) instead of the first-touch initialization that no longer happens here. No behaviour change for the request: the audit still records the same operation/outcome/resources.Tests
Per the owner's standing instruction no suite was run locally; CI verifies.
black --checkandflake8clean on the file. Unblocker for #8816 and any PR whose merge ref includes both #8741 and #7235.Related Issues
Cross-merge of #8741 and #7235. Unblocks #8816.
Checklist