feat(workbench): live LiteLLM gateway adapter + explicit project grants
CI (SIAX Cloud) / integration (push) Skipped
CI (SIAX Cloud) / sonar (push) Skipped
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 6s
masterplan-lock / check (push) Successful in 6s
CI (SIAX Cloud) / security (push) Successful in 14s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 19s
CI (SIAX Cloud) / security (pull_request) Successful in 21s
Security Scan (SIAX Cloud) / security (push) Successful in 25s
CI (SIAX Cloud) / integration (pull_request) Successful in 29s
CI (SIAX Cloud) / quality (pull_request) Successful in 51s
CI (SIAX Cloud) / quality (push) Successful in 1m29s

- createInf0Gateway prefers the live OpenAI-compatible LiteLLM gateway and
  falls back to the native INF0 surface; admission stays local and fail-closed.
- Project authorization: OpenFGA when configured, otherwise a validated
  server-owned OPT_PROJECT_GRANTS list (deny by default).
- Tests for the gateway adapter, the factory and grants.
This commit is contained in:
2026-11-02 14:50:50 +01:00
parent b3239487b7
commit e3c4bc28c3
8 changed files with 525 additions and 12 deletions
+11 -1
View File
@@ -22,7 +22,9 @@ UI: `/portal/dokument` (upload, structure, review, download) and `/portal/kredit
1. **Tenant and actor come only from middleware's verified headers.** A customer
route never trusts `tenant_id`/`actor_id` from the body.
2. **Project access is checked by OpenFGA** (`@siax/access`), the same primitive
DOC0 uses. Unconfigured or unavailable means *denied*, never allowed.
DOC0 uses. Until the central relationship store is deployed, an explicit
server-owned grant list (`OPT_PROJECT_GRANTS`) can be used instead.
Unconfigured or unavailable means *denied*, never allowed.
3. **The model never sees unverified text.** `Doc0SourceClient` verifies
version, tenant, checksum, segment hashes and that the index was not
truncated before anything is sent to INF0.
@@ -45,6 +47,14 @@ UI: `/portal/dokument` (upload, structure, review, download) and `/portal/kredit
modules have no Next.js imports and can be lifted into a published package
unchanged.
## Which AI path is used
`createInf0Gateway()` prefers the **live LiteLLM gateway**
(`INF0_GATEWAY_LITELLM_KEY`, `https://ai-gateway.siax.io/v1`, OpenAI-compatible)
and falls back to the native `INF0_URL` surface. Admission — tenant/project
scope, model allow-list, data class, external-transfer policy and token limits —
runs locally in both paths before the request leaves the process.
## What is still deliberately not claimed
- The output is `mechanically_validated`, not proven complete or semantically