fix(api): isolate ticket response build locks - #43
Conversation
There was a problem hiding this comment.
Deterministic Validator approval for exact head 7f2abfd396ce4d63d92f518cd3ef8e0831779606.
Ticket: PLF-10675
Correlation ID: planfile-striped-response-locks
Model: zai/glm-5.3
Reviewed diff chunks: 1
Advisory LLM verdict: APPROVE
Advisory summary: Reviewed all 1 diff chunk(s). Replaces the single ticket-list response build lock with 32 striped RLocks keyed by hash of the query tuple, so unrelated queue/status views build concurrently while identical cache misses still coalesce. Cache dictionary mutation and eviction remain serialized under the short _TICKET_LIST_RESPONSE_CACHE_LOCK. Two concurrency regression tests cover both the striping and coalescing behavior.
Advisory findings: none
The LLM output above is advisory and was not used as the approval trust root.
Merge will be attempted after this approval when explicitly authorized.
Decision record (recomputable)
DECISION D-675-5074
TICKET PLF-10675
HEAD_SHA 7f2abfd396ce4d63d92f518cd3ef8e0831779606
CORRELATION_ID planfile-striped-response-locks
ACTOR agent:ifuri-validator-agent[bot]
APPLIED_RULE P-CORE-015
INPUT author_login = "tom-sapletta-com"
INPUT observed_checks = ["notify=PASS","ci-loop=PASS"]
INPUT required_checks = ["ci-loop","notify"]
INPUT required_checks_source = "protected registry (env/request)"
INPUT reviewer_login = "ifuri-validator-agent[bot]"
INPUT superseded_checks = []
VERDICT APPROVE AUTHORITY DETERMINISTIC
REJECTED REQUEST_CHANGES BECAUSE NO_UNSAFE_CHANGE_REASON_FOUND
ADVISORY llm_verdict = "APPROVE" MODEL "zai/glm-5.3"
ASSERT VERDICT_AUTHORITY != "ADVISORY"
Ticket: PLF-10675
Correlation ID: planfile-striped-response-locks
Outcome
Replaces the single long-held ticket response build lock with 32 bounded stripes while retaining a short state lock around the shared cache dictionaries. Unrelated queue and status views can now render concurrently; identical cache misses still coalesce into one build.
Safety
Verification
pytest -q: 399 passed, 6 skippedruff check planfile/api/server.py tests/test_sqlite_ticket_index.py