mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
7a06f5e8bc
* refactor(session): make ModelLane the provider boundary (#979) ## Summary This closes the model-lane ownership gap left by #832: `ChatSession` no longer stores raw provider/client handles. `ResolvedModelBinding` now carries the provider, client, model, capabilities, registry generation, and backend-auth configuration as one coherent snapshot. - Atomically rebind existing sessions after model-registry changes while pinning each in-flight send, fallback, judge, output guard, task agent, title, compaction, perception, and voice operation to its initiating principal and binding. - Fence UI publication, canonical trajectory folds, durable writes, streams, retries, child scopes, and judge work by generation. Stop can hand off to a successor without accepting late state; cancelled tools retain typed effect receipts, and concurrent approval batches resolve by exact cycle or call. - Make create, fork, open, close, and delete race-safe with hidden `creating` reservations, incarnation-aware state tails, and an ACL-rechecked transaction that clones checkpoint-bounded history, configuration, project/persona state, and attachment references. - Extend REST/OpenAPI and Python/TypeScript SDK contracts for create/fork inputs, routed-create metadata, live-workstream probes, targeted approvals, and structured cancellation results. - Update architecture, storage, authentication, judge, channel, console, API, and SDK documentation, including regenerated architecture diagrams and OpenAPI artifacts. ## Validation - SQLite suite: 11,188 passed, 9 skipped, 10 deselected - PostgreSQL suite: 11,195 passed, 2 skipped, 10 deselected - Live backend: 3 passed - SSE recovery: 6 passed; browser recovery harness passed all scenarios - Ruff: clean; 595 files correctly formatted - mypy: 243 source files clean - TypeScript: typecheck/build and 35 tests passed - OpenAPI artifacts fresh; all 14 changed diagrams reproduce byte-for-byte - `git diff --check` and Git LFS integrity clean Closes #979. * fix(deps): update nanoid for GHSA-2v37-7h3g-55p8 Refresh the transitive lock entry admitted by PostCSS so the TypeScript security gate no longer resolves the vulnerable custom-generator implementation. Validation: - npm ci - npm audit --audit-level=moderate: 0 vulnerabilities - TypeScript typecheck and build - TypeScript tests: 35 passed * fix(test): assert canonical model registry URLs Replace prefix checks with exact canonical base URL assertions so the tests do not model incomplete URL validation. Validation: tests/test_model_registry.py (185 passed); Ruff check/format; mypy.
97 lines
2.6 KiB
Plaintext
97 lines
2.6 KiB
Plaintext
@startuml
|
|
!theme plain
|
|
title Turnstone — Docker Compose Deployment
|
|
|
|
skinparam node {
|
|
BackgroundColor #F5F5F5
|
|
}
|
|
|
|
cloud "LLM Provider" as llm {
|
|
component [vLLM / OpenAI API\nport 8000] as llm_api
|
|
}
|
|
|
|
node "Docker Host" as host {
|
|
|
|
frame "turnstone-net (bridge network)" as net {
|
|
|
|
node "server" <<turnstone image>> as server_node {
|
|
component [turnstone-server\nport 8080] as server
|
|
note bottom of server
|
|
Command: turnstone-server
|
|
--host 0.0.0.0
|
|
--port 8080
|
|
Volume: turnstone-data
|
|
(/data)
|
|
end note
|
|
}
|
|
|
|
node "console" <<turnstone image>> as console_node {
|
|
component [turnstone-console\nport 8090] as console
|
|
note bottom of console
|
|
Command: turnstone-console
|
|
--port 8090
|
|
Depends: server
|
|
FNV-1a rendezvous router for
|
|
multi-node clusters
|
|
end note
|
|
}
|
|
|
|
node "postgres (profile: production)" <<pgautoupgrade>> as pg_node {
|
|
component [PostgreSQL\nport 5432] as postgres
|
|
note bottom of postgres
|
|
Healthcheck: pg_isready
|
|
Volume: postgres-data
|
|
Required for cluster
|
|
and production profiles
|
|
end note
|
|
}
|
|
|
|
node "pgbouncer (optional)" <<bitnami/pgbouncer>> as pgb_node {
|
|
component [PgBouncer\nport 6432] as pgbouncer
|
|
note bottom of pgbouncer
|
|
pool_mode: transaction
|
|
Recommended for clusters
|
|
> 50 nodes
|
|
See docs/pgbouncer.md
|
|
end note
|
|
}
|
|
}
|
|
}
|
|
|
|
actor "Browser\nUser" as browser
|
|
actor "SDK /\nAPI Client" as apiclient
|
|
|
|
' External connections
|
|
browser --> server : HTTP + SSE\nport 8080
|
|
browser --> console : HTTP + SSE\nport 8090
|
|
apiclient --> server : HTTP + SSE\nport 8080
|
|
|
|
' Internal connections
|
|
server --> llm_api : OpenAI API\n(HTTPS/HTTP)
|
|
|
|
console --> server : HTTP proxy\n(FNV-1a rendezvous placement,\nproxy /node/{id}/*)
|
|
|
|
' Database connections (production/cluster profiles)
|
|
server ..> pgbouncer : PostgreSQL\n(pool_size=2)
|
|
console ..> pgbouncer : PostgreSQL\n(auth/admin)
|
|
pgbouncer --> postgres : transaction\npooling
|
|
|
|
' Environment variables
|
|
note right of host
|
|
**Environment Variables:**
|
|
* LLM_BASE_URL -- LLM endpoint
|
|
* OPENAI_API_KEY -- API key
|
|
* TURNSTONE_AUTH_TOKEN -- API auth
|
|
* TURNSTONE_DB_URL -- PostgreSQL URL
|
|
* POSTGRES_PASSWORD -- DB password
|
|
end note
|
|
|
|
' Volumes
|
|
database "turnstone-data" as tv
|
|
database "postgres-data" as pv
|
|
|
|
server_node --> tv
|
|
pg_node --> pv
|
|
|
|
@enduml
|