feat: unify installation model catalog
This commit is contained in:
@@ -106,15 +106,18 @@ a remote user's partial list. The isolated deployment exercise is
|
||||
`./scripts/verify-workspace-install-docs.sh --profile local` or `--profile server`.
|
||||
|
||||
<!-- workspace-descriptor-contract:start -->
|
||||
Schema v3 is the only accepted workspace descriptor. Schema v1 and v2 workspace descriptors are
|
||||
rejected before activation. Candidate snapshot validation therefore makes activation or a pull fail
|
||||
atomically while the prior valid snapshot remains active. There is no in-product migrator or
|
||||
automatic conversion. A repository must already contain reviewed v3 descriptors. One workspace
|
||||
owns one Qdrant collection;
|
||||
Schema v4 is the only accepted workspace descriptor. Schema v1, v2, and v3 workspace descriptors
|
||||
are rejected before activation. Candidate snapshot validation therefore makes activation or a pull
|
||||
fail atomically while the prior valid snapshot remains active. One workspace owns one Qdrant collection;
|
||||
schema, Evidence, and Memory records share that collection and stay separated by indexed payload
|
||||
`kind`.
|
||||
<!-- workspace-descriptor-contract:end -->
|
||||
|
||||
<!-- non-workspace-migration:start -->
|
||||
Convert a v3 descriptor before publication by setting `workspace.schema_version` to `4` and
|
||||
removing `llm_policy` and `semantic_index`; no database or Evidence field changes.
|
||||
<!-- non-workspace-migration:end -->
|
||||
|
||||
For NL→SQL runtime sessions, connector `ssh_tunnel` bindings remain diagnostic-only: their bounded
|
||||
probe cleans up the loopback forward and returns `workspace_not_activatable`; session creation is
|
||||
rejected before persistence. Database management is a separate boundary and supports a strict
|
||||
@@ -176,10 +179,10 @@ secret files, upstream-auth checks, and a fail-closed `503` assertion for its de
|
||||
unavailable disposable session endpoint. No real provider, database credential, or repository
|
||||
secret is required.
|
||||
|
||||
For a clean server bind, `scripts/prepare-server-pi-state.sh` creates the hidden regular
|
||||
`agent/auth.json`, `agent/models.json`, and `agent/settings.json` mount targets atomically before
|
||||
Compose. The server smoke starts from an empty Pi-state root and applies this same preflight; the
|
||||
real protected/tracked sources remain separate read-only mounts. Deterministic fixture tests render
|
||||
For a clean server bind, `scripts/prepare-server-pi-state.sh` creates the hidden regular Pi agent
|
||||
mount targets atomically before Compose. The auth target receives the protected credential bind;
|
||||
the model and settings targets receive generated read-only projections. The server smoke starts
|
||||
from an empty Pi-state root and applies this same preflight. Deterministic fixture tests render
|
||||
both profiles, verify that bindings stay on `core`, check mount readability, and run the production
|
||||
workspace resolver. Wrong-service, wrong-value, and broken-secret-mount mutations must fail.
|
||||
|
||||
@@ -189,7 +192,7 @@ an independent 32-minute outer timeout and does not retry a failed command.
|
||||
Current release status (2026-08-05): clean-root render/setup and the production runtime-binding
|
||||
resolver contracts are green. The server fixture supplies all four private trusted claims,
|
||||
including exact non-admin value `0`, and a focused test proves nginx normalization produces the
|
||||
accepted non-admin backend principal. Canonical schema-v3 registry descriptors now pass through
|
||||
accepted non-admin backend principal. Canonical schema-v4 registry descriptors now pass through
|
||||
one backend-owned, secret-safe runtime handoff for inventory and session execution; canonical
|
||||
identity and durable session/artifact/index roots are retained. The fresh update-only smoke passed
|
||||
bad-candidate mutation, automatic `rolled_back` compensation, exact prior-image restoration,
|
||||
@@ -295,14 +298,12 @@ Copy `deploy/secrets/thothii.secrets.example` to a protected host file, include
|
||||
keys, and set its absolute path as `THT_SECRETS_FILE` in the operator env. Keep Pi's native
|
||||
provider auth in the separate protected file named by `PI_AUTH_FILE`.
|
||||
|
||||
Description Generation is configured independently in the protected installation descriptor under
|
||||
`metadataGeneration`. Set `THT_INSTALLATION_CONFIG_SOURCE` to that exact host file; Compose mounts
|
||||
it read-only into `core` and supplies the fixed runtime `THT_INSTALLATION_CONFIG_FILE` path. Each
|
||||
keyed model stores only an audited `apiKeyEnv` reference. The referenced value stays in the secret
|
||||
bundle; a model may omit `apiKeyEnv` only when it declares an explicit endpoint that accepts
|
||||
unauthenticated requests. The browser receives only model IDs, labels, and the configured default.
|
||||
Configuration changes take effect after restart and do not use Pi settings or workspace
|
||||
`llm_policy`.
|
||||
Interactive sessions, Description Generation, and embedding share the protected installation
|
||||
descriptor's `modelCatalog`. Set `THT_INSTALLATION_CONFIG_SOURCE` to that exact host file; `tht`
|
||||
validates it and generates the runtime catalog, Pi adapters, and Compose override before startup.
|
||||
Each authenticated provider stores only an audited `apiKeyEnv` reference; the referenced value stays
|
||||
in the secret bundle. A provider may use `authentication.mode: none` only with an explicit keyless
|
||||
endpoint. The browser receives only eligible model IDs, labels, and the catalog default.
|
||||
|
||||
Before enabling Description Generation, approve the selected model provider for bounded source-data
|
||||
disclosure. Every catalog column has a **Sensitive** flag that defaults to `false`. Administrators can
|
||||
@@ -333,22 +334,11 @@ the host/secret-manager materialization and add a reviewed Compose override that
|
||||
does not create that mount. The frontend remains on loopback; the authenticated host proxy is the
|
||||
only public listener.
|
||||
|
||||
Set the selected model provider in application settings (or `PI_PROVIDER`). For each Pi spawn the
|
||||
backend validates and reads `THT_MODEL_API_KEY` from the bundle, then exposes its value only as the provider's
|
||||
recognized child variable (for example `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, or
|
||||
`ZAI_API_KEY`). Neither the generic file path nor deprecated `PI_PROVIDER_API_KEY` is inherited by
|
||||
Pi. Local providers such as Ollama require no model key.
|
||||
|
||||
`THT_MODEL_API_KEY` supports Pi providers whose authentication is exactly one key:
|
||||
`ant-ling`, `anthropic`, `cerebras`, `deepseek`, `fireworks`, `github-copilot`, `google`
|
||||
(including the `gemini` alias), `google-vertex` when using its API-key mode, `groq`,
|
||||
`huggingface`, `kimi-coding`, `minimax`, `minimax-cn`, `mistral`, `moonshotai`,
|
||||
`moonshotai-cn`, `nvidia`, `openai`, `opencode`, `opencode-go`, `openrouter`, `together`,
|
||||
`vercel-ai-gateway`, `xai`, the four `xiaomi*` providers, `zai`, and `zai-coding-cn`.
|
||||
Compound providers are deliberately unsupported: `amazon-bedrock`, `azure-openai-responses`,
|
||||
`cloudflare-workers-ai`, and `cloudflare-ai-gateway` require multiple credential/configuration
|
||||
values. Selecting one fails before Pi starts; ambient AWS, Azure, and Cloudflare credentials are
|
||||
still scrubbed. Supporting them requires a future dedicated provider-specific configuration.
|
||||
For each Pi spawn, the backend resolves the selected canonical provider/model in the runtime catalog,
|
||||
reads exactly that provider's declared `apiKeyEnv` value from the bundle, and exposes only that key
|
||||
to the child. Ambient provider credentials and secret-bundle paths are scrubbed. Providers needing a
|
||||
compound credential bundle remain unsupported until the catalog gains an explicit generic contract
|
||||
for them.
|
||||
|
||||
## User-owned session server cutover
|
||||
|
||||
|
||||
Reference in New Issue
Block a user