2 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
d5c6d6ba54 refactor: reuse single LLM gate in turn runtime; drop unwired guard
The turn path (chat/partners/mastery via turn_runtime) already enforces
LLM-grant access at its single enforcement point and surfaces a clear
terminal "no model assigned" rejection — so require_llm_access was never
wired to any endpoint and only duplicated that logic. Drop it (and its
guard-only tests) and have turn_runtime reuse has_capability_access, giving
the gate one source of truth shared with the frontend lock.

Frontend fixes kept from the original PR plus two corrections:
- capabilityForPath now matches on a path-segment boundary, so a sibling
  route like /booket can't be swallowed by the /book prefix (+ regression).
- fix the misleading Knowledge sidebar comment — Knowledge needs no
  per-user grant and is never gated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 14:56:14 +08:00
Ilia Avdeev
a40a525a1d test: cover capability gate helper and guard 2026-06-13 21:26:22 +02:00